Skip to content

Instantly share code, notes, and snippets.

View 64's full-sized avatar
😎

Matt Taylor 64

😎
View GitHub Profile
@64
64 / 1_0_1-extra.rs
Created July 17, 2017 13:04
OpenSSL error reasons and codes (removed duplicates)
pub const AEPHK_F_AEP_CTRL: c_int = 100;
pub const AEPHK_F_AEP_FINISH: c_int = 101;
pub const AEPHK_F_AEP_GET_CONNECTION: c_int = 102;
pub const AEPHK_F_AEP_INIT: c_int = 103;
pub const AEPHK_F_AEP_MOD_EXP: c_int = 104;
pub const AEPHK_F_AEP_MOD_EXP_CRT: c_int = 105;
pub const AEPHK_F_AEP_RAND: c_int = 106;
pub const AEPHK_F_AEP_RSA_MOD_EXP: c_int = 107;
pub const AEPHK_R_ALREADY_LOADED: c_int = 100;
pub const AEPHK_R_CLOSE_HANDLES_FAILED: c_int = 101;
@64
64 / 1_0_1-openssl-err.rs
Last active January 29, 2024 02:56
OpenSSL error reason and function codes
// Generated by https://gist.github.com/64/8ac13019f4faa491018aab6b5c265141
extern crate libc;
use libc::c_int;
pub const AEPHK_F_AEP_CTRL: c_int = 100;
pub const AEPHK_F_AEP_FINISH: c_int = 101;
pub const AEPHK_F_AEP_GET_CONNECTION: c_int = 102;
pub const AEPHK_F_AEP_INIT: c_int = 103;
pub const AEPHK_F_AEP_MOD_EXP: c_int = 104;
pub const AEPHK_F_AEP_MOD_EXP_CRT: c_int = 105;
@64
64 / errgen.rs
Last active July 17, 2017 02:26
Generate reason and function error codes for rust-openssl
// Quite slow in debug, make sure to run in release (< 2s on my computer)
// TODO: Convert stuff in "err.h" correctly
extern crate regex;
use std::io::Write;
use std::io::BufRead;
use std::collections::BTreeMap;
use regex::Regex;
const USAGE: &'static str = "\
errgen: generates rust constants from OpenSSL include directory
@64
64 / server.c
Last active March 11, 2022 16:52
TLS 1.3 example server using picotls library
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <signal.h>
#include <netdb.h>
#include <errno.h>