mirror of
https://github.com/vxcontrol/lualibs-openssl.git
synced 2026-07-01 10:05:31 -04:00
preliminary bindings (I only need the engine API; precompiled headers for libcrypto also available but need work
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
--OpenSSL libcrypto binding.
|
||||
--Written by Cosmin Apreutesei. Public Domain.
|
||||
|
||||
require'libcrypto_h'
|
||||
local ffi = require'ffi'
|
||||
--TODO: rename libcrypto.dll to crypto.dll on Windows.
|
||||
local C = pcall(ffi.load, 'crypto') or ffi.load'libcrypto'
|
||||
local M = {C = C}
|
||||
setmetatable(M, {__index = C})
|
||||
|
||||
return M
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,589 @@
|
||||
// csrc/openssl/src/include/openssl/bio.h
|
||||
enum {
|
||||
BIO_TYPE_DESCRIPTOR = 0x0100,
|
||||
BIO_TYPE_FILTER = 0x0200,
|
||||
BIO_TYPE_SOURCE_SINK = 0x0400,
|
||||
BIO_TYPE_NONE = 0,
|
||||
BIO_TYPE_MEM = ( 1|BIO_TYPE_SOURCE_SINK),
|
||||
BIO_TYPE_FILE = ( 2|BIO_TYPE_SOURCE_SINK),
|
||||
BIO_TYPE_FD = ( 4|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR),
|
||||
BIO_TYPE_SOCKET = ( 5|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR),
|
||||
BIO_TYPE_NULL = ( 6|BIO_TYPE_SOURCE_SINK),
|
||||
BIO_TYPE_SSL = ( 7|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_MD = ( 8|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_BUFFER = ( 9|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_CIPHER = (10|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_BASE64 = (11|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_CONNECT = (12|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR),
|
||||
BIO_TYPE_ACCEPT = (13|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR),
|
||||
BIO_TYPE_NBIO_TEST = (16|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_NULL_FILTER = (17|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_BIO = (19|BIO_TYPE_SOURCE_SINK),
|
||||
BIO_TYPE_LINEBUFFER = (20|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_DGRAM = (21|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR),
|
||||
BIO_TYPE_ASN1 = (22|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_COMP = (23|BIO_TYPE_FILTER),
|
||||
BIO_TYPE_START = 128,
|
||||
BIO_NOCLOSE = 0x00,
|
||||
BIO_CLOSE = 0x01,
|
||||
BIO_CTRL_RESET = 1,
|
||||
BIO_CTRL_EOF = 2,
|
||||
BIO_CTRL_INFO = 3,
|
||||
BIO_CTRL_SET = 4,
|
||||
BIO_CTRL_GET = 5,
|
||||
BIO_CTRL_PUSH = 6,
|
||||
BIO_CTRL_POP = 7,
|
||||
BIO_CTRL_GET_CLOSE = 8,
|
||||
BIO_CTRL_SET_CLOSE = 9,
|
||||
BIO_CTRL_PENDING = 10,
|
||||
BIO_CTRL_FLUSH = 11,
|
||||
BIO_CTRL_DUP = 12,
|
||||
BIO_CTRL_WPENDING = 13,
|
||||
BIO_CTRL_SET_CALLBACK = 14,
|
||||
BIO_CTRL_GET_CALLBACK = 15,
|
||||
BIO_CTRL_PEEK = 29,
|
||||
BIO_CTRL_SET_FILENAME = 30,
|
||||
BIO_CTRL_DGRAM_CONNECT = 31,
|
||||
BIO_CTRL_DGRAM_SET_CONNECTED = 32,
|
||||
BIO_CTRL_DGRAM_SET_RECV_TIMEOUT = 33,
|
||||
BIO_CTRL_DGRAM_GET_RECV_TIMEOUT = 34,
|
||||
BIO_CTRL_DGRAM_SET_SEND_TIMEOUT = 35,
|
||||
BIO_CTRL_DGRAM_GET_SEND_TIMEOUT = 36,
|
||||
BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP = 37,
|
||||
BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP = 38,
|
||||
BIO_CTRL_DGRAM_MTU_DISCOVER = 39,
|
||||
BIO_CTRL_DGRAM_QUERY_MTU = 40,
|
||||
BIO_CTRL_DGRAM_GET_FALLBACK_MTU = 47,
|
||||
BIO_CTRL_DGRAM_GET_MTU = 41,
|
||||
BIO_CTRL_DGRAM_SET_MTU = 42,
|
||||
BIO_CTRL_DGRAM_MTU_EXCEEDED = 43,
|
||||
BIO_CTRL_DGRAM_GET_PEER = 46,
|
||||
BIO_CTRL_DGRAM_SET_PEER = 44,
|
||||
BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT = 45,
|
||||
BIO_CTRL_DGRAM_SET_DONT_FRAG = 48,
|
||||
BIO_CTRL_DGRAM_GET_MTU_OVERHEAD = 49,
|
||||
BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE = 50,
|
||||
BIO_CTRL_DGRAM_SET_PEEK_MODE = 71,
|
||||
BIO_FP_READ = 0x02,
|
||||
BIO_FP_WRITE = 0x04,
|
||||
BIO_FP_APPEND = 0x08,
|
||||
BIO_FP_TEXT = 0x10,
|
||||
BIO_FLAGS_READ = 0x01,
|
||||
BIO_FLAGS_WRITE = 0x02,
|
||||
BIO_FLAGS_IO_SPECIAL = 0x04,
|
||||
BIO_FLAGS_RWS = (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL),
|
||||
BIO_FLAGS_SHOULD_RETRY = 0x08,
|
||||
BIO_FLAGS_UPLINK = 0,
|
||||
BIO_FLAGS_BASE64_NO_NL = 0x100,
|
||||
BIO_FLAGS_MEM_RDONLY = 0x200,
|
||||
BIO_FLAGS_NONCLEAR_RST = 0x400,
|
||||
};
|
||||
typedef union bio_addr_st BIO_ADDR;
|
||||
typedef struct bio_addrinfo_st BIO_ADDRINFO;
|
||||
int BIO_get_new_index(void);
|
||||
void BIO_set_flags(BIO *b, int flags);
|
||||
int BIO_test_flags(const BIO *b, int flags);
|
||||
void BIO_clear_flags(BIO *b, int flags);
|
||||
#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
|
||||
#define BIO_set_retry_special(b) BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
|
||||
#define BIO_set_retry_read(b) BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
|
||||
#define BIO_set_retry_write(b) BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
|
||||
#define BIO_clear_retry_flags(b) BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
#define BIO_get_retry_flags(b) BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
|
||||
#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
|
||||
#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
|
||||
#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
|
||||
#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
|
||||
enum {
|
||||
BIO_RR_SSL_X509_LOOKUP = 0x01,
|
||||
BIO_RR_CONNECT = 0x02,
|
||||
BIO_RR_ACCEPT = 0x03,
|
||||
BIO_CB_FREE = 0x01,
|
||||
BIO_CB_READ = 0x02,
|
||||
BIO_CB_WRITE = 0x03,
|
||||
BIO_CB_PUTS = 0x04,
|
||||
BIO_CB_GETS = 0x05,
|
||||
BIO_CB_CTRL = 0x06,
|
||||
BIO_CB_RETURN = 0x80,
|
||||
};
|
||||
#define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
||||
#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
||||
#define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
||||
typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp,
|
||||
size_t len, int argi,
|
||||
long argl, int ret, size_t *processed);
|
||||
BIO_callback_fn BIO_get_callback(const BIO *b);
|
||||
void BIO_set_callback(BIO *b, BIO_callback_fn callback);
|
||||
BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b);
|
||||
void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback);
|
||||
char *BIO_get_callback_arg(const BIO *b);
|
||||
void BIO_set_callback_arg(BIO *b, char *arg);
|
||||
typedef struct bio_method_st BIO_METHOD;
|
||||
const char *BIO_method_name(const BIO *b);
|
||||
int BIO_method_type(const BIO *b);
|
||||
typedef int BIO_info_cb(BIO *, int, int);
|
||||
typedef BIO_info_cb bio_info_cb;
|
||||
struct stack_st_BIO; typedef int (*sk_BIO_compfunc)(const BIO * const *a, const BIO *const *b); typedef void (*sk_BIO_freefunc)(BIO *a); typedef BIO * (*sk_BIO_copyfunc)(const BIO *a); static __attribute__((unused)) inline int sk_BIO_num(const struct stack_st_BIO *sk) { return OPENSSL_sk_num((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline BIO *sk_BIO_value(const struct stack_st_BIO *sk, int idx) { return (BIO *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); } static __attribute__((unused)) inline struct stack_st_BIO *sk_BIO_new(sk_BIO_compfunc compare) { return (struct stack_st_BIO *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); } static __attribute__((unused)) inline struct stack_st_BIO *sk_BIO_new_null(void) { return (struct stack_st_BIO *)OPENSSL_sk_new_null(); } static __attribute__((unused)) inline struct stack_st_BIO *sk_BIO_new_reserve(sk_BIO_compfunc compare, int n) { return (struct stack_st_BIO *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); } static __attribute__((unused)) inline int sk_BIO_reserve(struct stack_st_BIO *sk, int n) { return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); } static __attribute__((unused)) inline void sk_BIO_free(struct stack_st_BIO *sk) { OPENSSL_sk_free((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_BIO_zero(struct stack_st_BIO *sk) { OPENSSL_sk_zero((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline BIO *sk_BIO_delete(struct stack_st_BIO *sk, int i) { return (BIO *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); } static __attribute__((unused)) inline BIO *sk_BIO_delete_ptr(struct stack_st_BIO *sk, BIO *ptr) { return (BIO *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_BIO_push(struct stack_st_BIO *sk, BIO *ptr) { return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_BIO_unshift(struct stack_st_BIO *sk, BIO *ptr) { return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline BIO *sk_BIO_pop(struct stack_st_BIO *sk) { return (BIO *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline BIO *sk_BIO_shift(struct stack_st_BIO *sk) { return (BIO *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_BIO_pop_free(struct stack_st_BIO *sk, sk_BIO_freefunc freefunc) { OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline int sk_BIO_insert(struct stack_st_BIO *sk, BIO *ptr, int idx) { return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); } static __attribute__((unused)) inline BIO *sk_BIO_set(struct stack_st_BIO *sk, int idx, BIO *ptr) { return (BIO *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); } static __attribute__((unused)) inline int sk_BIO_find(struct stack_st_BIO *sk, BIO *ptr) { return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_BIO_find_ex(struct stack_st_BIO *sk, BIO *ptr) { return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline void sk_BIO_sort(struct stack_st_BIO *sk) { OPENSSL_sk_sort((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline int sk_BIO_is_sorted(const struct stack_st_BIO *sk) { return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_BIO * sk_BIO_dup(const struct stack_st_BIO *sk) { return (struct stack_st_BIO *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_BIO *sk_BIO_deep_copy(const struct stack_st_BIO *sk, sk_BIO_copyfunc copyfunc, sk_BIO_freefunc freefunc) { return (struct stack_st_BIO *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline sk_BIO_compfunc sk_BIO_set_cmp_func(struct stack_st_BIO *sk, sk_BIO_compfunc compare) { return (sk_BIO_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); }
|
||||
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
|
||||
void *parg);
|
||||
enum {
|
||||
BIO_C_SET_CONNECT = 100,
|
||||
BIO_C_DO_STATE_MACHINE = 101,
|
||||
BIO_C_SET_NBIO = 102,
|
||||
BIO_C_SET_FD = 104,
|
||||
BIO_C_GET_FD = 105,
|
||||
BIO_C_SET_FILE_PTR = 106,
|
||||
BIO_C_GET_FILE_PTR = 107,
|
||||
BIO_C_SET_FILENAME = 108,
|
||||
BIO_C_SET_SSL = 109,
|
||||
BIO_C_GET_SSL = 110,
|
||||
BIO_C_SET_MD = 111,
|
||||
BIO_C_GET_MD = 112,
|
||||
BIO_C_GET_CIPHER_STATUS = 113,
|
||||
BIO_C_SET_BUF_MEM = 114,
|
||||
BIO_C_GET_BUF_MEM_PTR = 115,
|
||||
BIO_C_GET_BUFF_NUM_LINES = 116,
|
||||
BIO_C_SET_BUFF_SIZE = 117,
|
||||
BIO_C_SET_ACCEPT = 118,
|
||||
BIO_C_SSL_MODE = 119,
|
||||
BIO_C_GET_MD_CTX = 120,
|
||||
BIO_C_SET_BUFF_READ_DATA = 122,
|
||||
BIO_C_GET_CONNECT = 123,
|
||||
BIO_C_GET_ACCEPT = 124,
|
||||
BIO_C_SET_SSL_RENEGOTIATE_BYTES = 125,
|
||||
BIO_C_GET_SSL_NUM_RENEGOTIATES = 126,
|
||||
BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT = 127,
|
||||
BIO_C_FILE_SEEK = 128,
|
||||
BIO_C_GET_CIPHER_CTX = 129,
|
||||
BIO_C_SET_BUF_MEM_EOF_RETURN = 130,
|
||||
BIO_C_SET_BIND_MODE = 131,
|
||||
BIO_C_GET_BIND_MODE = 132,
|
||||
BIO_C_FILE_TELL = 133,
|
||||
BIO_C_GET_SOCKS = 134,
|
||||
BIO_C_SET_SOCKS = 135,
|
||||
BIO_C_SET_WRITE_BUF_SIZE = 136,
|
||||
BIO_C_GET_WRITE_BUF_SIZE = 137,
|
||||
BIO_C_MAKE_BIO_PAIR = 138,
|
||||
BIO_C_DESTROY_BIO_PAIR = 139,
|
||||
BIO_C_GET_WRITE_GUARANTEE = 140,
|
||||
BIO_C_GET_READ_REQUEST = 141,
|
||||
BIO_C_SHUTDOWN_WR = 142,
|
||||
BIO_C_NREAD0 = 143,
|
||||
BIO_C_NREAD = 144,
|
||||
BIO_C_NWRITE0 = 145,
|
||||
BIO_C_NWRITE = 146,
|
||||
BIO_C_RESET_READ_REQUEST = 147,
|
||||
BIO_C_SET_MD_CTX = 148,
|
||||
BIO_C_SET_PREFIX = 149,
|
||||
BIO_C_GET_PREFIX = 150,
|
||||
BIO_C_SET_SUFFIX = 151,
|
||||
BIO_C_GET_SUFFIX = 152,
|
||||
BIO_C_SET_EX_ARG = 153,
|
||||
BIO_C_GET_EX_ARG = 154,
|
||||
BIO_C_SET_CONNECT_MODE = 155,
|
||||
};
|
||||
#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
|
||||
#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
|
||||
#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
|
||||
enum {
|
||||
BIO_FAMILY_IPV4 = 4,
|
||||
BIO_FAMILY_IPV6 = 6,
|
||||
BIO_FAMILY_IPANY = 256,
|
||||
};
|
||||
#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0, (char *)(name))
|
||||
#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1, (char *)(port))
|
||||
#define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2, (char *)(addr))
|
||||
#define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)
|
||||
#define BIO_get_conn_hostname(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))
|
||||
#define BIO_get_conn_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))
|
||||
#define BIO_get_conn_address(b) ((const BIO_ADDR *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))
|
||||
#define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
|
||||
#define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)
|
||||
#define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0, (char *)(name))
|
||||
#define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1, (char *)(port))
|
||||
#define BIO_get_accept_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))
|
||||
#define BIO_get_accept_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))
|
||||
#define BIO_get_peer_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))
|
||||
#define BIO_get_peer_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))
|
||||
#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(void *)"a":NULL)
|
||||
#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,3, (char *)(bio))
|
||||
#define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)
|
||||
#define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)
|
||||
enum {
|
||||
BIO_BIND_NORMAL = 0,
|
||||
BIO_BIND_REUSEADDR = BIO_SOCK_REUSEADDR,
|
||||
BIO_BIND_REUSEADDR_IF_UNUSED = BIO_SOCK_REUSEADDR,
|
||||
};
|
||||
#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
|
||||
#define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
|
||||
#define BIO_do_connect(b) BIO_do_handshake(b)
|
||||
#define BIO_do_accept(b) BIO_do_handshake(b)
|
||||
#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
|
||||
#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
|
||||
#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)(c))
|
||||
#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
|
||||
#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)(fpp))
|
||||
#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
|
||||
#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
|
||||
#define BIO_read_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE|BIO_FP_READ,(char *)(name))
|
||||
#define BIO_write_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE|BIO_FP_WRITE,name)
|
||||
#define BIO_append_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE|BIO_FP_APPEND,name)
|
||||
#define BIO_rw_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
|
||||
#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)(ssl))
|
||||
#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)(sslp))
|
||||
#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
|
||||
#define BIO_set_ssl_renegotiate_bytes(b,num) BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
|
||||
#define BIO_get_num_renegotiates(b) BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
|
||||
#define BIO_set_ssl_renegotiate_timeout(b,seconds) BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
|
||||
#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
|
||||
#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)(bm))
|
||||
#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, (char *)(pp))
|
||||
#define BIO_set_mem_eof_return(b,v) BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
|
||||
#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
|
||||
#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
|
||||
#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
|
||||
#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
|
||||
#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
|
||||
#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
|
||||
#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
|
||||
#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
|
||||
#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
|
||||
#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
|
||||
#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
|
||||
#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
|
||||
size_t BIO_ctrl_pending(BIO *b);
|
||||
size_t BIO_ctrl_wpending(BIO *b);
|
||||
#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
|
||||
#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, cbp)
|
||||
#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
|
||||
#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
|
||||
#define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))
|
||||
#define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
|
||||
#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
|
||||
#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
|
||||
#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
|
||||
#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
|
||||
#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
|
||||
#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
|
||||
size_t BIO_ctrl_get_write_guarantee(BIO *b);
|
||||
size_t BIO_ctrl_get_read_request(BIO *b);
|
||||
int BIO_ctrl_reset_read_request(BIO *b);
|
||||
#define BIO_ctrl_dgram_connect(b,peer) (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)(peer))
|
||||
#define BIO_ctrl_set_connected(b,peer) (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char *)(peer))
|
||||
#define BIO_dgram_recv_timedout(b) (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
|
||||
#define BIO_dgram_send_timedout(b) (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
|
||||
#define BIO_dgram_get_peer(b,peer) (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)(peer))
|
||||
#define BIO_dgram_set_peer(b,peer) (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)(peer))
|
||||
#define BIO_dgram_get_mtu_overhead(b) (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
|
||||
#define BIO_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef)
|
||||
int BIO_set_ex_data(BIO *bio, int idx, void *data);
|
||||
void *BIO_get_ex_data(BIO *bio, int idx);
|
||||
uint64_t BIO_number_read(BIO *bio);
|
||||
uint64_t BIO_number_written(BIO *bio);
|
||||
int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
|
||||
asn1_ps_func *prefix_free);
|
||||
int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
|
||||
asn1_ps_func **pprefix_free);
|
||||
int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
|
||||
asn1_ps_func *suffix_free);
|
||||
int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
|
||||
asn1_ps_func **psuffix_free);
|
||||
const BIO_METHOD *BIO_s_file(void);
|
||||
BIO *BIO_new_file(const char *filename, const char *mode);
|
||||
BIO *BIO_new_fp(FILE *stream, int close_flag);
|
||||
BIO *BIO_new(const BIO_METHOD *type);
|
||||
int BIO_free(BIO *a);
|
||||
void BIO_set_data(BIO *a, void *ptr);
|
||||
void *BIO_get_data(BIO *a);
|
||||
void BIO_set_init(BIO *a, int init);
|
||||
int BIO_get_init(BIO *a);
|
||||
void BIO_set_shutdown(BIO *a, int shut);
|
||||
int BIO_get_shutdown(BIO *a);
|
||||
void BIO_vfree(BIO *a);
|
||||
int BIO_up_ref(BIO *a);
|
||||
int BIO_read(BIO *b, void *data, int dlen);
|
||||
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
|
||||
int BIO_gets(BIO *bp, char *buf, int size);
|
||||
int BIO_write(BIO *b, const void *data, int dlen);
|
||||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
|
||||
int BIO_puts(BIO *bp, const char *buf);
|
||||
int BIO_indent(BIO *b, int indent, int max);
|
||||
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
|
||||
long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
|
||||
void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
|
||||
long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
|
||||
BIO *BIO_push(BIO *b, BIO *append);
|
||||
BIO *BIO_pop(BIO *b);
|
||||
void BIO_free_all(BIO *a);
|
||||
BIO *BIO_find_type(BIO *b, int bio_type);
|
||||
BIO *BIO_next(BIO *b);
|
||||
void BIO_set_next(BIO *b, BIO *next);
|
||||
BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
|
||||
int BIO_get_retry_reason(BIO *bio);
|
||||
void BIO_set_retry_reason(BIO *bio, int reason);
|
||||
BIO *BIO_dup_chain(BIO *in);
|
||||
int BIO_nread0(BIO *bio, char **buf);
|
||||
int BIO_nread(BIO *bio, char **buf, int num);
|
||||
int BIO_nwrite0(BIO *bio, char **buf);
|
||||
int BIO_nwrite(BIO *bio, char **buf, int num);
|
||||
long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
const BIO_METHOD *BIO_s_mem(void);
|
||||
const BIO_METHOD *BIO_s_secmem(void);
|
||||
BIO *BIO_new_mem_buf(const void *buf, int len);
|
||||
const BIO_METHOD *BIO_s_socket(void);
|
||||
const BIO_METHOD *BIO_s_connect(void);
|
||||
const BIO_METHOD *BIO_s_accept(void);
|
||||
const BIO_METHOD *BIO_s_fd(void);
|
||||
const BIO_METHOD *BIO_s_log(void);
|
||||
const BIO_METHOD *BIO_s_bio(void);
|
||||
const BIO_METHOD *BIO_s_null(void);
|
||||
const BIO_METHOD *BIO_f_null(void);
|
||||
const BIO_METHOD *BIO_f_buffer(void);
|
||||
const BIO_METHOD *BIO_f_linebuffer(void);
|
||||
const BIO_METHOD *BIO_f_nbio_test(void);
|
||||
const BIO_METHOD *BIO_s_datagram(void);
|
||||
int BIO_dgram_non_fatal_error(int error);
|
||||
BIO *BIO_new_dgram(int fd, int close_flag);
|
||||
int BIO_sock_should_retry(int i);
|
||||
int BIO_sock_non_fatal_error(int error);
|
||||
int BIO_fd_should_retry(int i);
|
||||
int BIO_fd_non_fatal_error(int error);
|
||||
int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len);
|
||||
int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len, int indent);
|
||||
int BIO_dump(BIO *b, const char *bytes, int len);
|
||||
int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
|
||||
int BIO_dump_fp(FILE *fp, const char *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
|
||||
int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
|
||||
int datalen);
|
||||
BIO_ADDR *BIO_ADDR_new(void);
|
||||
int BIO_ADDR_rawmake(BIO_ADDR *ap, int family,
|
||||
const void *where, size_t wherelen, unsigned short port);
|
||||
void BIO_ADDR_free(BIO_ADDR *);
|
||||
void BIO_ADDR_clear(BIO_ADDR *ap);
|
||||
int BIO_ADDR_family(const BIO_ADDR *ap);
|
||||
int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l);
|
||||
unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap);
|
||||
char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric);
|
||||
char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric);
|
||||
char *BIO_ADDR_path_string(const BIO_ADDR *ap);
|
||||
const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai);
|
||||
const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
|
||||
void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
|
||||
enum BIO_hostserv_priorities {
|
||||
BIO_PARSE_PRIO_HOST, BIO_PARSE_PRIO_SERV
|
||||
};
|
||||
int BIO_parse_hostserv(const char *hostserv, char **host, char **service,
|
||||
enum BIO_hostserv_priorities hostserv_prio);
|
||||
enum BIO_lookup_type {
|
||||
BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
|
||||
};
|
||||
int BIO_lookup(const char *host, const char *service,
|
||||
enum BIO_lookup_type lookup_type,
|
||||
int family, int socktype, BIO_ADDRINFO **res);
|
||||
int BIO_lookup_ex(const char *host, const char *service,
|
||||
int lookup_type, int family, int socktype, int protocol,
|
||||
BIO_ADDRINFO **res);
|
||||
int BIO_sock_error(int sock);
|
||||
int BIO_socket_ioctl(int fd, long type, void *arg);
|
||||
int BIO_socket_nbio(int fd, int mode);
|
||||
int BIO_sock_init(void);
|
||||
#define BIO_sock_cleanup() while(0) continue
|
||||
int BIO_set_tcp_ndelay(int sock, int turn_on);
|
||||
struct hostent *BIO_gethostbyname(const char *name) __attribute__ ((deprecated));
|
||||
int BIO_get_port(const char *str, unsigned short *port_ptr) __attribute__ ((deprecated));
|
||||
int BIO_get_host_ip(const char *str, unsigned char *ip) __attribute__ ((deprecated));
|
||||
int BIO_get_accept_socket(char *host_port, int mode) __attribute__ ((deprecated));
|
||||
int BIO_accept(int sock, char **ip_port) __attribute__ ((deprecated));
|
||||
union BIO_sock_info_u {
|
||||
BIO_ADDR *addr;
|
||||
};
|
||||
enum BIO_sock_info_type {
|
||||
BIO_SOCK_INFO_ADDRESS
|
||||
};
|
||||
int BIO_sock_info(int sock,
|
||||
enum BIO_sock_info_type type, union BIO_sock_info_u *info);
|
||||
enum {
|
||||
BIO_SOCK_REUSEADDR = 0x01,
|
||||
BIO_SOCK_V6_ONLY = 0x02,
|
||||
BIO_SOCK_KEEPALIVE = 0x04,
|
||||
BIO_SOCK_NONBLOCK = 0x08,
|
||||
BIO_SOCK_NODELAY = 0x10,
|
||||
};
|
||||
int BIO_socket(int domain, int socktype, int protocol, int options);
|
||||
int BIO_connect(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_bind(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_listen(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_accept_ex(int accept_sock, BIO_ADDR *addr, int options);
|
||||
int BIO_closesocket(int sock);
|
||||
BIO *BIO_new_socket(int sock, int close_flag);
|
||||
BIO *BIO_new_connect(const char *host_port);
|
||||
BIO *BIO_new_accept(const char *host_port);
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
void BIO_copy_next_retry(BIO *b);
|
||||
#define ossl_bio__attr__(x)
|
||||
enum {
|
||||
ossl_bio__attr__ = __attribute__,
|
||||
ossl_bio__printf__ = __gnu_printf__,
|
||||
};
|
||||
int BIO_printf(BIO *bio, const char *format, ...)
|
||||
__attribute__((__format__(__gnu_printf__, 2, 3)));
|
||||
int BIO_vprintf(BIO *bio, const char *format, va_list args)
|
||||
__attribute__((__format__(__gnu_printf__, 2, 0)));
|
||||
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
|
||||
__attribute__((__format__(__gnu_printf__, 3, 4)));
|
||||
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
|
||||
__attribute__((__format__(__gnu_printf__, 3, 0)));
|
||||
BIO_METHOD *BIO_meth_new(int type, const char *name);
|
||||
void BIO_meth_free(BIO_METHOD *biom);
|
||||
int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int);
|
||||
int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, size_t,
|
||||
size_t *);
|
||||
int BIO_meth_set_write(BIO_METHOD *biom,
|
||||
int (*write) (BIO *, const char *, int));
|
||||
int BIO_meth_set_write_ex(BIO_METHOD *biom,
|
||||
int (*bwrite) (BIO *, const char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *);
|
||||
int BIO_meth_set_read(BIO_METHOD *biom,
|
||||
int (*read) (BIO *, char *, int));
|
||||
int BIO_meth_set_read_ex(BIO_METHOD *biom,
|
||||
int (*bread) (BIO *, char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *);
|
||||
int BIO_meth_set_puts(BIO_METHOD *biom,
|
||||
int (*puts) (BIO *, const char *));
|
||||
int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int BIO_meth_set_gets(BIO_METHOD *biom,
|
||||
int (*gets) (BIO *, char *, int));
|
||||
long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *);
|
||||
int BIO_meth_set_ctrl(BIO_METHOD *biom,
|
||||
long (*ctrl) (BIO *, int, long, void *));
|
||||
int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *);
|
||||
int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *));
|
||||
int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *);
|
||||
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *));
|
||||
long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))
|
||||
(BIO *, int, BIO_info_cb *);
|
||||
int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
|
||||
long (*callback_ctrl) (BIO *, int,
|
||||
BIO_info_cb *));
|
||||
|
||||
// X:/tools/mingw64/x86_64-w64-mingw32/include/stdarg.h
|
||||
#define va_start(v,l) __builtin_va_start(v,l)
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#define va_arg(v,l) __builtin_va_arg(v,l)
|
||||
#define va_copy(d,s) __builtin_va_copy(d,s)
|
||||
#define __va_copy(d,s) __builtin_va_copy(d,s)
|
||||
|
||||
// X:/tools/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h
|
||||
|
||||
// csrc/openssl/src/include/openssl/bioerr.h
|
||||
int ERR_load_BIO_strings(void);
|
||||
enum {
|
||||
BIO_F_ACPT_STATE = 100,
|
||||
BIO_F_ADDRINFO_WRAP = 148,
|
||||
BIO_F_ADDR_STRINGS = 134,
|
||||
BIO_F_BIO_ACCEPT = 101,
|
||||
BIO_F_BIO_ACCEPT_EX = 137,
|
||||
BIO_F_BIO_ACCEPT_NEW = 152,
|
||||
BIO_F_BIO_ADDR_NEW = 144,
|
||||
BIO_F_BIO_BIND = 147,
|
||||
BIO_F_BIO_CALLBACK_CTRL = 131,
|
||||
BIO_F_BIO_CONNECT = 138,
|
||||
BIO_F_BIO_CONNECT_NEW = 153,
|
||||
BIO_F_BIO_CTRL = 103,
|
||||
BIO_F_BIO_GETS = 104,
|
||||
BIO_F_BIO_GET_HOST_IP = 106,
|
||||
BIO_F_BIO_GET_NEW_INDEX = 102,
|
||||
BIO_F_BIO_GET_PORT = 107,
|
||||
BIO_F_BIO_LISTEN = 139,
|
||||
BIO_F_BIO_LOOKUP = 135,
|
||||
BIO_F_BIO_LOOKUP_EX = 143,
|
||||
BIO_F_BIO_MAKE_PAIR = 121,
|
||||
BIO_F_BIO_METH_NEW = 146,
|
||||
BIO_F_BIO_NEW = 108,
|
||||
BIO_F_BIO_NEW_DGRAM_SCTP = 145,
|
||||
BIO_F_BIO_NEW_FILE = 109,
|
||||
BIO_F_BIO_NEW_MEM_BUF = 126,
|
||||
BIO_F_BIO_NREAD = 123,
|
||||
BIO_F_BIO_NREAD0 = 124,
|
||||
BIO_F_BIO_NWRITE = 125,
|
||||
BIO_F_BIO_NWRITE0 = 122,
|
||||
BIO_F_BIO_PARSE_HOSTSERV = 136,
|
||||
BIO_F_BIO_PUTS = 110,
|
||||
BIO_F_BIO_READ = 111,
|
||||
BIO_F_BIO_READ_EX = 105,
|
||||
BIO_F_BIO_READ_INTERN = 120,
|
||||
BIO_F_BIO_SOCKET = 140,
|
||||
BIO_F_BIO_SOCKET_NBIO = 142,
|
||||
BIO_F_BIO_SOCK_INFO = 141,
|
||||
BIO_F_BIO_SOCK_INIT = 112,
|
||||
BIO_F_BIO_WRITE = 113,
|
||||
BIO_F_BIO_WRITE_EX = 119,
|
||||
BIO_F_BIO_WRITE_INTERN = 128,
|
||||
BIO_F_BUFFER_CTRL = 114,
|
||||
BIO_F_CONN_CTRL = 127,
|
||||
BIO_F_CONN_STATE = 115,
|
||||
BIO_F_DGRAM_SCTP_NEW = 149,
|
||||
BIO_F_DGRAM_SCTP_READ = 132,
|
||||
BIO_F_DGRAM_SCTP_WRITE = 133,
|
||||
BIO_F_DOAPR_OUTCH = 150,
|
||||
BIO_F_FILE_CTRL = 116,
|
||||
BIO_F_FILE_READ = 130,
|
||||
BIO_F_LINEBUFFER_CTRL = 129,
|
||||
BIO_F_LINEBUFFER_NEW = 151,
|
||||
BIO_F_MEM_WRITE = 117,
|
||||
BIO_F_NBIOF_NEW = 154,
|
||||
BIO_F_SLG_WRITE = 155,
|
||||
BIO_F_SSL_NEW = 118,
|
||||
BIO_R_ACCEPT_ERROR = 100,
|
||||
BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET = 141,
|
||||
BIO_R_AMBIGUOUS_HOST_OR_SERVICE = 129,
|
||||
BIO_R_BAD_FOPEN_MODE = 101,
|
||||
BIO_R_BROKEN_PIPE = 124,
|
||||
BIO_R_CONNECT_ERROR = 103,
|
||||
BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET = 107,
|
||||
BIO_R_GETSOCKNAME_ERROR = 132,
|
||||
BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS = 133,
|
||||
BIO_R_GETTING_SOCKTYPE = 134,
|
||||
BIO_R_INVALID_ARGUMENT = 125,
|
||||
BIO_R_INVALID_SOCKET = 135,
|
||||
BIO_R_IN_USE = 123,
|
||||
BIO_R_LENGTH_TOO_LONG = 102,
|
||||
BIO_R_LISTEN_V6_ONLY = 136,
|
||||
BIO_R_LOOKUP_RETURNED_NOTHING = 142,
|
||||
BIO_R_MALFORMED_HOST_OR_SERVICE = 130,
|
||||
BIO_R_NBIO_CONNECT_ERROR = 110,
|
||||
BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED = 143,
|
||||
BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED = 144,
|
||||
BIO_R_NO_PORT_DEFINED = 113,
|
||||
BIO_R_NO_SUCH_FILE = 128,
|
||||
BIO_R_NULL_PARAMETER = 115,
|
||||
BIO_R_UNABLE_TO_BIND_SOCKET = 117,
|
||||
BIO_R_UNABLE_TO_CREATE_SOCKET = 118,
|
||||
BIO_R_UNABLE_TO_KEEPALIVE = 137,
|
||||
BIO_R_UNABLE_TO_LISTEN_SOCKET = 119,
|
||||
BIO_R_UNABLE_TO_NODELAY = 138,
|
||||
BIO_R_UNABLE_TO_REUSEADDR = 139,
|
||||
BIO_R_UNAVAILABLE_IP_FAMILY = 145,
|
||||
BIO_R_UNINITIALIZED = 120,
|
||||
BIO_R_UNKNOWN_INFO_TYPE = 140,
|
||||
BIO_R_UNSUPPORTED_IP_FAMILY = 146,
|
||||
BIO_R_UNSUPPORTED_METHOD = 121,
|
||||
BIO_R_UNSUPPORTED_PROTOCOL_FAMILY = 131,
|
||||
BIO_R_WRITE_TO_READ_ONLY_BIO = 126,
|
||||
BIO_R_WSASTARTUP = 122,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,360 @@
|
||||
// csrc/openssl/src/include/openssl/bn.h
|
||||
enum {
|
||||
BN_ULONG = unsigned long long,
|
||||
BN_BYTES = 8,
|
||||
BN_BITS2 = (BN_BYTES * 8),
|
||||
BN_BITS = (BN_BITS2 * 2),
|
||||
BN_TBIT = ((BN_ULONG)1 << (BN_BITS2 - 1)),
|
||||
BN_FLG_MALLOCED = 0x01,
|
||||
BN_FLG_STATIC_DATA = 0x02,
|
||||
BN_FLG_CONSTTIME = 0x04,
|
||||
BN_FLG_SECURE = 0x08,
|
||||
BN_FLG_EXP_CONSTTIME = BN_FLG_CONSTTIME,
|
||||
BN_FLG_FREE = 0x8000,
|
||||
};
|
||||
void BN_set_flags(BIGNUM *b, int n);
|
||||
int BN_get_flags(const BIGNUM *b, int n);
|
||||
enum {
|
||||
BN_RAND_TOP_ANY = -1,
|
||||
BN_RAND_TOP_ONE = 0,
|
||||
BN_RAND_TOP_TWO = 1,
|
||||
BN_RAND_BOTTOM_ANY = 0,
|
||||
BN_RAND_BOTTOM_ODD = 1,
|
||||
};
|
||||
void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);
|
||||
int BN_GENCB_call(BN_GENCB *cb, int a, int b);
|
||||
BN_GENCB *BN_GENCB_new(void);
|
||||
void BN_GENCB_free(BN_GENCB *cb);
|
||||
void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback) (int, int, void *),
|
||||
void *cb_arg);
|
||||
void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *),
|
||||
void *cb_arg);
|
||||
void *BN_GENCB_get_arg(BN_GENCB *cb);
|
||||
enum {
|
||||
BN_prime_checks = 0,
|
||||
};
|
||||
#define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : (b) >= 1345 ? 4 : (b) >= 476 ? 5 : (b) >= 400 ? 6 : (b) >= 347 ? 7 : (b) >= 308 ? 8 : (b) >= 55 ? 27 : 34)
|
||||
#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
|
||||
int BN_abs_is_word(const BIGNUM *a, const unsigned long long w);
|
||||
int BN_is_zero(const BIGNUM *a);
|
||||
int BN_is_one(const BIGNUM *a);
|
||||
int BN_is_word(const BIGNUM *a, const unsigned long long w);
|
||||
int BN_is_odd(const BIGNUM *a);
|
||||
#define BN_one(a) (BN_set_word((a),1))
|
||||
void BN_zero_ex(BIGNUM *a);
|
||||
#define BN_zero(a) (BN_set_word((a),0))
|
||||
const BIGNUM *BN_value_one(void);
|
||||
char *BN_options(void);
|
||||
BN_CTX *BN_CTX_new(void);
|
||||
BN_CTX *BN_CTX_secure_new(void);
|
||||
void BN_CTX_free(BN_CTX *c);
|
||||
void BN_CTX_start(BN_CTX *ctx);
|
||||
BIGNUM *BN_CTX_get(BN_CTX *ctx);
|
||||
void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_num_bits(const BIGNUM *a);
|
||||
int BN_num_bits_word(unsigned long long l);
|
||||
int BN_security_bits(int L, int N);
|
||||
BIGNUM *BN_new(void);
|
||||
BIGNUM *BN_secure_new(void);
|
||||
void BN_clear_free(BIGNUM *a);
|
||||
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
|
||||
void BN_swap(BIGNUM *a, BIGNUM *b);
|
||||
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
|
||||
int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
|
||||
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
|
||||
void BN_set_negative(BIGNUM *b, int n);
|
||||
int BN_is_negative(const BIGNUM *b);
|
||||
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
BN_CTX *ctx);
|
||||
#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
|
||||
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
|
||||
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *m);
|
||||
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *m);
|
||||
int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
|
||||
int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
|
||||
unsigned long long BN_mod_word(const BIGNUM *a, unsigned long long w);
|
||||
unsigned long long BN_div_word(BIGNUM *a, unsigned long long w);
|
||||
int BN_mul_word(BIGNUM *a, unsigned long long w);
|
||||
int BN_add_word(BIGNUM *a, unsigned long long w);
|
||||
int BN_sub_word(BIGNUM *a, unsigned long long w);
|
||||
int BN_set_word(BIGNUM *a, unsigned long long w);
|
||||
unsigned long long BN_get_word(const BIGNUM *a);
|
||||
int BN_cmp(const BIGNUM *a, const BIGNUM *b);
|
||||
void BN_free(BIGNUM *a);
|
||||
int BN_is_bit_set(const BIGNUM *a, int n);
|
||||
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
|
||||
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
|
||||
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx,
|
||||
BN_MONT_CTX *in_mont);
|
||||
int BN_mod_exp_mont_word(BIGNUM *r, unsigned long long a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
|
||||
const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
|
||||
BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mask_bits(BIGNUM *a, int n);
|
||||
int BN_print_fp(FILE *fp, const BIGNUM *a);
|
||||
int BN_print(BIO *bio, const BIGNUM *a);
|
||||
int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
|
||||
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
|
||||
int BN_rshift1(BIGNUM *r, const BIGNUM *a);
|
||||
void BN_clear(BIGNUM *a);
|
||||
BIGNUM *BN_dup(const BIGNUM *a);
|
||||
int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_set_bit(BIGNUM *a, int n);
|
||||
int BN_clear_bit(BIGNUM *a, int n);
|
||||
char *BN_bn2hex(const BIGNUM *a);
|
||||
char *BN_bn2dec(const BIGNUM *a);
|
||||
int BN_hex2bn(BIGNUM **a, const char *str);
|
||||
int BN_dec2bn(BIGNUM **a, const char *str);
|
||||
int BN_asc2bn(BIGNUM **a, const char *str);
|
||||
int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_inverse(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
|
||||
void BN_consttime_swap(unsigned long long swap, BIGNUM *a, BIGNUM *b, int nwords);
|
||||
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, void (*callback) (int, int, void *), void *cb_arg) __attribute__ ((deprecated));
|
||||
int BN_is_prime(const BIGNUM *p, int nchecks, void (*callback) (int, int, void *), BN_CTX *ctx, void *cb_arg) __attribute__ ((deprecated));
|
||||
int BN_is_prime_fasttest(const BIGNUM *p, int nchecks, void (*callback) (int, int, void *), BN_CTX *ctx, void *cb_arg, int do_trial_division) __attribute__ ((deprecated));
|
||||
int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
|
||||
const BIGNUM *rem, BN_GENCB *cb);
|
||||
int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
|
||||
int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
|
||||
int do_trial_division, BN_GENCB *cb);
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1,
|
||||
const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
|
||||
BN_GENCB *cb);
|
||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
|
||||
BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
|
||||
BN_CTX *ctx, BN_GENCB *cb);
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
BN_MONT_CTX *mont, BN_CTX *ctx);
|
||||
int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
||||
BN_CTX *ctx);
|
||||
int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
||||
BN_CTX *ctx);
|
||||
void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
||||
int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
|
||||
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx);
|
||||
enum {
|
||||
BN_BLINDING_NO_UPDATE = 0x00000001,
|
||||
BN_BLINDING_NO_RECREATE = 0x00000002,
|
||||
};
|
||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
|
||||
void BN_BLINDING_free(BN_BLINDING *b);
|
||||
int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
|
||||
int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
|
||||
BN_CTX *);
|
||||
int BN_BLINDING_is_current_thread(BN_BLINDING *b);
|
||||
void BN_BLINDING_set_current_thread(BN_BLINDING *b);
|
||||
int BN_BLINDING_lock(BN_BLINDING *b);
|
||||
int BN_BLINDING_unlock(BN_BLINDING *b);
|
||||
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
|
||||
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
|
||||
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
|
||||
const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
|
||||
int (*bn_mod_exp) (BIGNUM *r,
|
||||
const BIGNUM *a,
|
||||
const BIGNUM *p,
|
||||
const BIGNUM *m,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx),
|
||||
BN_MONT_CTX *m_ctx);
|
||||
void BN_set_params(int mul, int high, int low, int mont) __attribute__ ((deprecated));
|
||||
int BN_get_params(int which) __attribute__ ((deprecated));
|
||||
BN_RECP_CTX *BN_RECP_CTX_new(void);
|
||||
void BN_RECP_CTX_free(BN_RECP_CTX *recp);
|
||||
int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
|
||||
int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
|
||||
BN_RECP_CTX *recp, BN_CTX *ctx);
|
||||
int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
|
||||
BN_RECP_CTX *recp, BN_CTX *ctx);
|
||||
int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
#define BN_GF2m_sub(r,a,b) BN_GF2m_add(r, a, b)
|
||||
int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);
|
||||
int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BN_CTX *ctx);
|
||||
int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BN_CTX *ctx);
|
||||
#define BN_GF2m_cmp(a,b) BN_ucmp((a), (b))
|
||||
int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);
|
||||
int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
|
||||
BN_CTX *ctx);
|
||||
int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],
|
||||
BN_CTX *ctx);
|
||||
int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
|
||||
int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
|
||||
int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
const BIGNUM *BN_get0_nist_prime_192(void);
|
||||
const BIGNUM *BN_get0_nist_prime_224(void);
|
||||
const BIGNUM *BN_get0_nist_prime_256(void);
|
||||
const BIGNUM *BN_get0_nist_prime_384(void);
|
||||
const BIGNUM *BN_get0_nist_prime_521(void);
|
||||
int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a,
|
||||
const BIGNUM *field, BN_CTX *ctx);
|
||||
int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
|
||||
const BIGNUM *priv, const unsigned char *message,
|
||||
size_t message_len, BN_CTX *ctx);
|
||||
BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
|
||||
enum {
|
||||
get_rfc2409_prime_768 = BN_get_rfc2409_prime_768,
|
||||
get_rfc2409_prime_1024 = BN_get_rfc2409_prime_1024,
|
||||
get_rfc3526_prime_1536 = BN_get_rfc3526_prime_1536,
|
||||
get_rfc3526_prime_2048 = BN_get_rfc3526_prime_2048,
|
||||
get_rfc3526_prime_3072 = BN_get_rfc3526_prime_3072,
|
||||
get_rfc3526_prime_4096 = BN_get_rfc3526_prime_4096,
|
||||
get_rfc3526_prime_6144 = BN_get_rfc3526_prime_6144,
|
||||
get_rfc3526_prime_8192 = BN_get_rfc3526_prime_8192,
|
||||
};
|
||||
int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
|
||||
// csrc/openssl/src/include/openssl/bnerr.h
|
||||
int ERR_load_BN_strings(void);
|
||||
enum {
|
||||
BN_F_BNRAND = 127,
|
||||
BN_F_BNRAND_RANGE = 138,
|
||||
BN_F_BN_BLINDING_CONVERT_EX = 100,
|
||||
BN_F_BN_BLINDING_CREATE_PARAM = 128,
|
||||
BN_F_BN_BLINDING_INVERT_EX = 101,
|
||||
BN_F_BN_BLINDING_NEW = 102,
|
||||
BN_F_BN_BLINDING_UPDATE = 103,
|
||||
BN_F_BN_BN2DEC = 104,
|
||||
BN_F_BN_BN2HEX = 105,
|
||||
BN_F_BN_COMPUTE_WNAF = 142,
|
||||
BN_F_BN_CTX_GET = 116,
|
||||
BN_F_BN_CTX_NEW = 106,
|
||||
BN_F_BN_CTX_START = 129,
|
||||
BN_F_BN_DIV = 107,
|
||||
BN_F_BN_DIV_RECP = 130,
|
||||
BN_F_BN_EXP = 123,
|
||||
BN_F_BN_EXPAND_INTERNAL = 120,
|
||||
BN_F_BN_GENCB_NEW = 143,
|
||||
BN_F_BN_GENERATE_DSA_NONCE = 140,
|
||||
BN_F_BN_GENERATE_PRIME_EX = 141,
|
||||
BN_F_BN_GF2M_MOD = 131,
|
||||
BN_F_BN_GF2M_MOD_EXP = 132,
|
||||
BN_F_BN_GF2M_MOD_MUL = 133,
|
||||
BN_F_BN_GF2M_MOD_SOLVE_QUAD = 134,
|
||||
BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR = 135,
|
||||
BN_F_BN_GF2M_MOD_SQR = 136,
|
||||
BN_F_BN_GF2M_MOD_SQRT = 137,
|
||||
BN_F_BN_LSHIFT = 145,
|
||||
BN_F_BN_MOD_EXP2_MONT = 118,
|
||||
BN_F_BN_MOD_EXP_MONT = 109,
|
||||
BN_F_BN_MOD_EXP_MONT_CONSTTIME = 124,
|
||||
BN_F_BN_MOD_EXP_MONT_WORD = 117,
|
||||
BN_F_BN_MOD_EXP_RECP = 125,
|
||||
BN_F_BN_MOD_EXP_SIMPLE = 126,
|
||||
BN_F_BN_MOD_INVERSE = 110,
|
||||
BN_F_BN_MOD_INVERSE_NO_BRANCH = 139,
|
||||
BN_F_BN_MOD_LSHIFT_QUICK = 119,
|
||||
BN_F_BN_MOD_SQRT = 121,
|
||||
BN_F_BN_MONT_CTX_NEW = 149,
|
||||
BN_F_BN_MPI2BN = 112,
|
||||
BN_F_BN_NEW = 113,
|
||||
BN_F_BN_POOL_GET = 147,
|
||||
BN_F_BN_RAND = 114,
|
||||
BN_F_BN_RAND_RANGE = 122,
|
||||
BN_F_BN_RECP_CTX_NEW = 150,
|
||||
BN_F_BN_RSHIFT = 146,
|
||||
BN_F_BN_SET_WORDS = 144,
|
||||
BN_F_BN_STACK_PUSH = 148,
|
||||
BN_F_BN_USUB = 115,
|
||||
BN_R_ARG2_LT_ARG3 = 100,
|
||||
BN_R_BAD_RECIPROCAL = 101,
|
||||
BN_R_BIGNUM_TOO_LONG = 114,
|
||||
BN_R_BITS_TOO_SMALL = 118,
|
||||
BN_R_CALLED_WITH_EVEN_MODULUS = 102,
|
||||
BN_R_DIV_BY_ZERO = 103,
|
||||
BN_R_ENCODING_ERROR = 104,
|
||||
BN_R_EXPAND_ON_STATIC_BIGNUM_DATA = 105,
|
||||
BN_R_INPUT_NOT_REDUCED = 110,
|
||||
BN_R_INVALID_LENGTH = 106,
|
||||
BN_R_INVALID_RANGE = 115,
|
||||
BN_R_INVALID_SHIFT = 119,
|
||||
BN_R_NOT_A_SQUARE = 111,
|
||||
BN_R_NOT_INITIALIZED = 107,
|
||||
BN_R_NO_INVERSE = 108,
|
||||
BN_R_NO_SOLUTION = 116,
|
||||
BN_R_PRIVATE_KEY_TOO_LARGE = 117,
|
||||
BN_R_P_IS_NOT_PRIME = 112,
|
||||
BN_R_TOO_MANY_ITERATIONS = 113,
|
||||
BN_R_TOO_MANY_TEMPORARY_VARIABLES = 109,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// csrc/openssl/src/include/openssl/buffer.h
|
||||
#define BUF_strdup(s) OPENSSL_strdup(s)
|
||||
#define BUF_strndup(s,size) OPENSSL_strndup(s, size)
|
||||
#define BUF_memdup(data,size) OPENSSL_memdup(data, size)
|
||||
#define BUF_strlcpy(dst,src,size) OPENSSL_strlcpy(dst, src, size)
|
||||
#define BUF_strlcat(dst,src,size) OPENSSL_strlcat(dst, src, size)
|
||||
#define BUF_strnlen(str,maxlen) OPENSSL_strnlen(str, maxlen)
|
||||
struct buf_mem_st {
|
||||
size_t length;
|
||||
char *data;
|
||||
size_t max;
|
||||
unsigned long flags;
|
||||
};
|
||||
enum {
|
||||
BUF_MEM_FLAG_SECURE = 0x01,
|
||||
};
|
||||
BUF_MEM *BUF_MEM_new(void);
|
||||
BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
|
||||
void BUF_MEM_free(BUF_MEM *a);
|
||||
size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
|
||||
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
||||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
|
||||
|
||||
// csrc/openssl/src/include/openssl/buffererr.h
|
||||
int ERR_load_BUF_strings(void);
|
||||
enum {
|
||||
BUF_F_BUF_MEM_GROW = 100,
|
||||
BUF_F_BUF_MEM_GROW_CLEAN = 105,
|
||||
BUF_F_BUF_MEM_NEW = 101,
|
||||
};
|
||||
@@ -0,0 +1,216 @@
|
||||
// csrc/openssl/src/include/openssl/dh.h
|
||||
enum {
|
||||
OPENSSL_DH_MAX_MODULUS_BITS = 10000,
|
||||
OPENSSL_DH_FIPS_MIN_MODULUS_BITS = 1024,
|
||||
DH_FLAG_CACHE_MONT_P = 0x01,
|
||||
DH_FLAG_NO_EXP_CONSTTIME = 0x00,
|
||||
DH_FLAG_FIPS_METHOD = 0x0400,
|
||||
DH_FLAG_NON_FIPS_ALLOW = 0x0400,
|
||||
};
|
||||
const ASN1_ITEM * DHparams_it(void);
|
||||
enum {
|
||||
DH_GENERATOR_2 = 2,
|
||||
DH_GENERATOR_5 = 5,
|
||||
DH_CHECK_P_NOT_PRIME = 0x01,
|
||||
DH_CHECK_P_NOT_SAFE_PRIME = 0x02,
|
||||
DH_UNABLE_TO_CHECK_GENERATOR = 0x04,
|
||||
DH_NOT_SUITABLE_GENERATOR = 0x08,
|
||||
DH_CHECK_Q_NOT_PRIME = 0x10,
|
||||
DH_CHECK_INVALID_Q_VALUE = 0x20,
|
||||
DH_CHECK_INVALID_J_VALUE = 0x40,
|
||||
DH_CHECK_PUBKEY_TOO_SMALL = 0x01,
|
||||
DH_CHECK_PUBKEY_TOO_LARGE = 0x02,
|
||||
DH_CHECK_PUBKEY_INVALID = 0x04,
|
||||
DH_CHECK_P_NOT_STRONG_PRIME = DH_CHECK_P_NOT_SAFE_PRIME,
|
||||
};
|
||||
#define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, (char *(*)())d2i_DHparams, (fp), (unsigned char **)(x))
|
||||
#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))
|
||||
#define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)
|
||||
#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
|
||||
#define d2i_DHxparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, (char *(*)())d2i_DHxparams, (fp), (unsigned char **)(x))
|
||||
#define i2d_DHxparams_fp(fp,x) ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))
|
||||
#define d2i_DHxparams_bio(bp,x) ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)
|
||||
#define i2d_DHxparams_bio(bp,x) ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x)
|
||||
DH *DHparams_dup(DH *);
|
||||
const DH_METHOD *DH_OpenSSL(void);
|
||||
void DH_set_default_method(const DH_METHOD *meth);
|
||||
const DH_METHOD *DH_get_default_method(void);
|
||||
int DH_set_method(DH *dh, const DH_METHOD *meth);
|
||||
DH *DH_new_method(ENGINE *engine);
|
||||
DH *DH_new(void);
|
||||
void DH_free(DH *dh);
|
||||
int DH_up_ref(DH *dh);
|
||||
int DH_bits(const DH *dh);
|
||||
int DH_size(const DH *dh);
|
||||
int DH_security_bits(const DH *dh);
|
||||
#define DH_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, l, p, newf, dupf, freef)
|
||||
int DH_set_ex_data(DH *d, int idx, void *arg);
|
||||
void *DH_get_ex_data(DH *d, int idx);
|
||||
DH *DH_generate_parameters(int prime_len, int generator, void (*callback) (int, int, void *), void *cb_arg) __attribute__ ((deprecated));
|
||||
int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
|
||||
BN_GENCB *cb);
|
||||
int DH_check_params_ex(const DH *dh);
|
||||
int DH_check_ex(const DH *dh);
|
||||
int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
|
||||
int DH_check_params(const DH *dh, int *ret);
|
||||
int DH_check(const DH *dh, int *codes);
|
||||
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
|
||||
int DH_generate_key(DH *dh);
|
||||
int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
||||
int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
||||
DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
|
||||
int i2d_DHparams(const DH *a, unsigned char **pp);
|
||||
DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
|
||||
int i2d_DHxparams(const DH *a, unsigned char **pp);
|
||||
int DHparams_print_fp(FILE *fp, const DH *x);
|
||||
int DHparams_print(BIO *bp, const DH *x);
|
||||
DH *DH_get_1024_160(void);
|
||||
DH *DH_get_2048_224(void);
|
||||
DH *DH_get_2048_256(void);
|
||||
DH *DH_new_by_nid(int nid);
|
||||
int DH_get_nid(const DH *dh);
|
||||
int DH_KDF_X9_42(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
ASN1_OBJECT *key_oid,
|
||||
const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
|
||||
void DH_get0_pqg(const DH *dh,
|
||||
const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
|
||||
int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
|
||||
void DH_get0_key(const DH *dh,
|
||||
const BIGNUM **pub_key, const BIGNUM **priv_key);
|
||||
int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
|
||||
const BIGNUM *DH_get0_p(const DH *dh);
|
||||
const BIGNUM *DH_get0_q(const DH *dh);
|
||||
const BIGNUM *DH_get0_g(const DH *dh);
|
||||
const BIGNUM *DH_get0_priv_key(const DH *dh);
|
||||
const BIGNUM *DH_get0_pub_key(const DH *dh);
|
||||
void DH_clear_flags(DH *dh, int flags);
|
||||
int DH_test_flags(const DH *dh, int flags);
|
||||
void DH_set_flags(DH *dh, int flags);
|
||||
ENGINE *DH_get0_engine(DH *d);
|
||||
long DH_get_length(const DH *dh);
|
||||
int DH_set_length(DH *dh, long length);
|
||||
DH_METHOD *DH_meth_new(const char *name, int flags);
|
||||
void DH_meth_free(DH_METHOD *dhm);
|
||||
DH_METHOD *DH_meth_dup(const DH_METHOD *dhm);
|
||||
const char *DH_meth_get0_name(const DH_METHOD *dhm);
|
||||
int DH_meth_set1_name(DH_METHOD *dhm, const char *name);
|
||||
int DH_meth_get_flags(const DH_METHOD *dhm);
|
||||
int DH_meth_set_flags(DH_METHOD *dhm, int flags);
|
||||
void *DH_meth_get0_app_data(const DH_METHOD *dhm);
|
||||
int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data);
|
||||
int (*DH_meth_get_generate_key(const DH_METHOD *dhm)) (DH *);
|
||||
int DH_meth_set_generate_key(DH_METHOD *dhm, int (*generate_key) (DH *));
|
||||
int (*DH_meth_get_compute_key(const DH_METHOD *dhm))
|
||||
(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
||||
int DH_meth_set_compute_key(DH_METHOD *dhm,
|
||||
int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh));
|
||||
int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm))
|
||||
(const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
BN_CTX *, BN_MONT_CTX *);
|
||||
int DH_meth_set_bn_mod_exp(DH_METHOD *dhm,
|
||||
int (*bn_mod_exp) (const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
|
||||
int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *);
|
||||
int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *));
|
||||
int (*DH_meth_get_finish(const DH_METHOD *dhm)) (DH *);
|
||||
int DH_meth_set_finish(DH_METHOD *dhm, int (*finish) (DH *));
|
||||
int (*DH_meth_get_generate_params(const DH_METHOD *dhm))
|
||||
(DH *, int, int, BN_GENCB *);
|
||||
int DH_meth_set_generate_params(DH_METHOD *dhm,
|
||||
int (*generate_params) (DH *, int, int, BN_GENCB *));
|
||||
#define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx,len) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx,len) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_paramgen_type(ctx,typ) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx,gen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_rfc5114(ctx,gen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
||||
#define EVP_PKEY_CTX_set_dhx_rfc5114(ctx,gen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_nid(ctx,nid) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_DH_NID, nid, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_pad(ctx,pad) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_PAD, pad, NULL)
|
||||
#define EVP_PKEY_CTX_set_dh_kdf_type(ctx,kdf) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
|
||||
#define EVP_PKEY_CTX_get_dh_kdf_type(ctx) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
|
||||
#define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx,oid) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid))
|
||||
#define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx,poid) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid))
|
||||
#define EVP_PKEY_CTX_set_dh_kdf_md(ctx,md) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md))
|
||||
#define EVP_PKEY_CTX_get_dh_kdf_md(ctx,pmd) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd))
|
||||
#define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx,len) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
|
||||
#define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx,plen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen))
|
||||
#define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx,p,plen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p))
|
||||
#define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx,p) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p))
|
||||
enum {
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN = (EVP_PKEY_ALG_CTRL + 1),
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR = (EVP_PKEY_ALG_CTRL + 2),
|
||||
EVP_PKEY_CTRL_DH_RFC5114 = (EVP_PKEY_ALG_CTRL + 3),
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN = (EVP_PKEY_ALG_CTRL + 4),
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_TYPE = (EVP_PKEY_ALG_CTRL + 5),
|
||||
EVP_PKEY_CTRL_DH_KDF_TYPE = (EVP_PKEY_ALG_CTRL + 6),
|
||||
EVP_PKEY_CTRL_DH_KDF_MD = (EVP_PKEY_ALG_CTRL + 7),
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_MD = (EVP_PKEY_ALG_CTRL + 8),
|
||||
EVP_PKEY_CTRL_DH_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 9),
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 10),
|
||||
EVP_PKEY_CTRL_DH_KDF_UKM = (EVP_PKEY_ALG_CTRL + 11),
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_UKM = (EVP_PKEY_ALG_CTRL + 12),
|
||||
EVP_PKEY_CTRL_DH_KDF_OID = (EVP_PKEY_ALG_CTRL + 13),
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_OID = (EVP_PKEY_ALG_CTRL + 14),
|
||||
EVP_PKEY_CTRL_DH_NID = (EVP_PKEY_ALG_CTRL + 15),
|
||||
EVP_PKEY_CTRL_DH_PAD = (EVP_PKEY_ALG_CTRL + 16),
|
||||
EVP_PKEY_DH_KDF_NONE = 1,
|
||||
EVP_PKEY_DH_KDF_X9_42 = 2,
|
||||
};
|
||||
|
||||
// csrc/openssl/src/include/openssl/dherr.h
|
||||
int ERR_load_DH_strings(void);
|
||||
enum {
|
||||
DH_F_COMPUTE_KEY = 102,
|
||||
DH_F_DHPARAMS_PRINT_FP = 101,
|
||||
DH_F_DH_BUILTIN_GENPARAMS = 106,
|
||||
DH_F_DH_CHECK_EX = 121,
|
||||
DH_F_DH_CHECK_PARAMS_EX = 122,
|
||||
DH_F_DH_CHECK_PUB_KEY_EX = 123,
|
||||
DH_F_DH_CMS_DECRYPT = 114,
|
||||
DH_F_DH_CMS_SET_PEERKEY = 115,
|
||||
DH_F_DH_CMS_SET_SHARED_INFO = 116,
|
||||
DH_F_DH_METH_DUP = 117,
|
||||
DH_F_DH_METH_NEW = 118,
|
||||
DH_F_DH_METH_SET1_NAME = 119,
|
||||
DH_F_DH_NEW_BY_NID = 104,
|
||||
DH_F_DH_NEW_METHOD = 105,
|
||||
DH_F_DH_PARAM_DECODE = 107,
|
||||
DH_F_DH_PKEY_PUBLIC_CHECK = 124,
|
||||
DH_F_DH_PRIV_DECODE = 110,
|
||||
DH_F_DH_PRIV_ENCODE = 111,
|
||||
DH_F_DH_PUB_DECODE = 108,
|
||||
DH_F_DH_PUB_ENCODE = 109,
|
||||
DH_F_DO_DH_PRINT = 100,
|
||||
DH_F_GENERATE_KEY = 103,
|
||||
DH_F_PKEY_DH_CTRL_STR = 120,
|
||||
DH_F_PKEY_DH_DERIVE = 112,
|
||||
DH_F_PKEY_DH_INIT = 125,
|
||||
DH_F_PKEY_DH_KEYGEN = 113,
|
||||
DH_R_BAD_GENERATOR = 101,
|
||||
DH_R_BN_DECODE_ERROR = 109,
|
||||
DH_R_BN_ERROR = 106,
|
||||
DH_R_CHECK_INVALID_J_VALUE = 115,
|
||||
DH_R_CHECK_INVALID_Q_VALUE = 116,
|
||||
DH_R_CHECK_PUBKEY_INVALID = 122,
|
||||
DH_R_CHECK_PUBKEY_TOO_LARGE = 123,
|
||||
DH_R_CHECK_PUBKEY_TOO_SMALL = 124,
|
||||
DH_R_CHECK_P_NOT_PRIME = 117,
|
||||
DH_R_CHECK_P_NOT_SAFE_PRIME = 118,
|
||||
DH_R_CHECK_Q_NOT_PRIME = 119,
|
||||
DH_R_DECODE_ERROR = 104,
|
||||
DH_R_INVALID_PARAMETER_NAME = 110,
|
||||
DH_R_INVALID_PARAMETER_NID = 114,
|
||||
DH_R_INVALID_PUBKEY = 102,
|
||||
DH_R_KDF_PARAMETER_ERROR = 112,
|
||||
DH_R_KEYS_NOT_SET = 108,
|
||||
DH_R_MISSING_PUBKEY = 125,
|
||||
DH_R_MODULUS_TOO_LARGE = 103,
|
||||
DH_R_NOT_SUITABLE_GENERATOR = 120,
|
||||
DH_R_NO_PARAMETERS_SET = 107,
|
||||
DH_R_NO_PRIVATE_VALUE = 100,
|
||||
DH_R_PARAMETER_ENCODING_ERROR = 105,
|
||||
DH_R_PEER_KEY_ERROR = 111,
|
||||
DH_R_SHARED_INFO_ERROR = 113,
|
||||
DH_R_UNABLE_TO_CHECK_GENERATOR = 121,
|
||||
};
|
||||
@@ -0,0 +1,175 @@
|
||||
// csrc/openssl/src/include/openssl/dsa.h
|
||||
enum {
|
||||
OPENSSL_DSA_MAX_MODULUS_BITS = 10000,
|
||||
OPENSSL_DSA_FIPS_MIN_MODULUS_BITS = 1024,
|
||||
DSA_FLAG_CACHE_MONT_P = 0x01,
|
||||
DSA_FLAG_NO_EXP_CONSTTIME = 0x00,
|
||||
DSA_FLAG_FIPS_METHOD = 0x0400,
|
||||
DSA_FLAG_NON_FIPS_ALLOW = 0x0400,
|
||||
DSA_FLAG_FIPS_CHECKED = 0x0800,
|
||||
};
|
||||
typedef struct DSA_SIG_st DSA_SIG;
|
||||
#define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
|
||||
#define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), (unsigned char *)(x))
|
||||
#define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
|
||||
#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
|
||||
DSA *DSAparams_dup(DSA *x);
|
||||
DSA_SIG *DSA_SIG_new(void);
|
||||
void DSA_SIG_free(DSA_SIG *a);
|
||||
int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
|
||||
DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
|
||||
void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
|
||||
int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
|
||||
DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
|
||||
int DSA_do_verify(const unsigned char *dgst, int dgst_len,
|
||||
DSA_SIG *sig, DSA *dsa);
|
||||
const DSA_METHOD *DSA_OpenSSL(void);
|
||||
void DSA_set_default_method(const DSA_METHOD *);
|
||||
const DSA_METHOD *DSA_get_default_method(void);
|
||||
int DSA_set_method(DSA *dsa, const DSA_METHOD *);
|
||||
const DSA_METHOD *DSA_get_method(DSA *d);
|
||||
DSA *DSA_new(void);
|
||||
DSA *DSA_new_method(ENGINE *engine);
|
||||
void DSA_free(DSA *r);
|
||||
int DSA_up_ref(DSA *r);
|
||||
int DSA_size(const DSA *);
|
||||
int DSA_bits(const DSA *d);
|
||||
int DSA_security_bits(const DSA *d);
|
||||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
|
||||
int DSA_sign(int type, const unsigned char *dgst, int dlen,
|
||||
unsigned char *sig, unsigned int *siglen, DSA *dsa);
|
||||
int DSA_verify(int type, const unsigned char *dgst, int dgst_len,
|
||||
const unsigned char *sigbuf, int siglen, DSA *dsa);
|
||||
#define DSA_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef)
|
||||
int DSA_set_ex_data(DSA *d, int idx, void *arg);
|
||||
void *DSA_get_ex_data(DSA *d, int idx);
|
||||
DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
|
||||
DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
|
||||
DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
|
||||
DSA *DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, int *counter_ret, unsigned long *h_ret, void (*callback) (int, int, void *), void *cb_arg) __attribute__ ((deprecated));
|
||||
int DSA_generate_parameters_ex(DSA *dsa, int bits,
|
||||
const unsigned char *seed, int seed_len,
|
||||
int *counter_ret, unsigned long *h_ret,
|
||||
BN_GENCB *cb);
|
||||
int DSA_generate_key(DSA *a);
|
||||
int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
|
||||
int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
|
||||
int i2d_DSAparams(const DSA *a, unsigned char **pp);
|
||||
int DSAparams_print(BIO *bp, const DSA *x);
|
||||
int DSA_print(BIO *bp, const DSA *x, int off);
|
||||
int DSAparams_print_fp(FILE *fp, const DSA *x);
|
||||
int DSA_print_fp(FILE *bp, const DSA *x, int off);
|
||||
enum {
|
||||
DSS_prime_checks = 64,
|
||||
};
|
||||
#define DSA_is_prime(n,callback,cb_arg) BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
|
||||
DH *DSA_dup_DH(const DSA *r);
|
||||
#define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx,nbits) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)
|
||||
enum {
|
||||
EVP_PKEY_CTRL_DSA_PARAMGEN_BITS = (EVP_PKEY_ALG_CTRL + 1),
|
||||
EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS = (EVP_PKEY_ALG_CTRL + 2),
|
||||
EVP_PKEY_CTRL_DSA_PARAMGEN_MD = (EVP_PKEY_ALG_CTRL + 3),
|
||||
};
|
||||
void DSA_get0_pqg(const DSA *d,
|
||||
const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
|
||||
int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
|
||||
void DSA_get0_key(const DSA *d,
|
||||
const BIGNUM **pub_key, const BIGNUM **priv_key);
|
||||
int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
|
||||
const BIGNUM *DSA_get0_p(const DSA *d);
|
||||
const BIGNUM *DSA_get0_q(const DSA *d);
|
||||
const BIGNUM *DSA_get0_g(const DSA *d);
|
||||
const BIGNUM *DSA_get0_pub_key(const DSA *d);
|
||||
const BIGNUM *DSA_get0_priv_key(const DSA *d);
|
||||
void DSA_clear_flags(DSA *d, int flags);
|
||||
int DSA_test_flags(const DSA *d, int flags);
|
||||
void DSA_set_flags(DSA *d, int flags);
|
||||
ENGINE *DSA_get0_engine(DSA *d);
|
||||
DSA_METHOD *DSA_meth_new(const char *name, int flags);
|
||||
void DSA_meth_free(DSA_METHOD *dsam);
|
||||
DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam);
|
||||
const char *DSA_meth_get0_name(const DSA_METHOD *dsam);
|
||||
int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name);
|
||||
int DSA_meth_get_flags(const DSA_METHOD *dsam);
|
||||
int DSA_meth_set_flags(DSA_METHOD *dsam, int flags);
|
||||
void *DSA_meth_get0_app_data(const DSA_METHOD *dsam);
|
||||
int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data);
|
||||
DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))
|
||||
(const unsigned char *, int, DSA *);
|
||||
int DSA_meth_set_sign(DSA_METHOD *dsam,
|
||||
DSA_SIG *(*sign) (const unsigned char *, int, DSA *));
|
||||
int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))
|
||||
(DSA *, BN_CTX *, BIGNUM **, BIGNUM **);
|
||||
int DSA_meth_set_sign_setup(DSA_METHOD *dsam,
|
||||
int (*sign_setup) (DSA *, BN_CTX *, BIGNUM **, BIGNUM **));
|
||||
int (*DSA_meth_get_verify(const DSA_METHOD *dsam))
|
||||
(const unsigned char *, int, DSA_SIG *, DSA *);
|
||||
int DSA_meth_set_verify(DSA_METHOD *dsam,
|
||||
int (*verify) (const unsigned char *, int, DSA_SIG *, DSA *));
|
||||
int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))
|
||||
(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, const BIGNUM *, BN_CTX *, BN_MONT_CTX *);
|
||||
int DSA_meth_set_mod_exp(DSA_METHOD *dsam,
|
||||
int (*mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *,
|
||||
BN_MONT_CTX *));
|
||||
int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))
|
||||
(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
BN_CTX *, BN_MONT_CTX *);
|
||||
int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam,
|
||||
int (*bn_mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
|
||||
int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *);
|
||||
int DSA_meth_set_init(DSA_METHOD *dsam, int (*init)(DSA *));
|
||||
int (*DSA_meth_get_finish(const DSA_METHOD *dsam)) (DSA *);
|
||||
int DSA_meth_set_finish(DSA_METHOD *dsam, int (*finish) (DSA *));
|
||||
int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))
|
||||
(DSA *, int, const unsigned char *, int, int *, unsigned long *,
|
||||
BN_GENCB *);
|
||||
int DSA_meth_set_paramgen(DSA_METHOD *dsam,
|
||||
int (*paramgen) (DSA *, int, const unsigned char *, int, int *,
|
||||
unsigned long *, BN_GENCB *));
|
||||
int (*DSA_meth_get_keygen(const DSA_METHOD *dsam)) (DSA *);
|
||||
int DSA_meth_set_keygen(DSA_METHOD *dsam, int (*keygen) (DSA *));
|
||||
|
||||
// csrc/openssl/src/include/openssl/dsaerr.h
|
||||
int ERR_load_DSA_strings(void);
|
||||
enum {
|
||||
DSA_F_DSAPARAMS_PRINT = 100,
|
||||
DSA_F_DSAPARAMS_PRINT_FP = 101,
|
||||
DSA_F_DSA_BUILTIN_PARAMGEN = 125,
|
||||
DSA_F_DSA_BUILTIN_PARAMGEN2 = 126,
|
||||
DSA_F_DSA_DO_SIGN = 112,
|
||||
DSA_F_DSA_DO_VERIFY = 113,
|
||||
DSA_F_DSA_METH_DUP = 127,
|
||||
DSA_F_DSA_METH_NEW = 128,
|
||||
DSA_F_DSA_METH_SET1_NAME = 129,
|
||||
DSA_F_DSA_NEW_METHOD = 103,
|
||||
DSA_F_DSA_PARAM_DECODE = 119,
|
||||
DSA_F_DSA_PRINT_FP = 105,
|
||||
DSA_F_DSA_PRIV_DECODE = 115,
|
||||
DSA_F_DSA_PRIV_ENCODE = 116,
|
||||
DSA_F_DSA_PUB_DECODE = 117,
|
||||
DSA_F_DSA_PUB_ENCODE = 118,
|
||||
DSA_F_DSA_SIGN = 106,
|
||||
DSA_F_DSA_SIGN_SETUP = 107,
|
||||
DSA_F_DSA_SIG_NEW = 102,
|
||||
DSA_F_OLD_DSA_PRIV_DECODE = 122,
|
||||
DSA_F_PKEY_DSA_CTRL = 120,
|
||||
DSA_F_PKEY_DSA_CTRL_STR = 104,
|
||||
DSA_F_PKEY_DSA_KEYGEN = 121,
|
||||
DSA_R_BAD_Q_VALUE = 102,
|
||||
DSA_R_BN_DECODE_ERROR = 108,
|
||||
DSA_R_BN_ERROR = 109,
|
||||
DSA_R_DECODE_ERROR = 104,
|
||||
DSA_R_INVALID_DIGEST_TYPE = 106,
|
||||
DSA_R_INVALID_PARAMETERS = 112,
|
||||
DSA_R_MISSING_PARAMETERS = 101,
|
||||
DSA_R_MISSING_PRIVATE_KEY = 111,
|
||||
DSA_R_MODULUS_TOO_LARGE = 103,
|
||||
DSA_R_NO_PARAMETERS_SET = 107,
|
||||
DSA_R_PARAMETER_ENCODING_ERROR = 105,
|
||||
DSA_R_Q_NOT_PRIME = 113,
|
||||
DSA_R_SEED_LEN_SMALL = 110,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,610 @@
|
||||
// csrc/openssl/src/include/openssl/ec.h
|
||||
enum {
|
||||
OPENSSL_ECC_MAX_FIELD_BITS = 661,
|
||||
};
|
||||
typedef enum {
|
||||
POINT_CONVERSION_COMPRESSED = 2,
|
||||
POINT_CONVERSION_UNCOMPRESSED = 4,
|
||||
POINT_CONVERSION_HYBRID = 6
|
||||
} point_conversion_form_t;
|
||||
typedef struct ec_method_st EC_METHOD;
|
||||
typedef struct ec_group_st EC_GROUP;
|
||||
typedef struct ec_point_st EC_POINT;
|
||||
typedef struct ecpk_parameters_st ECPKPARAMETERS;
|
||||
typedef struct ec_parameters_st ECPARAMETERS;
|
||||
const EC_METHOD *EC_GFp_simple_method(void);
|
||||
const EC_METHOD *EC_GFp_mont_method(void);
|
||||
const EC_METHOD *EC_GFp_nist_method(void);
|
||||
const EC_METHOD *EC_GF2m_simple_method(void);
|
||||
EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
|
||||
void EC_GROUP_free(EC_GROUP *group);
|
||||
void EC_GROUP_clear_free(EC_GROUP *group);
|
||||
int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
|
||||
EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
|
||||
const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
|
||||
int EC_METHOD_get_field_type(const EC_METHOD *meth);
|
||||
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
|
||||
const BIGNUM *order, const BIGNUM *cofactor);
|
||||
const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
|
||||
BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
|
||||
int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
|
||||
const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
|
||||
int EC_GROUP_order_bits(const EC_GROUP *group);
|
||||
int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
|
||||
BN_CTX *ctx);
|
||||
const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group);
|
||||
void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
|
||||
int EC_GROUP_get_curve_name(const EC_GROUP *group);
|
||||
void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
|
||||
int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
|
||||
void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
|
||||
point_conversion_form_t form);
|
||||
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
|
||||
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
|
||||
size_t EC_GROUP_get_seed_len(const EC_GROUP *);
|
||||
size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
|
||||
int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx);
|
||||
int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
|
||||
BN_CTX *ctx);
|
||||
int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
|
||||
int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
|
||||
int EC_GROUP_get_degree(const EC_GROUP *group);
|
||||
int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
|
||||
int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
|
||||
int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
|
||||
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx);
|
||||
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx);
|
||||
EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
|
||||
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
|
||||
ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
|
||||
ECPARAMETERS *params);
|
||||
EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
|
||||
ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
|
||||
ECPKPARAMETERS *params);
|
||||
typedef struct {
|
||||
int nid;
|
||||
const char *comment;
|
||||
} EC_builtin_curve;
|
||||
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
|
||||
const char *EC_curve_nid2nist(int nid);
|
||||
int EC_curve_nist2nid(const char *name);
|
||||
EC_POINT *EC_POINT_new(const EC_GROUP *group);
|
||||
void EC_POINT_free(EC_POINT *point);
|
||||
void EC_POINT_clear_free(EC_POINT *point);
|
||||
int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
|
||||
EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
|
||||
const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
|
||||
int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
|
||||
int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
|
||||
EC_POINT *p, const BIGNUM *x,
|
||||
const BIGNUM *y, const BIGNUM *z,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
|
||||
const EC_POINT *p, BIGNUM *x,
|
||||
BIGNUM *y, BIGNUM *z,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
|
||||
const BIGNUM *x, const BIGNUM *y,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
|
||||
BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
||||
int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
|
||||
int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
||||
int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
|
||||
const BIGNUM *x, int y_bit,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
||||
int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
|
||||
int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
||||
int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
||||
size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
|
||||
point_conversion_form_t form,
|
||||
unsigned char *buf, size_t len, BN_CTX *ctx);
|
||||
int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
|
||||
const unsigned char *buf, size_t len, BN_CTX *ctx);
|
||||
size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point,
|
||||
point_conversion_form_t form,
|
||||
unsigned char **pbuf, BN_CTX *ctx);
|
||||
BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
|
||||
point_conversion_form_t form, BIGNUM *, BN_CTX *);
|
||||
EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
|
||||
EC_POINT *, BN_CTX *);
|
||||
char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
|
||||
point_conversion_form_t form, BN_CTX *);
|
||||
EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
|
||||
EC_POINT *, BN_CTX *);
|
||||
int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
|
||||
const EC_POINT *b, BN_CTX *ctx);
|
||||
int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
|
||||
int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
|
||||
int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
|
||||
int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
|
||||
EC_POINT *points[], BN_CTX *ctx);
|
||||
int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
|
||||
size_t num, const EC_POINT *p[], const BIGNUM *m[],
|
||||
BN_CTX *ctx);
|
||||
int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
|
||||
const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
|
||||
int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
|
||||
int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
|
||||
const ASN1_ITEM * ECPKPARAMETERS_it(void);
|
||||
ECPKPARAMETERS *ECPKPARAMETERS_new(void); void ECPKPARAMETERS_free(ECPKPARAMETERS *a);
|
||||
const ASN1_ITEM * ECPARAMETERS_it(void);
|
||||
ECPARAMETERS *ECPARAMETERS_new(void); void ECPARAMETERS_free(ECPARAMETERS *a);
|
||||
int EC_GROUP_get_basis_type(const EC_GROUP *);
|
||||
int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
|
||||
int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
|
||||
unsigned int *k2, unsigned int *k3);
|
||||
enum {
|
||||
OPENSSL_EC_EXPLICIT_CURVE = 0x000,
|
||||
OPENSSL_EC_NAMED_CURVE = 0x001,
|
||||
};
|
||||
EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
|
||||
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
|
||||
#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
|
||||
#define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
|
||||
#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
|
||||
#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), (unsigned char *)(x))
|
||||
int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
|
||||
int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
|
||||
enum {
|
||||
EC_PKEY_NO_PARAMETERS = 0x001,
|
||||
EC_PKEY_NO_PUBKEY = 0x002,
|
||||
EC_FLAG_NON_FIPS_ALLOW = 0x1,
|
||||
EC_FLAG_FIPS_CHECKED = 0x2,
|
||||
EC_FLAG_COFACTOR_ECDH = 0x1000,
|
||||
};
|
||||
EC_KEY *EC_KEY_new(void);
|
||||
int EC_KEY_get_flags(const EC_KEY *key);
|
||||
void EC_KEY_set_flags(EC_KEY *key, int flags);
|
||||
void EC_KEY_clear_flags(EC_KEY *key, int flags);
|
||||
EC_KEY *EC_KEY_new_by_curve_name(int nid);
|
||||
void EC_KEY_free(EC_KEY *key);
|
||||
EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
|
||||
EC_KEY *EC_KEY_dup(const EC_KEY *src);
|
||||
int EC_KEY_up_ref(EC_KEY *key);
|
||||
ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
|
||||
const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
|
||||
int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
|
||||
const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
|
||||
int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
|
||||
const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
|
||||
int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
|
||||
unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
|
||||
void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
|
||||
point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
|
||||
void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
|
||||
#define EC_KEY_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
|
||||
int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
|
||||
void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
|
||||
void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
|
||||
int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
|
||||
int EC_KEY_generate_key(EC_KEY *key);
|
||||
int EC_KEY_check_key(const EC_KEY *key);
|
||||
int EC_KEY_can_sign(const EC_KEY *eckey);
|
||||
int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
|
||||
BIGNUM *y);
|
||||
size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form,
|
||||
unsigned char **pbuf, BN_CTX *ctx);
|
||||
int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf, size_t len,
|
||||
BN_CTX *ctx);
|
||||
int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len);
|
||||
size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len);
|
||||
size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf);
|
||||
EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
|
||||
int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
|
||||
EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
|
||||
int i2d_ECParameters(EC_KEY *key, unsigned char **out);
|
||||
EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);
|
||||
int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);
|
||||
int ECParameters_print(BIO *bp, const EC_KEY *key);
|
||||
int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
|
||||
int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
|
||||
int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
|
||||
const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
|
||||
const EC_KEY_METHOD *EC_KEY_get_default_method(void);
|
||||
void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
|
||||
const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
|
||||
int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
|
||||
EC_KEY *EC_KEY_new_method(ENGINE *engine);
|
||||
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
const unsigned char *sinfo, size_t sinfolen,
|
||||
const EVP_MD *md);
|
||||
int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
|
||||
const EC_KEY *ecdh,
|
||||
void *(*KDF) (const void *in, size_t inlen,
|
||||
void *out, size_t *outlen));
|
||||
typedef struct ECDSA_SIG_st ECDSA_SIG;
|
||||
ECDSA_SIG *ECDSA_SIG_new(void);
|
||||
void ECDSA_SIG_free(ECDSA_SIG *sig);
|
||||
int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
|
||||
ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
|
||||
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
|
||||
const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
|
||||
const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
|
||||
int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
|
||||
ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
|
||||
EC_KEY *eckey);
|
||||
ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
|
||||
const BIGNUM *kinv, const BIGNUM *rp,
|
||||
EC_KEY *eckey);
|
||||
int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
|
||||
const ECDSA_SIG *sig, EC_KEY *eckey);
|
||||
int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
|
||||
int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
|
||||
unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
|
||||
int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,
|
||||
unsigned char *sig, unsigned int *siglen,
|
||||
const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
|
||||
int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
|
||||
const unsigned char *sig, int siglen, EC_KEY *eckey);
|
||||
int ECDSA_size(const EC_KEY *eckey);
|
||||
EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
|
||||
void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
|
||||
void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
|
||||
int (*init)(EC_KEY *key),
|
||||
void (*finish)(EC_KEY *key),
|
||||
int (*copy)(EC_KEY *dest, const EC_KEY *src),
|
||||
int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
|
||||
int (*set_private)(EC_KEY *key,
|
||||
const BIGNUM *priv_key),
|
||||
int (*set_public)(EC_KEY *key,
|
||||
const EC_POINT *pub_key));
|
||||
void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
|
||||
int (*keygen)(EC_KEY *key));
|
||||
void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth,
|
||||
int (*ckey)(unsigned char **psec,
|
||||
size_t *pseclen,
|
||||
const EC_POINT *pub_key,
|
||||
const EC_KEY *ecdh));
|
||||
void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth,
|
||||
int (*sign)(int type, const unsigned char *dgst,
|
||||
int dlen, unsigned char *sig,
|
||||
unsigned int *siglen,
|
||||
const BIGNUM *kinv, const BIGNUM *r,
|
||||
EC_KEY *eckey),
|
||||
int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||
BIGNUM **kinvp, BIGNUM **rp),
|
||||
ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
|
||||
int dgst_len,
|
||||
const BIGNUM *in_kinv,
|
||||
const BIGNUM *in_r,
|
||||
EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth,
|
||||
int (*verify)(int type, const unsigned
|
||||
char *dgst, int dgst_len,
|
||||
const unsigned char *sigbuf,
|
||||
int sig_len, EC_KEY *eckey),
|
||||
int (*verify_sig)(const unsigned char *dgst,
|
||||
int dgst_len,
|
||||
const ECDSA_SIG *sig,
|
||||
EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth,
|
||||
int (**pinit)(EC_KEY *key),
|
||||
void (**pfinish)(EC_KEY *key),
|
||||
int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
|
||||
int (**pset_group)(EC_KEY *key,
|
||||
const EC_GROUP *grp),
|
||||
int (**pset_private)(EC_KEY *key,
|
||||
const BIGNUM *priv_key),
|
||||
int (**pset_public)(EC_KEY *key,
|
||||
const EC_POINT *pub_key));
|
||||
void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth,
|
||||
int (**pkeygen)(EC_KEY *key));
|
||||
void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth,
|
||||
int (**pck)(unsigned char **psec,
|
||||
size_t *pseclen,
|
||||
const EC_POINT *pub_key,
|
||||
const EC_KEY *ecdh));
|
||||
void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth,
|
||||
int (**psign)(int type, const unsigned char *dgst,
|
||||
int dlen, unsigned char *sig,
|
||||
unsigned int *siglen,
|
||||
const BIGNUM *kinv, const BIGNUM *r,
|
||||
EC_KEY *eckey),
|
||||
int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||
BIGNUM **kinvp, BIGNUM **rp),
|
||||
ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
|
||||
int dgst_len,
|
||||
const BIGNUM *in_kinv,
|
||||
const BIGNUM *in_r,
|
||||
EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
|
||||
int (**pverify)(int type, const unsigned
|
||||
char *dgst, int dgst_len,
|
||||
const unsigned char *sigbuf,
|
||||
int sig_len, EC_KEY *eckey),
|
||||
int (**pverify_sig)(const unsigned char *dgst,
|
||||
int dgst_len,
|
||||
const ECDSA_SIG *sig,
|
||||
EC_KEY *eckey));
|
||||
#define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
|
||||
#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx,nid) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
|
||||
#define EVP_PKEY_CTX_set_ec_param_enc(ctx,flag) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL)
|
||||
#define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx,flag) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL)
|
||||
#define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL)
|
||||
#define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx,kdf) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL)
|
||||
#define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL)
|
||||
#define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx,md) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)(md))
|
||||
#define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx,pmd) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)(pmd))
|
||||
#define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx,len) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL)
|
||||
#define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx,plen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)(plen))
|
||||
#define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx,p,plen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)(p))
|
||||
#define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx,p) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_DERIVE, EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)(p))
|
||||
#define EVP_PKEY_CTX_set1_id(ctx,id,id_len) EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_SET1_ID, (int)id_len, (void*)(id))
|
||||
#define EVP_PKEY_CTX_get1_id(ctx,id) EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_GET1_ID, 0, (void*)(id))
|
||||
#define EVP_PKEY_CTX_get1_id_len(ctx,id_len) EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_GET1_ID_LEN, 0, (void*)(id_len))
|
||||
enum {
|
||||
EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID = (EVP_PKEY_ALG_CTRL + 1),
|
||||
EVP_PKEY_CTRL_EC_PARAM_ENC = (EVP_PKEY_ALG_CTRL + 2),
|
||||
EVP_PKEY_CTRL_EC_ECDH_COFACTOR = (EVP_PKEY_ALG_CTRL + 3),
|
||||
EVP_PKEY_CTRL_EC_KDF_TYPE = (EVP_PKEY_ALG_CTRL + 4),
|
||||
EVP_PKEY_CTRL_EC_KDF_MD = (EVP_PKEY_ALG_CTRL + 5),
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_MD = (EVP_PKEY_ALG_CTRL + 6),
|
||||
EVP_PKEY_CTRL_EC_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 7),
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 8),
|
||||
EVP_PKEY_CTRL_EC_KDF_UKM = (EVP_PKEY_ALG_CTRL + 9),
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_UKM = (EVP_PKEY_ALG_CTRL + 10),
|
||||
EVP_PKEY_CTRL_SET1_ID = (EVP_PKEY_ALG_CTRL + 11),
|
||||
EVP_PKEY_CTRL_GET1_ID = (EVP_PKEY_ALG_CTRL + 12),
|
||||
EVP_PKEY_CTRL_GET1_ID_LEN = (EVP_PKEY_ALG_CTRL + 13),
|
||||
EVP_PKEY_ECDH_KDF_NONE = 1,
|
||||
EVP_PKEY_ECDH_KDF_X9_63 = 2,
|
||||
EVP_PKEY_ECDH_KDF_X9_62 = EVP_PKEY_ECDH_KDF_X9_63,
|
||||
};
|
||||
|
||||
// csrc/openssl/src/include/openssl/ecerr.h
|
||||
int ERR_load_EC_strings(void);
|
||||
enum {
|
||||
EC_F_BN_TO_FELEM = 224,
|
||||
EC_F_D2I_ECPARAMETERS = 144,
|
||||
EC_F_D2I_ECPKPARAMETERS = 145,
|
||||
EC_F_D2I_ECPRIVATEKEY = 146,
|
||||
EC_F_DO_EC_KEY_PRINT = 221,
|
||||
EC_F_ECDH_CMS_DECRYPT = 238,
|
||||
EC_F_ECDH_CMS_SET_SHARED_INFO = 239,
|
||||
EC_F_ECDH_COMPUTE_KEY = 246,
|
||||
EC_F_ECDH_SIMPLE_COMPUTE_KEY = 257,
|
||||
EC_F_ECDSA_DO_SIGN_EX = 251,
|
||||
EC_F_ECDSA_DO_VERIFY = 252,
|
||||
EC_F_ECDSA_SIGN_EX = 254,
|
||||
EC_F_ECDSA_SIGN_SETUP = 248,
|
||||
EC_F_ECDSA_SIG_NEW = 265,
|
||||
EC_F_ECDSA_VERIFY = 253,
|
||||
EC_F_ECD_ITEM_VERIFY = 270,
|
||||
EC_F_ECKEY_PARAM2TYPE = 223,
|
||||
EC_F_ECKEY_PARAM_DECODE = 212,
|
||||
EC_F_ECKEY_PRIV_DECODE = 213,
|
||||
EC_F_ECKEY_PRIV_ENCODE = 214,
|
||||
EC_F_ECKEY_PUB_DECODE = 215,
|
||||
EC_F_ECKEY_PUB_ENCODE = 216,
|
||||
EC_F_ECKEY_TYPE2PARAM = 220,
|
||||
EC_F_ECPARAMETERS_PRINT = 147,
|
||||
EC_F_ECPARAMETERS_PRINT_FP = 148,
|
||||
EC_F_ECPKPARAMETERS_PRINT = 149,
|
||||
EC_F_ECPKPARAMETERS_PRINT_FP = 150,
|
||||
EC_F_ECP_NISTZ256_GET_AFFINE = 240,
|
||||
EC_F_ECP_NISTZ256_INV_MOD_ORD = 275,
|
||||
EC_F_ECP_NISTZ256_MULT_PRECOMPUTE = 243,
|
||||
EC_F_ECP_NISTZ256_POINTS_MUL = 241,
|
||||
EC_F_ECP_NISTZ256_PRE_COMP_NEW = 244,
|
||||
EC_F_ECP_NISTZ256_WINDOWED_MUL = 242,
|
||||
EC_F_ECX_KEY_OP = 266,
|
||||
EC_F_ECX_PRIV_ENCODE = 267,
|
||||
EC_F_ECX_PUB_ENCODE = 268,
|
||||
EC_F_EC_ASN1_GROUP2CURVE = 153,
|
||||
EC_F_EC_ASN1_GROUP2FIELDID = 154,
|
||||
EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY = 208,
|
||||
EC_F_EC_GF2M_SIMPLE_FIELD_INV = 296,
|
||||
EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT = 159,
|
||||
EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE = 195,
|
||||
EC_F_EC_GF2M_SIMPLE_LADDER_POST = 285,
|
||||
EC_F_EC_GF2M_SIMPLE_LADDER_PRE = 288,
|
||||
EC_F_EC_GF2M_SIMPLE_OCT2POINT = 160,
|
||||
EC_F_EC_GF2M_SIMPLE_POINT2OCT = 161,
|
||||
EC_F_EC_GF2M_SIMPLE_POINTS_MUL = 289,
|
||||
EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES = 162,
|
||||
EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES = 163,
|
||||
EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES = 164,
|
||||
EC_F_EC_GFP_MONT_FIELD_DECODE = 133,
|
||||
EC_F_EC_GFP_MONT_FIELD_ENCODE = 134,
|
||||
EC_F_EC_GFP_MONT_FIELD_INV = 297,
|
||||
EC_F_EC_GFP_MONT_FIELD_MUL = 131,
|
||||
EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE = 209,
|
||||
EC_F_EC_GFP_MONT_FIELD_SQR = 132,
|
||||
EC_F_EC_GFP_MONT_GROUP_SET_CURVE = 189,
|
||||
EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE = 225,
|
||||
EC_F_EC_GFP_NISTP224_POINTS_MUL = 228,
|
||||
EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES = 226,
|
||||
EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE = 230,
|
||||
EC_F_EC_GFP_NISTP256_POINTS_MUL = 231,
|
||||
EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES = 232,
|
||||
EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE = 233,
|
||||
EC_F_EC_GFP_NISTP521_POINTS_MUL = 234,
|
||||
EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES = 235,
|
||||
EC_F_EC_GFP_NIST_FIELD_MUL = 200,
|
||||
EC_F_EC_GFP_NIST_FIELD_SQR = 201,
|
||||
EC_F_EC_GFP_NIST_GROUP_SET_CURVE = 202,
|
||||
EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES = 287,
|
||||
EC_F_EC_GFP_SIMPLE_FIELD_INV = 298,
|
||||
EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT = 165,
|
||||
EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE = 166,
|
||||
EC_F_EC_GFP_SIMPLE_MAKE_AFFINE = 102,
|
||||
EC_F_EC_GFP_SIMPLE_OCT2POINT = 103,
|
||||
EC_F_EC_GFP_SIMPLE_POINT2OCT = 104,
|
||||
EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE = 137,
|
||||
EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES = 167,
|
||||
EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES = 168,
|
||||
EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES = 169,
|
||||
EC_F_EC_GROUP_CHECK = 170,
|
||||
EC_F_EC_GROUP_CHECK_DISCRIMINANT = 171,
|
||||
EC_F_EC_GROUP_COPY = 106,
|
||||
EC_F_EC_GROUP_GET_CURVE = 291,
|
||||
EC_F_EC_GROUP_GET_CURVE_GF2M = 172,
|
||||
EC_F_EC_GROUP_GET_CURVE_GFP = 130,
|
||||
EC_F_EC_GROUP_GET_DEGREE = 173,
|
||||
EC_F_EC_GROUP_GET_ECPARAMETERS = 261,
|
||||
EC_F_EC_GROUP_GET_ECPKPARAMETERS = 262,
|
||||
EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS = 193,
|
||||
EC_F_EC_GROUP_GET_TRINOMIAL_BASIS = 194,
|
||||
EC_F_EC_GROUP_NEW = 108,
|
||||
EC_F_EC_GROUP_NEW_BY_CURVE_NAME = 174,
|
||||
EC_F_EC_GROUP_NEW_FROM_DATA = 175,
|
||||
EC_F_EC_GROUP_NEW_FROM_ECPARAMETERS = 263,
|
||||
EC_F_EC_GROUP_NEW_FROM_ECPKPARAMETERS = 264,
|
||||
EC_F_EC_GROUP_SET_CURVE = 292,
|
||||
EC_F_EC_GROUP_SET_CURVE_GF2M = 176,
|
||||
EC_F_EC_GROUP_SET_CURVE_GFP = 109,
|
||||
EC_F_EC_GROUP_SET_GENERATOR = 111,
|
||||
EC_F_EC_GROUP_SET_SEED = 286,
|
||||
EC_F_EC_KEY_CHECK_KEY = 177,
|
||||
EC_F_EC_KEY_COPY = 178,
|
||||
EC_F_EC_KEY_GENERATE_KEY = 179,
|
||||
EC_F_EC_KEY_NEW = 182,
|
||||
EC_F_EC_KEY_NEW_METHOD = 245,
|
||||
EC_F_EC_KEY_OCT2PRIV = 255,
|
||||
EC_F_EC_KEY_PRINT = 180,
|
||||
EC_F_EC_KEY_PRINT_FP = 181,
|
||||
EC_F_EC_KEY_PRIV2BUF = 279,
|
||||
EC_F_EC_KEY_PRIV2OCT = 256,
|
||||
EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES = 229,
|
||||
EC_F_EC_KEY_SIMPLE_CHECK_KEY = 258,
|
||||
EC_F_EC_KEY_SIMPLE_OCT2PRIV = 259,
|
||||
EC_F_EC_KEY_SIMPLE_PRIV2OCT = 260,
|
||||
EC_F_EC_PKEY_CHECK = 273,
|
||||
EC_F_EC_PKEY_PARAM_CHECK = 274,
|
||||
EC_F_EC_POINTS_MAKE_AFFINE = 136,
|
||||
EC_F_EC_POINTS_MUL = 290,
|
||||
EC_F_EC_POINT_ADD = 112,
|
||||
EC_F_EC_POINT_BN2POINT = 280,
|
||||
EC_F_EC_POINT_CMP = 113,
|
||||
EC_F_EC_POINT_COPY = 114,
|
||||
EC_F_EC_POINT_DBL = 115,
|
||||
EC_F_EC_POINT_GET_AFFINE_COORDINATES = 293,
|
||||
EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M = 183,
|
||||
EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP = 116,
|
||||
EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP = 117,
|
||||
EC_F_EC_POINT_INVERT = 210,
|
||||
EC_F_EC_POINT_IS_AT_INFINITY = 118,
|
||||
EC_F_EC_POINT_IS_ON_CURVE = 119,
|
||||
EC_F_EC_POINT_MAKE_AFFINE = 120,
|
||||
EC_F_EC_POINT_NEW = 121,
|
||||
EC_F_EC_POINT_OCT2POINT = 122,
|
||||
EC_F_EC_POINT_POINT2BUF = 281,
|
||||
EC_F_EC_POINT_POINT2OCT = 123,
|
||||
EC_F_EC_POINT_SET_AFFINE_COORDINATES = 294,
|
||||
EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M = 185,
|
||||
EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP = 124,
|
||||
EC_F_EC_POINT_SET_COMPRESSED_COORDINATES = 295,
|
||||
EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M = 186,
|
||||
EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP = 125,
|
||||
EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP = 126,
|
||||
EC_F_EC_POINT_SET_TO_INFINITY = 127,
|
||||
EC_F_EC_PRE_COMP_NEW = 196,
|
||||
EC_F_EC_SCALAR_MUL_LADDER = 284,
|
||||
EC_F_EC_WNAF_MUL = 187,
|
||||
EC_F_EC_WNAF_PRECOMPUTE_MULT = 188,
|
||||
EC_F_I2D_ECPARAMETERS = 190,
|
||||
EC_F_I2D_ECPKPARAMETERS = 191,
|
||||
EC_F_I2D_ECPRIVATEKEY = 192,
|
||||
EC_F_I2O_ECPUBLICKEY = 151,
|
||||
EC_F_NISTP224_PRE_COMP_NEW = 227,
|
||||
EC_F_NISTP256_PRE_COMP_NEW = 236,
|
||||
EC_F_NISTP521_PRE_COMP_NEW = 237,
|
||||
EC_F_O2I_ECPUBLICKEY = 152,
|
||||
EC_F_OLD_EC_PRIV_DECODE = 222,
|
||||
EC_F_OSSL_ECDH_COMPUTE_KEY = 247,
|
||||
EC_F_OSSL_ECDSA_SIGN_SIG = 249,
|
||||
EC_F_OSSL_ECDSA_VERIFY_SIG = 250,
|
||||
EC_F_PKEY_ECD_CTRL = 271,
|
||||
EC_F_PKEY_ECD_DIGESTSIGN = 272,
|
||||
EC_F_PKEY_ECD_DIGESTSIGN25519 = 276,
|
||||
EC_F_PKEY_ECD_DIGESTSIGN448 = 277,
|
||||
EC_F_PKEY_ECX_DERIVE = 269,
|
||||
EC_F_PKEY_EC_CTRL = 197,
|
||||
EC_F_PKEY_EC_CTRL_STR = 198,
|
||||
EC_F_PKEY_EC_DERIVE = 217,
|
||||
EC_F_PKEY_EC_INIT = 282,
|
||||
EC_F_PKEY_EC_KDF_DERIVE = 283,
|
||||
EC_F_PKEY_EC_KEYGEN = 199,
|
||||
EC_F_PKEY_EC_PARAMGEN = 219,
|
||||
EC_F_PKEY_EC_SIGN = 218,
|
||||
EC_F_VALIDATE_ECX_DERIVE = 278,
|
||||
EC_R_ASN1_ERROR = 115,
|
||||
EC_R_BAD_SIGNATURE = 156,
|
||||
EC_R_BIGNUM_OUT_OF_RANGE = 144,
|
||||
EC_R_BUFFER_TOO_SMALL = 100,
|
||||
EC_R_CANNOT_INVERT = 165,
|
||||
EC_R_COORDINATES_OUT_OF_RANGE = 146,
|
||||
EC_R_CURVE_DOES_NOT_SUPPORT_ECDH = 160,
|
||||
EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING = 159,
|
||||
EC_R_D2I_ECPKPARAMETERS_FAILURE = 117,
|
||||
EC_R_DECODE_ERROR = 142,
|
||||
EC_R_DISCRIMINANT_IS_ZERO = 118,
|
||||
EC_R_EC_GROUP_NEW_BY_NAME_FAILURE = 119,
|
||||
EC_R_FIELD_TOO_LARGE = 143,
|
||||
EC_R_GF2M_NOT_SUPPORTED = 147,
|
||||
EC_R_GROUP2PKPARAMETERS_FAILURE = 120,
|
||||
EC_R_I2D_ECPKPARAMETERS_FAILURE = 121,
|
||||
EC_R_INCOMPATIBLE_OBJECTS = 101,
|
||||
EC_R_INVALID_ARGUMENT = 112,
|
||||
EC_R_INVALID_COMPRESSED_POINT = 110,
|
||||
EC_R_INVALID_COMPRESSION_BIT = 109,
|
||||
EC_R_INVALID_CURVE = 141,
|
||||
EC_R_INVALID_DIGEST = 151,
|
||||
EC_R_INVALID_DIGEST_TYPE = 138,
|
||||
EC_R_INVALID_ENCODING = 102,
|
||||
EC_R_INVALID_FIELD = 103,
|
||||
EC_R_INVALID_FORM = 104,
|
||||
EC_R_INVALID_GROUP_ORDER = 122,
|
||||
EC_R_INVALID_KEY = 116,
|
||||
EC_R_INVALID_OUTPUT_LENGTH = 161,
|
||||
EC_R_INVALID_PEER_KEY = 133,
|
||||
EC_R_INVALID_PENTANOMIAL_BASIS = 132,
|
||||
EC_R_INVALID_PRIVATE_KEY = 123,
|
||||
EC_R_INVALID_TRINOMIAL_BASIS = 137,
|
||||
EC_R_KDF_PARAMETER_ERROR = 148,
|
||||
EC_R_KEYS_NOT_SET = 140,
|
||||
EC_R_LADDER_POST_FAILURE = 136,
|
||||
EC_R_LADDER_PRE_FAILURE = 153,
|
||||
EC_R_LADDER_STEP_FAILURE = 162,
|
||||
EC_R_MISSING_PARAMETERS = 124,
|
||||
EC_R_MISSING_PRIVATE_KEY = 125,
|
||||
EC_R_NEED_NEW_SETUP_VALUES = 157,
|
||||
EC_R_NOT_A_NIST_PRIME = 135,
|
||||
EC_R_NOT_IMPLEMENTED = 126,
|
||||
EC_R_NOT_INITIALIZED = 111,
|
||||
EC_R_NO_PARAMETERS_SET = 139,
|
||||
EC_R_NO_PRIVATE_VALUE = 154,
|
||||
EC_R_OPERATION_NOT_SUPPORTED = 152,
|
||||
EC_R_PASSED_NULL_PARAMETER = 134,
|
||||
EC_R_PEER_KEY_ERROR = 149,
|
||||
EC_R_PKPARAMETERS2GROUP_FAILURE = 127,
|
||||
EC_R_POINT_ARITHMETIC_FAILURE = 155,
|
||||
EC_R_POINT_AT_INFINITY = 106,
|
||||
EC_R_POINT_COORDINATES_BLIND_FAILURE = 163,
|
||||
EC_R_POINT_IS_NOT_ON_CURVE = 107,
|
||||
EC_R_RANDOM_NUMBER_GENERATION_FAILED = 158,
|
||||
EC_R_SHARED_INFO_ERROR = 150,
|
||||
EC_R_SLOT_FULL = 108,
|
||||
EC_R_UNDEFINED_GENERATOR = 113,
|
||||
EC_R_UNDEFINED_ORDER = 128,
|
||||
EC_R_UNKNOWN_COFACTOR = 164,
|
||||
EC_R_UNKNOWN_GROUP = 129,
|
||||
EC_R_UNKNOWN_ORDER = 114,
|
||||
EC_R_UNSUPPORTED_FIELD = 131,
|
||||
EC_R_WRONG_CURVE_PARAMETERS = 145,
|
||||
EC_R_WRONG_ORDER = 130,
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
require'libcrypto_engine_h'
|
||||
local M = require'libcrypto'
|
||||
local C = M.C
|
||||
|
||||
function M.ENGINE_load_openssl() return C.OPENSSL_init_crypto(C.OPENSSL_INIT_ENGINE_OPENSSL, nil) end
|
||||
function M.ENGINE_load_dynamic() return C.OPENSSL_init_crypto(C.OPENSSL_INIT_ENGINE_DYNAMIC, nil) end
|
||||
function M.ENGINE_load_cryptodev() return C.OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, nil) end
|
||||
function M.ENGINE_load_rdrand() return C.OPENSSL_init_crypto(C.OPENSSL_INIT_ENGINE_RDRAND, nil) end
|
||||
function M.ENGINE_get_ex_new_index(...) return C.CRYPTO_get_ex_new_index(...) end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,307 @@
|
||||
local ffi = require'ffi' --engine.h, engineerr.h
|
||||
require'libcrypto_types_h'
|
||||
ffi.cdef[[
|
||||
// engine.h
|
||||
enum {
|
||||
ENGINE_METHOD_RSA = (unsigned int)0x0001,
|
||||
ENGINE_METHOD_DSA = (unsigned int)0x0002,
|
||||
ENGINE_METHOD_DH = (unsigned int)0x0004,
|
||||
ENGINE_METHOD_RAND = (unsigned int)0x0008,
|
||||
ENGINE_METHOD_CIPHERS = (unsigned int)0x0040,
|
||||
ENGINE_METHOD_DIGESTS = (unsigned int)0x0080,
|
||||
ENGINE_METHOD_PKEY_METHS = (unsigned int)0x0200,
|
||||
ENGINE_METHOD_PKEY_ASN1_METHS = (unsigned int)0x0400,
|
||||
ENGINE_METHOD_EC = (unsigned int)0x0800,
|
||||
ENGINE_METHOD_ALL = (unsigned int)0xFFFF,
|
||||
ENGINE_METHOD_NONE = (unsigned int)0x0000,
|
||||
ENGINE_TABLE_FLAG_NOINIT = (unsigned int)0x0001,
|
||||
ENGINE_FLAGS_MANUAL_CMD_CTRL = (int)0x0002,
|
||||
ENGINE_FLAGS_BY_ID_COPY = (int)0x0004,
|
||||
ENGINE_FLAGS_NO_REGISTER_ALL = (int)0x0008,
|
||||
ENGINE_CMD_FLAG_NUMERIC = (unsigned int)0x0001,
|
||||
ENGINE_CMD_FLAG_STRING = (unsigned int)0x0002,
|
||||
ENGINE_CMD_FLAG_NO_INPUT = (unsigned int)0x0004,
|
||||
ENGINE_CMD_FLAG_INTERNAL = (unsigned int)0x0008,
|
||||
ENGINE_CTRL_SET_LOGSTREAM = 1,
|
||||
ENGINE_CTRL_SET_PASSWORD_CALLBACK = 2,
|
||||
ENGINE_CTRL_HUP = 3,
|
||||
ENGINE_CTRL_SET_USER_INTERFACE = 4,
|
||||
ENGINE_CTRL_SET_CALLBACK_DATA = 5,
|
||||
ENGINE_CTRL_LOAD_CONFIGURATION = 6,
|
||||
ENGINE_CTRL_LOAD_SECTION = 7,
|
||||
ENGINE_CTRL_HAS_CTRL_FUNCTION = 10,
|
||||
ENGINE_CTRL_GET_FIRST_CMD_TYPE = 11,
|
||||
ENGINE_CTRL_GET_NEXT_CMD_TYPE = 12,
|
||||
ENGINE_CTRL_GET_CMD_FROM_NAME = 13,
|
||||
ENGINE_CTRL_GET_NAME_LEN_FROM_CMD = 14,
|
||||
ENGINE_CTRL_GET_NAME_FROM_CMD = 15,
|
||||
ENGINE_CTRL_GET_DESC_LEN_FROM_CMD = 16,
|
||||
ENGINE_CTRL_GET_DESC_FROM_CMD = 17,
|
||||
ENGINE_CTRL_GET_CMD_FLAGS = 18,
|
||||
ENGINE_CMD_BASE = 200,
|
||||
ENGINE_CTRL_CHIL_SET_FORKCHECK = 100,
|
||||
ENGINE_CTRL_CHIL_NO_LOCKING = 101,
|
||||
};
|
||||
typedef struct ENGINE_CMD_DEFN_st {
|
||||
unsigned int cmd_num;
|
||||
const char *cmd_name;
|
||||
const char *cmd_desc;
|
||||
unsigned int cmd_flags;
|
||||
} ENGINE_CMD_DEFN;
|
||||
typedef int (*ENGINE_GEN_FUNC_PTR) (void);
|
||||
typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
|
||||
typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
|
||||
void (*f) (void));
|
||||
typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
|
||||
UI_METHOD *ui_method,
|
||||
void *callback_data);
|
||||
typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
|
||||
struct stack_st_X509_NAME *ca_dn,
|
||||
X509 **pcert, EVP_PKEY **pkey,
|
||||
struct stack_st_X509 **pother,
|
||||
UI_METHOD *ui_method,
|
||||
void *callback_data);
|
||||
typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
|
||||
const int **, int);
|
||||
typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
|
||||
int);
|
||||
typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
|
||||
const int **, int);
|
||||
typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
|
||||
const int **, int);
|
||||
ENGINE *ENGINE_get_first(void);
|
||||
ENGINE *ENGINE_get_last(void);
|
||||
ENGINE *ENGINE_get_next(ENGINE *e);
|
||||
ENGINE *ENGINE_get_prev(ENGINE *e);
|
||||
int ENGINE_add(ENGINE *e);
|
||||
int ENGINE_remove(ENGINE *e);
|
||||
ENGINE *ENGINE_by_id(const char *id);
|
||||
void ENGINE_load_builtin_engines(void);
|
||||
unsigned int ENGINE_get_table_flags(void);
|
||||
void ENGINE_set_table_flags(unsigned int flags);
|
||||
int ENGINE_register_RSA(ENGINE *e);
|
||||
void ENGINE_unregister_RSA(ENGINE *e);
|
||||
void ENGINE_register_all_RSA(void);
|
||||
int ENGINE_register_DSA(ENGINE *e);
|
||||
void ENGINE_unregister_DSA(ENGINE *e);
|
||||
void ENGINE_register_all_DSA(void);
|
||||
int ENGINE_register_EC(ENGINE *e);
|
||||
void ENGINE_unregister_EC(ENGINE *e);
|
||||
void ENGINE_register_all_EC(void);
|
||||
int ENGINE_register_DH(ENGINE *e);
|
||||
void ENGINE_unregister_DH(ENGINE *e);
|
||||
void ENGINE_register_all_DH(void);
|
||||
int ENGINE_register_RAND(ENGINE *e);
|
||||
void ENGINE_unregister_RAND(ENGINE *e);
|
||||
void ENGINE_register_all_RAND(void);
|
||||
int ENGINE_register_ciphers(ENGINE *e);
|
||||
void ENGINE_unregister_ciphers(ENGINE *e);
|
||||
void ENGINE_register_all_ciphers(void);
|
||||
int ENGINE_register_digests(ENGINE *e);
|
||||
void ENGINE_unregister_digests(ENGINE *e);
|
||||
void ENGINE_register_all_digests(void);
|
||||
int ENGINE_register_pkey_meths(ENGINE *e);
|
||||
void ENGINE_unregister_pkey_meths(ENGINE *e);
|
||||
void ENGINE_register_all_pkey_meths(void);
|
||||
int ENGINE_register_pkey_asn1_meths(ENGINE *e);
|
||||
void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
|
||||
void ENGINE_register_all_pkey_asn1_meths(void);
|
||||
int ENGINE_register_complete(ENGINE *e);
|
||||
int ENGINE_register_all_complete(void);
|
||||
int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));
|
||||
int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
|
||||
int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
|
||||
long i, void *p, void (*f) (void), int cmd_optional);
|
||||
int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
|
||||
int cmd_optional);
|
||||
ENGINE *ENGINE_new(void);
|
||||
int ENGINE_free(ENGINE *e);
|
||||
int ENGINE_up_ref(ENGINE *e);
|
||||
int ENGINE_set_id(ENGINE *e, const char *id);
|
||||
int ENGINE_set_name(ENGINE *e, const char *name);
|
||||
int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
|
||||
int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
|
||||
int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
|
||||
int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
|
||||
int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
|
||||
int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
|
||||
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
|
||||
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
|
||||
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
|
||||
int ENGINE_set_load_privkey_function(ENGINE *e,
|
||||
ENGINE_LOAD_KEY_PTR loadpriv_f);
|
||||
int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
|
||||
int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
|
||||
ENGINE_SSL_CLIENT_CERT_PTR
|
||||
loadssl_f);
|
||||
int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
|
||||
int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
|
||||
int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
|
||||
int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
|
||||
int ENGINE_set_flags(ENGINE *e, int flags);
|
||||
int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
|
||||
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
|
||||
void *ENGINE_get_ex_data(const ENGINE *e, int idx);
|
||||
const char *ENGINE_get_id(const ENGINE *e);
|
||||
const char *ENGINE_get_name(const ENGINE *e);
|
||||
const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
|
||||
const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
|
||||
const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
|
||||
const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
|
||||
const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
|
||||
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
|
||||
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
|
||||
ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
|
||||
ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
|
||||
*e);
|
||||
ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
|
||||
ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
|
||||
ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
|
||||
ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
|
||||
const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
|
||||
const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
|
||||
const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
|
||||
const char *str,
|
||||
int len);
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
|
||||
const char *str,
|
||||
int len);
|
||||
const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
|
||||
int ENGINE_get_flags(const ENGINE *e);
|
||||
int ENGINE_init(ENGINE *e);
|
||||
int ENGINE_finish(ENGINE *e);
|
||||
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
|
||||
struct stack_st_X509_NAME *ca_dn, X509 **pcert,
|
||||
EVP_PKEY **ppkey, struct stack_st_X509 **pother,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
ENGINE *ENGINE_get_default_RSA(void);
|
||||
ENGINE *ENGINE_get_default_DSA(void);
|
||||
ENGINE *ENGINE_get_default_EC(void);
|
||||
ENGINE *ENGINE_get_default_DH(void);
|
||||
ENGINE *ENGINE_get_default_RAND(void);
|
||||
ENGINE *ENGINE_get_cipher_engine(int nid);
|
||||
ENGINE *ENGINE_get_digest_engine(int nid);
|
||||
ENGINE *ENGINE_get_pkey_meth_engine(int nid);
|
||||
ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
|
||||
int ENGINE_set_default_RSA(ENGINE *e);
|
||||
int ENGINE_set_default_string(ENGINE *e, const char *def_list);
|
||||
int ENGINE_set_default_DSA(ENGINE *e);
|
||||
int ENGINE_set_default_EC(ENGINE *e);
|
||||
int ENGINE_set_default_DH(ENGINE *e);
|
||||
int ENGINE_set_default_RAND(ENGINE *e);
|
||||
int ENGINE_set_default_ciphers(ENGINE *e);
|
||||
int ENGINE_set_default_digests(ENGINE *e);
|
||||
int ENGINE_set_default_pkey_meths(ENGINE *e);
|
||||
int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
|
||||
int ENGINE_set_default(ENGINE *e, unsigned int flags);
|
||||
void ENGINE_add_conf_module(void);
|
||||
enum {
|
||||
OSSL_DYNAMIC_VERSION = (unsigned long)0x00030000,
|
||||
OSSL_DYNAMIC_OLDEST = (unsigned long)0x00030000,
|
||||
};
|
||||
typedef void *(*dyn_MEM_malloc_fn) (size_t, const char *, int);
|
||||
typedef void *(*dyn_MEM_realloc_fn) (void *, size_t, const char *, int);
|
||||
typedef void (*dyn_MEM_free_fn) (void *, const char *, int);
|
||||
typedef struct st_dynamic_MEM_fns {
|
||||
dyn_MEM_malloc_fn malloc_fn;
|
||||
dyn_MEM_realloc_fn realloc_fn;
|
||||
dyn_MEM_free_fn free_fn;
|
||||
} dynamic_MEM_fns;
|
||||
typedef struct st_dynamic_fns {
|
||||
void *static_state;
|
||||
dynamic_MEM_fns mem_fns;
|
||||
} dynamic_fns;
|
||||
typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
|
||||
typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
|
||||
const dynamic_fns *fns);
|
||||
void *ENGINE_get_static_state(void);
|
||||
|
||||
// engineerr.h
|
||||
int ERR_load_ENGINE_strings(void);
|
||||
enum {
|
||||
ENGINE_F_DIGEST_UPDATE = 198,
|
||||
ENGINE_F_DYNAMIC_CTRL = 180,
|
||||
ENGINE_F_DYNAMIC_GET_DATA_CTX = 181,
|
||||
ENGINE_F_DYNAMIC_LOAD = 182,
|
||||
ENGINE_F_DYNAMIC_SET_DATA_CTX = 183,
|
||||
ENGINE_F_ENGINE_ADD = 105,
|
||||
ENGINE_F_ENGINE_BY_ID = 106,
|
||||
ENGINE_F_ENGINE_CMD_IS_EXECUTABLE = 170,
|
||||
ENGINE_F_ENGINE_CTRL = 142,
|
||||
ENGINE_F_ENGINE_CTRL_CMD = 178,
|
||||
ENGINE_F_ENGINE_CTRL_CMD_STRING = 171,
|
||||
ENGINE_F_ENGINE_FINISH = 107,
|
||||
ENGINE_F_ENGINE_GET_CIPHER = 185,
|
||||
ENGINE_F_ENGINE_GET_DIGEST = 186,
|
||||
ENGINE_F_ENGINE_GET_FIRST = 195,
|
||||
ENGINE_F_ENGINE_GET_LAST = 196,
|
||||
ENGINE_F_ENGINE_GET_NEXT = 115,
|
||||
ENGINE_F_ENGINE_GET_PKEY_ASN1_METH = 193,
|
||||
ENGINE_F_ENGINE_GET_PKEY_METH = 192,
|
||||
ENGINE_F_ENGINE_GET_PREV = 116,
|
||||
ENGINE_F_ENGINE_INIT = 119,
|
||||
ENGINE_F_ENGINE_LIST_ADD = 120,
|
||||
ENGINE_F_ENGINE_LIST_REMOVE = 121,
|
||||
ENGINE_F_ENGINE_LOAD_PRIVATE_KEY = 150,
|
||||
ENGINE_F_ENGINE_LOAD_PUBLIC_KEY = 151,
|
||||
ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 194,
|
||||
ENGINE_F_ENGINE_NEW = 122,
|
||||
ENGINE_F_ENGINE_PKEY_ASN1_FIND_STR = 197,
|
||||
ENGINE_F_ENGINE_REMOVE = 123,
|
||||
ENGINE_F_ENGINE_SET_DEFAULT_STRING = 189,
|
||||
ENGINE_F_ENGINE_SET_ID = 129,
|
||||
ENGINE_F_ENGINE_SET_NAME = 130,
|
||||
ENGINE_F_ENGINE_TABLE_REGISTER = 184,
|
||||
ENGINE_F_ENGINE_UNLOCKED_FINISH = 191,
|
||||
ENGINE_F_ENGINE_UP_REF = 190,
|
||||
ENGINE_F_INT_CLEANUP_ITEM = 199,
|
||||
ENGINE_F_INT_CTRL_HELPER = 172,
|
||||
ENGINE_F_INT_ENGINE_CONFIGURE = 188,
|
||||
ENGINE_F_INT_ENGINE_MODULE_INIT = 187,
|
||||
ENGINE_F_OSSL_HMAC_INIT = 200,
|
||||
ENGINE_R_ALREADY_LOADED = 100,
|
||||
ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER = 133,
|
||||
ENGINE_R_CMD_NOT_EXECUTABLE = 134,
|
||||
ENGINE_R_COMMAND_TAKES_INPUT = 135,
|
||||
ENGINE_R_COMMAND_TAKES_NO_INPUT = 136,
|
||||
ENGINE_R_CONFLICTING_ENGINE_ID = 103,
|
||||
ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED = 119,
|
||||
ENGINE_R_DSO_FAILURE = 104,
|
||||
ENGINE_R_DSO_NOT_FOUND = 132,
|
||||
ENGINE_R_ENGINES_SECTION_ERROR = 148,
|
||||
ENGINE_R_ENGINE_CONFIGURATION_ERROR = 102,
|
||||
ENGINE_R_ENGINE_IS_NOT_IN_LIST = 105,
|
||||
ENGINE_R_ENGINE_SECTION_ERROR = 149,
|
||||
ENGINE_R_FAILED_LOADING_PRIVATE_KEY = 128,
|
||||
ENGINE_R_FAILED_LOADING_PUBLIC_KEY = 129,
|
||||
ENGINE_R_FINISH_FAILED = 106,
|
||||
ENGINE_R_ID_OR_NAME_MISSING = 108,
|
||||
ENGINE_R_INIT_FAILED = 109,
|
||||
ENGINE_R_INTERNAL_LIST_ERROR = 110,
|
||||
ENGINE_R_INVALID_ARGUMENT = 143,
|
||||
ENGINE_R_INVALID_CMD_NAME = 137,
|
||||
ENGINE_R_INVALID_CMD_NUMBER = 138,
|
||||
ENGINE_R_INVALID_INIT_VALUE = 151,
|
||||
ENGINE_R_INVALID_STRING = 150,
|
||||
ENGINE_R_NOT_INITIALISED = 117,
|
||||
ENGINE_R_NOT_LOADED = 112,
|
||||
ENGINE_R_NO_CONTROL_FUNCTION = 120,
|
||||
ENGINE_R_NO_INDEX = 144,
|
||||
ENGINE_R_NO_LOAD_FUNCTION = 125,
|
||||
ENGINE_R_NO_REFERENCE = 130,
|
||||
ENGINE_R_NO_SUCH_ENGINE = 116,
|
||||
ENGINE_R_UNIMPLEMENTED_CIPHER = 146,
|
||||
ENGINE_R_UNIMPLEMENTED_DIGEST = 147,
|
||||
ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD = 101,
|
||||
ENGINE_R_VERSION_INCOMPATIBILITY = 145,
|
||||
};
|
||||
]]
|
||||
@@ -0,0 +1,200 @@
|
||||
// csrc/openssl/src/include/openssl/err.h
|
||||
#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
|
||||
enum {
|
||||
ERR_TXT_MALLOCED = 0x01,
|
||||
ERR_TXT_STRING = 0x02,
|
||||
ERR_FLAG_MARK = 0x01,
|
||||
ERR_FLAG_CLEAR = 0x02,
|
||||
ERR_NUM_ERRORS = 16,
|
||||
};
|
||||
typedef struct err_state_st {
|
||||
int err_flags[16];
|
||||
unsigned long err_buffer[16];
|
||||
char *err_data[16];
|
||||
int err_data_flags[16];
|
||||
const char *err_file[16];
|
||||
int err_line[16];
|
||||
int top, bottom;
|
||||
} ERR_STATE;
|
||||
enum {
|
||||
ERR_LIB_NONE = 1,
|
||||
ERR_LIB_SYS = 2,
|
||||
ERR_LIB_BN = 3,
|
||||
ERR_LIB_RSA = 4,
|
||||
ERR_LIB_DH = 5,
|
||||
ERR_LIB_EVP = 6,
|
||||
ERR_LIB_BUF = 7,
|
||||
ERR_LIB_OBJ = 8,
|
||||
ERR_LIB_PEM = 9,
|
||||
ERR_LIB_DSA = 10,
|
||||
ERR_LIB_X509 = 11,
|
||||
ERR_LIB_ASN1 = 13,
|
||||
ERR_LIB_CONF = 14,
|
||||
ERR_LIB_CRYPTO = 15,
|
||||
ERR_LIB_EC = 16,
|
||||
ERR_LIB_SSL = 20,
|
||||
ERR_LIB_BIO = 32,
|
||||
ERR_LIB_PKCS7 = 33,
|
||||
ERR_LIB_X509V3 = 34,
|
||||
ERR_LIB_PKCS12 = 35,
|
||||
ERR_LIB_RAND = 36,
|
||||
ERR_LIB_DSO = 37,
|
||||
ERR_LIB_ENGINE = 38,
|
||||
ERR_LIB_OCSP = 39,
|
||||
ERR_LIB_UI = 40,
|
||||
ERR_LIB_COMP = 41,
|
||||
ERR_LIB_ECDSA = 42,
|
||||
ERR_LIB_ECDH = 43,
|
||||
ERR_LIB_OSSL_STORE = 44,
|
||||
ERR_LIB_FIPS = 45,
|
||||
ERR_LIB_CMS = 46,
|
||||
ERR_LIB_TS = 47,
|
||||
ERR_LIB_HMAC = 48,
|
||||
ERR_LIB_CT = 50,
|
||||
ERR_LIB_ASYNC = 51,
|
||||
ERR_LIB_KDF = 52,
|
||||
ERR_LIB_SM2 = 53,
|
||||
ERR_LIB_USER = 128,
|
||||
};
|
||||
#define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define OSSL_STOREerr(f,r) ERR_PUT_error(ERR_LIB_OSSL_STORE,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
#define ERR_PACK(l,f,r) ( (((unsigned int)(l) & 0x0FF) << 24L) | (((unsigned int)(f) & 0xFFF) << 12L) | (((unsigned int)(r) & 0xFFF) ) )
|
||||
#define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL)
|
||||
#define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL)
|
||||
#define ERR_GET_REASON(l) (int)( (l) & 0xFFFL)
|
||||
#define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL)
|
||||
enum {
|
||||
SYS_F_FOPEN = 1,
|
||||
SYS_F_CONNECT = 2,
|
||||
SYS_F_GETSERVBYNAME = 3,
|
||||
SYS_F_SOCKET = 4,
|
||||
SYS_F_IOCTLSOCKET = 5,
|
||||
SYS_F_BIND = 6,
|
||||
SYS_F_LISTEN = 7,
|
||||
SYS_F_ACCEPT = 8,
|
||||
SYS_F_WSASTARTUP = 9,
|
||||
SYS_F_OPENDIR = 10,
|
||||
SYS_F_FREAD = 11,
|
||||
SYS_F_GETADDRINFO = 12,
|
||||
SYS_F_GETNAMEINFO = 13,
|
||||
SYS_F_SETSOCKOPT = 14,
|
||||
SYS_F_GETSOCKOPT = 15,
|
||||
SYS_F_GETSOCKNAME = 16,
|
||||
SYS_F_GETHOSTBYNAME = 17,
|
||||
SYS_F_FFLUSH = 18,
|
||||
SYS_F_OPEN = 19,
|
||||
SYS_F_CLOSE = 20,
|
||||
SYS_F_IOCTL = 21,
|
||||
SYS_F_STAT = 22,
|
||||
SYS_F_FCNTL = 23,
|
||||
SYS_F_FSTAT = 24,
|
||||
ERR_R_SYS_LIB = ERR_LIB_SYS,
|
||||
ERR_R_BN_LIB = ERR_LIB_BN,
|
||||
ERR_R_RSA_LIB = ERR_LIB_RSA,
|
||||
ERR_R_DH_LIB = ERR_LIB_DH,
|
||||
ERR_R_EVP_LIB = ERR_LIB_EVP,
|
||||
ERR_R_BUF_LIB = ERR_LIB_BUF,
|
||||
ERR_R_OBJ_LIB = ERR_LIB_OBJ,
|
||||
ERR_R_PEM_LIB = ERR_LIB_PEM,
|
||||
ERR_R_DSA_LIB = ERR_LIB_DSA,
|
||||
ERR_R_X509_LIB = ERR_LIB_X509,
|
||||
ERR_R_ASN1_LIB = ERR_LIB_ASN1,
|
||||
ERR_R_EC_LIB = ERR_LIB_EC,
|
||||
ERR_R_BIO_LIB = ERR_LIB_BIO,
|
||||
ERR_R_PKCS7_LIB = ERR_LIB_PKCS7,
|
||||
ERR_R_X509V3_LIB = ERR_LIB_X509V3,
|
||||
ERR_R_ENGINE_LIB = ERR_LIB_ENGINE,
|
||||
ERR_R_UI_LIB = ERR_LIB_UI,
|
||||
ERR_R_ECDSA_LIB = ERR_LIB_ECDSA,
|
||||
ERR_R_OSSL_STORE_LIB = ERR_LIB_OSSL_STORE,
|
||||
ERR_R_NESTED_ASN1_ERROR = 58,
|
||||
ERR_R_MISSING_ASN1_EOS = 63,
|
||||
ERR_R_FATAL = 64,
|
||||
ERR_R_MALLOC_FAILURE = (1|ERR_R_FATAL),
|
||||
ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED = (2|ERR_R_FATAL),
|
||||
ERR_R_PASSED_NULL_PARAMETER = (3|ERR_R_FATAL),
|
||||
ERR_R_INTERNAL_ERROR = (4|ERR_R_FATAL),
|
||||
ERR_R_DISABLED = (5|ERR_R_FATAL),
|
||||
ERR_R_INIT_FAIL = (6|ERR_R_FATAL),
|
||||
ERR_R_PASSED_INVALID_ARGUMENT = (7),
|
||||
ERR_R_OPERATION_FAIL = (8|ERR_R_FATAL),
|
||||
};
|
||||
typedef struct ERR_string_data_st {
|
||||
unsigned long error;
|
||||
const char *string;
|
||||
} ERR_STRING_DATA;
|
||||
struct lhash_st_ERR_STRING_DATA { union lh_ERR_STRING_DATA_dummy { void* d1; unsigned long d2; int d3; } dummy; }; static inline struct lhash_st_ERR_STRING_DATA * lh_ERR_STRING_DATA_new(unsigned long (*hfn)(const ERR_STRING_DATA *), int (*cfn)(const ERR_STRING_DATA *, const ERR_STRING_DATA *)) { return (struct lhash_st_ERR_STRING_DATA *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_free(struct lhash_st_ERR_STRING_DATA *lh) { OPENSSL_LH_free((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline ERR_STRING_DATA *lh_ERR_STRING_DATA_insert(struct lhash_st_ERR_STRING_DATA *lh, ERR_STRING_DATA *d) { return (ERR_STRING_DATA *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline ERR_STRING_DATA *lh_ERR_STRING_DATA_delete(struct lhash_st_ERR_STRING_DATA *lh, const ERR_STRING_DATA *d) { return (ERR_STRING_DATA *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline ERR_STRING_DATA *lh_ERR_STRING_DATA_retrieve(struct lhash_st_ERR_STRING_DATA *lh, const ERR_STRING_DATA *d) { return (ERR_STRING_DATA *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline int lh_ERR_STRING_DATA_error(struct lhash_st_ERR_STRING_DATA *lh) { return OPENSSL_LH_error((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline unsigned long lh_ERR_STRING_DATA_num_items(struct lhash_st_ERR_STRING_DATA *lh) { return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_node_stats_bio(const struct lhash_st_ERR_STRING_DATA *lh, BIO *out) { OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_node_usage_stats_bio(const struct lhash_st_ERR_STRING_DATA *lh, BIO *out) { OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_stats_bio(const struct lhash_st_ERR_STRING_DATA *lh, BIO *out) { OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline unsigned long lh_ERR_STRING_DATA_get_down_load(struct lhash_st_ERR_STRING_DATA *lh) { return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_set_down_load(struct lhash_st_ERR_STRING_DATA *lh, unsigned long dl) { OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); } static __attribute__((unused)) inline void lh_ERR_STRING_DATA_doall(struct lhash_st_ERR_STRING_DATA *lh, void (*doall)(ERR_STRING_DATA *)) { OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); } struct lhash_st_ERR_STRING_DATA;
|
||||
void ERR_put_error(int lib, int func, int reason, const char *file, int line);
|
||||
void ERR_set_error_data(char *data, int flags);
|
||||
unsigned long ERR_get_error(void);
|
||||
unsigned long ERR_get_error_line(const char **file, int *line);
|
||||
unsigned long ERR_get_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
unsigned long ERR_peek_error(void);
|
||||
unsigned long ERR_peek_error_line(const char **file, int *line);
|
||||
unsigned long ERR_peek_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
unsigned long ERR_peek_last_error(void);
|
||||
unsigned long ERR_peek_last_error_line(const char **file, int *line);
|
||||
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
void ERR_clear_error(void);
|
||||
char *ERR_error_string(unsigned long e, char *buf);
|
||||
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
|
||||
const char *ERR_lib_error_string(unsigned long e);
|
||||
const char *ERR_func_error_string(unsigned long e);
|
||||
const char *ERR_reason_error_string(unsigned long e);
|
||||
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
|
||||
void *u);
|
||||
void ERR_print_errors_fp(FILE *fp);
|
||||
void ERR_print_errors(BIO *bp);
|
||||
void ERR_add_error_data(int num, ...);
|
||||
void ERR_add_error_vdata(int num, va_list args);
|
||||
int ERR_load_strings(int lib, ERR_STRING_DATA *str);
|
||||
int ERR_load_strings_const(const ERR_STRING_DATA *str);
|
||||
int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
|
||||
int ERR_load_ERR_strings(void);
|
||||
#define ERR_load_crypto_strings() OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
|
||||
#define ERR_free_strings() while(0) continue
|
||||
void ERR_remove_thread_state(void *) __attribute__ ((deprecated));
|
||||
void ERR_remove_state(unsigned long pid) __attribute__ ((deprecated));
|
||||
ERR_STATE *ERR_get_state(void);
|
||||
int ERR_get_next_error_library(void);
|
||||
int ERR_set_mark(void);
|
||||
int ERR_pop_to_mark(void);
|
||||
int ERR_clear_last_mark(void);
|
||||
|
||||
+1397
File diff suppressed because it is too large
Load Diff
+205
@@ -0,0 +1,205 @@
|
||||
local ffi = require'ffi' --crypto.h, cryptoerr.h
|
||||
require'libcrypto_types_h'
|
||||
ffi.cdef[[
|
||||
// crypto.h
|
||||
typedef struct {
|
||||
int dummy;
|
||||
} CRYPTO_dynlock;
|
||||
typedef void CRYPTO_RWLOCK;
|
||||
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
|
||||
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock);
|
||||
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
|
||||
enum {
|
||||
CRYPTO_MEM_CHECK_OFF = 0x0,
|
||||
CRYPTO_MEM_CHECK_ON = 0x1,
|
||||
CRYPTO_MEM_CHECK_ENABLE = 0x2,
|
||||
CRYPTO_MEM_CHECK_DISABLE = 0x3,
|
||||
};
|
||||
struct crypto_ex_data_st {
|
||||
struct stack_st_void *sk;
|
||||
};
|
||||
struct stack_st_void; typedef int (*sk_void_compfunc)(const void * const *a, const void *const *b); typedef void (*sk_void_freefunc)(void *a); typedef void * (*sk_void_copyfunc)(const void *a); static __attribute__((unused)) inline int sk_void_num(const struct stack_st_void *sk) { return OPENSSL_sk_num((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void *sk_void_value(const struct stack_st_void *sk, int idx) { return (void *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); } static __attribute__((unused)) inline struct stack_st_void *sk_void_new(sk_void_compfunc compare) { return (struct stack_st_void *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); } static __attribute__((unused)) inline struct stack_st_void *sk_void_new_null(void) { return (struct stack_st_void *)OPENSSL_sk_new_null(); } static __attribute__((unused)) inline struct stack_st_void *sk_void_new_reserve(sk_void_compfunc compare, int n) { return (struct stack_st_void *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); } static __attribute__((unused)) inline int sk_void_reserve(struct stack_st_void *sk, int n) { return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); } static __attribute__((unused)) inline void sk_void_free(struct stack_st_void *sk) { OPENSSL_sk_free((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_void_zero(struct stack_st_void *sk) { OPENSSL_sk_zero((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void *sk_void_delete(struct stack_st_void *sk, int i) { return (void *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); } static __attribute__((unused)) inline void *sk_void_delete_ptr(struct stack_st_void *sk, void *ptr) { return (void *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_void_push(struct stack_st_void *sk, void *ptr) { return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_void_unshift(struct stack_st_void *sk, void *ptr) { return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline void *sk_void_pop(struct stack_st_void *sk) { return (void *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void *sk_void_shift(struct stack_st_void *sk) { return (void *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_void_pop_free(struct stack_st_void *sk, sk_void_freefunc freefunc) { OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline int sk_void_insert(struct stack_st_void *sk, void *ptr, int idx) { return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); } static __attribute__((unused)) inline void *sk_void_set(struct stack_st_void *sk, int idx, void *ptr) { return (void *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); } static __attribute__((unused)) inline int sk_void_find(struct stack_st_void *sk, void *ptr) { return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_void_find_ex(struct stack_st_void *sk, void *ptr) { return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline void sk_void_sort(struct stack_st_void *sk) { OPENSSL_sk_sort((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline int sk_void_is_sorted(const struct stack_st_void *sk) { return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_void * sk_void_dup(const struct stack_st_void *sk) { return (struct stack_st_void *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_void *sk_void_deep_copy(const struct stack_st_void *sk, sk_void_copyfunc copyfunc, sk_void_freefunc freefunc) { return (struct stack_st_void *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline sk_void_compfunc sk_void_set_cmp_func(struct stack_st_void *sk, sk_void_compfunc compare) { return (sk_void_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); }
|
||||
enum {
|
||||
CRYPTO_EX_INDEX_SSL = 0,
|
||||
CRYPTO_EX_INDEX_SSL_CTX = 1,
|
||||
CRYPTO_EX_INDEX_SSL_SESSION = 2,
|
||||
CRYPTO_EX_INDEX_X509 = 3,
|
||||
CRYPTO_EX_INDEX_X509_STORE = 4,
|
||||
CRYPTO_EX_INDEX_X509_STORE_CTX = 5,
|
||||
CRYPTO_EX_INDEX_DH = 6,
|
||||
CRYPTO_EX_INDEX_DSA = 7,
|
||||
CRYPTO_EX_INDEX_EC_KEY = 8,
|
||||
CRYPTO_EX_INDEX_RSA = 9,
|
||||
CRYPTO_EX_INDEX_ENGINE = 10,
|
||||
CRYPTO_EX_INDEX_UI = 11,
|
||||
CRYPTO_EX_INDEX_BIO = 12,
|
||||
CRYPTO_EX_INDEX_APP = 13,
|
||||
CRYPTO_EX_INDEX_UI_METHOD = 14,
|
||||
CRYPTO_EX_INDEX_DRBG = 15,
|
||||
CRYPTO_EX_INDEX__COUNT = 16,
|
||||
};
|
||||
int CRYPTO_mem_ctrl(int mode);
|
||||
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strnlen(const char *str, size_t maxlen);
|
||||
char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len);
|
||||
unsigned char *OPENSSL_hexstr2buf(const char *str, long *len);
|
||||
int OPENSSL_hexchar2int(unsigned char c);
|
||||
unsigned long OpenSSL_version_num(void);
|
||||
const char *OpenSSL_version(int type);
|
||||
enum {
|
||||
OPENSSL_VERSION = 0,
|
||||
OPENSSL_CFLAGS = 1,
|
||||
OPENSSL_BUILT_ON = 2,
|
||||
OPENSSL_PLATFORM = 3,
|
||||
OPENSSL_DIR = 4,
|
||||
OPENSSL_ENGINES_DIR = 5,
|
||||
};
|
||||
int OPENSSL_issetugid(void);
|
||||
typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
||||
void *from_d, int idx, long argl, void *argp);
|
||||
int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
||||
CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
|
||||
CRYPTO_EX_free *free_func);
|
||||
int CRYPTO_free_ex_index(int class_index, int idx);
|
||||
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
||||
const CRYPTO_EX_DATA *from);
|
||||
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
|
||||
void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
|
||||
enum {
|
||||
CRYPTO_LOCK = 1,
|
||||
CRYPTO_UNLOCK = 2,
|
||||
CRYPTO_READ = 4,
|
||||
CRYPTO_WRITE = 8,
|
||||
};
|
||||
typedef struct crypto_threadid_st {
|
||||
int dummy;
|
||||
} CRYPTO_THREADID;
|
||||
int CRYPTO_set_mem_functions(
|
||||
void *(*m) (size_t, const char *, int),
|
||||
void *(*r) (void *, size_t, const char *, int),
|
||||
void (*f) (void *, const char *, int));
|
||||
int CRYPTO_set_mem_debug(int flag);
|
||||
void CRYPTO_get_mem_functions(
|
||||
void *(**m) (size_t, const char *, int),
|
||||
void *(**r) (void *, size_t, const char *, int),
|
||||
void (**f) (void *, const char *, int));
|
||||
void *CRYPTO_malloc(size_t num, const char *file, int line);
|
||||
void *CRYPTO_zalloc(size_t num, const char *file, int line);
|
||||
void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
|
||||
char *CRYPTO_strdup(const char *str, const char *file, int line);
|
||||
char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
|
||||
void CRYPTO_free(void *ptr, const char *file, int line);
|
||||
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
|
||||
const char *file, int line);
|
||||
int CRYPTO_secure_malloc_init(size_t sz, int minsize);
|
||||
int CRYPTO_secure_malloc_done(void);
|
||||
void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
|
||||
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
|
||||
void CRYPTO_secure_free(void *ptr, const char *file, int line);
|
||||
void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
||||
const char *file, int line);
|
||||
int CRYPTO_secure_allocated(const void *ptr);
|
||||
int CRYPTO_secure_malloc_initialized(void);
|
||||
size_t CRYPTO_secure_actual_size(void *ptr);
|
||||
size_t CRYPTO_secure_used(void);
|
||||
void OPENSSL_cleanse(void *ptr, size_t len);
|
||||
void OPENSSL_die(const char *assertion, const char *file, int line);
|
||||
int OPENSSL_isservice(void);
|
||||
int FIPS_mode(void);
|
||||
int FIPS_mode_set(int r);
|
||||
void OPENSSL_init(void);
|
||||
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
|
||||
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec);
|
||||
int OPENSSL_gmtime_diff(int *pday, int *psec,
|
||||
const struct tm *from, const struct tm *to);
|
||||
int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
|
||||
enum {
|
||||
OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS = 0x00000001L,
|
||||
OPENSSL_INIT_LOAD_CRYPTO_STRINGS = 0x00000002L,
|
||||
OPENSSL_INIT_ADD_ALL_CIPHERS = 0x00000004L,
|
||||
OPENSSL_INIT_ADD_ALL_DIGESTS = 0x00000008L,
|
||||
OPENSSL_INIT_NO_ADD_ALL_CIPHERS = 0x00000010L,
|
||||
OPENSSL_INIT_NO_ADD_ALL_DIGESTS = 0x00000020L,
|
||||
OPENSSL_INIT_LOAD_CONFIG = 0x00000040L,
|
||||
OPENSSL_INIT_NO_LOAD_CONFIG = 0x00000080L,
|
||||
OPENSSL_INIT_ASYNC = 0x00000100L,
|
||||
OPENSSL_INIT_ENGINE_RDRAND = 0x00000200L,
|
||||
OPENSSL_INIT_ENGINE_DYNAMIC = 0x00000400L,
|
||||
OPENSSL_INIT_ENGINE_OPENSSL = 0x00000800L,
|
||||
OPENSSL_INIT_ENGINE_CRYPTODEV = 0x00001000L,
|
||||
OPENSSL_INIT_ENGINE_CAPI = 0x00002000L,
|
||||
OPENSSL_INIT_ENGINE_PADLOCK = 0x00004000L,
|
||||
OPENSSL_INIT_ENGINE_AFALG = 0x00008000L,
|
||||
OPENSSL_INIT_ATFORK = 0x00020000L,
|
||||
OPENSSL_INIT_NO_ATEXIT = 0x00080000L,
|
||||
OPENSSL_INIT_ENGINE_ALL_BUILTIN = (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK),
|
||||
};
|
||||
void OPENSSL_cleanup(void);
|
||||
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||
int OPENSSL_atexit(void (*handler)(void));
|
||||
void OPENSSL_thread_stop(void);
|
||||
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
|
||||
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
|
||||
const char *config_filename);
|
||||
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings,
|
||||
unsigned long flags);
|
||||
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings,
|
||||
const char *config_appname);
|
||||
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings);
|
||||
typedef unsigned int CRYPTO_ONCE;
|
||||
typedef unsigned int CRYPTO_THREAD_LOCAL;
|
||||
typedef unsigned int CRYPTO_THREAD_ID;
|
||||
enum {
|
||||
CRYPTO_ONCE_STATIC_INIT = 0,
|
||||
};
|
||||
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void));
|
||||
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *));
|
||||
void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key);
|
||||
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val);
|
||||
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
|
||||
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
|
||||
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
|
||||
|
||||
// cryptoerr.h
|
||||
int ERR_load_CRYPTO_strings(void);
|
||||
enum {
|
||||
CRYPTO_F_CMAC_CTX_NEW = 120,
|
||||
CRYPTO_F_CRYPTO_DUP_EX_DATA = 110,
|
||||
CRYPTO_F_CRYPTO_FREE_EX_DATA = 111,
|
||||
CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX = 100,
|
||||
CRYPTO_F_CRYPTO_MEMDUP = 115,
|
||||
CRYPTO_F_CRYPTO_NEW_EX_DATA = 112,
|
||||
CRYPTO_F_CRYPTO_OCB128_COPY_CTX = 121,
|
||||
CRYPTO_F_CRYPTO_OCB128_INIT = 122,
|
||||
CRYPTO_F_CRYPTO_SET_EX_DATA = 102,
|
||||
CRYPTO_F_FIPS_MODE_SET = 109,
|
||||
CRYPTO_F_GET_AND_LOCK = 113,
|
||||
CRYPTO_F_OPENSSL_ATEXIT = 114,
|
||||
CRYPTO_F_OPENSSL_BUF2HEXSTR = 117,
|
||||
CRYPTO_F_OPENSSL_FOPEN = 119,
|
||||
CRYPTO_F_OPENSSL_HEXSTR2BUF = 118,
|
||||
CRYPTO_F_OPENSSL_INIT_CRYPTO = 116,
|
||||
CRYPTO_F_OPENSSL_LH_NEW = 126,
|
||||
CRYPTO_F_OPENSSL_SK_DEEP_COPY = 127,
|
||||
CRYPTO_F_OPENSSL_SK_DUP = 128,
|
||||
CRYPTO_F_PKEY_HMAC_INIT = 123,
|
||||
CRYPTO_F_PKEY_POLY1305_INIT = 124,
|
||||
CRYPTO_F_PKEY_SIPHASH_INIT = 125,
|
||||
CRYPTO_F_SK_RESERVE = 129,
|
||||
CRYPTO_R_FIPS_MODE_NOT_SUPPORTED = 101,
|
||||
CRYPTO_R_ILLEGAL_HEX_DIGIT = 102,
|
||||
CRYPTO_R_ODD_NUMBER_OF_DIGITS = 103,
|
||||
};
|
||||
]]
|
||||
@@ -0,0 +1,64 @@
|
||||
// csrc/openssl/src/include/openssl/lhash.h
|
||||
typedef struct lhash_node_st OPENSSL_LH_NODE;
|
||||
typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
|
||||
typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
|
||||
typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
|
||||
typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
|
||||
typedef struct lhash_st OPENSSL_LHASH;
|
||||
#define DECLARE_LHASH_HASH_FN(name,o_type) unsigned long name ##_LHASH_HASH(const void *);
|
||||
#define IMPLEMENT_LHASH_HASH_FN(name,o_type) unsigned long name ##_LHASH_HASH(const void *arg) { const o_type *a = arg; return name ##_hash(a); }
|
||||
#define LHASH_HASH_FN(name) name ##_LHASH_HASH
|
||||
#define DECLARE_LHASH_COMP_FN(name,o_type) int name ##_LHASH_COMP(const void *, const void *);
|
||||
#define IMPLEMENT_LHASH_COMP_FN(name,o_type) int name ##_LHASH_COMP(const void *arg1, const void *arg2) { const o_type *a = arg1; const o_type *b = arg2; return name ##_cmp(a,b); }
|
||||
#define LHASH_COMP_FN(name) name ##_LHASH_COMP
|
||||
#define DECLARE_LHASH_DOALL_ARG_FN(name,o_type,a_type) void name ##_LHASH_DOALL_ARG(void *, void *);
|
||||
#define IMPLEMENT_LHASH_DOALL_ARG_FN(name,o_type,a_type) void name ##_LHASH_DOALL_ARG(void *arg1, void *arg2) { o_type *a = arg1; a_type *b = arg2; name ##_doall_arg(a, b); }
|
||||
#define LHASH_DOALL_ARG_FN(name) name ##_LHASH_DOALL_ARG
|
||||
enum {
|
||||
LH_LOAD_MULT = 256,
|
||||
};
|
||||
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
||||
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
||||
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
||||
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
||||
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
||||
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
||||
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
|
||||
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg);
|
||||
unsigned long OPENSSL_LH_strhash(const char *c);
|
||||
unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
|
||||
unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
|
||||
void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
|
||||
void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
enum {
|
||||
_LHASH = OPENSSL_LHASH,
|
||||
LHASH_NODE = OPENSSL_LH_NODE,
|
||||
lh_error = OPENSSL_LH_error,
|
||||
lh_new = OPENSSL_LH_new,
|
||||
lh_free = OPENSSL_LH_free,
|
||||
lh_insert = OPENSSL_LH_insert,
|
||||
lh_delete = OPENSSL_LH_delete,
|
||||
lh_retrieve = OPENSSL_LH_retrieve,
|
||||
lh_doall = OPENSSL_LH_doall,
|
||||
lh_doall_arg = OPENSSL_LH_doall_arg,
|
||||
lh_strhash = OPENSSL_LH_strhash,
|
||||
lh_num_items = OPENSSL_LH_num_items,
|
||||
lh_stats = OPENSSL_LH_stats,
|
||||
lh_node_stats = OPENSSL_LH_node_stats,
|
||||
lh_node_usage_stats = OPENSSL_LH_node_usage_stats,
|
||||
lh_stats_bio = OPENSSL_LH_stats_bio,
|
||||
lh_node_stats_bio = OPENSSL_LH_node_stats_bio,
|
||||
lh_node_usage_stats_bio = OPENSSL_LH_node_usage_stats_bio,
|
||||
};
|
||||
#define LHASH_OF(type) struct lhash_st_ ##type
|
||||
#define DEFINE_LHASH_OF(type) LHASH_OF(type) { union lh_ ##type ##_dummy { void* d1; unsigned long d2; int d3; } dummy; }; static ossl_inline LHASH_OF(type) * lh_ ##type ##_new(unsigned long (*hfn)(const type *), int (*cfn)(const type *, const type *)) { return (LHASH_OF(type) *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); } static ossl_unused ossl_inline void lh_ ##type ##_free(LHASH_OF(type) *lh) { OPENSSL_LH_free((OPENSSL_LHASH *)lh); } static ossl_unused ossl_inline type *lh_ ##type ##_insert(LHASH_OF(type) *lh, type *d) { return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); } static ossl_unused ossl_inline type *lh_ ##type ##_delete(LHASH_OF(type) *lh, const type *d) { return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); } static ossl_unused ossl_inline type *lh_ ##type ##_retrieve(LHASH_OF(type) *lh, const type *d) { return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); } static ossl_unused ossl_inline int lh_ ##type ##_error(LHASH_OF(type) *lh) { return OPENSSL_LH_error((OPENSSL_LHASH *)lh); } static ossl_unused ossl_inline unsigned long lh_ ##type ##_num_items(LHASH_OF(type) *lh) { return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); } static ossl_unused ossl_inline void lh_ ##type ##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) { OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); } static ossl_unused ossl_inline void lh_ ##type ##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) { OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); } static ossl_unused ossl_inline void lh_ ##type ##_stats_bio(const LHASH_OF(type) *lh, BIO *out) { OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); } static ossl_unused ossl_inline unsigned long lh_ ##type ##_get_down_load(LHASH_OF(type) *lh) { return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); } static ossl_unused ossl_inline void lh_ ##type ##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) { OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); } static ossl_unused ossl_inline void lh_ ##type ##_doall(LHASH_OF(type) *lh, void (*doall)(type *)) { OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); } LHASH_OF(type)
|
||||
#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type,argtype) int_implement_lhash_doall(type, argtype, const type)
|
||||
#define IMPLEMENT_LHASH_DOALL_ARG(type,argtype) int_implement_lhash_doall(type, argtype, type)
|
||||
#define int_implement_lhash_doall(type,argtype,cbargtype) static ossl_unused ossl_inline void lh_ ##type ##_doall_ ##argtype(LHASH_OF(type) *lh, void (*fn)(cbargtype *, argtype *), argtype *arg) { OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); } LHASH_OF(type)
|
||||
struct lhash_st_OPENSSL_STRING { union lh_OPENSSL_STRING_dummy { void* d1; unsigned long d2; int d3; } dummy; }; static inline struct lhash_st_OPENSSL_STRING * lh_OPENSSL_STRING_new(unsigned long (*hfn)(const OPENSSL_STRING *), int (*cfn)(const OPENSSL_STRING *, const OPENSSL_STRING *)) { return (struct lhash_st_OPENSSL_STRING *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_free(struct lhash_st_OPENSSL_STRING *lh) { OPENSSL_LH_free((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline OPENSSL_STRING *lh_OPENSSL_STRING_insert(struct lhash_st_OPENSSL_STRING *lh, OPENSSL_STRING *d) { return (OPENSSL_STRING *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline OPENSSL_STRING *lh_OPENSSL_STRING_delete(struct lhash_st_OPENSSL_STRING *lh, const OPENSSL_STRING *d) { return (OPENSSL_STRING *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline OPENSSL_STRING *lh_OPENSSL_STRING_retrieve(struct lhash_st_OPENSSL_STRING *lh, const OPENSSL_STRING *d) { return (OPENSSL_STRING *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline int lh_OPENSSL_STRING_error(struct lhash_st_OPENSSL_STRING *lh) { return OPENSSL_LH_error((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline unsigned long lh_OPENSSL_STRING_num_items(struct lhash_st_OPENSSL_STRING *lh) { return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_node_stats_bio(const struct lhash_st_OPENSSL_STRING *lh, BIO *out) { OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_node_usage_stats_bio(const struct lhash_st_OPENSSL_STRING *lh, BIO *out) { OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_stats_bio(const struct lhash_st_OPENSSL_STRING *lh, BIO *out) { OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline unsigned long lh_OPENSSL_STRING_get_down_load(struct lhash_st_OPENSSL_STRING *lh) { return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_set_down_load(struct lhash_st_OPENSSL_STRING *lh, unsigned long dl) { OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); } static __attribute__((unused)) inline void lh_OPENSSL_STRING_doall(struct lhash_st_OPENSSL_STRING *lh, void (*doall)(OPENSSL_STRING *)) { OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); } struct lhash_st_OPENSSL_STRING;
|
||||
struct lhash_st_OPENSSL_CSTRING { union lh_OPENSSL_CSTRING_dummy { void* d1; unsigned long d2; int d3; } dummy; }; static inline struct lhash_st_OPENSSL_CSTRING * lh_OPENSSL_CSTRING_new(unsigned long (*hfn)(const OPENSSL_CSTRING *), int (*cfn)(const OPENSSL_CSTRING *, const OPENSSL_CSTRING *)) { return (struct lhash_st_OPENSSL_CSTRING *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_free(struct lhash_st_OPENSSL_CSTRING *lh) { OPENSSL_LH_free((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline OPENSSL_CSTRING *lh_OPENSSL_CSTRING_insert(struct lhash_st_OPENSSL_CSTRING *lh, OPENSSL_CSTRING *d) { return (OPENSSL_CSTRING *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline OPENSSL_CSTRING *lh_OPENSSL_CSTRING_delete(struct lhash_st_OPENSSL_CSTRING *lh, const OPENSSL_CSTRING *d) { return (OPENSSL_CSTRING *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline OPENSSL_CSTRING *lh_OPENSSL_CSTRING_retrieve(struct lhash_st_OPENSSL_CSTRING *lh, const OPENSSL_CSTRING *d) { return (OPENSSL_CSTRING *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); } static __attribute__((unused)) inline int lh_OPENSSL_CSTRING_error(struct lhash_st_OPENSSL_CSTRING *lh) { return OPENSSL_LH_error((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline unsigned long lh_OPENSSL_CSTRING_num_items(struct lhash_st_OPENSSL_CSTRING *lh) { return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_node_stats_bio(const struct lhash_st_OPENSSL_CSTRING *lh, BIO *out) { OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_node_usage_stats_bio(const struct lhash_st_OPENSSL_CSTRING *lh, BIO *out) { OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_stats_bio(const struct lhash_st_OPENSSL_CSTRING *lh, BIO *out) { OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); } static __attribute__((unused)) inline unsigned long lh_OPENSSL_CSTRING_get_down_load(struct lhash_st_OPENSSL_CSTRING *lh) { return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_set_down_load(struct lhash_st_OPENSSL_CSTRING *lh, unsigned long dl) { OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); } static __attribute__((unused)) inline void lh_OPENSSL_CSTRING_doall(struct lhash_st_OPENSSL_CSTRING *lh, void (*doall)(OPENSSL_CSTRING *)) { OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); } struct lhash_st_OPENSSL_CSTRING;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,257 @@
|
||||
// csrc/openssl/src/include/openssl/pem.h
|
||||
enum {
|
||||
PEM_BUFSIZE = 1024,
|
||||
PEM_STRING_X509_OLD = "X509 CERTIFICATE",
|
||||
PEM_STRING_X509 = "CERTIFICATE",
|
||||
PEM_STRING_X509_TRUSTED = "TRUSTED CERTIFICATE",
|
||||
PEM_STRING_X509_REQ_OLD = "NEW CERTIFICATE REQUEST",
|
||||
PEM_STRING_X509_REQ = "CERTIFICATE REQUEST",
|
||||
PEM_STRING_X509_CRL = "X509 CRL",
|
||||
PEM_STRING_EVP_PKEY = "ANY PRIVATE KEY",
|
||||
PEM_STRING_PUBLIC = "PUBLIC KEY",
|
||||
PEM_STRING_RSA = "RSA PRIVATE KEY",
|
||||
PEM_STRING_RSA_PUBLIC = "RSA PUBLIC KEY",
|
||||
PEM_STRING_DSA = "DSA PRIVATE KEY",
|
||||
PEM_STRING_DSA_PUBLIC = "DSA PUBLIC KEY",
|
||||
PEM_STRING_PKCS7 = "PKCS7",
|
||||
PEM_STRING_PKCS7_SIGNED = "PKCS #7 SIGNED DATA",
|
||||
PEM_STRING_PKCS8 = "ENCRYPTED PRIVATE KEY",
|
||||
PEM_STRING_PKCS8INF = "PRIVATE KEY",
|
||||
PEM_STRING_DHPARAMS = "DH PARAMETERS",
|
||||
PEM_STRING_DHXPARAMS = "X9.42 DH PARAMETERS",
|
||||
PEM_STRING_SSL_SESSION = "SSL SESSION PARAMETERS",
|
||||
PEM_STRING_DSAPARAMS = "DSA PARAMETERS",
|
||||
PEM_STRING_ECDSA_PUBLIC = "ECDSA PUBLIC KEY",
|
||||
PEM_STRING_ECPARAMETERS = "EC PARAMETERS",
|
||||
PEM_STRING_ECPRIVATEKEY = "EC PRIVATE KEY",
|
||||
PEM_STRING_PARAMETERS = "PARAMETERS",
|
||||
PEM_STRING_CMS = "CMS",
|
||||
PEM_TYPE_ENCRYPTED = 10,
|
||||
PEM_TYPE_MIC_ONLY = 20,
|
||||
PEM_TYPE_MIC_CLEAR = 30,
|
||||
PEM_TYPE_CLEAR = 40,
|
||||
};
|
||||
#define IMPLEMENT_PEM_read_fp(name,type,str,asn1) type *PEM_read_ ##name(FILE *fp, type **x, pem_password_cb *cb, void *u){ return PEM_ASN1_read((d2i_of_void *)d2i_ ##asn1, str,fp,(void **)x,cb,u); }
|
||||
#define IMPLEMENT_PEM_write_fp(name,type,str,asn1) int PEM_write_ ##name(FILE *fp, type *x) { return PEM_ASN1_write((i2d_of_void *)i2d_ ##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); }
|
||||
#define IMPLEMENT_PEM_write_fp_const(name,type,str,asn1) int PEM_write_ ##name(FILE *fp, const type *x) { return PEM_ASN1_write((i2d_of_void *)i2d_ ##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); }
|
||||
#define IMPLEMENT_PEM_write_cb_fp(name,type,str,asn1) int PEM_write_ ##name(FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { return PEM_ASN1_write((i2d_of_void *)i2d_ ##asn1,str,fp,x,enc,kstr,klen,cb,u); }
|
||||
#define IMPLEMENT_PEM_write_cb_fp_const(name,type,str,asn1) int PEM_write_ ##name(FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { return PEM_ASN1_write((i2d_of_void *)i2d_ ##asn1,str,fp,x,enc,kstr,klen,cb,u); }
|
||||
#define IMPLEMENT_PEM_read_bio(name,type,str,asn1) type *PEM_read_bio_ ##name(BIO *bp, type **x, pem_password_cb *cb, void *u){ return PEM_ASN1_read_bio((d2i_of_void *)d2i_ ##asn1, str,bp,(void **)x,cb,u); }
|
||||
#define IMPLEMENT_PEM_write_bio(name,type,str,asn1) int PEM_write_bio_ ##name(BIO *bp, type *x) { return PEM_ASN1_write_bio((i2d_of_void *)i2d_ ##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); }
|
||||
#define IMPLEMENT_PEM_write_bio_const(name,type,str,asn1) int PEM_write_bio_ ##name(BIO *bp, const type *x) { return PEM_ASN1_write_bio((i2d_of_void *)i2d_ ##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); }
|
||||
#define IMPLEMENT_PEM_write_cb_bio(name,type,str,asn1) int PEM_write_bio_ ##name(BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { return PEM_ASN1_write_bio((i2d_of_void *)i2d_ ##asn1,str,bp,x,enc,kstr,klen,cb,u); }
|
||||
#define IMPLEMENT_PEM_write_cb_bio_const(name,type,str,asn1) int PEM_write_bio_ ##name(BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { return PEM_ASN1_write_bio((i2d_of_void *)i2d_ ##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); }
|
||||
#define IMPLEMENT_PEM_write(name,type,str,asn1) IMPLEMENT_PEM_write_bio(name, type, str, asn1) IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_write_const(name,type,str,asn1) IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_write_cb(name,type,str,asn1) IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_write_cb_const(name,type,str,asn1) IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_read(name,type,str,asn1) IMPLEMENT_PEM_read_bio(name, type, str, asn1) IMPLEMENT_PEM_read_fp(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_rw(name,type,str,asn1) IMPLEMENT_PEM_read(name, type, str, asn1) IMPLEMENT_PEM_write(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_rw_const(name,type,str,asn1) IMPLEMENT_PEM_read(name, type, str, asn1) IMPLEMENT_PEM_write_const(name, type, str, asn1)
|
||||
#define IMPLEMENT_PEM_rw_cb(name,type,str,asn1) IMPLEMENT_PEM_read(name, type, str, asn1) IMPLEMENT_PEM_write_cb(name, type, str, asn1)
|
||||
#define DECLARE_PEM_read_fp(name,type) type *PEM_read_ ##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
|
||||
#define DECLARE_PEM_write_fp(name,type) int PEM_write_ ##name(FILE *fp, type *x);
|
||||
#define DECLARE_PEM_write_fp_const(name,type) int PEM_write_ ##name(FILE *fp, const type *x);
|
||||
#define DECLARE_PEM_write_cb_fp(name,type) int PEM_write_ ##name(FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
#define DECLARE_PEM_read_bio(name,type) type *PEM_read_bio_ ##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
|
||||
#define DECLARE_PEM_write_bio(name,type) int PEM_write_bio_ ##name(BIO *bp, type *x);
|
||||
#define DECLARE_PEM_write_bio_const(name,type) int PEM_write_bio_ ##name(BIO *bp, const type *x);
|
||||
#define DECLARE_PEM_write_cb_bio(name,type) int PEM_write_bio_ ##name(BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
#define DECLARE_PEM_write(name,type) DECLARE_PEM_write_bio(name, type) DECLARE_PEM_write_fp(name, type)
|
||||
#define DECLARE_PEM_write_const(name,type) DECLARE_PEM_write_bio_const(name, type) DECLARE_PEM_write_fp_const(name, type)
|
||||
#define DECLARE_PEM_write_cb(name,type) DECLARE_PEM_write_cb_bio(name, type) DECLARE_PEM_write_cb_fp(name, type)
|
||||
#define DECLARE_PEM_read(name,type) DECLARE_PEM_read_bio(name, type) DECLARE_PEM_read_fp(name, type)
|
||||
#define DECLARE_PEM_rw(name,type) DECLARE_PEM_read(name, type) DECLARE_PEM_write(name, type)
|
||||
#define DECLARE_PEM_rw_const(name,type) DECLARE_PEM_read(name, type) DECLARE_PEM_write_const(name, type)
|
||||
#define DECLARE_PEM_rw_cb(name,type) DECLARE_PEM_read(name, type) DECLARE_PEM_write_cb(name, type)
|
||||
typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
|
||||
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
|
||||
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
|
||||
pem_password_cb *callback, void *u);
|
||||
int PEM_read_bio(BIO *bp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
enum {
|
||||
PEM_FLAG_SECURE = 0x1,
|
||||
PEM_FLAG_EAY_COMPATIBLE = 0x2,
|
||||
PEM_FLAG_ONLY_B64 = 0x4,
|
||||
};
|
||||
int PEM_read_bio_ex(BIO *bp, char **name, char **header,
|
||||
unsigned char **data, long *len, unsigned int flags);
|
||||
int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
|
||||
const char *name, BIO *bp, pem_password_cb *cb,
|
||||
void *u);
|
||||
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
|
||||
const char *name, BIO *bp, pem_password_cb *cb,
|
||||
void *u);
|
||||
void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
|
||||
const EVP_CIPHER *enc, unsigned char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
struct stack_st_X509_INFO *PEM_X509_INFO_read_bio(BIO *bp, struct stack_st_X509_INFO *sk,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
|
||||
unsigned char *kstr, int klen,
|
||||
pem_password_cb *cd, void *u);
|
||||
int PEM_read(FILE *fp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
int PEM_write(FILE *fp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
|
||||
void *x, const EVP_CIPHER *enc, unsigned char *kstr,
|
||||
int klen, pem_password_cb *callback, void *u);
|
||||
struct stack_st_X509_INFO *PEM_X509_INFO_read(FILE *fp, struct stack_st_X509_INFO *sk,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
|
||||
int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);
|
||||
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
|
||||
unsigned int *siglen, EVP_PKEY *pkey);
|
||||
int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
|
||||
void PEM_proc_type(char *buf, int type);
|
||||
void PEM_dek_info(char *buf, const char *type, int len, char *str);
|
||||
X509 *PEM_read_bio_X509(BIO *bp, X509 **x, pem_password_cb *cb, void *u); X509 *PEM_read_X509(FILE *fp, X509 **x, pem_password_cb *cb, void *u); int PEM_write_bio_X509(BIO *bp, X509 *x); int PEM_write_X509(FILE *fp, X509 *x);
|
||||
X509 *PEM_read_bio_X509_AUX(BIO *bp, X509 **x, pem_password_cb *cb, void *u); X509 *PEM_read_X509_AUX(FILE *fp, X509 **x, pem_password_cb *cb, void *u); int PEM_write_bio_X509_AUX(BIO *bp, X509 *x); int PEM_write_X509_AUX(FILE *fp, X509 *x);
|
||||
X509_REQ *PEM_read_bio_X509_REQ(BIO *bp, X509_REQ **x, pem_password_cb *cb, void *u); X509_REQ *PEM_read_X509_REQ(FILE *fp, X509_REQ **x, pem_password_cb *cb, void *u); int PEM_write_bio_X509_REQ(BIO *bp, X509_REQ *x); int PEM_write_X509_REQ(FILE *fp, X509_REQ *x);
|
||||
int PEM_write_bio_X509_REQ_NEW(BIO *bp, X509_REQ *x); int PEM_write_X509_REQ_NEW(FILE *fp, X509_REQ *x);
|
||||
X509_CRL *PEM_read_bio_X509_CRL(BIO *bp, X509_CRL **x, pem_password_cb *cb, void *u); X509_CRL *PEM_read_X509_CRL(FILE *fp, X509_CRL **x, pem_password_cb *cb, void *u); int PEM_write_bio_X509_CRL(BIO *bp, X509_CRL *x); int PEM_write_X509_CRL(FILE *fp, X509_CRL *x);
|
||||
PKCS7 *PEM_read_bio_PKCS7(BIO *bp, PKCS7 **x, pem_password_cb *cb, void *u); PKCS7 *PEM_read_PKCS7(FILE *fp, PKCS7 **x, pem_password_cb *cb, void *u); int PEM_write_bio_PKCS7(BIO *bp, PKCS7 *x); int PEM_write_PKCS7(FILE *fp, PKCS7 *x);
|
||||
NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, NETSCAPE_CERT_SEQUENCE **x, pem_password_cb *cb, void *u); NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp, NETSCAPE_CERT_SEQUENCE **x, pem_password_cb *cb, void *u); int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, NETSCAPE_CERT_SEQUENCE *x); int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp, NETSCAPE_CERT_SEQUENCE *x);
|
||||
X509_SIG *PEM_read_bio_PKCS8(BIO *bp, X509_SIG **x, pem_password_cb *cb, void *u); X509_SIG *PEM_read_PKCS8(FILE *fp, X509_SIG **x, pem_password_cb *cb, void *u); int PEM_write_bio_PKCS8(BIO *bp, X509_SIG *x); int PEM_write_PKCS8(FILE *fp, X509_SIG *x);
|
||||
PKCS8_PRIV_KEY_INFO *PEM_read_bio_PKCS8_PRIV_KEY_INFO(BIO *bp, PKCS8_PRIV_KEY_INFO **x, pem_password_cb *cb, void *u); PKCS8_PRIV_KEY_INFO *PEM_read_PKCS8_PRIV_KEY_INFO(FILE *fp, PKCS8_PRIV_KEY_INFO **x, pem_password_cb *cb, void *u); int PEM_write_bio_PKCS8_PRIV_KEY_INFO(BIO *bp, PKCS8_PRIV_KEY_INFO *x); int PEM_write_PKCS8_PRIV_KEY_INFO(FILE *fp, PKCS8_PRIV_KEY_INFO *x);
|
||||
RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x, pem_password_cb *cb, void *u); RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_RSAPrivateKey(BIO *bp, RSA *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u); int PEM_write_RSAPrivateKey(FILE *fp, RSA *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
RSA *PEM_read_bio_RSAPublicKey(BIO *bp, RSA **x, pem_password_cb *cb, void *u); RSA *PEM_read_RSAPublicKey(FILE *fp, RSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_RSAPublicKey(BIO *bp, const RSA *x); int PEM_write_RSAPublicKey(FILE *fp, const RSA *x);
|
||||
RSA *PEM_read_bio_RSA_PUBKEY(BIO *bp, RSA **x, pem_password_cb *cb, void *u); RSA *PEM_read_RSA_PUBKEY(FILE *fp, RSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_RSA_PUBKEY(BIO *bp, RSA *x); int PEM_write_RSA_PUBKEY(FILE *fp, RSA *x);
|
||||
DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **x, pem_password_cb *cb, void *u); DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_DSAPrivateKey(BIO *bp, DSA *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u); int PEM_write_DSAPrivateKey(FILE *fp, DSA *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
DSA *PEM_read_bio_DSA_PUBKEY(BIO *bp, DSA **x, pem_password_cb *cb, void *u); DSA *PEM_read_DSA_PUBKEY(FILE *fp, DSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_DSA_PUBKEY(BIO *bp, DSA *x); int PEM_write_DSA_PUBKEY(FILE *fp, DSA *x);
|
||||
DSA *PEM_read_bio_DSAparams(BIO *bp, DSA **x, pem_password_cb *cb, void *u); DSA *PEM_read_DSAparams(FILE *fp, DSA **x, pem_password_cb *cb, void *u); int PEM_write_bio_DSAparams(BIO *bp, const DSA *x); int PEM_write_DSAparams(FILE *fp, const DSA *x);
|
||||
EC_GROUP *PEM_read_bio_ECPKParameters(BIO *bp, EC_GROUP **x, pem_password_cb *cb, void *u); EC_GROUP *PEM_read_ECPKParameters(FILE *fp, EC_GROUP **x, pem_password_cb *cb, void *u); int PEM_write_bio_ECPKParameters(BIO *bp, const EC_GROUP *x); int PEM_write_ECPKParameters(FILE *fp, const EC_GROUP *x);
|
||||
EC_KEY *PEM_read_bio_ECPrivateKey(BIO *bp, EC_KEY **x, pem_password_cb *cb, void *u); EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **x, pem_password_cb *cb, void *u); int PEM_write_bio_ECPrivateKey(BIO *bp, EC_KEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u); int PEM_write_ECPrivateKey(FILE *fp, EC_KEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
EC_KEY *PEM_read_bio_EC_PUBKEY(BIO *bp, EC_KEY **x, pem_password_cb *cb, void *u); EC_KEY *PEM_read_EC_PUBKEY(FILE *fp, EC_KEY **x, pem_password_cb *cb, void *u); int PEM_write_bio_EC_PUBKEY(BIO *bp, EC_KEY *x); int PEM_write_EC_PUBKEY(FILE *fp, EC_KEY *x);
|
||||
DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u); DH *PEM_read_DHparams(FILE *fp, DH **x, pem_password_cb *cb, void *u); int PEM_write_bio_DHparams(BIO *bp, const DH *x); int PEM_write_DHparams(FILE *fp, const DH *x);
|
||||
int PEM_write_bio_DHxparams(BIO *bp, const DH *x); int PEM_write_DHxparams(FILE *fp, const DH *x);
|
||||
EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u); int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
|
||||
EVP_PKEY *PEM_read_bio_PUBKEY(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); EVP_PKEY *PEM_read_PUBKEY(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); int PEM_write_bio_PUBKEY(BIO *bp, EVP_PKEY *x); int PEM_write_PUBKEY(FILE *fp, EVP_PKEY *x);
|
||||
int PEM_write_bio_PrivateKey_traditional(BIO *bp, EVP_PKEY *x,
|
||||
const EVP_CIPHER *enc,
|
||||
unsigned char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
|
||||
char *, int, pem_password_cb *, void *);
|
||||
int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
|
||||
void *u);
|
||||
int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
|
||||
char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
|
||||
void *u);
|
||||
int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
char *kstr, int klen, pem_password_cb *cd,
|
||||
void *u);
|
||||
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
|
||||
int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
|
||||
EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
|
||||
EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
|
||||
EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
|
||||
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
|
||||
int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
|
||||
int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
|
||||
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
|
||||
int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
|
||||
pem_password_cb *cb, void *u);
|
||||
|
||||
// csrc/openssl/src/include/openssl/pemerr.h
|
||||
int ERR_load_PEM_strings(void);
|
||||
enum {
|
||||
PEM_F_B2I_DSS = 127,
|
||||
PEM_F_B2I_PVK_BIO = 128,
|
||||
PEM_F_B2I_RSA = 129,
|
||||
PEM_F_CHECK_BITLEN_DSA = 130,
|
||||
PEM_F_CHECK_BITLEN_RSA = 131,
|
||||
PEM_F_D2I_PKCS8PRIVATEKEY_BIO = 120,
|
||||
PEM_F_D2I_PKCS8PRIVATEKEY_FP = 121,
|
||||
PEM_F_DO_B2I = 132,
|
||||
PEM_F_DO_B2I_BIO = 133,
|
||||
PEM_F_DO_BLOB_HEADER = 134,
|
||||
PEM_F_DO_I2B = 146,
|
||||
PEM_F_DO_PK8PKEY = 126,
|
||||
PEM_F_DO_PK8PKEY_FP = 125,
|
||||
PEM_F_DO_PVK_BODY = 135,
|
||||
PEM_F_DO_PVK_HEADER = 136,
|
||||
PEM_F_GET_HEADER_AND_DATA = 143,
|
||||
PEM_F_GET_NAME = 144,
|
||||
PEM_F_I2B_PVK = 137,
|
||||
PEM_F_I2B_PVK_BIO = 138,
|
||||
PEM_F_LOAD_IV = 101,
|
||||
PEM_F_PEM_ASN1_READ = 102,
|
||||
PEM_F_PEM_ASN1_READ_BIO = 103,
|
||||
PEM_F_PEM_ASN1_WRITE = 104,
|
||||
PEM_F_PEM_ASN1_WRITE_BIO = 105,
|
||||
PEM_F_PEM_DEF_CALLBACK = 100,
|
||||
PEM_F_PEM_DO_HEADER = 106,
|
||||
PEM_F_PEM_GET_EVP_CIPHER_INFO = 107,
|
||||
PEM_F_PEM_READ = 108,
|
||||
PEM_F_PEM_READ_BIO = 109,
|
||||
PEM_F_PEM_READ_BIO_DHPARAMS = 141,
|
||||
PEM_F_PEM_READ_BIO_EX = 145,
|
||||
PEM_F_PEM_READ_BIO_PARAMETERS = 140,
|
||||
PEM_F_PEM_READ_BIO_PRIVATEKEY = 123,
|
||||
PEM_F_PEM_READ_DHPARAMS = 142,
|
||||
PEM_F_PEM_READ_PRIVATEKEY = 124,
|
||||
PEM_F_PEM_SIGNFINAL = 112,
|
||||
PEM_F_PEM_WRITE = 113,
|
||||
PEM_F_PEM_WRITE_BIO = 114,
|
||||
PEM_F_PEM_WRITE_PRIVATEKEY = 139,
|
||||
PEM_F_PEM_X509_INFO_READ = 115,
|
||||
PEM_F_PEM_X509_INFO_READ_BIO = 116,
|
||||
PEM_F_PEM_X509_INFO_WRITE_BIO = 117,
|
||||
PEM_R_BAD_BASE64_DECODE = 100,
|
||||
PEM_R_BAD_DECRYPT = 101,
|
||||
PEM_R_BAD_END_LINE = 102,
|
||||
PEM_R_BAD_IV_CHARS = 103,
|
||||
PEM_R_BAD_MAGIC_NUMBER = 116,
|
||||
PEM_R_BAD_PASSWORD_READ = 104,
|
||||
PEM_R_BAD_VERSION_NUMBER = 117,
|
||||
PEM_R_BIO_WRITE_FAILURE = 118,
|
||||
PEM_R_CIPHER_IS_NULL = 127,
|
||||
PEM_R_ERROR_CONVERTING_PRIVATE_KEY = 115,
|
||||
PEM_R_EXPECTING_PRIVATE_KEY_BLOB = 119,
|
||||
PEM_R_EXPECTING_PUBLIC_KEY_BLOB = 120,
|
||||
PEM_R_HEADER_TOO_LONG = 128,
|
||||
PEM_R_INCONSISTENT_HEADER = 121,
|
||||
PEM_R_KEYBLOB_HEADER_PARSE_ERROR = 122,
|
||||
PEM_R_KEYBLOB_TOO_SHORT = 123,
|
||||
PEM_R_MISSING_DEK_IV = 129,
|
||||
PEM_R_NOT_DEK_INFO = 105,
|
||||
PEM_R_NOT_ENCRYPTED = 106,
|
||||
PEM_R_NOT_PROC_TYPE = 107,
|
||||
PEM_R_NO_START_LINE = 108,
|
||||
PEM_R_PROBLEMS_GETTING_PASSWORD = 109,
|
||||
PEM_R_PVK_DATA_TOO_SHORT = 124,
|
||||
PEM_R_PVK_TOO_SHORT = 125,
|
||||
PEM_R_READ_KEY = 111,
|
||||
PEM_R_SHORT_HEADER = 112,
|
||||
PEM_R_UNEXPECTED_DEK_IV = 130,
|
||||
PEM_R_UNSUPPORTED_CIPHER = 113,
|
||||
PEM_R_UNSUPPORTED_ENCRYPTION = 114,
|
||||
PEM_R_UNSUPPORTED_KEY_COMPONENTS = 126,
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,93 @@
|
||||
// csrc/openssl/src/include/openssl/rand.h
|
||||
struct rand_meth_st {
|
||||
int (*seed) (const void *buf, int num);
|
||||
int (*bytes) (unsigned char *buf, int num);
|
||||
void (*cleanup) (void);
|
||||
int (*add) (const void *buf, int num, double randomness);
|
||||
int (*pseudorand) (unsigned char *buf, int num);
|
||||
int (*status) (void);
|
||||
};
|
||||
int RAND_set_rand_method(const RAND_METHOD *meth);
|
||||
const RAND_METHOD *RAND_get_rand_method(void);
|
||||
int RAND_set_rand_engine(ENGINE *engine);
|
||||
RAND_METHOD *RAND_OpenSSL(void);
|
||||
#define RAND_cleanup() while(0) continue
|
||||
int RAND_bytes(unsigned char *buf, int num);
|
||||
int RAND_priv_bytes(unsigned char *buf, int num);
|
||||
int RAND_pseudo_bytes(unsigned char *buf, int num) __attribute__ ((deprecated));
|
||||
void RAND_seed(const void *buf, int num);
|
||||
void RAND_keep_random_devices_open(int keep);
|
||||
void RAND_add(const void *buf, int num, double randomness);
|
||||
int RAND_load_file(const char *file, long max_bytes);
|
||||
int RAND_write_file(const char *file);
|
||||
const char *RAND_file_name(char *file, size_t num);
|
||||
int RAND_status(void);
|
||||
int RAND_poll(void);
|
||||
|
||||
// csrc/openssl/src/include/openssl/randerr.h
|
||||
int ERR_load_RAND_strings(void);
|
||||
enum {
|
||||
RAND_F_DRBG_BYTES = 101,
|
||||
RAND_F_DRBG_GET_ENTROPY = 105,
|
||||
RAND_F_DRBG_SETUP = 117,
|
||||
RAND_F_GET_ENTROPY = 106,
|
||||
RAND_F_RAND_BYTES = 100,
|
||||
RAND_F_RAND_DRBG_ENABLE_LOCKING = 119,
|
||||
RAND_F_RAND_DRBG_GENERATE = 107,
|
||||
RAND_F_RAND_DRBG_GET_ENTROPY = 120,
|
||||
RAND_F_RAND_DRBG_GET_NONCE = 123,
|
||||
RAND_F_RAND_DRBG_INSTANTIATE = 108,
|
||||
RAND_F_RAND_DRBG_NEW = 109,
|
||||
RAND_F_RAND_DRBG_RESEED = 110,
|
||||
RAND_F_RAND_DRBG_RESTART = 102,
|
||||
RAND_F_RAND_DRBG_SET = 104,
|
||||
RAND_F_RAND_DRBG_SET_DEFAULTS = 121,
|
||||
RAND_F_RAND_DRBG_UNINSTANTIATE = 118,
|
||||
RAND_F_RAND_LOAD_FILE = 111,
|
||||
RAND_F_RAND_POOL_ACQUIRE_ENTROPY = 122,
|
||||
RAND_F_RAND_POOL_ADD = 103,
|
||||
RAND_F_RAND_POOL_ADD_BEGIN = 113,
|
||||
RAND_F_RAND_POOL_ADD_END = 114,
|
||||
RAND_F_RAND_POOL_ATTACH = 124,
|
||||
RAND_F_RAND_POOL_BYTES_NEEDED = 115,
|
||||
RAND_F_RAND_POOL_GROW = 125,
|
||||
RAND_F_RAND_POOL_NEW = 116,
|
||||
RAND_F_RAND_WRITE_FILE = 112,
|
||||
RAND_R_ADDITIONAL_INPUT_TOO_LONG = 102,
|
||||
RAND_R_ALREADY_INSTANTIATED = 103,
|
||||
RAND_R_ARGUMENT_OUT_OF_RANGE = 105,
|
||||
RAND_R_CANNOT_OPEN_FILE = 121,
|
||||
RAND_R_DRBG_ALREADY_INITIALIZED = 129,
|
||||
RAND_R_DRBG_NOT_INITIALISED = 104,
|
||||
RAND_R_ENTROPY_INPUT_TOO_LONG = 106,
|
||||
RAND_R_ENTROPY_OUT_OF_RANGE = 124,
|
||||
RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED = 127,
|
||||
RAND_R_ERROR_INITIALISING_DRBG = 107,
|
||||
RAND_R_ERROR_INSTANTIATING_DRBG = 108,
|
||||
RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT = 109,
|
||||
RAND_R_ERROR_RETRIEVING_ENTROPY = 110,
|
||||
RAND_R_ERROR_RETRIEVING_NONCE = 111,
|
||||
RAND_R_FAILED_TO_CREATE_LOCK = 126,
|
||||
RAND_R_FUNC_NOT_IMPLEMENTED = 101,
|
||||
RAND_R_FWRITE_ERROR = 123,
|
||||
RAND_R_GENERATE_ERROR = 112,
|
||||
RAND_R_INTERNAL_ERROR = 113,
|
||||
RAND_R_IN_ERROR_STATE = 114,
|
||||
RAND_R_NOT_A_REGULAR_FILE = 122,
|
||||
RAND_R_NOT_INSTANTIATED = 115,
|
||||
RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED = 128,
|
||||
RAND_R_PARENT_LOCKING_NOT_ENABLED = 130,
|
||||
RAND_R_PARENT_STRENGTH_TOO_WEAK = 131,
|
||||
RAND_R_PERSONALISATION_STRING_TOO_LONG = 116,
|
||||
RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED = 133,
|
||||
RAND_R_PRNG_NOT_SEEDED = 100,
|
||||
RAND_R_RANDOM_POOL_OVERFLOW = 125,
|
||||
RAND_R_RANDOM_POOL_UNDERFLOW = 134,
|
||||
RAND_R_REQUEST_TOO_LARGE_FOR_DRBG = 117,
|
||||
RAND_R_RESEED_ERROR = 118,
|
||||
RAND_R_SELFTEST_FAILURE = 119,
|
||||
RAND_R_TOO_LITTLE_NONCE_REQUESTED = 135,
|
||||
RAND_R_TOO_MUCH_NONCE_REQUESTED = 136,
|
||||
RAND_R_UNSUPPORTED_DRBG_FLAGS = 132,
|
||||
RAND_R_UNSUPPORTED_DRBG_TYPE = 120,
|
||||
};
|
||||
@@ -0,0 +1,454 @@
|
||||
|
||||
// csrc/openssl/src/include/openssl/rsa.h
|
||||
enum {
|
||||
OPENSSL_RSA_MAX_MODULUS_BITS = 16384,
|
||||
OPENSSL_RSA_FIPS_MIN_MODULUS_BITS = 1024,
|
||||
OPENSSL_RSA_SMALL_MODULUS_BITS = 3072,
|
||||
OPENSSL_RSA_MAX_PUBEXP_BITS = 64,
|
||||
RSA_3 = 0x3L,
|
||||
RSA_F4 = 0x10001L,
|
||||
RSA_ASN1_VERSION_DEFAULT = 0,
|
||||
RSA_ASN1_VERSION_MULTI = 1,
|
||||
RSA_DEFAULT_PRIME_NUM = 2,
|
||||
RSA_METHOD_FLAG_NO_CHECK = 0x0001,
|
||||
RSA_FLAG_CACHE_PUBLIC = 0x0002,
|
||||
RSA_FLAG_CACHE_PRIVATE = 0x0004,
|
||||
RSA_FLAG_BLINDING = 0x0008,
|
||||
RSA_FLAG_THREAD_SAFE = 0x0010,
|
||||
RSA_FLAG_EXT_PKEY = 0x0020,
|
||||
RSA_FLAG_NO_BLINDING = 0x0080,
|
||||
RSA_FLAG_NO_CONSTTIME = 0x0000,
|
||||
RSA_FLAG_NO_EXP_CONSTTIME = RSA_FLAG_NO_CONSTTIME,
|
||||
};
|
||||
#define EVP_PKEY_CTX_set_rsa_padding(ctx,pad) RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_RSA_PADDING, pad, NULL)
|
||||
#define EVP_PKEY_CTX_get_rsa_padding(ctx,ppad) RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)
|
||||
#define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx,len) RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL)
|
||||
enum {
|
||||
RSA_PSS_SALTLEN_DIGEST = -1,
|
||||
RSA_PSS_SALTLEN_AUTO = -2,
|
||||
RSA_PSS_SALTLEN_MAX = -3,
|
||||
RSA_PSS_SALTLEN_MAX_SIGN = -2,
|
||||
};
|
||||
#define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx,len) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL)
|
||||
#define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx,plen) RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, plen)
|
||||
#define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx,bits) RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)
|
||||
#define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx,pubexp) RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)
|
||||
#define EVP_PKEY_CTX_set_rsa_keygen_primes(ctx,primes) RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES, primes, NULL)
|
||||
#define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx,md) RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md))
|
||||
#define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(ctx,md) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md))
|
||||
#define EVP_PKEY_CTX_set_rsa_oaep_md(ctx,md) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)(md))
|
||||
#define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx,pmd) RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)(pmd))
|
||||
#define EVP_PKEY_CTX_get_rsa_oaep_md(ctx,pmd) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)(pmd))
|
||||
#define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx,l,llen) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)(l))
|
||||
#define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx,l) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)(l))
|
||||
#define EVP_PKEY_CTX_set_rsa_pss_keygen_md(ctx,md) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_MD, 0, (void *)(md))
|
||||
enum {
|
||||
EVP_PKEY_CTRL_RSA_PADDING = (EVP_PKEY_ALG_CTRL + 1),
|
||||
EVP_PKEY_CTRL_RSA_PSS_SALTLEN = (EVP_PKEY_ALG_CTRL + 2),
|
||||
EVP_PKEY_CTRL_RSA_KEYGEN_BITS = (EVP_PKEY_ALG_CTRL + 3),
|
||||
EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP = (EVP_PKEY_ALG_CTRL + 4),
|
||||
EVP_PKEY_CTRL_RSA_MGF1_MD = (EVP_PKEY_ALG_CTRL + 5),
|
||||
EVP_PKEY_CTRL_GET_RSA_PADDING = (EVP_PKEY_ALG_CTRL + 6),
|
||||
EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN = (EVP_PKEY_ALG_CTRL + 7),
|
||||
EVP_PKEY_CTRL_GET_RSA_MGF1_MD = (EVP_PKEY_ALG_CTRL + 8),
|
||||
EVP_PKEY_CTRL_RSA_OAEP_MD = (EVP_PKEY_ALG_CTRL + 9),
|
||||
EVP_PKEY_CTRL_RSA_OAEP_LABEL = (EVP_PKEY_ALG_CTRL + 10),
|
||||
EVP_PKEY_CTRL_GET_RSA_OAEP_MD = (EVP_PKEY_ALG_CTRL + 11),
|
||||
EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL = (EVP_PKEY_ALG_CTRL + 12),
|
||||
EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES = (EVP_PKEY_ALG_CTRL + 13),
|
||||
RSA_PKCS1_PADDING = 1,
|
||||
RSA_SSLV23_PADDING = 2,
|
||||
RSA_NO_PADDING = 3,
|
||||
RSA_PKCS1_OAEP_PADDING = 4,
|
||||
RSA_X931_PADDING = 5,
|
||||
RSA_PKCS1_PSS_PADDING = 6,
|
||||
RSA_PKCS1_PADDING_SIZE = 11,
|
||||
};
|
||||
#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
|
||||
#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
|
||||
RSA *RSA_new(void);
|
||||
RSA *RSA_new_method(ENGINE *engine);
|
||||
int RSA_bits(const RSA *rsa);
|
||||
int RSA_size(const RSA *rsa);
|
||||
int RSA_security_bits(const RSA *rsa);
|
||||
int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
|
||||
int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
|
||||
int RSA_set0_crt_params(RSA *r,BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
|
||||
int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[],
|
||||
BIGNUM *coeffs[], int pnum);
|
||||
void RSA_get0_key(const RSA *r,
|
||||
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
|
||||
void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
|
||||
int RSA_get_multi_prime_extra_count(const RSA *r);
|
||||
int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]);
|
||||
void RSA_get0_crt_params(const RSA *r,
|
||||
const BIGNUM **dmp1, const BIGNUM **dmq1,
|
||||
const BIGNUM **iqmp);
|
||||
int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[],
|
||||
const BIGNUM *coeffs[]);
|
||||
const BIGNUM *RSA_get0_n(const RSA *d);
|
||||
const BIGNUM *RSA_get0_e(const RSA *d);
|
||||
const BIGNUM *RSA_get0_d(const RSA *d);
|
||||
const BIGNUM *RSA_get0_p(const RSA *d);
|
||||
const BIGNUM *RSA_get0_q(const RSA *d);
|
||||
const BIGNUM *RSA_get0_dmp1(const RSA *r);
|
||||
const BIGNUM *RSA_get0_dmq1(const RSA *r);
|
||||
const BIGNUM *RSA_get0_iqmp(const RSA *r);
|
||||
void RSA_clear_flags(RSA *r, int flags);
|
||||
int RSA_test_flags(const RSA *r, int flags);
|
||||
void RSA_set_flags(RSA *r, int flags);
|
||||
int RSA_get_version(RSA *r);
|
||||
ENGINE *RSA_get0_engine(const RSA *r);
|
||||
RSA *RSA_generate_key(int bits, unsigned long e, void (*callback) (int, int, void *), void *cb_arg) __attribute__ ((deprecated));
|
||||
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes,
|
||||
BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1,
|
||||
BIGNUM *q2, const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xq1, const BIGNUM *Xq2,
|
||||
const BIGNUM *Xq, const BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e,
|
||||
BN_GENCB *cb);
|
||||
int RSA_check_key(const RSA *);
|
||||
int RSA_check_key_ex(const RSA *, BN_GENCB *cb);
|
||||
int RSA_public_encrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_private_encrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_public_decrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_private_decrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
void RSA_free(RSA *r);
|
||||
int RSA_up_ref(RSA *r);
|
||||
int RSA_flags(const RSA *r);
|
||||
void RSA_set_default_method(const RSA_METHOD *meth);
|
||||
const RSA_METHOD *RSA_get_default_method(void);
|
||||
const RSA_METHOD *RSA_null_method(void);
|
||||
const RSA_METHOD *RSA_get_method(const RSA *rsa);
|
||||
int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
|
||||
const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
|
||||
int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
|
||||
RSA *d2i_RSAPublicKey(RSA **a, const unsigned char **in, long len); int i2d_RSAPublicKey(const RSA *a, unsigned char **out); const ASN1_ITEM * RSAPublicKey_it(void);
|
||||
RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len); int i2d_RSAPrivateKey(const RSA *a, unsigned char **out); const ASN1_ITEM * RSAPrivateKey_it(void);
|
||||
typedef struct rsa_pss_params_st {
|
||||
X509_ALGOR *hashAlgorithm;
|
||||
X509_ALGOR *maskGenAlgorithm;
|
||||
ASN1_INTEGER *saltLength;
|
||||
ASN1_INTEGER *trailerField;
|
||||
X509_ALGOR *maskHash;
|
||||
} RSA_PSS_PARAMS;
|
||||
RSA_PSS_PARAMS *RSA_PSS_PARAMS_new(void); void RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a); RSA_PSS_PARAMS *d2i_RSA_PSS_PARAMS(RSA_PSS_PARAMS **a, const unsigned char **in, long len); int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out); const ASN1_ITEM * RSA_PSS_PARAMS_it(void);
|
||||
typedef struct rsa_oaep_params_st {
|
||||
X509_ALGOR *hashFunc;
|
||||
X509_ALGOR *maskGenFunc;
|
||||
X509_ALGOR *pSourceFunc;
|
||||
X509_ALGOR *maskHash;
|
||||
} RSA_OAEP_PARAMS;
|
||||
RSA_OAEP_PARAMS *RSA_OAEP_PARAMS_new(void); void RSA_OAEP_PARAMS_free(RSA_OAEP_PARAMS *a); RSA_OAEP_PARAMS *d2i_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS **a, const unsigned char **in, long len); int i2d_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS *a, unsigned char **out); const ASN1_ITEM * RSA_OAEP_PARAMS_it(void);
|
||||
int RSA_print_fp(FILE *fp, const RSA *r, int offset);
|
||||
int RSA_print(BIO *bp, const RSA *r, int offset);
|
||||
int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
||||
int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
|
||||
const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
||||
int RSA_sign_ASN1_OCTET_STRING(int type,
|
||||
const unsigned char *m, unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen,
|
||||
RSA *rsa);
|
||||
int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
|
||||
unsigned int m_length, unsigned char *sigbuf,
|
||||
unsigned int siglen, RSA *rsa);
|
||||
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
||||
void RSA_blinding_off(RSA *rsa);
|
||||
BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
|
||||
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
|
||||
long seedlen, const EVP_MD *dgst);
|
||||
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
const unsigned char *p, int pl);
|
||||
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl, int rsa_len,
|
||||
const unsigned char *p, int pl);
|
||||
int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen,
|
||||
const unsigned char *param, int plen,
|
||||
const EVP_MD *md, const EVP_MD *mgf1md);
|
||||
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen,
|
||||
int num, const unsigned char *param,
|
||||
int plen, const EVP_MD *md,
|
||||
const EVP_MD *mgf1md);
|
||||
int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl, int rsa_len);
|
||||
int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f,
|
||||
int fl);
|
||||
int RSA_padding_check_none(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl, int rsa_len);
|
||||
int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f,
|
||||
int fl);
|
||||
int RSA_padding_check_X931(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl, int rsa_len);
|
||||
int RSA_X931_hash_id(int nid);
|
||||
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const unsigned char *EM,
|
||||
int sLen);
|
||||
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
|
||||
const unsigned char *mHash, const EVP_MD *Hash,
|
||||
int sLen);
|
||||
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
||||
const unsigned char *EM, int sLen);
|
||||
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
|
||||
const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
||||
int sLen);
|
||||
#define RSA_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef)
|
||||
int RSA_set_ex_data(RSA *r, int idx, void *arg);
|
||||
void *RSA_get_ex_data(const RSA *r, int idx);
|
||||
RSA *RSAPublicKey_dup(RSA *rsa);
|
||||
RSA *RSAPrivateKey_dup(RSA *rsa);
|
||||
enum {
|
||||
RSA_FLAG_FIPS_METHOD = 0x0400,
|
||||
RSA_FLAG_NON_FIPS_ALLOW = 0x0400,
|
||||
RSA_FLAG_CHECKED = 0x0800,
|
||||
};
|
||||
RSA_METHOD *RSA_meth_new(const char *name, int flags);
|
||||
void RSA_meth_free(RSA_METHOD *meth);
|
||||
RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
|
||||
const char *RSA_meth_get0_name(const RSA_METHOD *meth);
|
||||
int RSA_meth_set1_name(RSA_METHOD *meth, const char *name);
|
||||
int RSA_meth_get_flags(const RSA_METHOD *meth);
|
||||
int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
|
||||
void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
|
||||
int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data);
|
||||
int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))
|
||||
(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
|
||||
int (*pub_enc) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))
|
||||
(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
|
||||
int (*pub_dec) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))
|
||||
(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
|
||||
int (*priv_enc) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))
|
||||
(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
|
||||
int (*priv_dec) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))
|
||||
(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
|
||||
int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
|
||||
int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa,
|
||||
BN_CTX *ctx));
|
||||
int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))
|
||||
(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa,
|
||||
int (*bn_mod_exp) (BIGNUM *r,
|
||||
const BIGNUM *a,
|
||||
const BIGNUM *p,
|
||||
const BIGNUM *m,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx));
|
||||
int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa);
|
||||
int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa));
|
||||
int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa);
|
||||
int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa));
|
||||
int (*RSA_meth_get_sign(const RSA_METHOD *meth))
|
||||
(int type,
|
||||
const unsigned char *m, unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen,
|
||||
const RSA *rsa);
|
||||
int RSA_meth_set_sign(RSA_METHOD *rsa,
|
||||
int (*sign) (int type, const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen,
|
||||
const RSA *rsa));
|
||||
int (*RSA_meth_get_verify(const RSA_METHOD *meth))
|
||||
(int dtype, const unsigned char *m,
|
||||
unsigned int m_length, const unsigned char *sigbuf,
|
||||
unsigned int siglen, const RSA *rsa);
|
||||
int RSA_meth_set_verify(RSA_METHOD *rsa,
|
||||
int (*verify) (int dtype, const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
const unsigned char *sigbuf,
|
||||
unsigned int siglen, const RSA *rsa));
|
||||
int (*RSA_meth_get_keygen(const RSA_METHOD *meth))
|
||||
(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_meth_set_keygen(RSA_METHOD *rsa,
|
||||
int (*keygen) (RSA *rsa, int bits, BIGNUM *e,
|
||||
BN_GENCB *cb));
|
||||
int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth))
|
||||
(RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth,
|
||||
int (*keygen) (RSA *rsa, int bits,
|
||||
int primes, BIGNUM *e,
|
||||
BN_GENCB *cb));
|
||||
|
||||
// csrc/openssl/src/include/openssl/rsaerr.h
|
||||
int ERR_load_RSA_strings(void);
|
||||
enum {
|
||||
RSA_F_CHECK_PADDING_MD = 140,
|
||||
RSA_F_ENCODE_PKCS1 = 146,
|
||||
RSA_F_INT_RSA_VERIFY = 145,
|
||||
RSA_F_OLD_RSA_PRIV_DECODE = 147,
|
||||
RSA_F_PKEY_PSS_INIT = 165,
|
||||
RSA_F_PKEY_RSA_CTRL = 143,
|
||||
RSA_F_PKEY_RSA_CTRL_STR = 144,
|
||||
RSA_F_PKEY_RSA_SIGN = 142,
|
||||
RSA_F_PKEY_RSA_VERIFY = 149,
|
||||
RSA_F_PKEY_RSA_VERIFYRECOVER = 141,
|
||||
RSA_F_RSA_ALGOR_TO_MD = 156,
|
||||
RSA_F_RSA_BUILTIN_KEYGEN = 129,
|
||||
RSA_F_RSA_CHECK_KEY = 123,
|
||||
RSA_F_RSA_CHECK_KEY_EX = 160,
|
||||
RSA_F_RSA_CMS_DECRYPT = 159,
|
||||
RSA_F_RSA_CMS_VERIFY = 158,
|
||||
RSA_F_RSA_ITEM_VERIFY = 148,
|
||||
RSA_F_RSA_METH_DUP = 161,
|
||||
RSA_F_RSA_METH_NEW = 162,
|
||||
RSA_F_RSA_METH_SET1_NAME = 163,
|
||||
RSA_F_RSA_MGF1_TO_MD = 157,
|
||||
RSA_F_RSA_MULTIP_INFO_NEW = 166,
|
||||
RSA_F_RSA_NEW_METHOD = 106,
|
||||
RSA_F_RSA_NULL = 124,
|
||||
RSA_F_RSA_NULL_PRIVATE_DECRYPT = 132,
|
||||
RSA_F_RSA_NULL_PRIVATE_ENCRYPT = 133,
|
||||
RSA_F_RSA_NULL_PUBLIC_DECRYPT = 134,
|
||||
RSA_F_RSA_NULL_PUBLIC_ENCRYPT = 135,
|
||||
RSA_F_RSA_OSSL_PRIVATE_DECRYPT = 101,
|
||||
RSA_F_RSA_OSSL_PRIVATE_ENCRYPT = 102,
|
||||
RSA_F_RSA_OSSL_PUBLIC_DECRYPT = 103,
|
||||
RSA_F_RSA_OSSL_PUBLIC_ENCRYPT = 104,
|
||||
RSA_F_RSA_PADDING_ADD_NONE = 107,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_OAEP = 121,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 = 154,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_PSS = 125,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 = 152,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 = 108,
|
||||
RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 = 109,
|
||||
RSA_F_RSA_PADDING_ADD_SSLV23 = 110,
|
||||
RSA_F_RSA_PADDING_ADD_X931 = 127,
|
||||
RSA_F_RSA_PADDING_CHECK_NONE = 111,
|
||||
RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP = 122,
|
||||
RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 = 153,
|
||||
RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 = 112,
|
||||
RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 = 113,
|
||||
RSA_F_RSA_PADDING_CHECK_SSLV23 = 114,
|
||||
RSA_F_RSA_PADDING_CHECK_X931 = 128,
|
||||
RSA_F_RSA_PARAM_DECODE = 164,
|
||||
RSA_F_RSA_PRINT = 115,
|
||||
RSA_F_RSA_PRINT_FP = 116,
|
||||
RSA_F_RSA_PRIV_DECODE = 150,
|
||||
RSA_F_RSA_PRIV_ENCODE = 138,
|
||||
RSA_F_RSA_PSS_GET_PARAM = 151,
|
||||
RSA_F_RSA_PSS_TO_CTX = 155,
|
||||
RSA_F_RSA_PUB_DECODE = 139,
|
||||
RSA_F_RSA_SETUP_BLINDING = 136,
|
||||
RSA_F_RSA_SIGN = 117,
|
||||
RSA_F_RSA_SIGN_ASN1_OCTET_STRING = 118,
|
||||
RSA_F_RSA_VERIFY = 119,
|
||||
RSA_F_RSA_VERIFY_ASN1_OCTET_STRING = 120,
|
||||
RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 = 126,
|
||||
RSA_F_SETUP_TBUF = 167,
|
||||
RSA_R_ALGORITHM_MISMATCH = 100,
|
||||
RSA_R_BAD_E_VALUE = 101,
|
||||
RSA_R_BAD_FIXED_HEADER_DECRYPT = 102,
|
||||
RSA_R_BAD_PAD_BYTE_COUNT = 103,
|
||||
RSA_R_BAD_SIGNATURE = 104,
|
||||
RSA_R_BLOCK_TYPE_IS_NOT_01 = 106,
|
||||
RSA_R_BLOCK_TYPE_IS_NOT_02 = 107,
|
||||
RSA_R_DATA_GREATER_THAN_MOD_LEN = 108,
|
||||
RSA_R_DATA_TOO_LARGE = 109,
|
||||
RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 110,
|
||||
RSA_R_DATA_TOO_LARGE_FOR_MODULUS = 132,
|
||||
RSA_R_DATA_TOO_SMALL = 111,
|
||||
RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = 122,
|
||||
RSA_R_DIGEST_DOES_NOT_MATCH = 158,
|
||||
RSA_R_DIGEST_NOT_ALLOWED = 145,
|
||||
RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY = 112,
|
||||
RSA_R_DMP1_NOT_CONGRUENT_TO_D = 124,
|
||||
RSA_R_DMQ1_NOT_CONGRUENT_TO_D = 125,
|
||||
RSA_R_D_E_NOT_CONGRUENT_TO_1 = 123,
|
||||
RSA_R_FIRST_OCTET_INVALID = 133,
|
||||
RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE = 144,
|
||||
RSA_R_INVALID_DIGEST = 157,
|
||||
RSA_R_INVALID_DIGEST_LENGTH = 143,
|
||||
RSA_R_INVALID_HEADER = 137,
|
||||
RSA_R_INVALID_LABEL = 160,
|
||||
RSA_R_INVALID_MESSAGE_LENGTH = 131,
|
||||
RSA_R_INVALID_MGF1_MD = 156,
|
||||
RSA_R_INVALID_MULTI_PRIME_KEY = 167,
|
||||
RSA_R_INVALID_OAEP_PARAMETERS = 161,
|
||||
RSA_R_INVALID_PADDING = 138,
|
||||
RSA_R_INVALID_PADDING_MODE = 141,
|
||||
RSA_R_INVALID_PSS_PARAMETERS = 149,
|
||||
RSA_R_INVALID_PSS_SALTLEN = 146,
|
||||
RSA_R_INVALID_SALT_LENGTH = 150,
|
||||
RSA_R_INVALID_TRAILER = 139,
|
||||
RSA_R_INVALID_X931_DIGEST = 142,
|
||||
RSA_R_IQMP_NOT_INVERSE_OF_Q = 126,
|
||||
RSA_R_KEY_PRIME_NUM_INVALID = 165,
|
||||
RSA_R_KEY_SIZE_TOO_SMALL = 120,
|
||||
RSA_R_LAST_OCTET_INVALID = 134,
|
||||
RSA_R_MISSING_PRIVATE_KEY = 179,
|
||||
RSA_R_MGF1_DIGEST_NOT_ALLOWED = 152,
|
||||
RSA_R_MODULUS_TOO_LARGE = 105,
|
||||
RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R = 168,
|
||||
RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D = 169,
|
||||
RSA_R_MP_R_NOT_PRIME = 170,
|
||||
RSA_R_NO_PUBLIC_EXPONENT = 140,
|
||||
RSA_R_NULL_BEFORE_BLOCK_MISSING = 113,
|
||||
RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES = 172,
|
||||
RSA_R_N_DOES_NOT_EQUAL_P_Q = 127,
|
||||
RSA_R_OAEP_DECODING_ERROR = 121,
|
||||
RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 148,
|
||||
RSA_R_PADDING_CHECK_FAILED = 114,
|
||||
RSA_R_PKCS_DECODING_ERROR = 159,
|
||||
RSA_R_PSS_SALTLEN_TOO_SMALL = 164,
|
||||
RSA_R_P_NOT_PRIME = 128,
|
||||
RSA_R_Q_NOT_PRIME = 129,
|
||||
RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = 130,
|
||||
RSA_R_SLEN_CHECK_FAILED = 136,
|
||||
RSA_R_SLEN_RECOVERY_FAILED = 135,
|
||||
RSA_R_SSLV3_ROLLBACK_ATTACK = 115,
|
||||
RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 116,
|
||||
RSA_R_UNKNOWN_ALGORITHM_TYPE = 117,
|
||||
RSA_R_UNKNOWN_DIGEST = 166,
|
||||
RSA_R_UNKNOWN_MASK_DIGEST = 151,
|
||||
RSA_R_UNKNOWN_PADDING_TYPE = 118,
|
||||
RSA_R_UNSUPPORTED_ENCRYPTION_TYPE = 162,
|
||||
RSA_R_UNSUPPORTED_LABEL_SOURCE = 163,
|
||||
RSA_R_UNSUPPORTED_MASK_ALGORITHM = 153,
|
||||
RSA_R_UNSUPPORTED_MASK_PARAMETER = 154,
|
||||
RSA_R_UNSUPPORTED_SIGNATURE_TYPE = 155,
|
||||
RSA_R_VALUE_MISSING = 147,
|
||||
RSA_R_WRONG_SIGNATURE_LENGTH = 119,
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,64 @@
|
||||
// csrc/openssl/src/include/openssl/sha.h
|
||||
enum {
|
||||
SHA_LONG = unsigned int,
|
||||
SHA_LBLOCK = 16,
|
||||
SHA_CBLOCK = (SHA_LBLOCK*4),
|
||||
SHA_LAST_BLOCK = (SHA_CBLOCK-8),
|
||||
SHA_DIGEST_LENGTH = 20,
|
||||
};
|
||||
typedef struct SHAstate_st {
|
||||
unsigned int h0, h1, h2, h3, h4;
|
||||
unsigned int Nl, Nh;
|
||||
unsigned int data[16];
|
||||
unsigned int num;
|
||||
} SHA_CTX;
|
||||
int SHA1_Init(SHA_CTX *c);
|
||||
int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
|
||||
int SHA1_Final(unsigned char *md, SHA_CTX *c);
|
||||
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
|
||||
void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
|
||||
enum {
|
||||
SHA256_CBLOCK = (SHA_LBLOCK*4),
|
||||
};
|
||||
typedef struct SHA256state_st {
|
||||
unsigned int h[8];
|
||||
unsigned int Nl, Nh;
|
||||
unsigned int data[16];
|
||||
unsigned int num, md_len;
|
||||
} SHA256_CTX;
|
||||
int SHA224_Init(SHA256_CTX *c);
|
||||
int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
|
||||
int SHA224_Final(unsigned char *md, SHA256_CTX *c);
|
||||
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
|
||||
int SHA256_Init(SHA256_CTX *c);
|
||||
int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
|
||||
int SHA256_Final(unsigned char *md, SHA256_CTX *c);
|
||||
unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
|
||||
void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
|
||||
enum {
|
||||
SHA224_DIGEST_LENGTH = 28,
|
||||
SHA256_DIGEST_LENGTH = 32,
|
||||
SHA384_DIGEST_LENGTH = 48,
|
||||
SHA512_DIGEST_LENGTH = 64,
|
||||
SHA512_CBLOCK = (SHA_LBLOCK*8),
|
||||
SHA_LONG64 = unsigned long long,
|
||||
};
|
||||
#define U64(C) C ##ULL
|
||||
typedef struct SHA512state_st {
|
||||
unsigned long long h[8];
|
||||
unsigned long long Nl, Nh;
|
||||
union {
|
||||
unsigned long long d[16];
|
||||
unsigned char p[(16*8)];
|
||||
} u;
|
||||
unsigned int num, md_len;
|
||||
} SHA512_CTX;
|
||||
int SHA384_Init(SHA512_CTX *c);
|
||||
int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
|
||||
int SHA384_Final(unsigned char *md, SHA512_CTX *c);
|
||||
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
|
||||
int SHA512_Init(SHA512_CTX *c);
|
||||
int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
|
||||
int SHA512_Final(unsigned char *md, SHA512_CTX *c);
|
||||
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
|
||||
void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
|
||||
@@ -0,0 +1,105 @@
|
||||
local ffi = require'ffi' --ossl_typ.h
|
||||
ffi.cdef[[
|
||||
typedef int64_t time_t;
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
typedef struct asn1_string_st ASN1_INTEGER;
|
||||
typedef struct asn1_string_st ASN1_ENUMERATED;
|
||||
typedef struct asn1_string_st ASN1_BIT_STRING;
|
||||
typedef struct asn1_string_st ASN1_OCTET_STRING;
|
||||
typedef struct asn1_string_st ASN1_PRINTABLESTRING;
|
||||
typedef struct asn1_string_st ASN1_T61STRING;
|
||||
typedef struct asn1_string_st ASN1_IA5STRING;
|
||||
typedef struct asn1_string_st ASN1_GENERALSTRING;
|
||||
typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
|
||||
typedef struct asn1_string_st ASN1_BMPSTRING;
|
||||
typedef struct asn1_string_st ASN1_UTCTIME;
|
||||
typedef struct asn1_string_st ASN1_TIME;
|
||||
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
|
||||
typedef struct asn1_string_st ASN1_VISIBLESTRING;
|
||||
typedef struct asn1_string_st ASN1_UTF8STRING;
|
||||
typedef struct asn1_string_st ASN1_STRING;
|
||||
typedef int ASN1_BOOLEAN;
|
||||
typedef int ASN1_NULL;
|
||||
typedef struct asn1_object_st ASN1_OBJECT;
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct asn1_pctx_st ASN1_PCTX;
|
||||
typedef struct asn1_sctx_st ASN1_SCTX;
|
||||
struct dane_st;
|
||||
typedef struct bio_st BIO;
|
||||
typedef struct bignum_st BIGNUM;
|
||||
typedef struct bignum_ctx BN_CTX;
|
||||
typedef struct bn_blinding_st BN_BLINDING;
|
||||
typedef struct bn_mont_ctx_st BN_MONT_CTX;
|
||||
typedef struct bn_recp_ctx_st BN_RECP_CTX;
|
||||
typedef struct bn_gencb_st BN_GENCB;
|
||||
typedef struct buf_mem_st BUF_MEM;
|
||||
typedef struct evp_cipher_st EVP_CIPHER;
|
||||
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
|
||||
typedef struct evp_md_st EVP_MD;
|
||||
typedef struct evp_md_ctx_st EVP_MD_CTX;
|
||||
typedef struct evp_pkey_st EVP_PKEY;
|
||||
typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
|
||||
typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
|
||||
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
|
||||
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
|
||||
typedef struct hmac_ctx_st HMAC_CTX;
|
||||
typedef struct dh_st DH;
|
||||
typedef struct dh_method DH_METHOD;
|
||||
typedef struct dsa_st DSA;
|
||||
typedef struct dsa_method DSA_METHOD;
|
||||
typedef struct rsa_st RSA;
|
||||
typedef struct rsa_meth_st RSA_METHOD;
|
||||
typedef struct ec_key_st EC_KEY;
|
||||
typedef struct ec_key_method_st EC_KEY_METHOD;
|
||||
typedef struct rand_meth_st RAND_METHOD;
|
||||
typedef struct rand_drbg_st RAND_DRBG;
|
||||
typedef struct ssl_dane_st SSL_DANE;
|
||||
typedef struct x509_st X509;
|
||||
typedef struct X509_algor_st X509_ALGOR;
|
||||
typedef struct X509_crl_st X509_CRL;
|
||||
typedef struct x509_crl_method_st X509_CRL_METHOD;
|
||||
typedef struct x509_revoked_st X509_REVOKED;
|
||||
typedef struct X509_name_st X509_NAME;
|
||||
typedef struct X509_pubkey_st X509_PUBKEY;
|
||||
typedef struct x509_store_st X509_STORE;
|
||||
typedef struct x509_store_ctx_st X509_STORE_CTX;
|
||||
typedef struct x509_object_st X509_OBJECT;
|
||||
typedef struct x509_lookup_st X509_LOOKUP;
|
||||
typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
|
||||
typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
|
||||
typedef struct x509_sig_info_st X509_SIG_INFO;
|
||||
typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
|
||||
typedef struct v3_ext_ctx X509V3_CTX;
|
||||
typedef struct conf_st CONF;
|
||||
typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
|
||||
typedef struct ui_st UI;
|
||||
typedef struct ui_method_st UI_METHOD;
|
||||
typedef struct engine_st ENGINE;
|
||||
typedef struct ssl_st SSL;
|
||||
typedef struct ssl_ctx_st SSL_CTX;
|
||||
typedef struct comp_ctx_st COMP_CTX;
|
||||
typedef struct comp_method_st COMP_METHOD;
|
||||
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
|
||||
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
|
||||
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
|
||||
typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
|
||||
typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
|
||||
typedef struct DIST_POINT_st DIST_POINT;
|
||||
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
|
||||
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
|
||||
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
|
||||
typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
|
||||
typedef struct ocsp_response_st OCSP_RESPONSE;
|
||||
typedef struct ocsp_responder_id_st OCSP_RESPID;
|
||||
typedef struct sct_st SCT;
|
||||
typedef struct sct_ctx_st SCT_CTX;
|
||||
typedef struct ctlog_st CTLOG;
|
||||
typedef struct ctlog_store_st CTLOG_STORE;
|
||||
typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
|
||||
typedef struct ossl_store_info_st OSSL_STORE_INFO;
|
||||
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
|
||||
typedef intmax_t ossl_intmax_t;
|
||||
typedef uintmax_t ossl_uintmax_t;
|
||||
]]
|
||||
@@ -0,0 +1,147 @@
|
||||
// csrc/openssl/src/include/openssl/ui.h
|
||||
UI *UI_new(void);
|
||||
UI *UI_new_method(const UI_METHOD *method);
|
||||
void UI_free(UI *ui);
|
||||
int UI_add_input_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize);
|
||||
int UI_dup_input_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize);
|
||||
int UI_add_verify_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize,
|
||||
const char *test_buf);
|
||||
int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize,
|
||||
const char *test_buf);
|
||||
int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
||||
const char *ok_chars, const char *cancel_chars,
|
||||
int flags, char *result_buf);
|
||||
int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
||||
const char *ok_chars, const char *cancel_chars,
|
||||
int flags, char *result_buf);
|
||||
int UI_add_info_string(UI *ui, const char *text);
|
||||
int UI_dup_info_string(UI *ui, const char *text);
|
||||
int UI_add_error_string(UI *ui, const char *text);
|
||||
int UI_dup_error_string(UI *ui, const char *text);
|
||||
enum {
|
||||
UI_INPUT_FLAG_ECHO = 0x01,
|
||||
UI_INPUT_FLAG_DEFAULT_PWD = 0x02,
|
||||
UI_INPUT_FLAG_USER_BASE = 16,
|
||||
};
|
||||
char *UI_construct_prompt(UI *ui_method,
|
||||
const char *object_desc, const char *object_name);
|
||||
void *UI_add_user_data(UI *ui, void *user_data);
|
||||
int UI_dup_user_data(UI *ui, void *user_data);
|
||||
void *UI_get0_user_data(UI *ui);
|
||||
const char *UI_get0_result(UI *ui, int i);
|
||||
int UI_get_result_length(UI *ui, int i);
|
||||
int UI_process(UI *ui);
|
||||
int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));
|
||||
enum {
|
||||
UI_CTRL_PRINT_ERRORS = 1,
|
||||
UI_CTRL_IS_REDOABLE = 2,
|
||||
};
|
||||
#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
|
||||
#define UI_get_app_data(s) UI_get_ex_data(s,0)
|
||||
#define UI_get_ex_new_index(l,p,newf,dupf,freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef)
|
||||
int UI_set_ex_data(UI *r, int idx, void *arg);
|
||||
void *UI_get_ex_data(UI *r, int idx);
|
||||
void UI_set_default_method(const UI_METHOD *meth);
|
||||
const UI_METHOD *UI_get_default_method(void);
|
||||
const UI_METHOD *UI_get_method(UI *ui);
|
||||
const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
|
||||
UI_METHOD *UI_OpenSSL(void);
|
||||
const UI_METHOD *UI_null(void);
|
||||
typedef struct ui_string_st UI_STRING;
|
||||
struct stack_st_UI_STRING; typedef int (*sk_UI_STRING_compfunc)(const UI_STRING * const *a, const UI_STRING *const *b); typedef void (*sk_UI_STRING_freefunc)(UI_STRING *a); typedef UI_STRING * (*sk_UI_STRING_copyfunc)(const UI_STRING *a); static __attribute__((unused)) inline int sk_UI_STRING_num(const struct stack_st_UI_STRING *sk) { return OPENSSL_sk_num((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_value(const struct stack_st_UI_STRING *sk, int idx) { return (UI_STRING *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); } static __attribute__((unused)) inline struct stack_st_UI_STRING *sk_UI_STRING_new(sk_UI_STRING_compfunc compare) { return (struct stack_st_UI_STRING *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); } static __attribute__((unused)) inline struct stack_st_UI_STRING *sk_UI_STRING_new_null(void) { return (struct stack_st_UI_STRING *)OPENSSL_sk_new_null(); } static __attribute__((unused)) inline struct stack_st_UI_STRING *sk_UI_STRING_new_reserve(sk_UI_STRING_compfunc compare, int n) { return (struct stack_st_UI_STRING *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); } static __attribute__((unused)) inline int sk_UI_STRING_reserve(struct stack_st_UI_STRING *sk, int n) { return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); } static __attribute__((unused)) inline void sk_UI_STRING_free(struct stack_st_UI_STRING *sk) { OPENSSL_sk_free((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_UI_STRING_zero(struct stack_st_UI_STRING *sk) { OPENSSL_sk_zero((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_delete(struct stack_st_UI_STRING *sk, int i) { return (UI_STRING *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_delete_ptr(struct stack_st_UI_STRING *sk, UI_STRING *ptr) { return (UI_STRING *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_UI_STRING_push(struct stack_st_UI_STRING *sk, UI_STRING *ptr) { return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_UI_STRING_unshift(struct stack_st_UI_STRING *sk, UI_STRING *ptr) { return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_pop(struct stack_st_UI_STRING *sk) { return (UI_STRING *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_shift(struct stack_st_UI_STRING *sk) { return (UI_STRING *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline void sk_UI_STRING_pop_free(struct stack_st_UI_STRING *sk, sk_UI_STRING_freefunc freefunc) { OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline int sk_UI_STRING_insert(struct stack_st_UI_STRING *sk, UI_STRING *ptr, int idx) { return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); } static __attribute__((unused)) inline UI_STRING *sk_UI_STRING_set(struct stack_st_UI_STRING *sk, int idx, UI_STRING *ptr) { return (UI_STRING *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); } static __attribute__((unused)) inline int sk_UI_STRING_find(struct stack_st_UI_STRING *sk, UI_STRING *ptr) { return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline int sk_UI_STRING_find_ex(struct stack_st_UI_STRING *sk, UI_STRING *ptr) { return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); } static __attribute__((unused)) inline void sk_UI_STRING_sort(struct stack_st_UI_STRING *sk) { OPENSSL_sk_sort((OPENSSL_STACK *)sk); } static __attribute__((unused)) inline int sk_UI_STRING_is_sorted(const struct stack_st_UI_STRING *sk) { return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_UI_STRING * sk_UI_STRING_dup(const struct stack_st_UI_STRING *sk) { return (struct stack_st_UI_STRING *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); } static __attribute__((unused)) inline struct stack_st_UI_STRING *sk_UI_STRING_deep_copy(const struct stack_st_UI_STRING *sk, sk_UI_STRING_copyfunc copyfunc, sk_UI_STRING_freefunc freefunc) { return (struct stack_st_UI_STRING *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); } static __attribute__((unused)) inline sk_UI_STRING_compfunc sk_UI_STRING_set_cmp_func(struct stack_st_UI_STRING *sk, sk_UI_STRING_compfunc compare) { return (sk_UI_STRING_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); }
|
||||
enum UI_string_types {
|
||||
UIT_NONE = 0,
|
||||
UIT_PROMPT,
|
||||
UIT_VERIFY,
|
||||
UIT_BOOLEAN,
|
||||
UIT_INFO,
|
||||
UIT_ERROR
|
||||
};
|
||||
UI_METHOD *UI_create_method(const char *name);
|
||||
void UI_destroy_method(UI_METHOD *ui_method);
|
||||
int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));
|
||||
int UI_method_set_writer(UI_METHOD *method,
|
||||
int (*writer) (UI *ui, UI_STRING *uis));
|
||||
int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));
|
||||
int UI_method_set_reader(UI_METHOD *method,
|
||||
int (*reader) (UI *ui, UI_STRING *uis));
|
||||
int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
|
||||
int UI_method_set_data_duplicator(UI_METHOD *method,
|
||||
void *(*duplicator) (UI *ui, void *ui_data),
|
||||
void (*destructor)(UI *ui, void *ui_data));
|
||||
int UI_method_set_prompt_constructor(UI_METHOD *method,
|
||||
char *(*prompt_constructor) (UI *ui,
|
||||
const char
|
||||
*object_desc,
|
||||
const char
|
||||
*object_name));
|
||||
int UI_method_set_ex_data(UI_METHOD *method, int idx, void *data);
|
||||
int (*UI_method_get_opener(const UI_METHOD *method)) (UI *);
|
||||
int (*UI_method_get_writer(const UI_METHOD *method)) (UI *, UI_STRING *);
|
||||
int (*UI_method_get_flusher(const UI_METHOD *method)) (UI *);
|
||||
int (*UI_method_get_reader(const UI_METHOD *method)) (UI *, UI_STRING *);
|
||||
int (*UI_method_get_closer(const UI_METHOD *method)) (UI *);
|
||||
char *(*UI_method_get_prompt_constructor(const UI_METHOD *method))
|
||||
(UI *, const char *, const char *);
|
||||
void *(*UI_method_get_data_duplicator(const UI_METHOD *method)) (UI *, void *);
|
||||
void (*UI_method_get_data_destructor(const UI_METHOD *method)) (UI *, void *);
|
||||
const void *UI_method_get_ex_data(const UI_METHOD *method, int idx);
|
||||
enum UI_string_types UI_get_string_type(UI_STRING *uis);
|
||||
int UI_get_input_flags(UI_STRING *uis);
|
||||
const char *UI_get0_output_string(UI_STRING *uis);
|
||||
const char *UI_get0_action_string(UI_STRING *uis);
|
||||
const char *UI_get0_result_string(UI_STRING *uis);
|
||||
int UI_get_result_string_length(UI_STRING *uis);
|
||||
const char *UI_get0_test_string(UI_STRING *uis);
|
||||
int UI_get_result_minsize(UI_STRING *uis);
|
||||
int UI_get_result_maxsize(UI_STRING *uis);
|
||||
int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
|
||||
int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len);
|
||||
int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
|
||||
int verify);
|
||||
int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
|
||||
int verify);
|
||||
UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag);
|
||||
|
||||
// csrc/openssl/src/include/openssl/uierr.h
|
||||
int ERR_load_UI_strings(void);
|
||||
enum {
|
||||
UI_F_CLOSE_CONSOLE = 115,
|
||||
UI_F_ECHO_CONSOLE = 116,
|
||||
UI_F_GENERAL_ALLOCATE_BOOLEAN = 108,
|
||||
UI_F_GENERAL_ALLOCATE_PROMPT = 109,
|
||||
UI_F_NOECHO_CONSOLE = 117,
|
||||
UI_F_OPEN_CONSOLE = 114,
|
||||
UI_F_UI_CONSTRUCT_PROMPT = 121,
|
||||
UI_F_UI_CREATE_METHOD = 112,
|
||||
UI_F_UI_CTRL = 111,
|
||||
UI_F_UI_DUP_ERROR_STRING = 101,
|
||||
UI_F_UI_DUP_INFO_STRING = 102,
|
||||
UI_F_UI_DUP_INPUT_BOOLEAN = 110,
|
||||
UI_F_UI_DUP_INPUT_STRING = 103,
|
||||
UI_F_UI_DUP_USER_DATA = 118,
|
||||
UI_F_UI_DUP_VERIFY_STRING = 106,
|
||||
UI_F_UI_GET0_RESULT = 107,
|
||||
UI_F_UI_GET_RESULT_LENGTH = 119,
|
||||
UI_F_UI_NEW_METHOD = 104,
|
||||
UI_F_UI_PROCESS = 113,
|
||||
UI_F_UI_SET_RESULT = 105,
|
||||
UI_F_UI_SET_RESULT_EX = 120,
|
||||
UI_R_COMMON_OK_AND_CANCEL_CHARACTERS = 104,
|
||||
UI_R_INDEX_TOO_LARGE = 102,
|
||||
UI_R_INDEX_TOO_SMALL = 103,
|
||||
UI_R_NO_RESULT_BUFFER = 105,
|
||||
UI_R_PROCESSING_ERROR = 107,
|
||||
UI_R_RESULT_TOO_LARGE = 100,
|
||||
UI_R_RESULT_TOO_SMALL = 101,
|
||||
UI_R_SYSASSIGN_ERROR = 109,
|
||||
UI_R_SYSDASSGN_ERROR = 110,
|
||||
UI_R_SYSQIOW_ERROR = 111,
|
||||
UI_R_UNKNOWN_CONTROL_COMMAND = 106,
|
||||
UI_R_UNKNOWN_TTYGET_ERRNO_VALUE = 108,
|
||||
UI_R_USER_DATA_DUPLICATION_UNSUPPORTED = 112,
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
|
||||
--OpenSSL binding for LuaJIT.
|
||||
--Written by Cosmin Apreutesei. Public Domain.
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
local ffi = require'ffi'
|
||||
|
||||
ffi.cdef[[
|
||||
|
||||
|
||||
]]
|
||||
Reference in New Issue
Block a user