mirror of
https://github.com/lbr77/SideImpactor.git
synced 2026-08-05 23:05:22 -04:00
refactor directory
This commit is contained in:
42
wasm/openssl/vendor/openssl-sys/src/handwritten/aes.rs
vendored
Normal file
42
wasm/openssl/vendor/openssl-sys/src/handwritten/aes.rs
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
#[repr(C)]
|
||||
pub struct AES_KEY {
|
||||
// There is some business with AES_LONG which is there to ensure the values here are 32 bits
|
||||
rd_key: [u32; 4 * (AES_MAXNR as usize + 1)],
|
||||
rounds: c_int,
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn AES_set_encrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
|
||||
pub fn AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
pub fn AES_ige_encrypt(
|
||||
in_: *const c_uchar,
|
||||
out: *mut c_uchar,
|
||||
length: size_t,
|
||||
key: *const AES_KEY,
|
||||
ivec: *mut c_uchar,
|
||||
enc: c_int,
|
||||
);
|
||||
|
||||
pub fn AES_wrap_key(
|
||||
key: *mut AES_KEY,
|
||||
iv: *const c_uchar,
|
||||
out: *mut c_uchar,
|
||||
in_: *const c_uchar,
|
||||
inlen: c_uint,
|
||||
) -> c_int;
|
||||
|
||||
pub fn AES_unwrap_key(
|
||||
key: *mut AES_KEY,
|
||||
iv: *const c_uchar,
|
||||
out: *mut c_uchar,
|
||||
in_: *const c_uchar,
|
||||
inlen: c_uint,
|
||||
) -> c_int;
|
||||
}
|
||||
119
wasm/openssl/vendor/openssl-sys/src/handwritten/asn1.rs
vendored
Normal file
119
wasm/openssl/vendor/openssl-sys/src/handwritten/asn1.rs
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct ASN1_ENCODING {
|
||||
pub enc: *mut c_uchar,
|
||||
pub len: c_long,
|
||||
pub modified: c_int,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn ASN1_OBJECT_free(x: *mut ASN1_OBJECT);
|
||||
pub fn OBJ_dup(x: *const ASN1_OBJECT) -> *mut ASN1_OBJECT;
|
||||
}
|
||||
|
||||
stack!(stack_st_ASN1_OBJECT);
|
||||
|
||||
#[repr(C)]
|
||||
pub struct ASN1_TYPE {
|
||||
pub type_: c_int,
|
||||
pub value: ASN1_TYPE_value,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub union ASN1_TYPE_value {
|
||||
pub ptr: *mut c_char,
|
||||
pub boolean: ASN1_BOOLEAN,
|
||||
pub asn1_string: *mut ASN1_STRING,
|
||||
pub object: *mut ASN1_OBJECT,
|
||||
pub integer: *mut ASN1_INTEGER,
|
||||
pub enumerated: *mut ASN1_ENUMERATED,
|
||||
pub bit_string: *mut ASN1_BIT_STRING,
|
||||
pub octet_string: *mut ASN1_OCTET_STRING,
|
||||
pub printablestring: *mut ASN1_PRINTABLESTRING,
|
||||
pub t61string: *mut ASN1_T61STRING,
|
||||
pub ia5string: *mut ASN1_IA5STRING,
|
||||
pub generalstring: *mut ASN1_GENERALSTRING,
|
||||
pub bmpstring: *mut ASN1_BMPSTRING,
|
||||
pub universalstring: *mut ASN1_UNIVERSALSTRING,
|
||||
pub utctime: *mut ASN1_UTCTIME,
|
||||
pub generalizedtime: *mut ASN1_GENERALIZEDTIME,
|
||||
pub visiblestring: *mut ASN1_VISIBLESTRING,
|
||||
pub utf8string: *mut ASN1_UTF8STRING,
|
||||
pub set: *mut ASN1_STRING,
|
||||
pub sequence: *mut ASN1_STRING,
|
||||
pub asn1_value: *mut ASN1_VALUE,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar;
|
||||
#[cfg(any(all(ossl102, not(ossl110)), libressl))]
|
||||
pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar;
|
||||
pub fn ASN1_STRING_new() -> *mut ASN1_STRING;
|
||||
pub fn ASN1_OCTET_STRING_new() -> *mut ASN1_OCTET_STRING;
|
||||
pub fn ASN1_STRING_free(x: *mut ASN1_STRING);
|
||||
pub fn ASN1_STRING_length(x: *const ASN1_STRING) -> c_int;
|
||||
pub fn ASN1_STRING_set(x: *mut ASN1_STRING, data: *const c_void, len_in: c_int) -> c_int;
|
||||
pub fn ASN1_OCTET_STRING_set(
|
||||
x: *mut ASN1_OCTET_STRING,
|
||||
data: *const c_uchar,
|
||||
len_in: c_int,
|
||||
) -> c_int;
|
||||
|
||||
pub fn ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING);
|
||||
pub fn ASN1_OCTET_STRING_free(x: *mut ASN1_OCTET_STRING);
|
||||
|
||||
pub fn ASN1_GENERALIZEDTIME_new() -> *mut ASN1_GENERALIZEDTIME;
|
||||
pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME);
|
||||
pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int;
|
||||
pub fn ASN1_GENERALIZEDTIME_set_string(
|
||||
s: *mut ASN1_GENERALIZEDTIME,
|
||||
str: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn ASN1_TIME_new() -> *mut ASN1_TIME;
|
||||
pub fn ASN1_TIME_diff(
|
||||
pday: *mut c_int,
|
||||
psec: *mut c_int,
|
||||
from: *const ASN1_TIME,
|
||||
to: *const ASN1_TIME,
|
||||
) -> c_int;
|
||||
pub fn ASN1_TIME_free(tm: *mut ASN1_TIME);
|
||||
pub fn ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int;
|
||||
pub fn ASN1_TIME_set(from: *mut ASN1_TIME, to: time_t) -> *mut ASN1_TIME;
|
||||
|
||||
pub fn ASN1_INTEGER_free(x: *mut ASN1_INTEGER);
|
||||
pub fn ASN1_INTEGER_dup(a: *const ASN1_INTEGER) -> *mut ASN1_INTEGER;
|
||||
pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long;
|
||||
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
|
||||
pub fn ASN1_INTEGER_cmp(a: *const ASN1_INTEGER, b: *const ASN1_INTEGER) -> c_int;
|
||||
pub fn BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER;
|
||||
pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
|
||||
pub fn ASN1_TIME_set_string(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
|
||||
|
||||
pub fn ASN1_ENUMERATED_free(a: *mut ASN1_ENUMERATED);
|
||||
#[cfg(ossl110)]
|
||||
pub fn ASN1_ENUMERATED_get_int64(pr: *mut i64, a: *const ASN1_ENUMERATED) -> c_int;
|
||||
|
||||
pub fn ASN1_TYPE_new() -> *mut ASN1_TYPE;
|
||||
pub fn ASN1_TYPE_set(a: *mut ASN1_TYPE, type_: c_int, value: *mut c_void);
|
||||
pub fn ASN1_TYPE_free(x: *mut ASN1_TYPE);
|
||||
pub fn d2i_ASN1_TYPE(
|
||||
k: *mut *mut ASN1_TYPE,
|
||||
buf: *mut *const u8,
|
||||
len: c_long,
|
||||
) -> *mut ASN1_TYPE;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: #[const_ptr_if(any(ossl110, libressl))] ASN1_STRING) -> c_int;
|
||||
pub fn ASN1_STRING_type(x: #[const_ptr_if(any(ossl110, libressl))] ASN1_STRING) -> c_int;
|
||||
pub fn ASN1_generate_v3(str: #[const_ptr_if(any(ossl110, libressl))] c_char, cnf: *mut X509V3_CTX) -> *mut ASN1_TYPE;
|
||||
pub fn i2d_ASN1_TYPE(a: #[const_ptr_if(ossl300)] ASN1_TYPE, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
165
wasm/openssl/vendor/openssl-sys/src/handwritten/bio.rs
vendored
Normal file
165
wasm/openssl/vendor/openssl-sys/src/handwritten/bio.rs
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn BIO_set_flags(b: *mut BIO, flags: c_int);
|
||||
pub fn BIO_clear_flags(b: *mut BIO, flags: c_int);
|
||||
}
|
||||
|
||||
pub type bio_info_cb =
|
||||
Option<unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long)>;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum BIO_METHOD {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct BIO_METHOD {
|
||||
pub type_: c_int,
|
||||
pub name: *const c_char,
|
||||
pub bwrite: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>,
|
||||
pub bread: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
|
||||
pub bputs: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>,
|
||||
pub bgets: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
|
||||
pub ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>,
|
||||
pub create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
|
||||
pub destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
|
||||
pub callback_ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, bio_info_cb) -> c_long>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn BIO_s_file() -> #[const_ptr_if(any(ossl110, libressl))] BIO_METHOD;
|
||||
pub fn BIO_new(type_: #[const_ptr_if(any(ossl110, libressl))] BIO_METHOD) -> *mut BIO;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
|
||||
pub fn BIO_new_fp(stream: *mut FILE, close_flag: c_int) -> *mut BIO;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BIO_set_data(a: *mut BIO, data: *mut c_void);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BIO_get_data(a: *mut BIO) -> *mut c_void;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BIO_set_init(a: *mut BIO, init: c_int);
|
||||
pub fn BIO_write(b: *mut BIO, buf: *const c_void, len: c_int) -> c_int;
|
||||
pub fn BIO_read(b: *mut BIO, buf: *mut c_void, len: c_int) -> c_int;
|
||||
pub fn BIO_ctrl(b: *mut BIO, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
|
||||
pub fn BIO_free_all(b: *mut BIO);
|
||||
pub fn BIO_new_mem_buf(buf: *const c_void, len: c_int) -> *mut BIO;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn BIO_s_mem() -> #[const_ptr_if(any(ossl110, libressl))] BIO_METHOD;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SOCK"))]
|
||||
pub fn BIO_new_socket(sock: c_int, close_flag: c_int) -> *mut BIO;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BIO_meth_new(type_: c_int, name: *const c_char) -> *mut BIO_METHOD;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BIO_meth_free(biom: *mut BIO_METHOD);
|
||||
}
|
||||
|
||||
#[allow(clashing_extern_declarations)]
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_write"]
|
||||
pub fn BIO_meth_set_write__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
write: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_read"]
|
||||
pub fn BIO_meth_set_read__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
read: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_puts"]
|
||||
pub fn BIO_meth_set_puts__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
read: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_ctrl"]
|
||||
pub fn BIO_meth_set_ctrl__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
read: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_create"]
|
||||
pub fn BIO_meth_set_create__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
#[link_name = "BIO_meth_set_destroy"]
|
||||
pub fn BIO_meth_set_destroy__fixed_rust(
|
||||
biom: *mut BIO_METHOD,
|
||||
destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(ossl320)]
|
||||
extern "C" {
|
||||
pub fn BIO_meth_set_sendmmsg(
|
||||
biom: *mut BIO_METHOD,
|
||||
f: Option<
|
||||
unsafe extern "C" fn(
|
||||
arg1: *mut BIO,
|
||||
arg2: *mut BIO_MSG,
|
||||
arg3: usize,
|
||||
arg4: usize,
|
||||
arg5: u64,
|
||||
arg6: *mut usize,
|
||||
) -> c_int,
|
||||
>,
|
||||
) -> c_int;
|
||||
pub fn BIO_meth_set_recvmmsg(
|
||||
biom: *mut BIO_METHOD,
|
||||
f: Option<
|
||||
unsafe extern "C" fn(
|
||||
arg1: *mut BIO,
|
||||
arg2: *mut BIO_MSG,
|
||||
arg3: usize,
|
||||
arg4: usize,
|
||||
arg5: u64,
|
||||
arg6: *mut usize,
|
||||
) -> c_int,
|
||||
>,
|
||||
) -> c_int;
|
||||
pub fn BIO_new_bio_dgram_pair(
|
||||
bio1: *mut *mut BIO,
|
||||
writebuf1: usize,
|
||||
bio2: *mut *mut BIO,
|
||||
writebuf2: usize,
|
||||
) -> c_int;
|
||||
pub fn BIO_s_dgram_pair() -> *const BIO_METHOD;
|
||||
pub fn BIO_s_datagram() -> *const BIO_METHOD;
|
||||
pub fn BIO_get_rpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
|
||||
pub fn BIO_get_wpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
|
||||
pub fn BIO_sendmmsg(
|
||||
b: *mut BIO,
|
||||
msg: *mut BIO_MSG,
|
||||
stride: usize,
|
||||
num_msg: usize,
|
||||
flags: u64,
|
||||
msgs_processed: *mut usize,
|
||||
) -> c_int;
|
||||
pub fn BIO_recvmmsg(
|
||||
b: *mut BIO,
|
||||
msg: *mut BIO_MSG,
|
||||
stride: usize,
|
||||
num_msg: usize,
|
||||
flags: u64,
|
||||
msgs_processed: *mut usize,
|
||||
) -> c_int;
|
||||
pub fn BIO_err_is_non_fatal(errcode: c_uint) -> c_int;
|
||||
}
|
||||
176
wasm/openssl/vendor/openssl-sys/src/handwritten/bn.rs
vendored
Normal file
176
wasm/openssl/vendor/openssl-sys/src/handwritten/bn.rs
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn BN_CTX_new() -> *mut BN_CTX;
|
||||
#[cfg(ossl110)]
|
||||
pub fn BN_CTX_secure_new() -> *mut BN_CTX;
|
||||
pub fn BN_CTX_free(ctx: *mut BN_CTX);
|
||||
pub fn BN_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
pub fn BN_pseudo_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
|
||||
pub fn BN_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
pub fn BN_pseudo_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
|
||||
pub fn BN_new() -> *mut BIGNUM;
|
||||
#[cfg(ossl110)]
|
||||
pub fn BN_secure_new() -> *mut BIGNUM;
|
||||
#[cfg(ossl110)]
|
||||
pub fn BN_set_flags(b: *mut BIGNUM, n: c_int);
|
||||
#[cfg(ossl110)]
|
||||
pub fn BN_get_flags(b: *const BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_num_bits(bn: *const BIGNUM) -> c_int;
|
||||
pub fn BN_clear_free(bn: *mut BIGNUM);
|
||||
pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_bn2bin(a: *const BIGNUM, to: *mut u8) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BN_bn2binpad(a: *const BIGNUM, to: *mut u8, tolen: c_int) -> c_int;
|
||||
pub fn BN_sub(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
|
||||
pub fn BN_add(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
|
||||
pub fn BN_mul(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
|
||||
pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
|
||||
pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BN_is_negative(b: *const BIGNUM) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn BN_is_odd(b: *const BIGNUM) -> c_int;
|
||||
|
||||
pub fn BN_div(
|
||||
dv: *mut BIGNUM,
|
||||
rem: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_nnmod(
|
||||
rem: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_mod_add(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_mod_sub(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_mod_mul(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_mod_sqr(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
pub fn BN_mod_sqrt(
|
||||
ret: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
p: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut BIGNUM;
|
||||
|
||||
pub fn BN_mod_word(r: *const BIGNUM, w: BN_ULONG) -> BN_ULONG;
|
||||
pub fn BN_div_word(r: *mut BIGNUM, w: BN_ULONG) -> BN_ULONG;
|
||||
pub fn BN_mul_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
|
||||
pub fn BN_add_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
|
||||
pub fn BN_sub_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
|
||||
pub fn BN_set_word(bn: *mut BIGNUM, n: BN_ULONG) -> c_int;
|
||||
|
||||
pub fn BN_cmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
|
||||
pub fn BN_free(bn: *mut BIGNUM);
|
||||
pub fn BN_is_bit_set(a: *const BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_lshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_lshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
|
||||
pub fn BN_exp(r: *mut BIGNUM, a: *const BIGNUM, p: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
|
||||
|
||||
pub fn BN_mod_exp(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
p: *const BIGNUM,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn BN_mask_bits(a: *mut BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_rshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_rshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
|
||||
pub fn BN_bn2hex(a: *const BIGNUM) -> *mut c_char;
|
||||
pub fn BN_bn2dec(a: *const BIGNUM) -> *mut c_char;
|
||||
pub fn BN_hex2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
|
||||
pub fn BN_dec2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
|
||||
pub fn BN_gcd(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
|
||||
pub fn BN_mod_inverse(
|
||||
r: *mut BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
n: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut BIGNUM;
|
||||
pub fn BN_clear(bn: *mut BIGNUM);
|
||||
pub fn BN_dup(n: *const BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_ucmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
|
||||
pub fn BN_set_bit(a: *mut BIGNUM, n: c_int) -> c_int;
|
||||
pub fn BN_clear_bit(a: *mut BIGNUM, n: c_int) -> c_int;
|
||||
|
||||
pub fn BN_generate_prime_ex(
|
||||
r: *mut BIGNUM,
|
||||
bits: c_int,
|
||||
safe: c_int,
|
||||
add: *const BIGNUM,
|
||||
rem: *const BIGNUM,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
pub fn BN_is_prime_ex(
|
||||
p: *const BIGNUM,
|
||||
checks: c_int,
|
||||
ctx: *mut BN_CTX,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
pub fn BN_is_prime_fasttest_ex(
|
||||
p: *const BIGNUM,
|
||||
checks: c_int,
|
||||
ctx: *mut BN_CTX,
|
||||
do_trial_division: c_int,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn BN_get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn BN_get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
pub fn get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
wasm/openssl/vendor/openssl-sys/src/handwritten/cmac.rs
vendored
Normal file
19
wasm/openssl/vendor/openssl-sys/src/handwritten/cmac.rs
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
use crate::libc::*;
|
||||
|
||||
use super::super::*;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn CMAC_CTX_new() -> *mut CMAC_CTX;
|
||||
pub fn CMAC_CTX_free(ctx: *mut CMAC_CTX);
|
||||
pub fn CMAC_Init(
|
||||
ctx: *mut CMAC_CTX,
|
||||
key: *const c_void,
|
||||
len: size_t,
|
||||
cipher: *const EVP_CIPHER,
|
||||
impl_: *mut ENGINE,
|
||||
) -> c_int;
|
||||
pub fn CMAC_Update(ctx: *mut CMAC_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn CMAC_Final(ctx: *mut CMAC_CTX, out: *mut c_uchar, len: *mut size_t) -> c_int;
|
||||
pub fn CMAC_CTX_copy(dst: *mut CMAC_CTX, src: *const CMAC_CTX) -> c_int;
|
||||
}
|
||||
57
wasm/openssl/vendor/openssl-sys/src/handwritten/cms.rs
vendored
Normal file
57
wasm/openssl/vendor/openssl-sys/src/handwritten/cms.rs
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
pub enum CMS_ContentInfo {}
|
||||
|
||||
extern "C" {
|
||||
pub fn CMS_ContentInfo_free(cms: *mut CMS_ContentInfo);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_CMS_ContentInfo(a: #[const_ptr_if(ossl300)] CMS_ContentInfo, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_CMS_ContentInfo(
|
||||
a: *mut *mut CMS_ContentInfo,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut CMS_ContentInfo;
|
||||
|
||||
pub fn SMIME_read_CMS(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut CMS_ContentInfo;
|
||||
|
||||
pub fn CMS_sign(
|
||||
signcert: *mut X509,
|
||||
pkey: *mut EVP_PKEY,
|
||||
certs: *mut stack_st_X509,
|
||||
data: *mut BIO,
|
||||
flags: c_uint,
|
||||
) -> *mut CMS_ContentInfo;
|
||||
|
||||
pub fn CMS_verify(
|
||||
cms: *mut CMS_ContentInfo,
|
||||
certs: *mut stack_st_X509,
|
||||
store: *mut X509_STORE,
|
||||
detached_data: *mut BIO,
|
||||
out: *mut BIO,
|
||||
flags: c_uint,
|
||||
) -> c_int;
|
||||
|
||||
pub fn CMS_encrypt(
|
||||
certs: *mut stack_st_X509,
|
||||
data: *mut BIO,
|
||||
cipher: *const EVP_CIPHER,
|
||||
flags: c_uint,
|
||||
) -> *mut CMS_ContentInfo;
|
||||
|
||||
pub fn CMS_decrypt(
|
||||
cms: *mut CMS_ContentInfo,
|
||||
pkey: *mut EVP_PKEY,
|
||||
cert: *mut X509,
|
||||
dcont: *mut BIO,
|
||||
out: *mut BIO,
|
||||
flags: c_uint,
|
||||
) -> c_int;
|
||||
}
|
||||
13
wasm/openssl/vendor/openssl-sys/src/handwritten/conf.rs
vendored
Normal file
13
wasm/openssl/vendor/openssl-sys/src/handwritten/conf.rs
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
use super::super::*;
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn NCONF_new(meth: #[const_ptr_if(libressl400)] CONF_METHOD) -> *mut CONF;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(libressl400))]
|
||||
pub fn NCONF_default() -> *mut CONF_METHOD;
|
||||
pub fn NCONF_free(conf: *mut CONF);
|
||||
}
|
||||
85
wasm/openssl/vendor/openssl-sys/src/handwritten/crypto.rs
vendored
Normal file
85
wasm/openssl/vendor/openssl-sys/src/handwritten/crypto.rs
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
stack!(stack_st_void);
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn OpenSSL_version_num() -> c_ulong;
|
||||
pub fn OpenSSL_version(key: c_int) -> *const c_char;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn SSLeay() -> c_ulong;
|
||||
pub fn SSLeay_version(key: c_int) -> *const c_char;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn CRYPTO_get_ex_new_index(
|
||||
class_index: c_int,
|
||||
argl: c_long,
|
||||
argp: *mut c_void,
|
||||
new_func: Option<CRYPTO_EX_new>,
|
||||
dup_func: Option<CRYPTO_EX_dup>,
|
||||
free_func: Option<CRYPTO_EX_free>,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn CRYPTO_num_locks() -> c_int;
|
||||
}
|
||||
|
||||
#[allow(clashing_extern_declarations)]
|
||||
extern "C" {
|
||||
#[cfg(not(ossl110))]
|
||||
#[link_name = "CRYPTO_set_locking_callback"]
|
||||
pub fn CRYPTO_set_locking_callback__fixed_rust(
|
||||
func: Option<unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int)>,
|
||||
);
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
#[link_name = "CRYPTO_set_id_callback"]
|
||||
pub fn CRYPTO_set_id_callback__fixed_rust(func: Option<unsafe extern "C" fn() -> c_ulong>);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn CRYPTO_add_lock(
|
||||
pointer: *mut c_int,
|
||||
amount: c_int,
|
||||
type_: c_int,
|
||||
file: *const c_char,
|
||||
line: c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl390))] {
|
||||
extern "C" {
|
||||
pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
|
||||
pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn CRYPTO_malloc(num: c_int, file: *const c_char, line: c_int) -> *mut c_void;
|
||||
pub fn CRYPTO_free(buf: *mut c_void);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(all(ossl102, not(ossl300)))]
|
||||
pub fn FIPS_mode() -> c_int;
|
||||
#[cfg(all(ossl102, not(ossl300)))]
|
||||
pub fn FIPS_mode_set(onoff: c_int) -> c_int;
|
||||
|
||||
pub fn CRYPTO_memcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_LIB_CTX_new() -> *mut OSSL_LIB_CTX;
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_LIB_CTX_free(libcts: *mut OSSL_LIB_CTX);
|
||||
}
|
||||
52
wasm/openssl/vendor/openssl-sys/src/handwritten/decoder.rs
vendored
Normal file
52
wasm/openssl/vendor/openssl-sys/src/handwritten/decoder.rs
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn OSSL_DECODER_CTX_new() -> *mut OSSL_DECODER_CTX;
|
||||
pub fn OSSL_DECODER_CTX_free(ctx: *mut OSSL_DECODER_CTX);
|
||||
|
||||
pub fn OSSL_DECODER_CTX_new_for_pkey(
|
||||
pkey: *mut *mut EVP_PKEY,
|
||||
input_type: *const c_char,
|
||||
input_struct: *const c_char,
|
||||
keytype: *const c_char,
|
||||
selection: c_int,
|
||||
libctx: *mut OSSL_LIB_CTX,
|
||||
propquery: *const c_char,
|
||||
) -> *mut OSSL_DECODER_CTX;
|
||||
|
||||
pub fn OSSL_DECODER_CTX_set_selection(ctx: *mut OSSL_DECODER_CTX, selection: c_int) -> c_int;
|
||||
pub fn OSSL_DECODER_CTX_set_input_type(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
input_type: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn OSSL_DECODER_CTX_set_input_structure(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
input_structure: *const c_char,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OSSL_DECODER_CTX_set_passphrase(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
kstr: *const c_uchar,
|
||||
klen: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_DECODER_CTX_set_pem_password_cb(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
cb: pem_password_cb,
|
||||
cbarg: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn OSSL_DECODER_CTX_set_passphrase_cb(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
cb: OSSL_PASSPHRASE_CALLBACK,
|
||||
cbarg: *mut c_void,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OSSL_DECODER_from_bio(ctx: *mut OSSL_DECODER_CTX, b_in: *mut BIO) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
|
||||
pub fn OSSL_DECODER_from_fp(ctx: *mut OSSL_DECODER_CTX, fp: *mut FILE) -> c_int;
|
||||
pub fn OSSL_DECODER_from_data(
|
||||
ctx: *mut OSSL_DECODER_CTX,
|
||||
pdata: *mut *const c_uchar,
|
||||
pdata_len: *mut size_t,
|
||||
) -> c_int;
|
||||
}
|
||||
59
wasm/openssl/vendor/openssl-sys/src/handwritten/dh.rs
vendored
Normal file
59
wasm/openssl/vendor/openssl-sys/src/handwritten/dh.rs
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
use super::super::*;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set_dh_paramgen_generator(ctx: *mut EVP_PKEY_CTX, gen: c_int) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn DH_new() -> *mut DH;
|
||||
pub fn DH_free(dh: *mut DH);
|
||||
pub fn DH_check(dh: *const DH, codes: *mut c_int) -> c_int;
|
||||
|
||||
#[cfg(not(libressl382))]
|
||||
pub fn DH_generate_parameters(
|
||||
prime_len: c_int,
|
||||
generator: c_int,
|
||||
callback: Option<extern "C" fn(c_int, c_int, *mut c_void)>,
|
||||
cb_arg: *mut c_void,
|
||||
) -> *mut DH;
|
||||
|
||||
pub fn DH_generate_parameters_ex(
|
||||
dh: *mut DH,
|
||||
prime_len: c_int,
|
||||
generator: c_int,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
|
||||
pub fn DH_generate_key(dh: *mut DH) -> c_int;
|
||||
pub fn DH_compute_key(key: *mut c_uchar, pub_key: *const BIGNUM, dh: *mut DH) -> c_int;
|
||||
pub fn DH_size(dh: *const DH) -> c_int;
|
||||
|
||||
pub fn d2i_DHparams(k: *mut *mut DH, pp: *mut *const c_uchar, length: c_long) -> *mut DH;
|
||||
pub fn i2d_DHparams(dh: *const DH, pp: *mut *mut c_uchar) -> c_int;
|
||||
|
||||
#[cfg(ossl102)]
|
||||
pub fn DH_get_1024_160() -> *mut DH;
|
||||
#[cfg(ossl102)]
|
||||
pub fn DH_get_2048_224() -> *mut DH;
|
||||
#[cfg(ossl102)]
|
||||
pub fn DH_get_2048_256() -> *mut DH;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DH_set0_pqg(dh: *mut DH, p: *mut BIGNUM, q: *mut BIGNUM, g: *mut BIGNUM) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DH_get0_pqg(
|
||||
dh: *const DH,
|
||||
p: *mut *const BIGNUM,
|
||||
q: *mut *const BIGNUM,
|
||||
g: *mut *const BIGNUM,
|
||||
);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DH_set0_key(dh: *mut DH, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DH_get0_key(dh: *const DH, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
|
||||
}
|
||||
94
wasm/openssl/vendor/openssl-sys/src/handwritten/dsa.rs
vendored
Normal file
94
wasm/openssl/vendor/openssl-sys/src/handwritten/dsa.rs
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
use crate::libc::*;
|
||||
|
||||
use super::super::*;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx: *mut EVP_PKEY_CTX, nbits: c_int) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum DSA_SIG {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct DSA_SIG {
|
||||
pub r: *mut BIGNUM,
|
||||
pub s: *mut BIGNUM,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn DSA_new() -> *mut DSA;
|
||||
pub fn DSA_free(dsa: *mut DSA);
|
||||
pub fn DSA_up_ref(dsa: *mut DSA) -> c_int;
|
||||
pub fn DSA_size(dsa: *const DSA) -> c_int;
|
||||
pub fn DSA_sign(
|
||||
dummy: c_int,
|
||||
dgst: *const c_uchar,
|
||||
len: c_int,
|
||||
sigret: *mut c_uchar,
|
||||
siglen: *mut c_uint,
|
||||
dsa: *mut DSA,
|
||||
) -> c_int;
|
||||
pub fn DSA_verify(
|
||||
dummy: c_int,
|
||||
dgst: *const c_uchar,
|
||||
len: c_int,
|
||||
sigbuf: *const c_uchar,
|
||||
siglen: c_int,
|
||||
dsa: *mut DSA,
|
||||
) -> c_int;
|
||||
|
||||
pub fn d2i_DSAPublicKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
|
||||
pub fn d2i_DSAPrivateKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long)
|
||||
-> *mut DSA;
|
||||
|
||||
pub fn DSA_generate_parameters_ex(
|
||||
dsa: *mut DSA,
|
||||
bits: c_int,
|
||||
seed: *const c_uchar,
|
||||
seed_len: c_int,
|
||||
counter_ref: *mut c_int,
|
||||
h_ret: *mut c_ulong,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
|
||||
pub fn DSA_generate_key(dsa: *mut DSA) -> c_int;
|
||||
pub fn i2d_DSAPublicKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
|
||||
pub fn i2d_DSAPrivateKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_get0_pqg(
|
||||
d: *const DSA,
|
||||
p: *mut *const BIGNUM,
|
||||
q: *mut *const BIGNUM,
|
||||
q: *mut *const BIGNUM,
|
||||
);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_set0_pqg(d: *mut DSA, p: *mut BIGNUM, q: *mut BIGNUM, q: *mut BIGNUM) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_get0_key(d: *const DSA, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_set0_key(d: *mut DSA, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_DSA_SIG(
|
||||
sig: *mut *mut DSA_SIG,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut DSA_SIG;
|
||||
pub fn i2d_DSA_SIG(a: *const DSA_SIG, pp: *mut *mut c_uchar) -> c_int;
|
||||
|
||||
pub fn DSA_SIG_new() -> *mut DSA_SIG;
|
||||
pub fn DSA_SIG_free(sig: *mut DSA_SIG);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_SIG_get0(sig: *const DSA_SIG, pr: *mut *const BIGNUM, ps: *mut *const BIGNUM);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn DSA_SIG_set0(sig: *mut DSA_SIG, pr: *mut BIGNUM, ps: *mut BIGNUM) -> c_int;
|
||||
}
|
||||
294
wasm/openssl/vendor/openssl-sys/src/handwritten/ec.rs
vendored
Normal file
294
wasm/openssl/vendor/openssl-sys/src/handwritten/ec.rs
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx: *mut EVP_PKEY_CTX, nid: c_int) -> c_int;
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum point_conversion_form_t {
|
||||
POINT_CONVERSION_COMPRESSED = 2,
|
||||
POINT_CONVERSION_UNCOMPRESSED = 4,
|
||||
POINT_CONVERSION_HYBRID = 6,
|
||||
}
|
||||
|
||||
#[cfg(not(any(libressl410, osslconf = "OPENSSL_NO_DEPRECATED_3_0")))]
|
||||
pub enum EC_METHOD {}
|
||||
pub enum EC_GROUP {}
|
||||
pub enum EC_POINT {}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(any(libressl410, osslconf = "OPENSSL_NO_DEPRECATED_3_0")))]
|
||||
pub fn EC_GROUP_new(meth: *const EC_METHOD) -> *mut EC_GROUP;
|
||||
|
||||
pub fn EC_GROUP_dup(group: *const EC_GROUP) -> *mut EC_GROUP;
|
||||
|
||||
pub fn EC_GROUP_free(group: *mut EC_GROUP);
|
||||
|
||||
pub fn EC_GROUP_get_order(
|
||||
group: *const EC_GROUP,
|
||||
order: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_get_cofactor(
|
||||
group: *const EC_GROUP,
|
||||
cofactor: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_get0_generator(group: *const EC_GROUP) -> *const EC_POINT;
|
||||
|
||||
pub fn EC_GROUP_set_generator(
|
||||
group: *mut EC_GROUP,
|
||||
generator: *const EC_POINT,
|
||||
order: *const BIGNUM,
|
||||
cofactor: *const BIGNUM,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_get_curve_name(group: *const EC_GROUP) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_set_asn1_flag(key: *mut EC_GROUP, flag: c_int);
|
||||
|
||||
pub fn EC_GROUP_get_asn1_flag(group: *const EC_GROUP) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn EC_GROUP_order_bits(group: *const EC_GROUP) -> c_int;
|
||||
|
||||
pub fn EC_GROUP_new_curve_GFp(
|
||||
p: *const BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut EC_GROUP;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
|
||||
pub fn EC_GROUP_new_curve_GF2m(
|
||||
p: *const BIGNUM,
|
||||
a: *const BIGNUM,
|
||||
b: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut EC_GROUP;
|
||||
|
||||
pub fn EC_GROUP_new_by_curve_name(nid: c_int) -> *mut EC_GROUP;
|
||||
|
||||
pub fn EC_POINT_is_at_infinity(group: *const EC_GROUP, point: *const EC_POINT) -> c_int;
|
||||
|
||||
pub fn EC_POINT_is_on_curve(
|
||||
group: *const EC_GROUP,
|
||||
point: *const EC_POINT,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_new(group: *const EC_GROUP) -> *mut EC_POINT;
|
||||
|
||||
pub fn EC_POINT_free(point: *mut EC_POINT);
|
||||
|
||||
pub fn EC_POINT_dup(p: *const EC_POINT, group: *const EC_GROUP) -> *mut EC_POINT;
|
||||
|
||||
#[cfg(any(ossl111, boringssl, libressl, awslc))]
|
||||
pub fn EC_POINT_get_affine_coordinates(
|
||||
group: *const EC_GROUP,
|
||||
p: *const EC_POINT,
|
||||
x: *mut BIGNUM,
|
||||
y: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl111, boringssl, libressl, awslc))]
|
||||
pub fn EC_POINT_set_affine_coordinates(
|
||||
group: *const EC_GROUP,
|
||||
p: *mut EC_POINT,
|
||||
x: *const BIGNUM,
|
||||
y: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_point2oct(
|
||||
group: *const EC_GROUP,
|
||||
p: *const EC_POINT,
|
||||
form: point_conversion_form_t,
|
||||
buf: *mut c_uchar,
|
||||
len: size_t,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> size_t;
|
||||
|
||||
pub fn EC_POINT_oct2point(
|
||||
group: *const EC_GROUP,
|
||||
p: *mut EC_POINT,
|
||||
buf: *const c_uchar,
|
||||
len: size_t,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_point2hex(
|
||||
group: *const EC_GROUP,
|
||||
p: *const EC_POINT,
|
||||
form: point_conversion_form_t,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut c_char;
|
||||
|
||||
pub fn EC_POINT_hex2point(
|
||||
group: *const EC_GROUP,
|
||||
s: *const c_char,
|
||||
p: *mut EC_POINT,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> *mut EC_POINT;
|
||||
|
||||
pub fn EC_POINT_add(
|
||||
group: *const EC_GROUP,
|
||||
r: *mut EC_POINT,
|
||||
a: *const EC_POINT,
|
||||
b: *const EC_POINT,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_invert(group: *const EC_GROUP, r: *mut EC_POINT, ctx: *mut BN_CTX) -> c_int;
|
||||
|
||||
pub fn EC_POINT_cmp(
|
||||
group: *const EC_GROUP,
|
||||
a: *const EC_POINT,
|
||||
b: *const EC_POINT,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_mul(
|
||||
group: *const EC_GROUP,
|
||||
r: *mut EC_POINT,
|
||||
n: *const BIGNUM,
|
||||
q: *const EC_POINT,
|
||||
m: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
|
||||
pub fn EC_GF2m_simple_method() -> *const EC_METHOD;
|
||||
|
||||
pub fn EC_GROUP_get_curve_GFp(
|
||||
group: *const EC_GROUP,
|
||||
p: *mut BIGNUM,
|
||||
a: *mut BIGNUM,
|
||||
b: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
|
||||
pub fn EC_GROUP_get_curve_GF2m(
|
||||
group: *const EC_GROUP,
|
||||
p: *mut BIGNUM,
|
||||
a: *mut BIGNUM,
|
||||
b: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_get_affine_coordinates_GFp(
|
||||
group: *const EC_GROUP,
|
||||
p: *const EC_POINT,
|
||||
x: *mut BIGNUM,
|
||||
y: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_POINT_set_affine_coordinates_GFp(
|
||||
group: *const EC_GROUP,
|
||||
p: *mut EC_POINT,
|
||||
x: *const BIGNUM,
|
||||
y: *const BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
|
||||
pub fn EC_POINT_get_affine_coordinates_GF2m(
|
||||
group: *const EC_GROUP,
|
||||
p: *const EC_POINT,
|
||||
x: *mut BIGNUM,
|
||||
y: *mut BIGNUM,
|
||||
ctx: *mut BN_CTX,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EC_KEY_new() -> *mut EC_KEY;
|
||||
|
||||
pub fn EC_KEY_new_by_curve_name(nid: c_int) -> *mut EC_KEY;
|
||||
|
||||
pub fn EC_KEY_free(key: *mut EC_KEY);
|
||||
|
||||
pub fn EC_KEY_dup(key: *const EC_KEY) -> *mut EC_KEY;
|
||||
|
||||
pub fn EC_KEY_up_ref(key: *mut EC_KEY) -> c_int;
|
||||
|
||||
pub fn EC_KEY_get0_group(key: *const EC_KEY) -> *const EC_GROUP;
|
||||
|
||||
pub fn EC_KEY_set_group(key: *mut EC_KEY, group: *const EC_GROUP) -> c_int;
|
||||
|
||||
pub fn EC_KEY_get0_private_key(key: *const EC_KEY) -> *const BIGNUM;
|
||||
|
||||
pub fn EC_KEY_set_private_key(key: *mut EC_KEY, key: *const BIGNUM) -> c_int;
|
||||
|
||||
pub fn EC_KEY_get0_public_key(key: *const EC_KEY) -> *const EC_POINT;
|
||||
|
||||
pub fn EC_KEY_set_public_key(key: *mut EC_KEY, key: *const EC_POINT) -> c_int;
|
||||
|
||||
pub fn EC_KEY_generate_key(key: *mut EC_KEY) -> c_int;
|
||||
|
||||
pub fn EC_KEY_check_key(key: *const EC_KEY) -> c_int;
|
||||
|
||||
pub fn EC_KEY_set_public_key_affine_coordinates(
|
||||
key: *mut EC_KEY,
|
||||
x: *mut BIGNUM,
|
||||
y: *mut BIGNUM,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum ECDSA_SIG {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct ECDSA_SIG {
|
||||
pub r: *mut BIGNUM,
|
||||
pub s: *mut BIGNUM,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn ECDSA_SIG_new() -> *mut ECDSA_SIG;
|
||||
|
||||
pub fn ECDSA_SIG_free(sig: *mut ECDSA_SIG);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn ECDSA_SIG_get0(sig: *const ECDSA_SIG, pr: *mut *const BIGNUM, ps: *mut *const BIGNUM);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn ECDSA_SIG_set0(sig: *mut ECDSA_SIG, pr: *mut BIGNUM, ps: *mut BIGNUM) -> c_int;
|
||||
|
||||
pub fn d2i_ECDSA_SIG(
|
||||
sig: *mut *mut ECDSA_SIG,
|
||||
inp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut ECDSA_SIG;
|
||||
|
||||
pub fn i2d_ECDSA_SIG(sig: *const ECDSA_SIG, out: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn ECDSA_do_sign(
|
||||
dgst: *const c_uchar,
|
||||
dgst_len: c_int,
|
||||
eckey: *mut EC_KEY,
|
||||
) -> *mut ECDSA_SIG;
|
||||
|
||||
pub fn ECDSA_do_verify(
|
||||
dgst: *const c_uchar,
|
||||
dgst_len: c_int,
|
||||
sig: *const ECDSA_SIG,
|
||||
eckey: *mut EC_KEY,
|
||||
) -> c_int;
|
||||
}
|
||||
56
wasm/openssl/vendor/openssl-sys/src/handwritten/encoder.rs
vendored
Normal file
56
wasm/openssl/vendor/openssl-sys/src/handwritten/encoder.rs
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
extern "C" {
|
||||
pub fn OSSL_ENCODER_CTX_new() -> *mut OSSL_ENCODER_CTX;
|
||||
pub fn OSSL_ENCODER_CTX_free(ctx: *mut OSSL_ENCODER_CTX);
|
||||
|
||||
pub fn OSSL_ENCODER_CTX_new_for_pkey(
|
||||
pkey: *const EVP_PKEY,
|
||||
selection: c_int,
|
||||
output_type: *const c_char,
|
||||
output_structure: *const c_char,
|
||||
propquery: *const c_char,
|
||||
) -> *mut OSSL_ENCODER_CTX;
|
||||
|
||||
pub fn OSSL_ENCODER_CTX_set_selection(ctx: *mut OSSL_ENCODER_CTX, selection: c_int) -> c_int;
|
||||
pub fn OSSL_ENCODER_CTX_set_output_type(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
output_type: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn OSSL_ENCODER_CTX_set_output_structure(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
output_structure: *const c_char,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OSSL_ENCODER_CTX_set_cipher(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
cipher_name: *const c_char,
|
||||
propquery: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn OSSL_ENCODER_CTX_set_passphrase(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
kstr: *const c_uchar,
|
||||
klen: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_ENCODER_CTX_set_pem_password_cb(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
cb: pem_password_cb,
|
||||
cbarg: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn OSSL_ENCODER_CTX_set_passphrase_cb(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
cb: OSSL_PASSPHRASE_CALLBACK,
|
||||
cbarg: *mut c_void,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OSSL_ENCODER_to_data(
|
||||
ctx: *mut OSSL_ENCODER_CTX,
|
||||
pdata: *mut *mut c_uchar,
|
||||
pdata_len: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_ENCODER_to_bio(ctx: *mut OSSL_ENCODER_CTX, out: *mut BIO) -> c_int;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
|
||||
pub fn OSSL_ENCODER_to_fp(ctx: *mut OSSL_ENCODER_CTX, fp: *mut FILE) -> c_int;
|
||||
}
|
||||
59
wasm/openssl/vendor/openssl-sys/src/handwritten/err.rs
vendored
Normal file
59
wasm/openssl/vendor/openssl-sys/src/handwritten/err.rs
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct ERR_STRING_DATA {
|
||||
pub error: c_ulong,
|
||||
pub string: *const c_char,
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn ERR_new();
|
||||
pub fn ERR_set_debug(file: *const c_char, line: c_int, func: *const c_char);
|
||||
pub fn ERR_set_error(lib: c_int, reason: c_int, fmt: *const c_char, ...);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn ERR_put_error(lib: c_int, func: c_int, reason: c_int, file: *const c_char, line: c_int);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn ERR_set_error_data(data: *mut c_char, flags: c_int);
|
||||
|
||||
pub fn ERR_get_error() -> c_ulong;
|
||||
#[cfg(ossl300)]
|
||||
pub fn ERR_get_error_all(
|
||||
file: *mut *const c_char,
|
||||
line: *mut c_int,
|
||||
func: *mut *const c_char,
|
||||
data: *mut *const c_char,
|
||||
flags: *mut c_int,
|
||||
) -> c_ulong;
|
||||
pub fn ERR_peek_last_error() -> c_ulong;
|
||||
pub fn ERR_clear_error();
|
||||
pub fn ERR_lib_error_string(err: c_ulong) -> *const c_char;
|
||||
pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char;
|
||||
#[cfg(ossl110)]
|
||||
pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA) -> c_int;
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA);
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn ERR_load_crypto_strings();
|
||||
|
||||
pub fn ERR_get_next_error_library() -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn ERR_get_error_line_data(
|
||||
file: *mut *const c_char,
|
||||
line: *mut c_int,
|
||||
data: *mut *const c_char,
|
||||
flags: *mut c_int,
|
||||
) -> c_ulong;
|
||||
pub fn ERR_func_error_string(err: c_ulong) -> *const c_char;
|
||||
}
|
||||
860
wasm/openssl/vendor/openssl-sys/src/handwritten/evp.rs
vendored
Normal file
860
wasm/openssl/vendor/openssl-sys/src/handwritten/evp.rs
vendored
Normal file
@@ -0,0 +1,860 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_MD_get_block_size(md: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_MD_get_size(md: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_MD_get_type(md: *const EVP_MD) -> c_int;
|
||||
|
||||
pub fn EVP_MD_CTX_get0_md(ctx: *const EVP_MD_CTX) -> *const EVP_MD;
|
||||
|
||||
pub fn EVP_CIPHER_get_key_length(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_get_block_size(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_get_iv_length(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_get_nid(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_fetch(
|
||||
ctx: *mut OSSL_LIB_CTX,
|
||||
algorithm: *const c_char,
|
||||
properties: *const c_char,
|
||||
) -> *mut EVP_CIPHER;
|
||||
pub fn EVP_CIPHER_free(cipher: *mut EVP_CIPHER);
|
||||
|
||||
pub fn EVP_CIPHER_CTX_get0_cipher(ctx: *const EVP_CIPHER_CTX) -> *const EVP_CIPHER;
|
||||
pub fn EVP_CIPHER_CTX_get_block_size(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_get_key_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_get_iv_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_get_tag_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_get_num(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn EVP_MD_block_size(md: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_MD_size(md: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_MD_type(md: *const EVP_MD) -> c_int;
|
||||
|
||||
pub fn EVP_MD_CTX_md(ctx: *const EVP_MD_CTX) -> *const EVP_MD;
|
||||
|
||||
pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int;
|
||||
pub fn EVP_CIPHER_nid(cipher: *const EVP_CIPHER) -> c_int;
|
||||
|
||||
pub fn EVP_CIPHER_CTX_cipher(ctx: *const EVP_CIPHER_CTX) -> *const EVP_CIPHER;
|
||||
pub fn EVP_CIPHER_CTX_block_size(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_key_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_iv_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_CIPHER_CTX_num(ctx: *const EVP_CIPHER_CTX) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl382))] {
|
||||
extern "C" {
|
||||
pub fn EVP_MD_CTX_new() -> *mut EVP_MD_CTX;
|
||||
pub fn EVP_MD_CTX_free(ctx: *mut EVP_MD_CTX);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn EVP_MD_CTX_create() -> *mut EVP_MD_CTX;
|
||||
pub fn EVP_MD_CTX_destroy(ctx: *mut EVP_MD_CTX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_default_properties_is_fips_enabled(libctx: *mut OSSL_LIB_CTX) -> c_int;
|
||||
pub fn EVP_default_properties_enable_fips(libctx: *mut OSSL_LIB_CTX, enable: c_int) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn EVP_DigestInit_ex(ctx: *mut EVP_MD_CTX, typ: *const EVP_MD, imple: *mut ENGINE)
|
||||
-> c_int;
|
||||
pub fn EVP_DigestUpdate(ctx: *mut EVP_MD_CTX, data: *const c_void, n: size_t) -> c_int;
|
||||
pub fn EVP_DigestFinal_ex(ctx: *mut EVP_MD_CTX, res: *mut u8, n: *mut u32) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_Q_digest(
|
||||
libctx: *mut OSSL_LIB_CTX,
|
||||
name: *const c_char,
|
||||
propq: *const c_char,
|
||||
data: *const c_void,
|
||||
count: size_t,
|
||||
md: *mut c_uchar,
|
||||
size: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_DigestInit(ctx: *mut EVP_MD_CTX, typ: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_DigestFinal(ctx: *mut EVP_MD_CTX, res: *mut u8, n: *mut u32) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_DigestFinalXOF(ctx: *mut EVP_MD_CTX, res: *mut u8, len: usize) -> c_int;
|
||||
#[cfg(any(ossl330, awslc))]
|
||||
pub fn EVP_DigestSqueeze(ctx: *mut EVP_MD_CTX, res: *mut u8, len: usize) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_MD_fetch(
|
||||
ctx: *mut OSSL_LIB_CTX,
|
||||
algorithm: *const c_char,
|
||||
properties: *const c_char,
|
||||
) -> *mut EVP_MD;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_MD_free(md: *mut EVP_MD);
|
||||
|
||||
pub fn EVP_BytesToKey(
|
||||
typ: *const EVP_CIPHER,
|
||||
md: *const EVP_MD,
|
||||
salt: *const u8,
|
||||
data: *const u8,
|
||||
datalen: c_int,
|
||||
count: c_int,
|
||||
key: *mut u8,
|
||||
iv: *mut u8,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_CipherInit(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
evp: *const EVP_CIPHER,
|
||||
key: *const u8,
|
||||
iv: *const u8,
|
||||
mode: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_CipherInit_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
type_: *const EVP_CIPHER,
|
||||
impl_: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
iv: *const c_uchar,
|
||||
enc: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_CipherUpdate(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
outbuf: *mut u8,
|
||||
outlen: *mut c_int,
|
||||
inbuf: *const u8,
|
||||
inlen: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_CipherFinal(ctx: *mut EVP_CIPHER_CTX, res: *mut u8, len: *mut c_int) -> c_int;
|
||||
|
||||
pub fn EVP_DigestSignInit(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
pctx: *mut *mut EVP_PKEY_CTX,
|
||||
type_: *const EVP_MD,
|
||||
e: *mut ENGINE,
|
||||
pkey: *mut EVP_PKEY,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_DigestSignUpdate(ctx: *mut EVP_MD_CTX, data: *const c_void, dsize: size_t) -> c_int;
|
||||
pub fn EVP_DigestSignFinal(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
sig: *mut c_uchar,
|
||||
siglen: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_DigestVerifyInit(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
pctx: *mut *mut EVP_PKEY_CTX,
|
||||
type_: *const EVP_MD,
|
||||
e: *mut ENGINE,
|
||||
pkey: *mut EVP_PKEY,
|
||||
) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_DigestVerifyUpdate(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
data: *const c_void,
|
||||
dsize: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_DigestVerifyFinal(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
sigret: *const c_uchar,
|
||||
siglen: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_SealInit(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
type_: *const EVP_CIPHER,
|
||||
ek: *mut *mut c_uchar,
|
||||
ekl: *mut c_int,
|
||||
iv: *mut c_uchar,
|
||||
pubk: *mut *mut EVP_PKEY,
|
||||
npubk: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_SealFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
|
||||
pub fn EVP_EncryptInit_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
cipher: *const EVP_CIPHER,
|
||||
impl_: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
iv: *const c_uchar,
|
||||
) -> c_int;
|
||||
pub fn EVP_EncryptUpdate(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
out: *mut c_uchar,
|
||||
outl: *mut c_int,
|
||||
in_: *const u8,
|
||||
inl: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_EncryptFinal_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
out: *mut c_uchar,
|
||||
outl: *mut c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_OpenInit(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
type_: *const EVP_CIPHER,
|
||||
ek: *const c_uchar,
|
||||
ekl: c_int,
|
||||
iv: *const c_uchar,
|
||||
priv_: *mut EVP_PKEY,
|
||||
) -> c_int;
|
||||
pub fn EVP_OpenFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
|
||||
pub fn EVP_DecryptInit_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
cipher: *const EVP_CIPHER,
|
||||
impl_: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
iv: *const c_uchar,
|
||||
) -> c_int;
|
||||
pub fn EVP_DecryptUpdate(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
out: *mut c_uchar,
|
||||
outl: *mut c_int,
|
||||
in_: *const u8,
|
||||
inl: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_DecryptFinal_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
outm: *mut c_uchar,
|
||||
outl: *mut c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_get_size(pkey: *const EVP_PKEY) -> c_int;
|
||||
}
|
||||
} else {
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_size(pkey: #[const_ptr_if(any(ossl111b, libressl))] EVP_PKEY) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl111, libressl370))] {
|
||||
extern "C" {
|
||||
pub fn EVP_DigestSign(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
sigret: *mut c_uchar,
|
||||
siglen: *mut size_t,
|
||||
tbs: *const c_uchar,
|
||||
tbslen: size_t
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_DigestVerify(
|
||||
ctx: *mut EVP_MD_CTX,
|
||||
sigret: *const c_uchar,
|
||||
siglen: size_t,
|
||||
tbs: *const c_uchar,
|
||||
tbslen: size_t
|
||||
) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn EVP_CIPHER_CTX_new() -> *mut EVP_CIPHER_CTX;
|
||||
pub fn EVP_CIPHER_CTX_free(ctx: *mut EVP_CIPHER_CTX);
|
||||
pub fn EVP_CIPHER_CTX_copy(dst: *mut EVP_CIPHER_CTX, src: *const EVP_CIPHER_CTX) -> c_int;
|
||||
|
||||
pub fn EVP_MD_CTX_copy_ex(dst: *mut EVP_MD_CTX, src: *const EVP_MD_CTX) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_MD_CTX_reset(ctx: *mut EVP_MD_CTX) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_set_key_length(ctx: *mut EVP_CIPHER_CTX, keylen: c_int) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_set_padding(ctx: *mut EVP_CIPHER_CTX, padding: c_int) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_ctrl(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
type_: c_int,
|
||||
arg: c_int,
|
||||
ptr: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_rand_key(ctx: *mut EVP_CIPHER_CTX, key: *mut c_uchar) -> c_int;
|
||||
pub fn EVP_CIPHER_CTX_set_flags(ctx: *mut EVP_CIPHER_CTX, flags: c_int);
|
||||
|
||||
pub fn EVP_md_null() -> *const EVP_MD;
|
||||
pub fn EVP_md5() -> *const EVP_MD;
|
||||
pub fn EVP_sha1() -> *const EVP_MD;
|
||||
pub fn EVP_sha224() -> *const EVP_MD;
|
||||
pub fn EVP_sha256() -> *const EVP_MD;
|
||||
pub fn EVP_sha384() -> *const EVP_MD;
|
||||
pub fn EVP_sha512() -> *const EVP_MD;
|
||||
#[cfg(any(ossl111, libressl380))]
|
||||
pub fn EVP_sha3_224() -> *const EVP_MD;
|
||||
#[cfg(any(ossl111, libressl380))]
|
||||
pub fn EVP_sha3_256() -> *const EVP_MD;
|
||||
#[cfg(any(ossl111, libressl380))]
|
||||
pub fn EVP_sha3_384() -> *const EVP_MD;
|
||||
#[cfg(any(ossl111, libressl380))]
|
||||
pub fn EVP_sha3_512() -> *const EVP_MD;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_shake128() -> *const EVP_MD;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_shake256() -> *const EVP_MD;
|
||||
pub fn EVP_ripemd160() -> *const EVP_MD;
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM3")))]
|
||||
pub fn EVP_sm3() -> *const EVP_MD;
|
||||
pub fn EVP_des_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3_cfb64() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3_cfb8() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_ede3_ofb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_des_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
|
||||
pub fn EVP_rc4() -> *const EVP_CIPHER;
|
||||
pub fn EVP_bf_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_bf_cbc() -> *const EVP_CIPHER;
|
||||
pub fn EVP_bf_cfb64() -> *const EVP_CIPHER;
|
||||
pub fn EVP_bf_ofb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_cbc() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_cfb1() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_cfb8() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_cfb128() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_ctr() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_xts() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_128_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_128_ocb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl102)]
|
||||
pub fn EVP_aes_128_wrap() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_128_wrap_pad() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_cbc() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_cfb1() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_cfb8() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_cfb128() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_ctr() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_ccm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_gcm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_192_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_192_ocb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl102)]
|
||||
pub fn EVP_aes_192_wrap() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_192_wrap_pad() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_ecb() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_cbc() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_cfb8() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_cfb128() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_ctr() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_xts() -> *const EVP_CIPHER;
|
||||
pub fn EVP_aes_256_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_256_ocb() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl102)]
|
||||
pub fn EVP_aes_256_wrap() -> *const EVP_CIPHER;
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_aes_256_wrap_pad() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl110, libressl), not(osslconf = "OPENSSL_NO_CHACHA")))]
|
||||
pub fn EVP_chacha20() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
|
||||
pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
|
||||
pub fn EVP_seed_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
|
||||
pub fn EVP_seed_cfb128() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
|
||||
pub fn EVP_seed_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
|
||||
pub fn EVP_seed_ofb() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM4")))]
|
||||
pub fn EVP_sm4_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM4")))]
|
||||
pub fn EVP_sm4_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM4")))]
|
||||
pub fn EVP_sm4_cfb128() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM4")))]
|
||||
pub fn EVP_sm4_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(all(any(ossl111, libressl), not(osslconf = "OPENSSL_NO_SM4")))]
|
||||
pub fn EVP_sm4_ctr() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_128_cfb128() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_128_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_128_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_128_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_192_cfb128() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_192_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_192_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_192_ofb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_256_cfb128() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_256_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_256_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
|
||||
pub fn EVP_camellia_256_ofb() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
|
||||
pub fn EVP_cast5_cfb64() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
|
||||
pub fn EVP_cast5_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
|
||||
pub fn EVP_cast5_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
|
||||
pub fn EVP_cast5_ofb() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
|
||||
pub fn EVP_idea_cfb64() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
|
||||
pub fn EVP_idea_ecb() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
|
||||
pub fn EVP_idea_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
|
||||
pub fn EVP_idea_ofb() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
|
||||
pub fn EVP_rc2_cbc() -> *const EVP_CIPHER;
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
|
||||
pub fn EVP_rc2_40_cbc() -> *const EVP_CIPHER;
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn OPENSSL_add_all_algorithms_noconf();
|
||||
|
||||
pub fn EVP_get_digestbyname(name: *const c_char) -> *const EVP_MD;
|
||||
pub fn EVP_get_cipherbyname(name: *const c_char) -> *const EVP_CIPHER;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_get_id(pkey: *const EVP_PKEY) -> c_int;
|
||||
pub fn EVP_PKEY_get_bits(key: *const EVP_PKEY) -> c_int;
|
||||
pub fn EVP_PKEY_get_security_bits(key: *const EVP_PKEY) -> c_int;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_id(pkey: *const EVP_PKEY) -> c_int;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_bits(key: #[const_ptr_if(any(ossl110, libressl))] EVP_PKEY) -> c_int;
|
||||
#[cfg(any(ossl110, libressl360))]
|
||||
pub fn EVP_PKEY_security_bits(pkey: #[const_ptr_if(any(ossl110, libressl))] EVP_PKEY) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_get1_RSA(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut RSA;
|
||||
pub fn EVP_PKEY_get1_DSA(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut DSA;
|
||||
pub fn EVP_PKEY_get1_DH(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut DH;
|
||||
pub fn EVP_PKEY_get1_EC_KEY(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut EC_KEY;
|
||||
}
|
||||
}
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_assign(pkey: *mut EVP_PKEY, typ: c_int, key: *mut c_void) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_set1_RSA(k: *mut EVP_PKEY, r: *mut RSA) -> c_int;
|
||||
pub fn EVP_PKEY_set1_DSA(k: *mut EVP_PKEY, k: *mut DSA) -> c_int;
|
||||
pub fn EVP_PKEY_set1_DH(k: *mut EVP_PKEY, k: *mut DH) -> c_int;
|
||||
pub fn EVP_PKEY_set1_EC_KEY(k: *mut EVP_PKEY, k: *mut EC_KEY) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_cmp(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_new() -> *mut EVP_PKEY;
|
||||
pub fn EVP_PKEY_free(k: *mut EVP_PKEY);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn EVP_PKEY_up_ref(pkey: *mut EVP_PKEY) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_fromdata_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_fromdata(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
ppkey: *mut *mut EVP_PKEY,
|
||||
selection: c_int,
|
||||
param: *mut OSSL_PARAM,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_todata(
|
||||
ppkey: *const EVP_PKEY,
|
||||
selection: c_int,
|
||||
param: *mut *mut OSSL_PARAM,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_generate(ctx: *mut EVP_PKEY_CTX, k: *mut *mut EVP_PKEY) -> c_int;
|
||||
|
||||
pub fn d2i_AutoPrivateKey(
|
||||
a: *mut *mut EVP_PKEY,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut EVP_PKEY;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_eq(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_parameters_eq(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_copy_parameters(to: *mut EVP_PKEY, from: *const EVP_PKEY) -> c_int;
|
||||
|
||||
pub fn PKCS5_PBKDF2_HMAC_SHA1(
|
||||
pass: *const c_char,
|
||||
passlen: c_int,
|
||||
salt: *const u8,
|
||||
saltlen: c_int,
|
||||
iter: c_int,
|
||||
keylen: c_int,
|
||||
out: *mut u8,
|
||||
) -> c_int;
|
||||
pub fn PKCS5_PBKDF2_HMAC(
|
||||
pass: *const c_char,
|
||||
passlen: c_int,
|
||||
salt: *const c_uchar,
|
||||
saltlen: c_int,
|
||||
iter: c_int,
|
||||
digest: *const EVP_MD,
|
||||
keylen: c_int,
|
||||
out: *mut u8,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl110)]
|
||||
pub fn EVP_PBE_scrypt(
|
||||
pass: *const c_char,
|
||||
passlen: size_t,
|
||||
salt: *const c_uchar,
|
||||
saltlen: size_t,
|
||||
N: u64,
|
||||
r: u64,
|
||||
p: u64,
|
||||
maxmem: u64,
|
||||
key: *mut c_uchar,
|
||||
keylen: size_t,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_CTX_new(k: *mut EVP_PKEY, e: *mut ENGINE) -> *mut EVP_PKEY_CTX;
|
||||
pub fn EVP_PKEY_CTX_new_id(id: c_int, e: *mut ENGINE) -> *mut EVP_PKEY_CTX;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_CTX_new_from_name(
|
||||
libctx: *mut OSSL_LIB_CTX,
|
||||
name: *const c_char,
|
||||
propquery: *const c_char,
|
||||
) -> *mut EVP_PKEY_CTX;
|
||||
pub fn EVP_PKEY_CTX_free(ctx: *mut EVP_PKEY_CTX);
|
||||
|
||||
pub fn EVP_PKEY_CTX_ctrl(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
keytype: c_int,
|
||||
optype: c_int,
|
||||
cmd: c_int,
|
||||
p1: c_int,
|
||||
p2: *mut c_void,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_CTX_set_signature_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_CTX_set_params(ctx: *mut EVP_PKEY_CTX, params: *const OSSL_PARAM) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_CTX_get_params(ctx: *mut EVP_PKEY_CTX, params: *mut OSSL_PARAM) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_new_mac_key(
|
||||
type_: c_int,
|
||||
e: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
keylen: c_int,
|
||||
) -> *mut EVP_PKEY;
|
||||
|
||||
pub fn EVP_PKEY_derive_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_derive_set_peer(ctx: *mut EVP_PKEY_CTX, peer: *mut EVP_PKEY) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_derive_set_peer_ex(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
peer: *mut EVP_PKEY,
|
||||
validate_peer: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_derive(ctx: *mut EVP_PKEY_CTX, key: *mut c_uchar, size: *mut size_t) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_Q_keygen(
|
||||
libctx: *mut OSSL_LIB_CTX,
|
||||
propq: *const c_char,
|
||||
type_: *const c_char,
|
||||
...
|
||||
) -> *mut EVP_PKEY;
|
||||
pub fn EVP_PKEY_keygen_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_paramgen_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_keygen(ctx: *mut EVP_PKEY_CTX, key: *mut *mut EVP_PKEY) -> c_int;
|
||||
pub fn EVP_PKEY_paramgen(ctx: *mut EVP_PKEY_CTX, key: *mut *mut EVP_PKEY) -> c_int;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_PKEY_param_check(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_PKEY_public_check(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn EVP_PKEY_check(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_sign_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
|
||||
#[cfg(ossl340)]
|
||||
pub fn EVP_PKEY_sign_message_init(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
algo: *mut EVP_SIGNATURE,
|
||||
params: *const OSSL_PARAM,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_sign(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
sig: *mut c_uchar,
|
||||
siglen: *mut size_t,
|
||||
tbs: *const c_uchar,
|
||||
tbslen: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_verify_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
|
||||
#[cfg(ossl340)]
|
||||
pub fn EVP_PKEY_verify_message_init(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
algo: *mut EVP_SIGNATURE,
|
||||
params: *const OSSL_PARAM,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_verify(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
sig: *const c_uchar,
|
||||
siglen: size_t,
|
||||
tbs: *const c_uchar,
|
||||
tbslen: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_encrypt_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_encrypt(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
pout: *mut c_uchar,
|
||||
poutlen: *mut size_t,
|
||||
pin: *const c_uchar,
|
||||
pinlen: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_decrypt_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_decrypt(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
pout: *mut c_uchar,
|
||||
poutlen: *mut size_t,
|
||||
pin: *const c_uchar,
|
||||
pinlen: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_verify_recover_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
|
||||
pub fn EVP_PKEY_verify_recover(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
rout: *mut c_uchar,
|
||||
routlen: *mut size_t,
|
||||
sig: *const c_uchar,
|
||||
siglen: size_t,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_encapsulate_init(ctx: *mut EVP_PKEY_CTX, params: *const OSSL_PARAM) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_encapsulate(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
wrappedkey: *mut c_uchar,
|
||||
wrappedkeylen: *mut size_t,
|
||||
genkey: *mut c_uchar,
|
||||
genkeylen: *mut size_t,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_decapsulate_init(ctx: *mut EVP_PKEY_CTX, params: *const OSSL_PARAM) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn EVP_PKEY_decapsulate(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
genkey: *mut c_uchar,
|
||||
genkeylen: *mut size_t,
|
||||
wrappedkey: *const c_uchar,
|
||||
wrappedkeylen: size_t,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn EVP_PKCS82PKEY(p8: #[const_ptr_if(any(ossl110, libressl))] PKCS8_PRIV_KEY_INFO) -> *mut EVP_PKEY;
|
||||
pub fn EVP_PKEY2PKCS8(pkey: #[const_ptr_if(any(ossl300))] EVP_PKEY) -> *mut PKCS8_PRIV_KEY_INFO;
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl111, libressl370))] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_get_raw_public_key(
|
||||
pkey: *const EVP_PKEY,
|
||||
ppub: *mut c_uchar,
|
||||
len: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_new_raw_public_key(
|
||||
ttype: c_int,
|
||||
e: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
keylen: size_t,
|
||||
) -> *mut EVP_PKEY;
|
||||
pub fn EVP_PKEY_get_raw_private_key(
|
||||
pkey: *const EVP_PKEY,
|
||||
ppriv: *mut c_uchar,
|
||||
len: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_new_raw_private_key(
|
||||
ttype: c_int,
|
||||
e: *mut ENGINE,
|
||||
key: *const c_uchar,
|
||||
keylen: size_t,
|
||||
) -> *mut EVP_PKEY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn EVP_EncodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
|
||||
pub fn EVP_DecodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_gettable_params(pkey: *const EVP_PKEY) -> *const OSSL_PARAM;
|
||||
pub fn EVP_PKEY_get_params(pkey: *const EVP_PKEY, params: *mut OSSL_PARAM) -> c_int;
|
||||
pub fn EVP_PKEY_get_int_param(
|
||||
pkey: *const EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
out: *mut c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_get_size_t_param(
|
||||
pkey: *const EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
out: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_get_bn_param(
|
||||
pkey: *const EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
out: *mut *mut BIGNUM,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_get_utf8_string_param(
|
||||
pkey: *const EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
str: *mut c_char,
|
||||
max_buf_sz: size_t,
|
||||
out_len: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_get_octet_string_param(
|
||||
pkey: *const EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
buf: *mut c_uchar,
|
||||
max_buf_sz: size_t,
|
||||
out_len: *mut size_t,
|
||||
) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_settable_params(pkey: *const EVP_PKEY) -> *const OSSL_PARAM;
|
||||
pub fn EVP_PKEY_set_params(pkey: *mut EVP_PKEY, params: *mut OSSL_PARAM) -> c_int;
|
||||
pub fn EVP_PKEY_set_int_param(
|
||||
pkey: *mut EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
in_val: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_set_size_t_param(
|
||||
pkey: *mut EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
in_val: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_set_bn_param(
|
||||
pkey: *mut EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
bn: *const BIGNUM,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_set_utf8_string_param(
|
||||
pkey: *mut EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
str: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_set_octet_string_param(
|
||||
pkey: *mut EVP_PKEY,
|
||||
key_name: *const c_char,
|
||||
buf: *const c_uchar,
|
||||
bsize: size_t,
|
||||
) -> c_int;
|
||||
pub fn EVP_SIGNATURE_free(s: *mut EVP_SIGNATURE);
|
||||
pub fn EVP_SIGNATURE_up_ref(s: *mut EVP_SIGNATURE) -> c_int;
|
||||
pub fn EVP_SIGNATURE_fetch(ctx: *mut OSSL_LIB_CTX,
|
||||
algorithm: *const c_char,
|
||||
properties: *const c_char)
|
||||
-> *mut EVP_SIGNATURE;
|
||||
pub fn EVP_SIGNATURE_get0_name(s: *const EVP_SIGNATURE) -> *const c_char;
|
||||
pub fn EVP_SIGNATURE_get0_description(s: *const EVP_SIGNATURE) -> *const c_char;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_MAC_fetch(libctx: *mut OSSL_LIB_CTX, algorithm: *const c_char, properties: *const c_char) -> *mut EVP_MAC;
|
||||
pub fn EVP_MAC_up_ref(mac: *mut EVP_MAC) -> c_int;
|
||||
pub fn EVP_MAC_free(mac: *mut EVP_MAC);
|
||||
pub fn EVP_MAC_is_a(mac: *const EVP_MAC, name: *const c_char) -> c_int;
|
||||
pub fn EVP_MAC_get0_name(mac: *const EVP_MAC) -> *const c_char;
|
||||
pub fn EVP_MAC_get0_description(mac: *const EVP_MAC) -> *const c_char;
|
||||
pub fn EVP_MAC_get0_provider(mac: *const EVP_MAC) -> *const OSSL_PROVIDER;
|
||||
pub fn EVP_MAC_get_params(mac: *mut EVP_MAC, params: *mut OSSL_PARAM) -> c_int;
|
||||
|
||||
pub fn EVP_MAC_CTX_new(mac: *mut EVP_MAC) -> *mut EVP_MAC_CTX;
|
||||
pub fn EVP_MAC_CTX_free(ctx: *mut EVP_MAC_CTX);
|
||||
pub fn EVP_MAC_CTX_dup(src: *const EVP_MAC_CTX) -> *mut EVP_MAC_CTX;
|
||||
pub fn EVP_MAC_CTX_get0_mac(ctx: *mut EVP_MAC_CTX) -> *mut EVP_MAC;
|
||||
pub fn EVP_MAC_CTX_get_params(ctx: *mut EVP_MAC_CTX, params: *mut OSSL_PARAM) -> c_int;
|
||||
pub fn EVP_MAC_CTX_set_params(ctx: *mut EVP_MAC_CTX, params: *const OSSL_PARAM) -> c_int;
|
||||
|
||||
pub fn EVP_MAC_CTX_get_mac_size(ctx: *mut EVP_MAC_CTX) -> size_t;
|
||||
pub fn EVP_MAC_CTX_get_block_size(ctx: *mut EVP_MAC_CTX) -> size_t;
|
||||
|
||||
pub fn EVP_MAC_init(ctx: *mut EVP_MAC_CTX, key: *const c_uchar, keylen: size_t, params: *const OSSL_PARAM) -> c_int;
|
||||
pub fn EVP_MAC_update(ctx: *mut EVP_MAC_CTX, data: *const c_uchar, datalen: size_t) -> c_int;
|
||||
pub fn EVP_MAC_final(ctx: *mut EVP_MAC_CTX, out: *mut c_uchar, outl: *mut size_t, outsize: size_t) -> c_int;
|
||||
pub fn EVP_MAC_finalXOF(ctx: *mut EVP_MAC_CTX, out: *mut c_uchar, outsize: size_t) -> c_int;
|
||||
|
||||
pub fn EVP_MAC_gettable_params(mac: *const EVP_MAC) -> *const OSSL_PARAM;
|
||||
pub fn EVP_MAC_gettable_ctx_params(mac: *const EVP_MAC) -> *const OSSL_PARAM;
|
||||
pub fn EVP_MAC_settable_ctx_params(mac: *const EVP_MAC) -> *const OSSL_PARAM;
|
||||
pub fn EVP_MAC_CTX_gettable_params(ctx: *mut EVP_MAC_CTX) -> *const OSSL_PARAM;
|
||||
pub fn EVP_MAC_CTX_settable_params(ctx: *mut EVP_MAC_CTX) -> *const OSSL_PARAM;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
wasm/openssl/vendor/openssl-sys/src/handwritten/hmac.rs
vendored
Normal file
32
wasm/openssl/vendor/openssl-sys/src/handwritten/hmac.rs
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
use crate::libc::*;
|
||||
|
||||
use super::super::*;
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn HMAC_CTX_new() -> *mut HMAC_CTX;
|
||||
pub fn HMAC_CTX_free(ctx: *mut HMAC_CTX);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn HMAC_CTX_init(ctx: *mut HMAC_CTX);
|
||||
pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn HMAC_Init_ex(
|
||||
ctx: *mut HMAC_CTX,
|
||||
key: *const c_void,
|
||||
len: c_int,
|
||||
md: *const EVP_MD,
|
||||
impl_: *mut ENGINE,
|
||||
) -> c_int;
|
||||
pub fn HMAC_Update(ctx: *mut HMAC_CTX, data: *const c_uchar, len: size_t) -> c_int;
|
||||
pub fn HMAC_Final(ctx: *mut HMAC_CTX, md: *mut c_uchar, len: *mut c_uint) -> c_int;
|
||||
pub fn HMAC_CTX_copy(dst: *mut HMAC_CTX, src: *mut HMAC_CTX) -> c_int;
|
||||
}
|
||||
34
wasm/openssl/vendor/openssl-sys/src/handwritten/kdf.rs
vendored
Normal file
34
wasm/openssl/vendor/openssl-sys/src/handwritten/kdf.rs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_CTX_set_hkdf_mode(ctx: *mut EVP_PKEY_CTX, mode: c_int) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set_hkdf_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set1_hkdf_salt(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
salt: *const u8,
|
||||
saltlen: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set1_hkdf_key(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
key: *const u8,
|
||||
keylen: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_add1_hkdf_info(
|
||||
ctx: *mut EVP_PKEY_CTX,
|
||||
info: *const u8,
|
||||
infolen: c_int,
|
||||
) -> c_int;
|
||||
pub fn EVP_KDF_CTX_new(kdf: *mut EVP_KDF) -> *mut EVP_KDF_CTX;
|
||||
pub fn EVP_KDF_CTX_free(ctx: *mut EVP_KDF_CTX);
|
||||
pub fn EVP_KDF_CTX_reset(ctx: *mut EVP_KDF_CTX);
|
||||
pub fn EVP_KDF_CTX_get_kdf_size(ctx: *mut EVP_KDF_CTX) -> size_t;
|
||||
pub fn EVP_KDF_derive(ctx: *mut EVP_KDF_CTX, key: *mut u8, keylen: size_t, params: *const OSSL_PARAM) -> c_int;
|
||||
pub fn EVP_KDF_fetch(ctx: *mut OSSL_LIB_CTX, algorithm: *const c_char, properties: *const c_char) -> *mut EVP_KDF;
|
||||
pub fn EVP_KDF_free(kdf: *mut EVP_KDF);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
87
wasm/openssl/vendor/openssl-sys/src/handwritten/mod.rs
vendored
Normal file
87
wasm/openssl/vendor/openssl-sys/src/handwritten/mod.rs
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
pub use self::aes::*;
|
||||
pub use self::asn1::*;
|
||||
pub use self::bio::*;
|
||||
pub use self::bn::*;
|
||||
pub use self::cmac::*;
|
||||
pub use self::cms::*;
|
||||
pub use self::conf::*;
|
||||
pub use self::crypto::*;
|
||||
#[cfg(ossl300)]
|
||||
pub use self::decoder::*;
|
||||
pub use self::dh::*;
|
||||
pub use self::dsa::*;
|
||||
pub use self::ec::*;
|
||||
#[cfg(ossl300)]
|
||||
pub use self::encoder::*;
|
||||
pub use self::err::*;
|
||||
pub use self::evp::*;
|
||||
pub use self::hmac::*;
|
||||
pub use self::kdf::*;
|
||||
pub use self::object::*;
|
||||
pub use self::ocsp::*;
|
||||
#[cfg(ossl300)]
|
||||
pub use self::params::*;
|
||||
pub use self::pem::*;
|
||||
pub use self::pkcs12::*;
|
||||
pub use self::pkcs7::*;
|
||||
#[cfg(libressl)]
|
||||
pub use self::poly1305::*;
|
||||
pub use self::provider::*;
|
||||
pub use self::rand::*;
|
||||
pub use self::rsa::*;
|
||||
pub use self::safestack::*;
|
||||
pub use self::sha::*;
|
||||
pub use self::srtp::*;
|
||||
pub use self::ssl::*;
|
||||
pub use self::stack::*;
|
||||
#[cfg(ossl320)]
|
||||
pub use self::thread::*;
|
||||
pub use self::tls1::*;
|
||||
pub use self::types::*;
|
||||
pub use self::x509::*;
|
||||
pub use self::x509_vfy::*;
|
||||
pub use self::x509v3::*;
|
||||
|
||||
mod aes;
|
||||
mod asn1;
|
||||
mod bio;
|
||||
mod bn;
|
||||
mod cmac;
|
||||
mod cms;
|
||||
mod conf;
|
||||
mod crypto;
|
||||
#[cfg(ossl300)]
|
||||
mod decoder;
|
||||
mod dh;
|
||||
mod dsa;
|
||||
mod ec;
|
||||
#[cfg(ossl300)]
|
||||
mod encoder;
|
||||
mod err;
|
||||
mod evp;
|
||||
mod hmac;
|
||||
mod kdf;
|
||||
mod object;
|
||||
mod ocsp;
|
||||
#[cfg(ossl300)]
|
||||
mod params;
|
||||
mod pem;
|
||||
mod pkcs12;
|
||||
mod pkcs7;
|
||||
#[cfg(libressl)]
|
||||
mod poly1305;
|
||||
mod provider;
|
||||
mod rand;
|
||||
mod rsa;
|
||||
mod safestack;
|
||||
mod sha;
|
||||
mod srtp;
|
||||
mod ssl;
|
||||
mod stack;
|
||||
#[cfg(ossl320)]
|
||||
mod thread;
|
||||
mod tls1;
|
||||
mod types;
|
||||
mod x509;
|
||||
mod x509_vfy;
|
||||
mod x509v3;
|
||||
31
wasm/openssl/vendor/openssl-sys/src/handwritten/object.rs
vendored
Normal file
31
wasm/openssl/vendor/openssl-sys/src/handwritten/object.rs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
use crate::libc::*;
|
||||
|
||||
use super::super::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn OBJ_nid2ln(nid: c_int) -> *const c_char;
|
||||
pub fn OBJ_nid2sn(nid: c_int) -> *const c_char;
|
||||
pub fn OBJ_nid2obj(n: c_int) -> *mut ASN1_OBJECT;
|
||||
pub fn OBJ_obj2nid(o: *const ASN1_OBJECT) -> c_int;
|
||||
pub fn OBJ_obj2txt(
|
||||
buf: *mut c_char,
|
||||
buf_len: c_int,
|
||||
a: *const ASN1_OBJECT,
|
||||
no_name: c_int,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OBJ_find_sigid_algs(signid: c_int, pdig_nid: *mut c_int, ppkey_nid: *mut c_int)
|
||||
-> c_int;
|
||||
pub fn OBJ_sn2nid(sn: *const crate::libc::c_char) -> crate::libc::c_int;
|
||||
pub fn OBJ_txt2obj(s: *const crate::libc::c_char, no_name: crate::libc::c_int) -> *mut ASN1_OBJECT;
|
||||
pub fn OBJ_create(
|
||||
oid: *const crate::libc::c_char,
|
||||
sn: *const crate::libc::c_char,
|
||||
ln: *const crate::libc::c_char,
|
||||
) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn OBJ_length(obj: *const ASN1_OBJECT) -> crate::libc::size_t;
|
||||
#[cfg(ossl111)]
|
||||
pub fn OBJ_get0_data(obj: *const ASN1_OBJECT) -> *const c_uchar;
|
||||
pub fn OBJ_cmp(a: *const ASN1_OBJECT, b: *const ASN1_OBJECT) -> c_int;
|
||||
}
|
||||
89
wasm/openssl/vendor/openssl-sys/src/handwritten/ocsp.rs
vendored
Normal file
89
wasm/openssl/vendor/openssl-sys/src/handwritten/ocsp.rs
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
pub enum OCSP_CERTID {}
|
||||
|
||||
pub enum OCSP_ONEREQ {}
|
||||
|
||||
pub enum OCSP_REQUEST {}
|
||||
|
||||
pub enum OCSP_BASICRESP {}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn OCSP_cert_to_id(
|
||||
dgst: *const EVP_MD,
|
||||
subject: #[const_ptr_if(any(ossl110, libressl))] X509,
|
||||
issuer: #[const_ptr_if(any(ossl110, libressl))] X509,
|
||||
) -> *mut OCSP_CERTID;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn OCSP_request_add0_id(r: *mut OCSP_REQUEST, id: *mut OCSP_CERTID) -> *mut OCSP_ONEREQ;
|
||||
|
||||
pub fn OCSP_resp_find_status(
|
||||
bs: *mut OCSP_BASICRESP,
|
||||
id: *mut OCSP_CERTID,
|
||||
status: *mut c_int,
|
||||
reason: *mut c_int,
|
||||
revtime: *mut *mut ASN1_GENERALIZEDTIME,
|
||||
thisupd: *mut *mut ASN1_GENERALIZEDTIME,
|
||||
nextupd: *mut *mut ASN1_GENERALIZEDTIME,
|
||||
) -> c_int;
|
||||
pub fn OCSP_check_validity(
|
||||
thisupd: *mut ASN1_GENERALIZEDTIME,
|
||||
nextupd: *mut ASN1_GENERALIZEDTIME,
|
||||
sec: c_long,
|
||||
maxsec: c_long,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OCSP_response_status(resp: *mut OCSP_RESPONSE) -> c_int;
|
||||
pub fn OCSP_response_get1_basic(resp: *mut OCSP_RESPONSE) -> *mut OCSP_BASICRESP;
|
||||
|
||||
pub fn OCSP_response_create(status: c_int, bs: *mut OCSP_BASICRESP) -> *mut OCSP_RESPONSE;
|
||||
|
||||
pub fn OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP;
|
||||
pub fn OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP);
|
||||
pub fn OCSP_RESPONSE_new() -> *mut OCSP_RESPONSE;
|
||||
pub fn OCSP_RESPONSE_free(r: *mut OCSP_RESPONSE);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_OCSP_RESPONSE(a: #[const_ptr_if(ossl300)] OCSP_RESPONSE, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_OCSP_RESPONSE(
|
||||
a: *mut *mut OCSP_RESPONSE,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut OCSP_RESPONSE;
|
||||
pub fn OCSP_ONEREQ_free(r: *mut OCSP_ONEREQ);
|
||||
pub fn OCSP_CERTID_free(id: *mut OCSP_CERTID);
|
||||
pub fn OCSP_REQUEST_new() -> *mut OCSP_REQUEST;
|
||||
pub fn OCSP_REQUEST_free(r: *mut OCSP_REQUEST);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_OCSP_REQUEST(a: #[const_ptr_if(ossl300)] OCSP_REQUEST, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_OCSP_REQUEST(
|
||||
a: *mut *mut OCSP_REQUEST,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut OCSP_REQUEST;
|
||||
|
||||
pub fn OCSP_basic_verify(
|
||||
bs: *mut OCSP_BASICRESP,
|
||||
certs: *mut stack_st_X509,
|
||||
st: *mut X509_STORE,
|
||||
flags: c_ulong,
|
||||
) -> c_int;
|
||||
}
|
||||
91
wasm/openssl/vendor/openssl-sys/src/handwritten/params.rs
vendored
Normal file
91
wasm/openssl/vendor/openssl-sys/src/handwritten/params.rs
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn OSSL_PARAM_free(p: *mut OSSL_PARAM);
|
||||
pub fn OSSL_PARAM_dup(params: *const OSSL_PARAM) -> *mut OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_merge(
|
||||
params: *const OSSL_PARAM,
|
||||
params1: *const OSSL_PARAM,
|
||||
) -> *mut OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_construct_uint(key: *const c_char, buf: *mut c_uint) -> OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_construct_end() -> OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_construct_octet_string(
|
||||
key: *const c_char,
|
||||
buf: *mut c_void,
|
||||
bsize: size_t,
|
||||
) -> OSSL_PARAM;
|
||||
|
||||
pub fn OSSL_PARAM_locate(p: *mut OSSL_PARAM, key: *const c_char) -> *mut OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_locate_const(
|
||||
params: *const OSSL_PARAM,
|
||||
key: *const c_char,
|
||||
) -> *const OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_get_BN(p: *const OSSL_PARAM, val: *mut *mut BIGNUM) -> c_int;
|
||||
pub fn OSSL_PARAM_get_utf8_string(
|
||||
p: *const OSSL_PARAM,
|
||||
val: *mut *mut c_char,
|
||||
max_len: usize,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_get_utf8_string_ptr(p: *const OSSL_PARAM, val: *mut *const c_char) -> c_int;
|
||||
pub fn OSSL_PARAM_get_octet_string(
|
||||
p: *const OSSL_PARAM,
|
||||
val: *mut *mut c_void,
|
||||
max_len: usize,
|
||||
used_len: *mut usize,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_get_octet_string_ptr(
|
||||
p: *const OSSL_PARAM,
|
||||
val: *mut *const c_void,
|
||||
used_len: *mut usize,
|
||||
) -> c_int;
|
||||
|
||||
pub fn OSSL_PARAM_BLD_new() -> *mut OSSL_PARAM_BLD;
|
||||
pub fn OSSL_PARAM_BLD_free(bld: *mut OSSL_PARAM_BLD);
|
||||
pub fn OSSL_PARAM_BLD_to_param(bld: *mut OSSL_PARAM_BLD) -> *mut OSSL_PARAM;
|
||||
pub fn OSSL_PARAM_BLD_push_uint(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
val: c_uint,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_size_t(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
val: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_BN(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
bn: *const BIGNUM,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_BN_pad(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
bn: *const BIGNUM,
|
||||
sz: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_utf8_string(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
buf: *const c_char,
|
||||
bsize: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_utf8_ptr(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
buf: *mut c_char,
|
||||
bsize: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_octet_string(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
buf: *const c_void,
|
||||
bsize: size_t,
|
||||
) -> c_int;
|
||||
pub fn OSSL_PARAM_BLD_push_octet_ptr(
|
||||
bld: *mut OSSL_PARAM_BLD,
|
||||
key: *const c_char,
|
||||
buf: *mut c_void,
|
||||
bsize: size_t,
|
||||
) -> c_int;
|
||||
}
|
||||
196
wasm/openssl/vendor/openssl-sys/src/handwritten/pem.rs
vendored
Normal file
196
wasm/openssl/vendor/openssl-sys/src/handwritten/pem.rs
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
pub type pem_password_cb = Option<
|
||||
unsafe extern "C" fn(
|
||||
buf: *mut c_char,
|
||||
size: c_int,
|
||||
rwflag: c_int,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int,
|
||||
>;
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn PEM_write_bio_X509(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509) -> c_int;
|
||||
pub fn PEM_write_bio_X509_REQ(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509_REQ) -> c_int;
|
||||
pub fn PEM_write_bio_X509_CRL(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509_CRL) -> c_int;
|
||||
pub fn PEM_write_bio_PrivateKey(
|
||||
bio: *mut BIO,
|
||||
pkey: #[const_ptr_if(ossl300)] EVP_PKEY,
|
||||
cipher: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_uchar,
|
||||
klen: c_int,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn PEM_write_bio_PUBKEY(bp: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
|
||||
pub fn PEM_write_bio_PKCS8PrivateKey(
|
||||
bio: *mut BIO,
|
||||
pkey: #[const_ptr_if(ossl300)] EVP_PKEY,
|
||||
cipher: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_char,
|
||||
klen: c_int,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn PEM_write_bio_PKCS7(bp: *mut BIO, x: #[const_ptr_if(ossl300)] PKCS7) -> c_int;
|
||||
pub fn i2d_PKCS8PrivateKey_bio(
|
||||
bp: *mut BIO,
|
||||
x: #[const_ptr_if(ossl300)] EVP_PKEY,
|
||||
enc: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_char,
|
||||
klen: c_int,
|
||||
cb: pem_password_cb,
|
||||
u: *mut c_void,
|
||||
) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn PEM_read_bio_X509(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut X509,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut X509;
|
||||
pub fn PEM_read_bio_X509_REQ(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut X509_REQ,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut X509_REQ;
|
||||
pub fn PEM_read_bio_X509_CRL(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut X509_CRL,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut X509_CRL;
|
||||
pub fn PEM_read_bio_PrivateKey(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut EVP_PKEY,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut EVP_PKEY;
|
||||
pub fn PEM_read_bio_PUBKEY(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut EVP_PKEY,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut EVP_PKEY;
|
||||
|
||||
pub fn d2i_PKCS8PrivateKey_bio(
|
||||
bp: *mut BIO,
|
||||
x: *mut *mut EVP_PKEY,
|
||||
cb: pem_password_cb,
|
||||
u: *mut c_void,
|
||||
) -> *mut EVP_PKEY;
|
||||
pub fn d2i_PKCS8_PRIV_KEY_INFO(
|
||||
k: *mut *mut PKCS8_PRIV_KEY_INFO,
|
||||
buf: *mut *const u8,
|
||||
length: c_long,
|
||||
) -> *mut PKCS8_PRIV_KEY_INFO;
|
||||
pub fn PKCS8_PRIV_KEY_INFO_free(p8inf: *mut PKCS8_PRIV_KEY_INFO);
|
||||
|
||||
pub fn PEM_read_bio_PKCS7(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut PKCS7,
|
||||
cb: pem_password_cb,
|
||||
u: *mut c_void,
|
||||
) -> *mut PKCS7;
|
||||
|
||||
pub fn PEM_read_bio_CMS(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut CMS_ContentInfo,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut CMS_ContentInfo;
|
||||
pub fn PEM_write_bio_CMS(bio: *mut BIO, cms: *const CMS_ContentInfo) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn PEM_read_bio_DHparams(
|
||||
bio: *mut BIO,
|
||||
out: *mut *mut DH,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut DH;
|
||||
pub fn PEM_read_bio_DSAPrivateKey(
|
||||
bp: *mut BIO,
|
||||
dsa: *mut *mut DSA,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut DSA;
|
||||
pub fn PEM_read_bio_DSA_PUBKEY(
|
||||
bp: *mut BIO,
|
||||
dsa: *mut *mut DSA,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut DSA;
|
||||
pub fn PEM_read_bio_ECPrivateKey(
|
||||
bio: *mut BIO,
|
||||
key: *mut *mut EC_KEY,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut EC_KEY;
|
||||
pub fn PEM_read_bio_EC_PUBKEY(
|
||||
bp: *mut BIO,
|
||||
ec: *mut *mut EC_KEY,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut EC_KEY;
|
||||
pub fn PEM_read_bio_RSAPrivateKey(
|
||||
bio: *mut BIO,
|
||||
rsa: *mut *mut RSA,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut RSA;
|
||||
pub fn PEM_read_bio_RSA_PUBKEY(
|
||||
bio: *mut BIO,
|
||||
rsa: *mut *mut RSA,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut RSA;
|
||||
pub fn PEM_read_bio_RSAPublicKey(
|
||||
bio: *mut BIO,
|
||||
rsa: *mut *mut RSA,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> *mut RSA;
|
||||
|
||||
pub fn PEM_write_bio_DHparams(bio: *mut BIO, x: *const DH) -> c_int;
|
||||
pub fn PEM_write_bio_DSAPrivateKey(
|
||||
bp: *mut BIO,
|
||||
dsa: #[const_ptr_if(ossl300)] DSA,
|
||||
cipher: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_uchar,
|
||||
klen: c_int,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn PEM_write_bio_DSA_PUBKEY(bp: *mut BIO, dsa: #[const_ptr_if(ossl300)] DSA) -> c_int;
|
||||
pub fn PEM_write_bio_ECPrivateKey(
|
||||
bio: *mut BIO,
|
||||
key: #[const_ptr_if(ossl300)] EC_KEY,
|
||||
cipher: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_uchar,
|
||||
klen: c_int,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn PEM_write_bio_EC_PUBKEY(bp: *mut BIO, ec: #[const_ptr_if(ossl300)] EC_KEY) -> c_int;
|
||||
pub fn PEM_write_bio_RSAPrivateKey(
|
||||
bp: *mut BIO,
|
||||
rsa: #[const_ptr_if(ossl300)] RSA,
|
||||
cipher: *const EVP_CIPHER,
|
||||
kstr: #[const_ptr_if(ossl300)] c_uchar,
|
||||
klen: c_int,
|
||||
callback: pem_password_cb,
|
||||
user_data: *mut c_void,
|
||||
) -> c_int;
|
||||
pub fn PEM_write_bio_RSA_PUBKEY(bp: *mut BIO, rsa: #[const_ptr_if(ossl300)] RSA) -> c_int;
|
||||
pub fn PEM_write_bio_RSAPublicKey(bp: *mut BIO, rsa: *const RSA) -> c_int;
|
||||
}
|
||||
}
|
||||
53
wasm/openssl/vendor/openssl-sys/src/handwritten/pkcs12.rs
vendored
Normal file
53
wasm/openssl/vendor/openssl-sys/src/handwritten/pkcs12.rs
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
use crate::libc::*;
|
||||
|
||||
use super::super::*;
|
||||
|
||||
pub enum PKCS12 {}
|
||||
|
||||
extern "C" {
|
||||
pub fn PKCS12_free(p12: *mut PKCS12);
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_PKCS12(a: #[const_ptr_if(ossl300)] PKCS12, buf: *mut *mut u8) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn d2i_PKCS12(a: *mut *mut PKCS12, pp: *mut *const u8, length: c_long) -> *mut PKCS12;
|
||||
|
||||
pub fn PKCS12_parse(
|
||||
p12: *mut PKCS12,
|
||||
pass: *const c_char,
|
||||
pkey: *mut *mut EVP_PKEY,
|
||||
cert: *mut *mut X509,
|
||||
ca: *mut *mut stack_st_X509,
|
||||
) -> c_int;
|
||||
|
||||
pub fn PKCS12_set_mac(
|
||||
p12: *mut PKCS12,
|
||||
pass: *const c_char,
|
||||
passlen: c_int,
|
||||
salt: *mut c_uchar,
|
||||
saltlen: c_int,
|
||||
iter: c_int,
|
||||
md_type: *const EVP_MD,
|
||||
) -> c_int;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn PKCS12_create(
|
||||
pass: #[const_ptr_if(any(ossl110, libressl))] c_char,
|
||||
friendly_name: #[const_ptr_if(any(ossl110, libressl))] c_char,
|
||||
pkey: *mut EVP_PKEY,
|
||||
cert: *mut X509,
|
||||
ca: *mut stack_st_X509,
|
||||
nid_key: c_int,
|
||||
nid_cert: c_int,
|
||||
iter: c_int,
|
||||
mac_iter: c_int,
|
||||
keytype: c_int,
|
||||
) -> *mut PKCS12;
|
||||
|
||||
pub fn i2d_PKCS12_bio(b: *mut BIO, a: #[const_ptr_if(ossl300)] PKCS12) -> c_int;
|
||||
}
|
||||
}
|
||||
257
wasm/openssl/vendor/openssl-sys/src/handwritten/pkcs7.rs
vendored
Normal file
257
wasm/openssl/vendor/openssl-sys/src/handwritten/pkcs7.rs
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_CTX {
|
||||
libctx: *mut OSSL_LIB_CTX,
|
||||
propq: *mut c_char,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_SIGNED {
|
||||
pub version: *mut ASN1_INTEGER, /* version 1 */
|
||||
pub md_algs: *mut stack_st_X509_ALGOR, /* md used */
|
||||
pub cert: *mut stack_st_X509, /* [ 0 ] */
|
||||
pub crl: *mut stack_st_X509_CRL, /* [ 1 ] */
|
||||
pub signer_info: *mut stack_st_PKCS7_SIGNER_INFO,
|
||||
pub contents: *mut PKCS7,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_ENC_CONTENT {
|
||||
pub content_type: *mut ASN1_OBJECT,
|
||||
pub algorithm: *mut X509_ALGOR,
|
||||
pub enc_data: *mut ASN1_OCTET_STRING, /* [ 0 ] */
|
||||
pub cipher: *const EVP_CIPHER,
|
||||
#[cfg(ossl300)]
|
||||
pub ctx: *const PKCS7_CTX,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_ENVELOPE {
|
||||
pub version: *mut ASN1_INTEGER, /* version 0 */
|
||||
pub recipientinfo: *mut stack_st_PKCS7_RECIP_INFO,
|
||||
pub enc_data: *mut PKCS7_ENC_CONTENT,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_SIGN_ENVELOPE {
|
||||
pub version: *mut ASN1_INTEGER, /* version 1 */
|
||||
pub md_algs: *mut stack_st_X509_ALGOR, /* md used */
|
||||
pub cert: *mut stack_st_X509, /* [ 0 ] */
|
||||
pub crl: *mut stack_st_X509_CRL, /* [ 1 ] */
|
||||
pub signer_info: *mut stack_st_PKCS7_SIGNER_INFO,
|
||||
pub enc_data: *mut PKCS7_ENC_CONTENT,
|
||||
pub recipientinfo: *mut stack_st_PKCS7_RECIP_INFO,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_DIGEST {
|
||||
pub version: *mut ASN1_INTEGER, /* version 0 */
|
||||
pub md: *mut X509_ALGOR, /* md used */
|
||||
pub contents: *mut PKCS7,
|
||||
pub digest: *mut ASN1_OCTET_STRING,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_ENCRYPT {
|
||||
pub version: *mut ASN1_INTEGER, /* version 0 */
|
||||
pub enc_data: *mut PKCS7_ENC_CONTENT,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn PKCS7_SIGNED_free(info: *mut PKCS7_SIGNED);
|
||||
pub fn PKCS7_ENC_CONTENT_free(info: *mut PKCS7_ENC_CONTENT);
|
||||
pub fn PKCS7_ENVELOPE_free(info: *mut PKCS7_ENVELOPE);
|
||||
pub fn PKCS7_SIGN_ENVELOPE_free(info: *mut PKCS7_SIGN_ENVELOPE);
|
||||
pub fn PKCS7_DIGEST_free(info: *mut PKCS7_DIGEST);
|
||||
pub fn PKCS7_SIGNER_INFO_free(info: *mut PKCS7_SIGNER_INFO);
|
||||
pub fn PKCS7_ENCRYPT_free(enc: *mut PKCS7_ENCRYPT);
|
||||
pub fn PKCS7_ISSUER_AND_SERIAL_free(ias: *mut PKCS7_ISSUER_AND_SERIAL);
|
||||
pub fn PKCS7_RECIP_INFO_free(info: *mut PKCS7_RECIP_INFO);
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PKCS7 {
|
||||
/*
|
||||
* The following is non NULL if it contains ASN1 encoding of this
|
||||
* structure
|
||||
*/
|
||||
pub asn1: *mut c_uchar,
|
||||
pub length: c_long,
|
||||
// # define PKCS7_S_HEADER 0
|
||||
// # define PKCS7_S_BODY 1
|
||||
// # define PKCS7_S_TAIL 2
|
||||
pub state: c_int, /* used during processing */
|
||||
pub detached: c_int,
|
||||
pub type_: *mut ASN1_OBJECT,
|
||||
/* content as defined by the type */
|
||||
/*
|
||||
* all encryption/message digests are applied to the 'contents', leaving
|
||||
* out the 'type' field.
|
||||
*/
|
||||
pub d: PKCS7_data,
|
||||
#[cfg(ossl300)]
|
||||
pub ctx: PKCS7_CTX,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub union PKCS7_data {
|
||||
pub ptr: *mut c_char,
|
||||
/* NID_pkcs7_data */
|
||||
pub data: *mut ASN1_OCTET_STRING,
|
||||
/* NID_pkcs7_signed */
|
||||
pub sign: *mut PKCS7_SIGNED,
|
||||
/* NID_pkcs7_enveloped */
|
||||
pub enveloped: *mut PKCS7_ENVELOPE,
|
||||
/* NID_pkcs7_signedAndEnveloped */
|
||||
pub signed_and_enveloped: *mut PKCS7_SIGN_ENVELOPE,
|
||||
/* NID_pkcs7_digest */
|
||||
pub digest: *mut PKCS7_DIGEST,
|
||||
/* NID_pkcs7_encrypted */
|
||||
pub encrypted: *mut PKCS7_ENCRYPT,
|
||||
/* Anything else */
|
||||
pub other: *mut ASN1_TYPE,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_ISSUER_AND_SERIAL {
|
||||
pub issuer: *mut X509_NAME,
|
||||
pub serial: *mut ASN1_INTEGER,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_SIGNER_INFO {
|
||||
pub version: *mut ASN1_INTEGER, /* version 1 */
|
||||
pub issuer_and_serial: *mut PKCS7_ISSUER_AND_SERIAL,
|
||||
pub digest_alg: *mut X509_ALGOR,
|
||||
pub auth_attr: *mut stack_st_X509_ATTRIBUTE, /* [ 0 ] */
|
||||
pub digest_enc_alg: *mut X509_ALGOR,
|
||||
pub enc_digest: *mut ASN1_OCTET_STRING,
|
||||
pub unauth_attr: *mut stack_st_X509_ATTRIBUTE, /* [ 1 ] */
|
||||
pub pkey: *mut EVP_PKEY, /* The private key to sign with */
|
||||
#[cfg(ossl300)]
|
||||
pub ctx: *const PKCS7_CTX,
|
||||
}
|
||||
|
||||
stack!(stack_st_PKCS7_SIGNER_INFO);
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PKCS7_RECIP_INFO {
|
||||
pub version: *mut ASN1_INTEGER, /* version 0 */
|
||||
pub issuer_and_serial: *mut PKCS7_ISSUER_AND_SERIAL,
|
||||
pub key_enc_algor: *mut X509_ALGOR,
|
||||
pub enc_key: *mut ASN1_OCTET_STRING,
|
||||
pub cert: *mut X509, /* get the pub-key from this */
|
||||
#[cfg(ossl300)]
|
||||
pub ctx: *const PKCS7_CTX,
|
||||
}
|
||||
|
||||
stack!(stack_st_PKCS7_RECIP_INFO);
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_PKCS7(a: *mut *mut PKCS7, pp: *mut *const c_uchar, length: c_long) -> *mut PKCS7;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_PKCS7(a: #[const_ptr_if(ossl300)] PKCS7, buf: *mut *mut u8) -> c_int;
|
||||
pub fn i2d_PKCS7_bio(bio: *mut BIO, p7: #[const_ptr_if(ossl300)] PKCS7) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn PKCS7_encrypt(
|
||||
certs: *mut stack_st_X509,
|
||||
b: *mut BIO,
|
||||
cipher: *const EVP_CIPHER,
|
||||
flags: c_int,
|
||||
) -> *mut PKCS7;
|
||||
|
||||
pub fn PKCS7_verify(
|
||||
pkcs7: *mut PKCS7,
|
||||
certs: *mut stack_st_X509,
|
||||
store: *mut X509_STORE,
|
||||
indata: *mut BIO,
|
||||
out: *mut BIO,
|
||||
flags: c_int,
|
||||
) -> c_int;
|
||||
|
||||
pub fn PKCS7_get0_signers(
|
||||
pkcs7: *mut PKCS7,
|
||||
certs: *mut stack_st_X509,
|
||||
flags: c_int,
|
||||
) -> *mut stack_st_X509;
|
||||
|
||||
pub fn PKCS7_sign(
|
||||
signcert: *mut X509,
|
||||
pkey: *mut EVP_PKEY,
|
||||
certs: *mut stack_st_X509,
|
||||
data: *mut BIO,
|
||||
flags: c_int,
|
||||
) -> *mut PKCS7;
|
||||
|
||||
pub fn PKCS7_decrypt(
|
||||
pkcs7: *mut PKCS7,
|
||||
pkey: *mut EVP_PKEY,
|
||||
cert: *mut X509,
|
||||
data: *mut BIO,
|
||||
flags: c_int,
|
||||
) -> c_int;
|
||||
|
||||
pub fn PKCS7_free(pkcs7: *mut PKCS7);
|
||||
|
||||
pub fn SMIME_write_PKCS7(
|
||||
out: *mut BIO,
|
||||
pkcs7: *mut PKCS7,
|
||||
data: *mut BIO,
|
||||
flags: c_int,
|
||||
) -> c_int;
|
||||
|
||||
pub fn SMIME_read_PKCS7(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut PKCS7;
|
||||
|
||||
pub fn PKCS7_new() -> *mut PKCS7;
|
||||
|
||||
pub fn PKCS7_set_type(p7: *mut PKCS7, nid_pkcs7: c_int) -> c_int;
|
||||
|
||||
pub fn PKCS7_add_certificate(p7: *mut PKCS7, x509: *mut X509) -> c_int;
|
||||
|
||||
pub fn PKCS7_add_signature(
|
||||
p7: *mut PKCS7,
|
||||
x509: *mut X509,
|
||||
pkey: *mut EVP_PKEY,
|
||||
digest: *const EVP_MD,
|
||||
) -> *mut PKCS7_SIGNER_INFO;
|
||||
|
||||
pub fn PKCS7_set_signed_attributes(
|
||||
p7si: *mut PKCS7_SIGNER_INFO,
|
||||
attributes: *mut stack_st_X509_ATTRIBUTE,
|
||||
) -> c_int;
|
||||
|
||||
pub fn PKCS7_add_signed_attribute(
|
||||
p7si: *mut PKCS7_SIGNER_INFO,
|
||||
nid: c_int,
|
||||
attrtype: c_int,
|
||||
data: *mut c_void,
|
||||
) -> c_int;
|
||||
|
||||
pub fn PKCS7_content_new(p7: *mut PKCS7, nid_pkcs7: c_int) -> c_int;
|
||||
|
||||
pub fn PKCS7_dataInit(p7: *mut PKCS7, bio: *mut BIO) -> *mut BIO;
|
||||
|
||||
pub fn PKCS7_dataFinal(p7: *mut PKCS7, bio: *mut BIO) -> c_int;
|
||||
|
||||
pub fn PKCS7_get_signer_info(p7: *mut PKCS7) -> *mut stack_st_PKCS7_SIGNER_INFO;
|
||||
|
||||
pub fn PKCS7_SIGNER_INFO_get0_algs(
|
||||
si: *mut PKCS7_SIGNER_INFO,
|
||||
pk: *mut *mut EVP_PKEY,
|
||||
pdig: *mut *mut X509_ALGOR,
|
||||
psig: *mut *mut X509_ALGOR,
|
||||
);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn PKCS7_get_signed_attribute(
|
||||
si: #[const_ptr_if(ossl300)] PKCS7_SIGNER_INFO,
|
||||
nid: c_int
|
||||
) -> *mut ASN1_TYPE;
|
||||
}
|
||||
}
|
||||
23
wasm/openssl/vendor/openssl-sys/src/handwritten/poly1305.rs
vendored
Normal file
23
wasm/openssl/vendor/openssl-sys/src/handwritten/poly1305.rs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(libressl)] {
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct poly1305_context {
|
||||
pub aligner: usize,
|
||||
pub opaque: [crate::libc::c_uchar; 136usize],
|
||||
}
|
||||
pub type poly1305_state = poly1305_context;
|
||||
extern "C" {
|
||||
pub fn CRYPTO_poly1305_init(ctx: *mut poly1305_context, key: *const crate::libc::c_uchar);
|
||||
pub fn CRYPTO_poly1305_update(
|
||||
ctx: *mut poly1305_context,
|
||||
in_: *const crate::libc::c_uchar,
|
||||
len: usize,
|
||||
);
|
||||
pub fn CRYPTO_poly1305_finish(ctx: *mut poly1305_context, mac: *mut crate::libc::c_uchar);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
wasm/openssl/vendor/openssl-sys/src/handwritten/provider.rs
vendored
Normal file
20
wasm/openssl/vendor/openssl-sys/src/handwritten/provider.rs
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_PROVIDER_load(ctx: *mut OSSL_LIB_CTX, name: *const c_char) -> *mut OSSL_PROVIDER;
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_PROVIDER_try_load(
|
||||
ctx: *mut OSSL_LIB_CTX,
|
||||
name: *const c_char,
|
||||
retain_fallbacks: c_int,
|
||||
) -> *mut OSSL_PROVIDER;
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_PROVIDER_unload(prov: *mut OSSL_PROVIDER) -> c_int;
|
||||
#[cfg(ossl300)]
|
||||
pub fn OSSL_PROVIDER_set_default_search_path(
|
||||
ctx: *mut OSSL_LIB_CTX,
|
||||
path: *const c_char,
|
||||
) -> c_int;
|
||||
}
|
||||
15
wasm/openssl/vendor/openssl-sys/src/handwritten/rand.rs
vendored
Normal file
15
wasm/openssl/vendor/openssl-sys/src/handwritten/rand.rs
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub fn RAND_priv_bytes(buf: *mut u8, num: c_int) -> c_int;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub fn RAND_keep_random_devices_open(keep: c_int);
|
||||
|
||||
pub fn RAND_status() -> c_int;
|
||||
|
||||
pub fn RAND_add(buf: *const c_void, num: c_int, randomness: c_double);
|
||||
}
|
||||
128
wasm/openssl/vendor/openssl-sys/src/handwritten/rsa.rs
vendored
Normal file
128
wasm/openssl/vendor/openssl-sys/src/handwritten/rsa.rs
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn EVP_PKEY_CTX_set_rsa_keygen_bits(ctx: *mut EVP_PKEY_CTX, bits: c_int) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx: *mut EVP_PKEY_CTX, pubexp: *mut BIGNUM) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_CTX_set_rsa_padding(ctx: *mut EVP_PKEY_CTX, pad_mode: c_int) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_get_rsa_padding(ctx: *mut EVP_PKEY_CTX, pad_mode: *mut c_int) -> c_int;
|
||||
|
||||
pub fn EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int;
|
||||
pub fn EVP_PKEY_CTX_set_rsa_mgf1_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn RSA_new() -> *mut RSA;
|
||||
pub fn RSA_size(k: *const RSA) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_set0_key(r: *mut RSA, n: *mut BIGNUM, e: *mut BIGNUM, d: *mut BIGNUM) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_set0_factors(r: *mut RSA, p: *mut BIGNUM, q: *mut BIGNUM) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_set0_crt_params(
|
||||
r: *mut RSA,
|
||||
dmp1: *mut BIGNUM,
|
||||
dmq1: *mut BIGNUM,
|
||||
iqmp: *mut BIGNUM,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_get0_key(
|
||||
r: *const RSA,
|
||||
n: *mut *const BIGNUM,
|
||||
e: *mut *const BIGNUM,
|
||||
d: *mut *const BIGNUM,
|
||||
);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_get0_factors(r: *const RSA, p: *mut *const BIGNUM, q: *mut *const BIGNUM);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn RSA_get0_crt_params(
|
||||
r: *const RSA,
|
||||
dmp1: *mut *const BIGNUM,
|
||||
dmq1: *mut *const BIGNUM,
|
||||
iqmp: *mut *const BIGNUM,
|
||||
);
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn RSA_generate_key(
|
||||
modsz: c_int,
|
||||
e: c_ulong,
|
||||
cb: Option<extern "C" fn(c_int, c_int, *mut c_void)>,
|
||||
cbarg: *mut c_void,
|
||||
) -> *mut RSA;
|
||||
|
||||
pub fn RSA_generate_key_ex(
|
||||
rsa: *mut RSA,
|
||||
bits: c_int,
|
||||
e: *mut BIGNUM,
|
||||
cb: *mut BN_GENCB,
|
||||
) -> c_int;
|
||||
|
||||
pub fn RSA_public_encrypt(
|
||||
flen: c_int,
|
||||
from: *const u8,
|
||||
to: *mut u8,
|
||||
k: *mut RSA,
|
||||
pad: c_int,
|
||||
) -> c_int;
|
||||
pub fn RSA_private_encrypt(
|
||||
flen: c_int,
|
||||
from: *const u8,
|
||||
to: *mut u8,
|
||||
k: *mut RSA,
|
||||
pad: c_int,
|
||||
) -> c_int;
|
||||
pub fn RSA_public_decrypt(
|
||||
flen: c_int,
|
||||
from: *const u8,
|
||||
to: *mut u8,
|
||||
k: *mut RSA,
|
||||
pad: c_int,
|
||||
) -> c_int;
|
||||
pub fn RSA_private_decrypt(
|
||||
flen: c_int,
|
||||
from: *const u8,
|
||||
to: *mut u8,
|
||||
k: *mut RSA,
|
||||
pad: c_int,
|
||||
) -> c_int;
|
||||
pub fn RSA_check_key(r: *const RSA) -> c_int;
|
||||
pub fn RSA_free(rsa: *mut RSA);
|
||||
pub fn RSA_up_ref(rsa: *mut RSA) -> c_int;
|
||||
|
||||
pub fn i2d_RSAPublicKey(k: *const RSA, buf: *mut *mut u8) -> c_int;
|
||||
pub fn d2i_RSAPublicKey(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
|
||||
pub fn i2d_RSAPrivateKey(k: *const RSA, buf: *mut *mut u8) -> c_int;
|
||||
pub fn d2i_RSAPrivateKey(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
|
||||
|
||||
pub fn RSA_sign(
|
||||
t: c_int,
|
||||
m: *const u8,
|
||||
mlen: c_uint,
|
||||
sig: *mut u8,
|
||||
siglen: *mut c_uint,
|
||||
k: *mut RSA,
|
||||
) -> c_int;
|
||||
pub fn RSA_verify(
|
||||
t: c_int,
|
||||
m: *const u8,
|
||||
mlen: c_uint,
|
||||
sig: *const u8,
|
||||
siglen: c_uint,
|
||||
k: *mut RSA,
|
||||
) -> c_int;
|
||||
|
||||
pub fn RSA_padding_check_PKCS1_type_2(
|
||||
to: *mut c_uchar,
|
||||
tlen: c_int,
|
||||
f: *const c_uchar,
|
||||
fl: c_int,
|
||||
rsa_len: c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
1
wasm/openssl/vendor/openssl-sys/src/handwritten/safestack.rs
vendored
Normal file
1
wasm/openssl/vendor/openssl-sys/src/handwritten/safestack.rs
vendored
Normal file
@@ -0,0 +1 @@
|
||||
stack!(stack_st_OPENSSL_STRING);
|
||||
101
wasm/openssl/vendor/openssl-sys/src/handwritten/sha.rs
vendored
Normal file
101
wasm/openssl/vendor/openssl-sys/src/handwritten/sha.rs
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
pub struct SHA_CTX {
|
||||
pub h0: SHA_LONG,
|
||||
pub h1: SHA_LONG,
|
||||
pub h2: SHA_LONG,
|
||||
pub h3: SHA_LONG,
|
||||
pub h4: SHA_LONG,
|
||||
pub Nl: SHA_LONG,
|
||||
pub Nh: SHA_LONG,
|
||||
pub data: [SHA_LONG; SHA_LBLOCK as usize],
|
||||
pub num: c_uint,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SHA1_Init(c: *mut SHA_CTX) -> c_int;
|
||||
pub fn SHA1_Update(c: *mut SHA_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn SHA1_Final(md: *mut c_uchar, c: *mut SHA_CTX) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(ossl300))] {
|
||||
extern "C" {
|
||||
pub fn SHA1(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
pub struct SHA256_CTX {
|
||||
pub h: [SHA_LONG; 8],
|
||||
pub Nl: SHA_LONG,
|
||||
pub Nh: SHA_LONG,
|
||||
pub data: [SHA_LONG; SHA_LBLOCK as usize],
|
||||
pub num: c_uint,
|
||||
pub md_len: c_uint,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SHA224_Init(c: *mut SHA256_CTX) -> c_int;
|
||||
pub fn SHA224_Update(c: *mut SHA256_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn SHA224_Final(md: *mut c_uchar, c: *mut SHA256_CTX) -> c_int;
|
||||
pub fn SHA256_Init(c: *mut SHA256_CTX) -> c_int;
|
||||
pub fn SHA256_Update(c: *mut SHA256_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn SHA256_Final(md: *mut c_uchar, c: *mut SHA256_CTX) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(ossl300))] {
|
||||
extern "C" {
|
||||
pub fn SHA224(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
|
||||
pub fn SHA256(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
|
||||
#[repr(C)]
|
||||
#[derive(Clone)]
|
||||
pub struct SHA512_CTX {
|
||||
pub h: [SHA_LONG64; 8],
|
||||
pub Nl: SHA_LONG64,
|
||||
pub Nh: SHA_LONG64,
|
||||
// this is a union but we don't want to require 1.19
|
||||
u: [SHA_LONG64; SHA_LBLOCK as usize],
|
||||
pub num: c_uint,
|
||||
pub md_len: c_uint,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SHA384_Init(c: *mut SHA512_CTX) -> c_int;
|
||||
pub fn SHA384_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn SHA384_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int;
|
||||
pub fn SHA512_Init(c: *mut SHA512_CTX) -> c_int;
|
||||
pub fn SHA512_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int;
|
||||
pub fn SHA512_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(not(ossl300))] {
|
||||
extern "C" {
|
||||
pub fn SHA384(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
|
||||
pub fn SHA512(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
wasm/openssl/vendor/openssl-sys/src/handwritten/srtp.rs
vendored
Normal file
10
wasm/openssl/vendor/openssl-sys/src/handwritten/srtp.rs
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut SSL_CTX, profiles: *const c_char) -> c_int;
|
||||
pub fn SSL_set_tlsext_use_srtp(ssl: *mut SSL, profiles: *const c_char) -> c_int;
|
||||
|
||||
pub fn SSL_get_srtp_profiles(ssl: *mut SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
|
||||
pub fn SSL_get_selected_srtp_profile(ssl: *mut SSL) -> *mut SRTP_PROTECTION_PROFILE;
|
||||
}
|
||||
948
wasm/openssl/vendor/openssl-sys/src/handwritten/ssl.rs
vendored
Normal file
948
wasm/openssl/vendor/openssl-sys/src/handwritten/ssl.rs
vendored
Normal file
@@ -0,0 +1,948 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
pub enum SSL_METHOD {}
|
||||
pub enum SSL_CIPHER {}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum SSL_SESSION {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct SSL_SESSION {
|
||||
ssl_version: c_int,
|
||||
key_arg_length: c_uint,
|
||||
key_arg: [c_uchar; SSL_MAX_KEY_ARG_LENGTH as usize],
|
||||
pub master_key_length: c_int,
|
||||
pub master_key: [c_uchar; 48],
|
||||
session_id_length: c_uint,
|
||||
session_id: [c_uchar; SSL_MAX_SSL_SESSION_ID_LENGTH as usize],
|
||||
sid_ctx_length: c_uint,
|
||||
sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
|
||||
krb5_client_princ_len: c_uint,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
|
||||
krb5_client_princ: [c_uchar; SSL_MAX_KRB5_PRINCIPAL_LENGTH as usize],
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_identity_hint: *mut c_char,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_identity: *mut c_char,
|
||||
not_resumable: c_int,
|
||||
sess_cert: *mut c_void,
|
||||
peer: *mut X509,
|
||||
verify_result: c_long,
|
||||
pub references: c_int,
|
||||
timeout: c_long,
|
||||
time: c_long,
|
||||
compress_meth: c_uint,
|
||||
cipher: *const c_void,
|
||||
cipher_id: c_ulong,
|
||||
ciphers: *mut c_void,
|
||||
ex_data: CRYPTO_EX_DATA,
|
||||
prev: *mut c_void,
|
||||
next: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_hostname: *mut c_char,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ecpointformatlist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ecpointformatlist: *mut c_uchar,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ellipticcurvelist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ellipticcurvelist: *mut c_uchar,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_tick: *mut c_uchar,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ticklen: size_t,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_tick_lifetime_hint: c_long,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
|
||||
srp_username: *mut c_char,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack!(stack_st_SSL_CIPHER);
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SRTP_PROTECTION_PROFILE {
|
||||
pub name: *const c_char,
|
||||
pub id: c_ulong,
|
||||
}
|
||||
|
||||
stack!(stack_st_SRTP_PROTECTION_PROFILE);
|
||||
|
||||
pub type tls_session_ticket_ext_cb_fn =
|
||||
Option<unsafe extern "C" fn(*mut SSL, *const c_uchar, c_int, *mut c_void) -> c_int>;
|
||||
pub type tls_session_secret_cb_fn = Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut SSL,
|
||||
*mut c_void,
|
||||
*mut c_int,
|
||||
*mut stack_st_SSL_CIPHER,
|
||||
*mut *mut SSL_CIPHER,
|
||||
*mut c_void,
|
||||
) -> c_int,
|
||||
>;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub type SSL_custom_ext_add_cb_ex = Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
ext_type: c_uint,
|
||||
context: c_uint,
|
||||
out: *mut *const c_uchar,
|
||||
outlen: *mut size_t,
|
||||
x: *mut X509,
|
||||
chainidx: size_t,
|
||||
al: *mut c_int,
|
||||
add_arg: *mut c_void,
|
||||
) -> c_int,
|
||||
>;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub type SSL_custom_ext_free_cb_ex = Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
ext_type: c_uint,
|
||||
context: c_uint,
|
||||
out: *const c_uchar,
|
||||
add_arg: *mut c_void,
|
||||
),
|
||||
>;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub type SSL_custom_ext_parse_cb_ex = Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
ext_type: c_uint,
|
||||
context: c_uint,
|
||||
input: *const c_uchar,
|
||||
inlen: size_t,
|
||||
x: *mut X509,
|
||||
chainidx: size_t,
|
||||
al: *mut c_int,
|
||||
parse_arg: *mut c_void,
|
||||
) -> c_int,
|
||||
>;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl300)] {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_get_options(ctx: *const SSL_CTX) -> u64;
|
||||
pub fn SSL_CTX_set_options(ctx: *mut SSL_CTX, op: u64) -> u64;
|
||||
pub fn SSL_CTX_clear_options(ctx: *mut SSL_CTX, op: u64) -> u64;
|
||||
}
|
||||
} else if #[cfg(ossl110)] {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_get_options(ctx: *const SSL_CTX) -> c_ulong;
|
||||
pub fn SSL_CTX_set_options(ctx: *mut SSL_CTX, op: c_ulong) -> c_ulong;
|
||||
pub fn SSL_CTX_clear_options(ctx: *mut SSL_CTX, op: c_ulong) -> c_ulong;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type GEN_SESSION_CB =
|
||||
Option<unsafe extern "C" fn(*const SSL, *mut c_uchar, *mut c_uint) -> c_int>;
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_sess_set_new_cb(
|
||||
ctx: *mut SSL_CTX,
|
||||
new_session_cb: Option<unsafe extern "C" fn(*mut SSL, *mut SSL_SESSION) -> c_int>,
|
||||
);
|
||||
pub fn SSL_CTX_sess_set_remove_cb(
|
||||
ctx: *mut SSL_CTX,
|
||||
remove_session_cb: Option<unsafe extern "C" fn(*mut SSL_CTX, *mut SSL_SESSION)>,
|
||||
);
|
||||
}
|
||||
cfg_if! {
|
||||
// const change in passed function pointer signature
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_sess_set_get_cb(
|
||||
ctx: *mut SSL_CTX,
|
||||
get_session_cb: Option<
|
||||
unsafe extern "C" fn(*mut SSL, *const c_uchar, c_int, *mut c_int) -> *mut SSL_SESSION,
|
||||
>,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_sess_set_get_cb(
|
||||
ctx: *mut SSL_CTX,
|
||||
get_session_cb: Option<
|
||||
unsafe extern "C" fn(*mut SSL, *mut c_uchar, c_int, *mut c_int) -> *mut SSL_SESSION,
|
||||
>,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
// FIXME change to unsafe extern "C" fn
|
||||
pub fn SSL_CTX_set_cookie_generate_cb(
|
||||
s: *mut SSL_CTX,
|
||||
cb: Option<
|
||||
extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: *mut c_uint) -> c_int,
|
||||
>,
|
||||
);
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
// const change in passed function pointer signature
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_cookie_verify_cb(
|
||||
s: *mut SSL_CTX,
|
||||
cb: Option<
|
||||
extern "C" fn(ssl: *mut SSL, cookie: *const c_uchar, cookie_len: c_uint) -> c_int,
|
||||
>,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_cookie_verify_cb(
|
||||
s: *mut SSL_CTX,
|
||||
cb: Option<extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: c_uint) -> c_int>,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_set_stateless_cookie_generate_cb(
|
||||
s: *mut SSL_CTX,
|
||||
cb: Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
cookie: *mut c_uchar,
|
||||
cookie_len: *mut size_t,
|
||||
) -> c_int,
|
||||
>,
|
||||
);
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_set_stateless_cookie_verify_cb(
|
||||
s: *mut SSL_CTX,
|
||||
cb: Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
cookie: *const c_uchar,
|
||||
cookie_len: size_t,
|
||||
) -> c_int,
|
||||
>,
|
||||
);
|
||||
|
||||
pub fn SSL_CTX_set_next_protos_advertised_cb(
|
||||
ssl: *mut SSL_CTX,
|
||||
cb: extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
out: *mut *const c_uchar,
|
||||
outlen: *mut c_uint,
|
||||
arg: *mut c_void,
|
||||
) -> c_int,
|
||||
arg: *mut c_void,
|
||||
);
|
||||
pub fn SSL_CTX_set_next_proto_select_cb(
|
||||
ssl: *mut SSL_CTX,
|
||||
cb: extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
out: *mut *mut c_uchar,
|
||||
outlen: *mut c_uchar,
|
||||
inbuf: *const c_uchar,
|
||||
inlen: c_uint,
|
||||
arg: *mut c_void,
|
||||
) -> c_int,
|
||||
arg: *mut c_void,
|
||||
);
|
||||
pub fn SSL_get0_next_proto_negotiated(
|
||||
s: *const SSL,
|
||||
data: *mut *const c_uchar,
|
||||
len: *mut c_uint,
|
||||
);
|
||||
|
||||
pub fn SSL_select_next_proto(
|
||||
out: *mut *mut c_uchar,
|
||||
outlen: *mut c_uchar,
|
||||
inbuf: *const c_uchar,
|
||||
inlen: c_uint,
|
||||
client: *const c_uchar,
|
||||
client_len: c_uint,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_alpn_protos(s: *mut SSL_CTX, data: *const c_uchar, len: c_uint) -> c_int;
|
||||
pub fn SSL_set_alpn_protos(s: *mut SSL, data: *const c_uchar, len: c_uint) -> c_int;
|
||||
#[link_name = "SSL_CTX_set_alpn_select_cb"]
|
||||
pub fn SSL_CTX_set_alpn_select_cb__fixed_rust(
|
||||
ssl: *mut SSL_CTX,
|
||||
cb: Option<
|
||||
unsafe extern "C" fn(
|
||||
ssl: *mut SSL,
|
||||
out: *mut *const c_uchar,
|
||||
outlen: *mut c_uchar,
|
||||
inbuf: *const c_uchar,
|
||||
inlen: c_uint,
|
||||
arg: *mut c_void,
|
||||
) -> c_int,
|
||||
>,
|
||||
arg: *mut c_void,
|
||||
);
|
||||
pub fn SSL_get0_alpn_selected(s: *const SSL, data: *mut *const c_uchar, len: *mut c_uint);
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_psk_client_callback(
|
||||
ssl: *mut SSL_CTX,
|
||||
psk_client_cb: Option<
|
||||
extern "C" fn(
|
||||
*mut SSL,
|
||||
*const c_char,
|
||||
*mut c_char,
|
||||
c_uint,
|
||||
*mut c_uchar,
|
||||
c_uint,
|
||||
) -> c_uint,
|
||||
>,
|
||||
);
|
||||
pub fn SSL_CTX_set_psk_server_callback(
|
||||
ssl: *mut SSL_CTX,
|
||||
psk_server_cb: Option<
|
||||
extern "C" fn(*mut SSL, *const c_char, *mut c_uchar, c_uint) -> c_uint,
|
||||
>,
|
||||
);
|
||||
pub fn SSL_get_psk_identity_hint(ssl: *const SSL) -> *const c_char;
|
||||
pub fn SSL_get_psk_identity(ssl: *const SSL) -> *const c_char;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_add_custom_ext(
|
||||
ctx: *mut SSL_CTX,
|
||||
ext_type: c_uint,
|
||||
context: c_uint,
|
||||
add_cb: SSL_custom_ext_add_cb_ex,
|
||||
free_cb: SSL_custom_ext_free_cb_ex,
|
||||
add_arg: *mut c_void,
|
||||
parse_cb: SSL_custom_ext_parse_cb_ex,
|
||||
parse_arg: *mut c_void,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl102)]
|
||||
pub fn SSL_extension_supported(ext_type: c_uint) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub type SSL_CTX_keylog_cb_func =
|
||||
Option<unsafe extern "C" fn(ssl: *const SSL, line: *const c_char)>;
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_set_keylog_callback(ctx: *mut SSL_CTX, cb: SSL_CTX_keylog_cb_func);
|
||||
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_CTX_set_max_early_data(ctx: *mut SSL_CTX, max_early_data: u32) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_CTX_get_max_early_data(ctx: *const SSL_CTX) -> u32;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_set_max_early_data(ctx: *mut SSL, max_early_data: u32) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_get_max_early_data(ctx: *const SSL) -> u32;
|
||||
|
||||
pub fn SSL_get_finished(s: *const SSL, buf: *mut c_void, count: size_t) -> size_t;
|
||||
pub fn SSL_get_peer_finished(s: *const SSL, buf: *mut c_void, count: size_t) -> size_t;
|
||||
|
||||
pub fn SSL_CTX_get_verify_mode(ctx: *const SSL_CTX) -> c_int;
|
||||
pub fn SSL_get_verify_mode(s: *const SSL) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
#[cfg(ossl110)]
|
||||
pub fn SSL_is_init_finished(s: #[const_ptr_if(ossl111)] SSL) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(libressl)] {
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_min_proto_version(ctx: *mut SSL_CTX, version: u16) -> c_int;
|
||||
pub fn SSL_CTX_set_max_proto_version(ctx: *mut SSL_CTX, version: u16) -> c_int;
|
||||
pub fn SSL_set_min_proto_version(s: *mut SSL, version: u16) -> c_int;
|
||||
pub fn SSL_set_max_proto_version(s: *mut SSL, version: u16) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_get_min_proto_version(ctx: *mut SSL_CTX) -> c_int;
|
||||
pub fn SSL_CTX_get_max_proto_version(ctx: *mut SSL_CTX) -> c_int;
|
||||
pub fn SSL_get_min_proto_version(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_max_proto_version(s: *mut SSL) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set_cipher_list(ssl: *mut SSL_CTX, s: *const c_char) -> c_int;
|
||||
pub fn SSL_CTX_new(method: *const SSL_METHOD) -> *mut SSL_CTX;
|
||||
pub fn SSL_CTX_free(ctx: *mut SSL_CTX);
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_CTX_up_ref(x: *mut SSL_CTX) -> c_int;
|
||||
pub fn SSL_CTX_get_cert_store(ctx: *const SSL_CTX) -> *mut X509_STORE;
|
||||
pub fn SSL_CTX_set_cert_store(ctx: *mut SSL_CTX, store: *mut X509_STORE);
|
||||
|
||||
pub fn SSL_get_current_cipher(ssl: *const SSL) -> *const SSL_CIPHER;
|
||||
pub fn SSL_CIPHER_get_bits(cipher: *const SSL_CIPHER, alg_bits: *mut c_int) -> c_int;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn SSL_CIPHER_get_version(cipher: *const SSL_CIPHER) -> #[const_ptr_if(any(ossl110, libressl))] c_char;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CIPHER_get_handshake_digest(cipher: *const SSL_CIPHER) -> *const EVP_MD;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CIPHER_get_protocol_id(cipher: *const SSL_CIPHER) -> u16;
|
||||
pub fn SSL_CIPHER_get_name(cipher: *const SSL_CIPHER) -> *const c_char;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CIPHER_standard_name(cipher: *const SSL_CIPHER) -> *const c_char;
|
||||
#[cfg(ossl111)]
|
||||
pub fn OPENSSL_cipher_name(rfc_name: *const c_char) -> *const c_char;
|
||||
|
||||
pub fn SSL_pending(ssl: *const SSL) -> c_int;
|
||||
pub fn SSL_set_bio(ssl: *mut SSL, rbio: *mut BIO, wbio: *mut BIO);
|
||||
pub fn SSL_get_rbio(ssl: *const SSL) -> *mut BIO;
|
||||
pub fn SSL_get_wbio(ssl: *const SSL) -> *mut BIO;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_CTX_set_ciphersuites(ctx: *mut SSL_CTX, str: *const c_char) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_set_ciphersuites(ssl: *mut SSL, str: *const c_char) -> c_int;
|
||||
pub fn SSL_set_cipher_list(ssl: *mut SSL, s: *const c_char) -> c_int;
|
||||
pub fn SSL_set_ssl_method(s: *mut SSL, method: *const SSL_METHOD) -> c_int;
|
||||
pub fn SSL_set_verify(
|
||||
ssl: *mut SSL,
|
||||
mode: c_int,
|
||||
// FIXME should be unsafe
|
||||
verify_callback: Option<extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
|
||||
);
|
||||
pub fn SSL_CTX_use_PrivateKey(ctx: *mut SSL_CTX, key: *mut EVP_PKEY) -> c_int;
|
||||
pub fn SSL_CTX_use_certificate(ctx: *mut SSL_CTX, cert: *mut X509) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_use_PrivateKey_file(
|
||||
ctx: *mut SSL_CTX,
|
||||
key_file: *const c_char,
|
||||
file_type: c_int,
|
||||
) -> c_int;
|
||||
pub fn SSL_CTX_use_certificate_file(
|
||||
ctx: *mut SSL_CTX,
|
||||
cert_file: *const c_char,
|
||||
file_type: c_int,
|
||||
) -> c_int;
|
||||
pub fn SSL_CTX_use_certificate_chain_file(
|
||||
ctx: *mut SSL_CTX,
|
||||
cert_chain_file: *const c_char,
|
||||
) -> c_int;
|
||||
pub fn SSL_use_PrivateKey_file(ssl: *mut SSL, file: *const c_char, type_: c_int) -> c_int;
|
||||
pub fn SSL_use_PrivateKey(ssl: *mut SSL, pkey: *mut EVP_PKEY) -> c_int;
|
||||
pub fn SSL_use_certificate(ssl: *mut SSL, x: *mut X509) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_use_certificate_chain_file(ssl: *mut SSL, file: *const c_char) -> c_int;
|
||||
pub fn SSL_set_client_CA_list(s: *mut SSL, name_list: *mut stack_st_X509_NAME);
|
||||
pub fn SSL_add_client_CA(ssl: *mut SSL, x: *mut X509) -> c_int;
|
||||
pub fn SSL_load_client_CA_file(file: *const c_char) -> *mut stack_st_X509_NAME;
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn SSL_load_error_strings();
|
||||
pub fn SSL_state_string(ssl: *const SSL) -> *const c_char;
|
||||
pub fn SSL_state_string_long(ssl: *const SSL) -> *const c_char;
|
||||
|
||||
pub fn SSL_SESSION_get_time(s: *const SSL_SESSION) -> c_long;
|
||||
pub fn SSL_SESSION_get_timeout(s: *const SSL_SESSION) -> c_long;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_SESSION_get_protocol_version(s: *const SSL_SESSION) -> c_int;
|
||||
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_SESSION_set_max_early_data(ctx: *mut SSL_SESSION, max_early_data: u32) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_SESSION_get_max_early_data(ctx: *const SSL_SESSION) -> u32;
|
||||
|
||||
pub fn SSL_SESSION_get_id(s: *const SSL_SESSION, len: *mut c_uint) -> *const c_uchar;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_SESSION_up_ref(ses: *mut SSL_SESSION) -> c_int;
|
||||
pub fn SSL_SESSION_free(s: *mut SSL_SESSION);
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_SSL_SESSION(s: #[const_ptr_if(ossl300)] SSL_SESSION, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn SSL_set_session(ssl: *mut SSL, session: *mut SSL_SESSION) -> c_int;
|
||||
pub fn SSL_CTX_add_session(ctx: *mut SSL_CTX, session: *mut SSL_SESSION) -> c_int;
|
||||
pub fn SSL_CTX_remove_session(ctx: *mut SSL_CTX, session: *mut SSL_SESSION) -> c_int;
|
||||
pub fn d2i_SSL_SESSION(
|
||||
a: *mut *mut SSL_SESSION,
|
||||
pp: *mut *const c_uchar,
|
||||
len: c_long,
|
||||
) -> *mut SSL_SESSION;
|
||||
|
||||
#[cfg(not(ossl300))]
|
||||
pub fn SSL_get_peer_certificate(ssl: *const SSL) -> *mut X509;
|
||||
#[cfg(ossl300)]
|
||||
pub fn SSL_get1_peer_certificate(ssl: *const SSL) -> *mut X509;
|
||||
|
||||
pub fn SSL_get_peer_cert_chain(ssl: *const SSL) -> *mut stack_st_X509;
|
||||
|
||||
pub fn SSL_CTX_set_verify(
|
||||
ctx: *mut SSL_CTX,
|
||||
mode: c_int,
|
||||
verify_callback: Option<extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
|
||||
);
|
||||
pub fn SSL_CTX_set_verify_depth(ctx: *mut SSL_CTX, depth: c_int);
|
||||
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_CTX_set_post_handshake_auth(ctx: *mut SSL_CTX, val: c_int);
|
||||
|
||||
pub fn SSL_CTX_check_private_key(ctx: *const SSL_CTX) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_set_session_id_context(
|
||||
ssl: *mut SSL_CTX,
|
||||
sid_ctx: *const c_uchar,
|
||||
sid_ctx_len: c_uint,
|
||||
) -> c_int;
|
||||
|
||||
pub fn SSL_new(ctx: *mut SSL_CTX) -> *mut SSL;
|
||||
|
||||
pub fn SSL_CTX_get0_param(ctx: *mut SSL_CTX) -> *mut X509_VERIFY_PARAM;
|
||||
|
||||
pub fn SSL_get0_param(ssl: *mut SSL) -> *mut X509_VERIFY_PARAM;
|
||||
}
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub type SSL_client_hello_cb_fn =
|
||||
Option<unsafe extern "C" fn(s: *mut SSL, al: *mut c_int, arg: *mut c_void) -> c_int>;
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_set_client_hello_cb(
|
||||
c: *mut SSL_CTX,
|
||||
cb: SSL_client_hello_cb_fn,
|
||||
arg: *mut c_void,
|
||||
);
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_isv2(s: *mut SSL) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_legacy_version(s: *mut SSL) -> c_uint;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_random(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_session_id(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_ciphers(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_compression_methods(
|
||||
s: *mut SSL,
|
||||
out: *mut *const c_uchar,
|
||||
) -> size_t;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get1_extensions_present(
|
||||
s: *mut SSL,
|
||||
out: *mut *mut c_int,
|
||||
outlen: *mut size_t,
|
||||
) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_client_hello_get0_ext(
|
||||
s: *mut SSL,
|
||||
type_: c_uint,
|
||||
out: *mut *const c_uchar,
|
||||
outlen: *mut size_t,
|
||||
) -> c_int;
|
||||
|
||||
pub fn SSL_free(ssl: *mut SSL);
|
||||
pub fn SSL_accept(ssl: *mut SSL) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_stateless(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_connect(ssl: *mut SSL) -> c_int;
|
||||
pub fn SSL_read(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_read_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize)
|
||||
-> c_int;
|
||||
pub fn SSL_peek(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_peek_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize)
|
||||
-> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_read_early_data(
|
||||
s: *mut SSL,
|
||||
buf: *mut c_void,
|
||||
num: size_t,
|
||||
readbytes: *mut size_t,
|
||||
) -> c_int;
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_bytes_to_cipher_list(
|
||||
s: *mut SSL,
|
||||
bytes: *const c_uchar,
|
||||
len: size_t,
|
||||
isv2format: c_int,
|
||||
sk: *mut *mut stack_st_SSL_CIPHER,
|
||||
scsvs: *mut *mut stack_st_SSL_CIPHER,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_write(ssl: *mut SSL, buf: *const c_void, num: c_int) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_write_ex(
|
||||
ssl: *mut SSL,
|
||||
buf: *const c_void,
|
||||
num: size_t,
|
||||
written: *mut size_t,
|
||||
) -> c_int;
|
||||
#[cfg(any(ossl111, libressl))]
|
||||
pub fn SSL_write_early_data(
|
||||
s: *mut SSL,
|
||||
buf: *const c_void,
|
||||
num: size_t,
|
||||
written: *mut size_t,
|
||||
) -> c_int;
|
||||
pub fn SSL_ctrl(ssl: *mut SSL, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
|
||||
pub fn SSL_CTX_ctrl(ctx: *mut SSL_CTX, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
|
||||
#[link_name = "SSL_CTX_callback_ctrl"]
|
||||
pub fn SSL_CTX_callback_ctrl__fixed_rust(
|
||||
ctx: *mut SSL_CTX,
|
||||
cmd: c_int,
|
||||
fp: Option<unsafe extern "C" fn()>,
|
||||
) -> c_long;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn TLS_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn DTLS_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn TLS_server_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn TLS_client_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn DTLS_server_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn DTLS_client_method() -> *const SSL_METHOD;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SSL3_METHOD"))]
|
||||
pub fn SSLv3_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn SSLv23_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn SSLv23_client_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn SSLv23_server_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn TLSv1_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn TLSv1_1_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn TLSv1_2_method() -> *const SSL_METHOD;
|
||||
|
||||
pub fn DTLSv1_method() -> *const SSL_METHOD;
|
||||
|
||||
#[cfg(ossl102)]
|
||||
pub fn DTLSv1_2_method() -> *const SSL_METHOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_get_error(ssl: *const SSL, ret: c_int) -> c_int;
|
||||
pub fn SSL_get_version(ssl: *const SSL) -> *const c_char;
|
||||
|
||||
pub fn SSL_do_handshake(ssl: *mut SSL) -> c_int;
|
||||
pub fn SSL_shutdown(ssl: *mut SSL) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_set_client_CA_list(ctx: *mut SSL_CTX, list: *mut stack_st_X509_NAME);
|
||||
|
||||
pub fn SSL_CTX_add_client_CA(ctx: *mut SSL_CTX, cacert: *mut X509) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_set_default_verify_paths(ctx: *mut SSL_CTX) -> c_int;
|
||||
pub fn SSL_CTX_load_verify_locations(
|
||||
ctx: *mut SSL_CTX,
|
||||
CAfile: *const c_char,
|
||||
CApath: *const c_char,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn SSL_get_ssl_method(ssl: #[const_ptr_if(ossl111b)] SSL) -> *const SSL_METHOD;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_set_connect_state(s: *mut SSL);
|
||||
pub fn SSL_set_accept_state(s: *mut SSL);
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn SSL_library_init() -> c_int;
|
||||
|
||||
pub fn SSL_CIPHER_description(
|
||||
cipher: *const SSL_CIPHER,
|
||||
buf: *mut c_char,
|
||||
size: c_int,
|
||||
) -> *mut c_char;
|
||||
|
||||
pub fn SSL_get_certificate(ssl: *const SSL) -> *mut X509;
|
||||
pub fn SSL_get_privatekey(ssl: *const SSL) -> *mut EVP_PKEY;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_get0_certificate(ctx: *const SSL_CTX) -> *mut X509;
|
||||
pub fn SSL_CTX_get0_privatekey(ctx: *const SSL_CTX) -> *mut EVP_PKEY;
|
||||
|
||||
pub fn SSL_set_shutdown(ss: *mut SSL, mode: c_int);
|
||||
pub fn SSL_get_shutdown(ssl: *const SSL) -> c_int;
|
||||
pub fn SSL_version(ssl: *const SSL) -> c_int;
|
||||
pub fn SSL_get_session(s: *const SSL) -> *mut SSL_SESSION;
|
||||
pub fn SSL_get_SSL_CTX(ssl: *const SSL) -> *mut SSL_CTX;
|
||||
pub fn SSL_set_SSL_CTX(ssl: *mut SSL, ctx: *mut SSL_CTX) -> *mut SSL_CTX;
|
||||
|
||||
pub fn SSL_get_verify_result(ssl: *const SSL) -> c_long;
|
||||
#[cfg(ossl110)]
|
||||
pub fn SSL_get0_verified_chain(ssl: *const SSL) -> *mut stack_st_X509;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_get_client_random(ssl: *const SSL, out: *mut c_uchar, len: size_t) -> size_t;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_get_server_random(ssl: *const SSL, out: *mut c_uchar, len: size_t) -> size_t;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_SESSION_get_master_key(
|
||||
session: *const SSL_SESSION,
|
||||
out: *mut c_uchar,
|
||||
outlen: size_t,
|
||||
) -> size_t;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn SSL_get_ex_new_index(
|
||||
argl: c_long,
|
||||
argp: *mut c_void,
|
||||
new_func: Option<CRYPTO_EX_new>,
|
||||
dup_func: Option<CRYPTO_EX_dup>,
|
||||
free_func: Option<CRYPTO_EX_free>,
|
||||
) -> c_int;
|
||||
|
||||
pub fn SSL_set_ex_data(ssl: *mut SSL, idx: c_int, data: *mut c_void) -> c_int;
|
||||
pub fn SSL_get_ex_data(ssl: *const SSL, idx: c_int) -> *mut c_void;
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
pub fn SSL_CTX_get_ex_new_index(
|
||||
argl: c_long,
|
||||
argp: *mut c_void,
|
||||
new_func: Option<CRYPTO_EX_new>,
|
||||
dup_func: Option<CRYPTO_EX_dup>,
|
||||
free_func: Option<CRYPTO_EX_free>,
|
||||
) -> c_int;
|
||||
|
||||
pub fn SSL_CTX_set_ex_data(ctx: *mut SSL_CTX, idx: c_int, data: *mut c_void) -> c_int;
|
||||
pub fn SSL_CTX_get_ex_data(ctx: *const SSL_CTX, idx: c_int) -> *mut c_void;
|
||||
|
||||
pub fn SSL_get_ex_data_X509_STORE_CTX_idx() -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
#[link_name = "SSL_CTX_set_tmp_dh_callback"]
|
||||
pub fn SSL_CTX_set_tmp_dh_callback__fixed_rust(
|
||||
ctx: *mut SSL_CTX,
|
||||
dh: Option<
|
||||
unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
|
||||
>,
|
||||
);
|
||||
#[link_name = "SSL_set_tmp_dh_callback"]
|
||||
pub fn SSL_set_tmp_dh_callback__fixed_rust(
|
||||
ctx: *mut SSL,
|
||||
dh: Option<
|
||||
unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
|
||||
>,
|
||||
);
|
||||
#[cfg(not(ossl110))]
|
||||
#[link_name = "SSL_CTX_set_tmp_ecdh_callback"]
|
||||
pub fn SSL_CTX_set_tmp_ecdh_callback__fixed_rust(
|
||||
ctx: *mut SSL_CTX,
|
||||
ecdh: Option<
|
||||
unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY,
|
||||
>,
|
||||
);
|
||||
#[cfg(not(ossl110))]
|
||||
#[link_name = "SSL_set_tmp_ecdh_callback"]
|
||||
pub fn SSL_set_tmp_ecdh_callback__fixed_rust(
|
||||
ssl: *mut SSL,
|
||||
ecdh: Option<
|
||||
unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY,
|
||||
>,
|
||||
);
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(libressl)] {
|
||||
extern "C" {
|
||||
pub fn SSL_get_current_compression(ssl: *mut SSL) -> *const crate::libc::c_void;
|
||||
}
|
||||
} else if #[cfg(not(osslconf = "OPENSSL_NO_COMP"))] {
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn SSL_get_current_compression(ssl: #[const_ptr_if(ossl111b)] SSL) -> *const COMP_METHOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(libressl)] {
|
||||
extern "C" {
|
||||
pub fn SSL_COMP_get_name(comp: *const crate::libc::c_void) -> *const c_char;
|
||||
}
|
||||
} else if #[cfg(not(osslconf = "OPENSSL_NO_COMP"))] {
|
||||
extern "C" {
|
||||
pub fn SSL_COMP_get_name(comp: *const COMP_METHOD) -> *const c_char;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
|
||||
extern "C" {
|
||||
#[cfg(ossl110)]
|
||||
pub fn COMP_get_type(meth: *const COMP_METHOD) -> i32;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_CIPHER_get_cipher_nid(c: *const SSL_CIPHER) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn SSL_CIPHER_get_digest_nid(c: *const SSL_CIPHER) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
#[cfg(ossl110)]
|
||||
pub fn SSL_session_reused(ssl: #[const_ptr_if(ossl111c)] SSL) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn SSL_is_server(s: #[const_ptr_if(any(ossl110f, libressl))] SSL) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl110)]
|
||||
pub fn OPENSSL_init_ssl(opts: u64, settings: *const OPENSSL_INIT_SETTINGS) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_CTX_set_num_tickets(ctx: *mut SSL_CTX, num_tickets: size_t) -> c_int;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_set_num_tickets(s: *mut SSL, num_tickets: size_t) -> c_int;
|
||||
|
||||
#[cfg(ossl111b)]
|
||||
pub fn SSL_CTX_get_num_tickets(ctx: *const SSL_CTX) -> size_t;
|
||||
#[cfg(all(ossl111, not(ossl111b)))]
|
||||
pub fn SSL_CTX_get_num_tickets(ctx: *mut SSL_CTX) -> size_t;
|
||||
|
||||
#[cfg(ossl111b)]
|
||||
pub fn SSL_get_num_tickets(s: *const SSL) -> size_t;
|
||||
#[cfg(all(ossl111, not(ossl111b)))]
|
||||
pub fn SSL_get_num_tickets(s: *mut SSL) -> size_t;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl360))]
|
||||
pub fn SSL_CTX_set_security_level(ctx: *mut SSL_CTX, level: c_int);
|
||||
|
||||
#[cfg(any(ossl110, libressl360))]
|
||||
pub fn SSL_set_security_level(s: *mut SSL, level: c_int);
|
||||
|
||||
#[cfg(any(ossl110, libressl360))]
|
||||
pub fn SSL_CTX_get_security_level(ctx: *const SSL_CTX) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl360))]
|
||||
pub fn SSL_get_security_level(s: *const SSL) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(ossl320)]
|
||||
extern "C" {
|
||||
pub fn OSSL_QUIC_client_method() -> *const SSL_METHOD;
|
||||
pub fn OSSL_QUIC_client_thread_method() -> *const SSL_METHOD;
|
||||
pub fn SSL_get_event_timeout(s: *mut SSL, tv: *mut timeval, is_infinite: *mut c_int) -> c_int;
|
||||
pub fn SSL_handle_events(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_blocking_mode(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_set_blocking_mode(s: *mut SSL, blocking: c_int) -> c_int;
|
||||
pub fn SSL_get_rpoll_descriptor(s: *mut SSL, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
|
||||
pub fn SSL_get_wpoll_descriptor(s: *mut SSL, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
|
||||
pub fn SSL_net_read_desired(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_net_write_desired(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_set1_initial_peer_addr(s: *mut SSL, peer_addr: *const BIO_ADDR) -> c_int;
|
||||
pub fn SSL_shutdown_ex(
|
||||
ssl: *mut SSL,
|
||||
flags: u64,
|
||||
args: *const SSL_SHUTDOWN_EX_ARGS,
|
||||
args_len: usize,
|
||||
) -> c_int;
|
||||
pub fn SSL_stream_conclude(ssl: *mut SSL, flags: u64) -> c_int;
|
||||
pub fn SSL_stream_reset(
|
||||
ssl: *mut SSL,
|
||||
args: *const SSL_STREAM_RESET_ARGS,
|
||||
args_len: usize,
|
||||
) -> c_int;
|
||||
pub fn SSL_get_stream_read_state(ssl: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_stream_write_state(ssl: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_conn_close_info(
|
||||
ssl: *mut SSL,
|
||||
info: *mut SSL_CONN_CLOSE_INFO,
|
||||
info_len: usize,
|
||||
) -> c_int;
|
||||
pub fn SSL_get0_connection(s: *mut SSL) -> *mut SSL;
|
||||
pub fn SSL_is_connection(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_stream_type(s: *mut SSL) -> c_int;
|
||||
pub fn SSL_get_stream_id(s: *mut SSL) -> u64;
|
||||
pub fn SSL_new_stream(s: *mut SSL, flags: u64) -> *mut SSL;
|
||||
pub fn SSL_accept_stream(s: *mut SSL, flags: u64) -> *mut SSL;
|
||||
pub fn SSL_set_incoming_stream_policy(s: *mut SSL, policy: c_int, aec: u64) -> c_int;
|
||||
pub fn SSL_get_accept_stream_queue_len(s: *mut SSL) -> usize;
|
||||
pub fn SSL_set_default_stream_mode(s: *mut SSL, mode: u32) -> c_int;
|
||||
pub fn SSL_get0_group_name(s: *mut SSL) -> *const c_char;
|
||||
}
|
||||
|
||||
#[cfg(ossl330)]
|
||||
extern "C" {
|
||||
pub fn SSL_write_ex2(
|
||||
s: *mut SSL,
|
||||
buf: *const c_void,
|
||||
num: usize,
|
||||
flags: u64,
|
||||
written: *mut usize,
|
||||
) -> c_int;
|
||||
pub fn SSL_get_value_uint(s: *mut SSL, class_: u32, id: u32, v: *mut u64) -> c_int;
|
||||
pub fn SSL_set_value_uint(s: *mut SSL, class_: u32, id: u32, v: u64) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
extern "C" {
|
||||
pub fn SSL_CTX_set0_tmp_dh_pkey(ctx: *mut SSL_CTX, dhpkey: *mut EVP_PKEY) -> c_int;
|
||||
pub fn SSL_set0_tmp_dh_pkey(s: *mut SSL, dhpkey: *mut EVP_PKEY) -> c_int;
|
||||
}
|
||||
47
wasm/openssl/vendor/openssl-sys/src/handwritten/stack.rs
vendored
Normal file
47
wasm/openssl/vendor/openssl-sys/src/handwritten/stack.rs
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl110)] {
|
||||
pub enum OPENSSL_STACK {}
|
||||
} else if #[cfg(libressl390)] {
|
||||
pub enum _STACK {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct _STACK {
|
||||
pub num: c_int,
|
||||
pub data: *mut *mut c_char,
|
||||
pub sorted: c_int,
|
||||
pub num_alloc: c_int,
|
||||
pub comp: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(ossl110)] {
|
||||
extern "C" {
|
||||
pub fn OPENSSL_sk_num(stack: *const OPENSSL_STACK) -> c_int;
|
||||
pub fn OPENSSL_sk_value(stack: *const OPENSSL_STACK, idx: c_int) -> *mut c_void;
|
||||
|
||||
pub fn OPENSSL_sk_new_null() -> *mut OPENSSL_STACK;
|
||||
pub fn OPENSSL_sk_free(st: *mut OPENSSL_STACK);
|
||||
pub fn OPENSSL_sk_pop_free(
|
||||
st: *mut OPENSSL_STACK,
|
||||
free: Option<unsafe extern "C" fn(*mut c_void)>,
|
||||
);
|
||||
pub fn OPENSSL_sk_push(st: *mut OPENSSL_STACK, data: *const c_void) -> c_int;
|
||||
pub fn OPENSSL_sk_pop(st: *mut OPENSSL_STACK) -> *mut c_void;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn sk_num(st: *const _STACK) -> c_int;
|
||||
pub fn sk_value(st: *const _STACK, n: c_int) -> *mut c_void;
|
||||
|
||||
pub fn sk_new_null() -> *mut _STACK;
|
||||
pub fn sk_free(st: *mut _STACK);
|
||||
pub fn sk_pop_free(st: *mut _STACK, free: Option<unsafe extern "C" fn(*mut c_void)>);
|
||||
pub fn sk_push(st: *mut _STACK, data: *mut c_void) -> c_int;
|
||||
pub fn sk_pop(st: *mut _STACK) -> *mut c_void;
|
||||
}
|
||||
}
|
||||
}
|
||||
7
wasm/openssl/vendor/openssl-sys/src/handwritten/thread.rs
vendored
Normal file
7
wasm/openssl/vendor/openssl-sys/src/handwritten/thread.rs
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn OSSL_set_max_threads(ctx: *mut OSSL_LIB_CTX, max_threads: u64) -> c_int;
|
||||
pub fn OSSL_get_max_threads(ctx: *mut OSSL_LIB_CTX) -> u64;
|
||||
}
|
||||
28
wasm/openssl/vendor/openssl-sys/src/handwritten/tls1.rs
vendored
Normal file
28
wasm/openssl/vendor/openssl-sys/src/handwritten/tls1.rs
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
extern "C" {
|
||||
pub fn SSL_get_servername(ssl: *const SSL, name_type: c_int) -> *const c_char;
|
||||
|
||||
pub fn SSL_export_keying_material(
|
||||
s: *mut SSL,
|
||||
out: *mut c_uchar,
|
||||
olen: size_t,
|
||||
label: *const c_char,
|
||||
llen: size_t,
|
||||
context: *const c_uchar,
|
||||
contextlen: size_t,
|
||||
use_context: c_int,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl111)]
|
||||
pub fn SSL_export_keying_material_early(
|
||||
s: *mut SSL,
|
||||
out: *mut c_uchar,
|
||||
olen: size_t,
|
||||
label: *const c_char,
|
||||
llen: size_t,
|
||||
context: *const c_uchar,
|
||||
contextlen: size_t,
|
||||
) -> c_int;
|
||||
}
|
||||
863
wasm/openssl/vendor/openssl-sys/src/handwritten/types.rs
vendored
Normal file
863
wasm/openssl/vendor/openssl-sys/src/handwritten/types.rs
vendored
Normal file
@@ -0,0 +1,863 @@
|
||||
use crate::libc::*;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use super::super::*;
|
||||
|
||||
pub enum ASN1_OBJECT {}
|
||||
pub enum ASN1_VALUE {}
|
||||
|
||||
pub type ASN1_BOOLEAN = c_int;
|
||||
pub enum ASN1_INTEGER {}
|
||||
pub enum ASN1_ENUMERATED {}
|
||||
pub enum ASN1_GENERALIZEDTIME {}
|
||||
pub enum ASN1_STRING {}
|
||||
pub enum ASN1_BIT_STRING {}
|
||||
pub enum ASN1_TIME {}
|
||||
pub enum ASN1_OCTET_STRING {}
|
||||
pub enum ASN1_NULL {}
|
||||
pub enum ASN1_PRINTABLESTRING {}
|
||||
pub enum ASN1_T61STRING {}
|
||||
pub enum ASN1_IA5STRING {}
|
||||
pub enum ASN1_GENERALSTRING {}
|
||||
pub enum ASN1_BMPSTRING {}
|
||||
pub enum ASN1_UNIVERSALSTRING {}
|
||||
pub enum ASN1_UTCTIME {}
|
||||
pub enum ASN1_VISIBLESTRING {}
|
||||
pub enum ASN1_UTF8STRING {}
|
||||
|
||||
pub enum bio_st {} // FIXME remove
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum BIO {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct BIO {
|
||||
pub method: *mut BIO_METHOD,
|
||||
pub callback: Option<
|
||||
unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long) -> c_long,
|
||||
>,
|
||||
pub cb_arg: *mut c_char,
|
||||
pub init: c_int,
|
||||
pub shutdown: c_int,
|
||||
pub flags: c_int,
|
||||
pub retry_reason: c_int,
|
||||
pub num: c_int,
|
||||
pub ptr: *mut c_void,
|
||||
pub next_bio: *mut BIO,
|
||||
pub prev_bio: *mut BIO,
|
||||
pub references: c_int,
|
||||
pub num_read: c_ulong,
|
||||
pub num_write: c_ulong,
|
||||
pub ex_data: CRYPTO_EX_DATA,
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(ossl320)] {
|
||||
pub enum BIO_ADDR {}
|
||||
pub enum BIO_POLL_DESCRIPTOR {}
|
||||
#[repr(C)]
|
||||
pub struct BIO_MSG {
|
||||
pub data: *mut c_void,
|
||||
pub data_len: usize,
|
||||
pub peer: *mut BIO_ADDR,
|
||||
pub local: *mut BIO_ADDR,
|
||||
pub flags: u64,
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum BIGNUM {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct BIGNUM {
|
||||
pub d: *mut BN_ULONG,
|
||||
pub top: c_int,
|
||||
pub dmax: c_int,
|
||||
pub neg: c_int,
|
||||
pub flags: c_int,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub enum BN_BLINDING {}
|
||||
pub enum BN_MONT_CTX {}
|
||||
|
||||
pub enum BN_CTX {}
|
||||
pub enum BN_GENCB {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum EVP_CIPHER {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct EVP_CIPHER {
|
||||
pub nid: c_int,
|
||||
pub block_size: c_int,
|
||||
pub key_len: c_int,
|
||||
pub iv_len: c_int,
|
||||
pub flags: c_ulong,
|
||||
pub init: Option<
|
||||
unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *const c_uchar, *const c_uchar, c_int) -> c_int,
|
||||
>,
|
||||
pub do_cipher: Option<
|
||||
unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut c_uchar, *const c_uchar, size_t) -> c_int,
|
||||
>,
|
||||
pub cleanup: Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX) -> c_int>,
|
||||
pub ctx_size: c_int,
|
||||
pub set_asn1_parameters:
|
||||
Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>,
|
||||
pub get_asn1_parameters:
|
||||
Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>,
|
||||
pub ctrl:
|
||||
Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, c_int, c_int, *mut c_void) -> c_int>,
|
||||
pub app_data: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub enum EVP_CIPHER_CTX {}
|
||||
pub enum EVP_MD {}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum EVP_MD_CTX {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct EVP_MD_CTX {
|
||||
digest: *mut EVP_MD,
|
||||
engine: *mut ENGINE,
|
||||
flags: c_ulong,
|
||||
md_data: *mut c_void,
|
||||
pctx: *mut EVP_PKEY_CTX,
|
||||
update: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum PKCS8_PRIV_KEY_INFO {}
|
||||
|
||||
pub enum EVP_PKEY_ASN1_METHOD {}
|
||||
|
||||
pub enum EVP_PKEY_CTX {}
|
||||
|
||||
pub enum CMAC_CTX {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum HMAC_CTX {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct HMAC_CTX {
|
||||
md: *mut EVP_MD,
|
||||
md_ctx: EVP_MD_CTX,
|
||||
i_ctx: EVP_MD_CTX,
|
||||
o_ctx: EVP_MD_CTX,
|
||||
key_length: c_uint,
|
||||
key: [c_uchar; 128],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum DH {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct DH {
|
||||
pub pad: c_int,
|
||||
pub version: c_int,
|
||||
pub p: *mut BIGNUM,
|
||||
pub g: *mut BIGNUM,
|
||||
pub length: c_long,
|
||||
pub pub_key: *mut BIGNUM,
|
||||
pub priv_key: *mut BIGNUM,
|
||||
pub flags: c_int,
|
||||
pub method_mont_p: *mut BN_MONT_CTX,
|
||||
pub q: *mut BIGNUM,
|
||||
pub j: *mut BIGNUM,
|
||||
pub seed: *mut c_uchar,
|
||||
pub seedlen: c_int,
|
||||
pub counter: *mut BIGNUM,
|
||||
pub references: c_int,
|
||||
pub ex_data: CRYPTO_EX_DATA,
|
||||
pub meth: *const DH_METHOD,
|
||||
pub engine: *mut ENGINE,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub enum DH_METHOD {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum DSA {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct DSA {
|
||||
pub pad: c_int,
|
||||
pub version: c_long,
|
||||
pub write_params: c_int,
|
||||
|
||||
pub p: *mut BIGNUM,
|
||||
pub q: *mut BIGNUM,
|
||||
pub g: *mut BIGNUM,
|
||||
pub pub_key: *mut BIGNUM,
|
||||
pub priv_key: *mut BIGNUM,
|
||||
pub kinv: *mut BIGNUM,
|
||||
pub r: *mut BIGNUM,
|
||||
|
||||
pub flags: c_int,
|
||||
pub method_mont_p: *mut BN_MONT_CTX,
|
||||
pub references: c_int,
|
||||
pub ex_data: CRYPTO_EX_DATA,
|
||||
pub meth: *const DSA_METHOD,
|
||||
pub engine: *mut ENGINE,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub enum DSA_METHOD {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum RSA {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct RSA {
|
||||
pub pad: c_int,
|
||||
pub version: c_long,
|
||||
pub meth: *const RSA_METHOD,
|
||||
|
||||
pub engine: *mut ENGINE,
|
||||
pub n: *mut BIGNUM,
|
||||
pub e: *mut BIGNUM,
|
||||
pub d: *mut BIGNUM,
|
||||
pub p: *mut BIGNUM,
|
||||
pub q: *mut BIGNUM,
|
||||
pub dmp1: *mut BIGNUM,
|
||||
pub dmq1: *mut BIGNUM,
|
||||
pub iqmp: *mut BIGNUM,
|
||||
|
||||
pub ex_data: CRYPTO_EX_DATA,
|
||||
pub references: c_int,
|
||||
pub flags: c_int,
|
||||
|
||||
pub _method_mod_n: *mut BN_MONT_CTX,
|
||||
pub _method_mod_p: *mut BN_MONT_CTX,
|
||||
pub _method_mod_q: *mut BN_MONT_CTX,
|
||||
|
||||
pub bignum_data: *mut c_char,
|
||||
pub blinding: *mut BN_BLINDING,
|
||||
pub mt_blinding: *mut BN_BLINDING,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub enum RSA_METHOD {}
|
||||
|
||||
pub enum EC_KEY {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509 {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509 {
|
||||
pub cert_info: *mut X509_CINF,
|
||||
pub sig_alg: *mut X509_ALGOR,
|
||||
pub signature: *mut ASN1_BIT_STRING,
|
||||
pub valid: c_int,
|
||||
pub references: c_int,
|
||||
pub name: *mut c_char,
|
||||
pub ex_data: CRYPTO_EX_DATA,
|
||||
pub ex_pathlen: c_long,
|
||||
pub ex_pcpathlen: c_long,
|
||||
pub ex_flags: c_ulong,
|
||||
pub ex_kusage: c_ulong,
|
||||
pub ex_xkusage: c_ulong,
|
||||
pub ex_nscert: c_ulong,
|
||||
skid: *mut c_void,
|
||||
akid: *mut c_void,
|
||||
policy_cache: *mut c_void,
|
||||
crldp: *mut c_void,
|
||||
altname: *mut c_void,
|
||||
nc: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_RFC3779"))]
|
||||
rfc3779_addr: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_RFC3779"))]
|
||||
rfc3779_asid: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SHA"))]
|
||||
sha1_hash: [c_uchar; 20],
|
||||
aux: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl382))] {
|
||||
pub enum X509_ALGOR {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_ALGOR {
|
||||
pub algorithm: *mut ASN1_OBJECT,
|
||||
parameter: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack!(stack_st_X509_ALGOR);
|
||||
|
||||
pub enum X509_LOOKUP_METHOD {}
|
||||
|
||||
pub enum X509_NAME {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_STORE {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_STORE {
|
||||
cache: c_int,
|
||||
pub objs: *mut stack_st_X509_OBJECT,
|
||||
get_cert_methods: *mut stack_st_X509_LOOKUP,
|
||||
param: *mut X509_VERIFY_PARAM,
|
||||
verify: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
|
||||
verify_cb: Option<extern "C" fn(ok: c_int, ctx: *mut X509_STORE_CTX) -> c_int>,
|
||||
get_issuer: Option<
|
||||
extern "C" fn(issuer: *mut *mut X509, ctx: *mut X509_STORE_CTX, x: *mut X509) -> c_int,
|
||||
>,
|
||||
check_issued:
|
||||
Option<extern "C" fn(ctx: *mut X509_STORE_CTX, x: *mut X509, issuer: *mut X509) -> c_int>,
|
||||
check_revocation: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
|
||||
get_crl: Option<
|
||||
extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut *mut X509_CRL, x: *mut X509) -> c_int,
|
||||
>,
|
||||
check_crl: Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL) -> c_int>,
|
||||
cert_crl:
|
||||
Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL, x: *mut X509) -> c_int>,
|
||||
lookup_certs:
|
||||
Option<extern "C" fn(ctx: *mut X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509>,
|
||||
lookup_crls: Option<
|
||||
extern "C" fn(ctx: *const X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509_CRL,
|
||||
>,
|
||||
cleanup: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
|
||||
ex_data: CRYPTO_EX_DATA,
|
||||
references: c_int,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum X509_STORE_CTX {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_VERIFY_PARAM {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_VERIFY_PARAM {
|
||||
pub name: *mut c_char,
|
||||
pub check_time: time_t,
|
||||
pub inh_flags: c_ulong,
|
||||
pub flags: c_ulong,
|
||||
pub purpose: c_int,
|
||||
pub trust: c_int,
|
||||
pub depth: c_int,
|
||||
pub policies: *mut stack_st_ASN1_OBJECT,
|
||||
#[cfg(ossl102)]
|
||||
pub id: *mut X509_VERIFY_PARAM_ID,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_OBJECT {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_OBJECT {
|
||||
pub type_: c_int,
|
||||
pub data: X509_OBJECT_data,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub union X509_OBJECT_data {
|
||||
pub ptr: *mut c_char,
|
||||
pub x509: *mut X509,
|
||||
pub crl: *mut X509_CRL,
|
||||
pub pkey: *mut EVP_PKEY,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum X509_LOOKUP {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct X509V3_CTX {
|
||||
flags: c_int,
|
||||
issuer_cert: *mut c_void,
|
||||
subject_cert: *mut c_void,
|
||||
subject_req: *mut c_void,
|
||||
crl: *mut c_void,
|
||||
#[cfg(not(libressl400))]
|
||||
db_meth: *mut c_void,
|
||||
db: *mut c_void,
|
||||
#[cfg(ossl300)]
|
||||
issuer_pkey: *mut c_void,
|
||||
// I like the last comment line, it is copied from OpenSSL sources:
|
||||
// Maybe more here
|
||||
}
|
||||
pub enum CONF {}
|
||||
#[cfg(ossl110)]
|
||||
pub enum OPENSSL_INIT_SETTINGS {}
|
||||
|
||||
pub enum ENGINE {}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum SSL {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct SSL {
|
||||
version: c_int,
|
||||
type_: c_int,
|
||||
method: *const SSL_METHOD,
|
||||
rbio: *mut c_void,
|
||||
wbio: *mut c_void,
|
||||
bbio: *mut c_void,
|
||||
rwstate: c_int,
|
||||
in_handshake: c_int,
|
||||
handshake_func: Option<unsafe extern "C" fn(*mut SSL) -> c_int>,
|
||||
pub server: c_int,
|
||||
new_session: c_int,
|
||||
quiet_session: c_int,
|
||||
shutdown: c_int,
|
||||
state: c_int,
|
||||
rstate: c_int,
|
||||
init_buf: *mut c_void,
|
||||
init_msg: *mut c_void,
|
||||
init_num: c_int,
|
||||
init_off: c_int,
|
||||
packet: *mut c_uchar,
|
||||
packet_length: c_uint,
|
||||
s2: *mut c_void,
|
||||
s3: *mut c_void,
|
||||
d1: *mut c_void,
|
||||
read_ahead: c_int,
|
||||
msg_callback: Option<
|
||||
unsafe extern "C" fn(c_int, c_int, c_int, *const c_void, size_t, *mut SSL, *mut c_void),
|
||||
>,
|
||||
msg_callback_arg: *mut c_void,
|
||||
hit: c_int,
|
||||
param: *mut c_void,
|
||||
cipher_list: *mut stack_st_SSL_CIPHER,
|
||||
cipher_list_by_id: *mut stack_st_SSL_CIPHER,
|
||||
mac_flags: c_int,
|
||||
enc_read_ctx: *mut EVP_CIPHER_CTX,
|
||||
read_hash: *mut EVP_MD_CTX,
|
||||
expand: *mut c_void,
|
||||
enc_write_ctx: *mut EVP_CIPHER_CTX,
|
||||
write_hash: *mut EVP_MD_CTX,
|
||||
compress: *mut c_void,
|
||||
cert: *mut c_void,
|
||||
sid_ctx_length: c_uint,
|
||||
sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
|
||||
session: *mut SSL_SESSION,
|
||||
generate_session_id: GEN_SESSION_CB,
|
||||
verify_mode: c_int,
|
||||
verify_callback: Option<unsafe extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
|
||||
info_callback: Option<unsafe extern "C" fn(*mut SSL, c_int, c_int)>,
|
||||
error: c_int,
|
||||
error_code: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
|
||||
kssl_ctx: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_client_callback: Option<
|
||||
unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_char, c_uint, *mut c_uchar, c_uint)
|
||||
-> c_uint,
|
||||
>,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_server_callback:
|
||||
Option<unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_uchar, c_uint) -> c_uint>,
|
||||
ctx: *mut SSL_CTX,
|
||||
debug: c_int,
|
||||
verify_result: c_long,
|
||||
ex_data: CRYPTO_EX_DATA,
|
||||
client_CA: *mut stack_st_X509_NAME,
|
||||
references: c_int,
|
||||
options: c_ulong,
|
||||
mode: c_ulong,
|
||||
max_cert_list: c_long,
|
||||
first_packet: c_int,
|
||||
client_version: c_int,
|
||||
max_send_fragment: c_uint,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_debug_cb:
|
||||
Option<unsafe extern "C" fn(*mut SSL, c_int, c_int, *mut c_uchar, c_int, *mut c_void)>,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_debug_arg: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_hostname: *mut c_char,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
servername_done: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_status_type: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_status_expected: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ocsp_ids: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ocsp_exts: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ocsp_resp: *mut c_uchar,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ocsp_resplen: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ticket_expected: c_int,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ecpointformatlist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ecpointformatlist: *mut c_uchar,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ellipticcurvelist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC")
|
||||
))]
|
||||
tlsext_ellipticcurvelist: *mut c_uchar,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_opaque_prf_input: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_opaque_prf_input_len: size_t,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_session_ticket: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_session_ticket_ext_cb: tls_session_ticket_ext_cb_fn,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tls_session_ticket_ext_cb_arg: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tls_session_secret_cb: tls_session_secret_cb_fn,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tls_session_secret_cb_arg: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
initial_ctx: *mut SSL_CTX,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_proto_negotiated: *mut c_uchar,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_proto_negotiated_len: c_uchar,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
srtp_profiles: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
srtp_profile: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_heartbeat: c_uint,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_hb_pending: c_uint,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_hb_seq: c_uint,
|
||||
renegotiate: c_int,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
|
||||
srp_ctx: SRP_CTX,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_client_proto_list: *mut c_uchar,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_client_proto_list_len: c_uint,
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum SSL_CTX {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct SSL_CTX {
|
||||
method: *mut c_void,
|
||||
cipher_list: *mut c_void,
|
||||
cipher_list_by_id: *mut c_void,
|
||||
cert_store: *mut c_void,
|
||||
sessions: *mut c_void,
|
||||
session_cache_size: c_ulong,
|
||||
session_cache_head: *mut c_void,
|
||||
session_cache_tail: *mut c_void,
|
||||
session_cache_mode: c_int,
|
||||
session_timeout: c_long,
|
||||
new_session_cb: *mut c_void,
|
||||
remove_session_cb: *mut c_void,
|
||||
get_session_cb: *mut c_void,
|
||||
stats: [c_int; 11],
|
||||
pub references: c_int,
|
||||
app_verify_callback: *mut c_void,
|
||||
app_verify_arg: *mut c_void,
|
||||
default_passwd_callback: *mut c_void,
|
||||
default_passwd_callback_userdata: *mut c_void,
|
||||
client_cert_cb: *mut c_void,
|
||||
app_gen_cookie_cb: *mut c_void,
|
||||
app_verify_cookie_cb: *mut c_void,
|
||||
ex_dat: CRYPTO_EX_DATA,
|
||||
rsa_md5: *mut c_void,
|
||||
md5: *mut c_void,
|
||||
sha1: *mut c_void,
|
||||
extra_certs: *mut c_void,
|
||||
comp_methods: *mut c_void,
|
||||
info_callback: *mut c_void,
|
||||
client_CA: *mut c_void,
|
||||
options: c_ulong,
|
||||
mode: c_ulong,
|
||||
max_cert_list: c_long,
|
||||
cert: *mut c_void,
|
||||
read_ahead: c_int,
|
||||
msg_callback: *mut c_void,
|
||||
msg_callback_arg: *mut c_void,
|
||||
verify_mode: c_int,
|
||||
sid_ctx_length: c_uint,
|
||||
sid_ctx: [c_uchar; 32],
|
||||
default_verify_callback: *mut c_void,
|
||||
generate_session_id: *mut c_void,
|
||||
param: *mut c_void,
|
||||
quiet_shutdown: c_int,
|
||||
max_send_fragment: c_uint,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_ENGINE"))]
|
||||
client_cert_engine: *mut c_void,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_servername_callback: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsect_servername_arg: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_tick_key_name: [c_uchar; 16],
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_tick_hmac_key: [c_uchar; 16],
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_tick_aes_key: [c_uchar; 16],
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_ticket_key_cb: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_status_cb: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_status_arg: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_opaque_prf_input_callback: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
tlsext_opaque_prf_input_callback_arg: *mut c_void,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_identity_hint: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_client_callback: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
|
||||
psk_server_callback: *mut c_void,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
|
||||
freelist_max_len: c_uint,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
|
||||
wbuf_freelist: *mut c_void,
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
|
||||
rbuf_freelist: *mut c_void,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
|
||||
srp_ctx: SRP_CTX,
|
||||
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_protos_advertised_cb: *mut c_void,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_protos_advertised_cb_arg: *mut c_void,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_proto_select_cb: *mut c_void,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
|
||||
))]
|
||||
next_proto_select_cb_arg: *mut c_void,
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
|
||||
srtp_profiles: *mut c_void,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_select_cb: *mut c_void,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_select_cb_arg: *mut c_void,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_client_proto_list: *mut c_void,
|
||||
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
|
||||
alpn_client_proto_list_len: c_uint,
|
||||
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC"),
|
||||
ossl102
|
||||
))]
|
||||
tlsext_ecpointformatlist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC"),
|
||||
ossl102
|
||||
))]
|
||||
tlsext_ecpointformatlist: *mut c_uchar,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC"),
|
||||
ossl102
|
||||
))]
|
||||
tlsext_ellipticcurvelist_length: size_t,
|
||||
#[cfg(all(
|
||||
not(osslconf = "OPENSSL_NO_TLSEXT"),
|
||||
not(osslconf = "OPENSSL_NO_EC"),
|
||||
ossl102
|
||||
))]
|
||||
tlsext_ellipticcurvelist: *mut c_uchar,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
|
||||
pub struct SRP_CTX {
|
||||
SRP_cb_arg: *mut c_void,
|
||||
TLS_ext_srp_username_callback: *mut c_void,
|
||||
SRP_verify_param_callback: *mut c_void,
|
||||
SRP_give_srp_client_pwd_callback: *mut c_void,
|
||||
login: *mut c_void,
|
||||
N: *mut c_void,
|
||||
g: *mut c_void,
|
||||
s: *mut c_void,
|
||||
B: *mut c_void,
|
||||
A: *mut c_void,
|
||||
a: *mut c_void,
|
||||
b: *mut c_void,
|
||||
v: *mut c_void,
|
||||
info: *mut c_void,
|
||||
stringth: c_int,
|
||||
srp_Mask: c_ulong,
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(ossl320)] {
|
||||
#[repr(C)]
|
||||
pub struct SSL_CONN_CLOSE_INFO {
|
||||
pub error_code: u64,
|
||||
pub frame_type: u64,
|
||||
pub reason: *const crate::libc::c_char,
|
||||
pub reason_len: usize,
|
||||
pub flags: u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct SSL_SHUTDOWN_EX_ARGS {
|
||||
pub quic_error_code: u64,
|
||||
pub quic_reason: *const c_char,
|
||||
}
|
||||
#[repr(C)]
|
||||
pub struct SSL_STREAM_RESET_ARGS {
|
||||
pub quic_error_code: u64,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum COMP_CTX {}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(all(any(ossl110, libressl), not(osslconf = "OPENSSL_NO_COMP")))] {
|
||||
pub enum COMP_METHOD {}
|
||||
} else if #[cfg(not(osslconf = "OPENSSL_NO_COMP"))] {
|
||||
#[repr(C)]
|
||||
pub struct COMP_METHOD {
|
||||
pub type_: c_int,
|
||||
pub name: *const c_char,
|
||||
init: Option<unsafe extern "C" fn(*mut COMP_CTX) -> c_int>,
|
||||
finish: Option<unsafe extern "C" fn(*mut COMP_CTX)>,
|
||||
compress: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut COMP_CTX,
|
||||
*mut c_uchar,
|
||||
c_uint,
|
||||
*mut c_uchar,
|
||||
c_uint,
|
||||
) -> c_int,
|
||||
>,
|
||||
expand: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut COMP_CTX,
|
||||
*mut c_uchar,
|
||||
c_uint,
|
||||
*mut c_uchar,
|
||||
c_uint,
|
||||
) -> c_int,
|
||||
>,
|
||||
ctrl: Option<unsafe extern "C" fn() -> c_long>,
|
||||
callback_ctrl: Option<unsafe extern "C" fn() -> c_long>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum CRYPTO_EX_DATA {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct CRYPTO_EX_DATA {
|
||||
pub sk: *mut stack_st_void,
|
||||
pub dummy: c_int,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum OCSP_RESPONSE {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum OSSL_PROVIDER {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum OSSL_LIB_CTX {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
#[repr(C)]
|
||||
pub struct OSSL_PARAM {
|
||||
key: *const c_char,
|
||||
data_type: c_uint,
|
||||
data: *mut c_void,
|
||||
data_size: size_t,
|
||||
return_size: size_t,
|
||||
}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum OSSL_PARAM_BLD {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum EVP_KDF {}
|
||||
#[cfg(ossl300)]
|
||||
pub enum EVP_KDF_CTX {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum OSSL_ENCODER_CTX {}
|
||||
#[cfg(ossl300)]
|
||||
pub enum OSSL_DECODER_CTX {}
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub type OSSL_PASSPHRASE_CALLBACK = Option<
|
||||
unsafe extern "C" fn(
|
||||
pass: *mut c_char,
|
||||
pass_size: size_t,
|
||||
pass_len: *mut size_t,
|
||||
params: *const OSSL_PARAM,
|
||||
arg: *mut c_void,
|
||||
) -> c_int,
|
||||
>;
|
||||
|
||||
#[cfg(ossl300)]
|
||||
pub enum EVP_MAC {}
|
||||
#[cfg(ossl300)]
|
||||
pub enum EVP_MAC_CTX {}
|
||||
788
wasm/openssl/vendor/openssl-sys/src/handwritten/x509.rs
vendored
Normal file
788
wasm/openssl/vendor/openssl-sys/src/handwritten/x509.rs
vendored
Normal file
@@ -0,0 +1,788 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(libressl400)] {
|
||||
pub enum X509_VAL {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_VAL {
|
||||
pub notBefore: *mut ASN1_TIME,
|
||||
pub notAfter: *mut ASN1_TIME,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum X509_NAME_ENTRY {}
|
||||
|
||||
stack!(stack_st_X509_NAME_ENTRY);
|
||||
|
||||
stack!(stack_st_X509_NAME);
|
||||
|
||||
pub enum X509_EXTENSION {}
|
||||
|
||||
stack!(stack_st_X509_EXTENSION);
|
||||
|
||||
pub enum X509_ATTRIBUTE {}
|
||||
|
||||
stack!(stack_st_X509_ATTRIBUTE);
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_REQ_INFO {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_REQ_INFO {
|
||||
pub enc: ASN1_ENCODING,
|
||||
pub version: *mut ASN1_INTEGER,
|
||||
pub subject: *mut X509_NAME,
|
||||
pubkey: *mut c_void,
|
||||
pub attributes: *mut stack_st_X509_ATTRIBUTE,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_CRL {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_CRL {
|
||||
pub crl: *mut X509_CRL_INFO,
|
||||
sig_alg: *mut X509_ALGOR,
|
||||
signature: *mut c_void,
|
||||
references: c_int,
|
||||
flags: c_int,
|
||||
akid: *mut c_void,
|
||||
idp: *mut c_void,
|
||||
idp_flags: c_int,
|
||||
idp_reasons: c_int,
|
||||
crl_number: *mut ASN1_INTEGER,
|
||||
base_crl_number: *mut ASN1_INTEGER,
|
||||
sha1_hash: [c_uchar; 20],
|
||||
issuers: *mut c_void,
|
||||
meth: *const c_void,
|
||||
meth_data: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack!(stack_st_X509_CRL);
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_CRL_INFO {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_CRL_INFO {
|
||||
version: *mut ASN1_INTEGER,
|
||||
sig_alg: *mut X509_ALGOR,
|
||||
pub issuer: *mut X509_NAME,
|
||||
pub lastUpdate: *mut ASN1_TIME,
|
||||
pub nextUpdate: *mut ASN1_TIME,
|
||||
pub revoked: *mut stack_st_X509_REVOKED,
|
||||
extensions: *mut stack_st_X509_EXTENSION,
|
||||
enc: ASN1_ENCODING,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_REVOKED {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_REVOKED {
|
||||
pub serialNumber: *mut ASN1_INTEGER,
|
||||
pub revocationDate: *mut ASN1_TIME,
|
||||
pub extensions: *mut stack_st_X509_EXTENSION,
|
||||
issuer: *mut stack_st_GENERAL_NAME,
|
||||
reason: c_int,
|
||||
sequence: c_int,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack!(stack_st_X509_REVOKED);
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_REQ {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_REQ {
|
||||
pub req_info: *mut X509_REQ_INFO,
|
||||
sig_alg: *mut c_void,
|
||||
signature: *mut c_void,
|
||||
references: c_int,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
pub enum X509_CINF {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_CINF {
|
||||
version: *mut c_void,
|
||||
serialNumber: *mut c_void,
|
||||
signature: *mut c_void,
|
||||
issuer: *mut c_void,
|
||||
pub validity: *mut X509_VAL,
|
||||
subject: *mut c_void,
|
||||
key: *mut c_void,
|
||||
issuerUID: *mut c_void,
|
||||
subjectUID: *mut c_void,
|
||||
pub extensions: *mut stack_st_X509_EXTENSION,
|
||||
enc: ASN1_ENCODING,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack!(stack_st_X509);
|
||||
|
||||
stack!(stack_st_X509_OBJECT);
|
||||
|
||||
stack!(stack_st_X509_LOOKUP);
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_verify_cert_error_string(n: c_long) -> *const c_char;
|
||||
|
||||
pub fn X509_sign(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
|
||||
|
||||
pub fn X509_digest(
|
||||
x: *const X509,
|
||||
digest: *const EVP_MD,
|
||||
buf: *mut c_uchar,
|
||||
len: *mut c_uint,
|
||||
) -> c_int;
|
||||
|
||||
pub fn X509_REQ_sign(x: *mut X509_REQ, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] X509) -> c_int;
|
||||
pub fn i2d_X509_REQ_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] X509_REQ) -> c_int;
|
||||
pub fn i2d_PrivateKey_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
|
||||
pub fn i2d_PUBKEY_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
|
||||
|
||||
pub fn i2d_PUBKEY(k: #[const_ptr_if(ossl300)] EVP_PKEY, buf: *mut *mut u8) -> c_int;
|
||||
pub fn i2d_PrivateKey(k: #[const_ptr_if(ossl300)] EVP_PKEY, buf: *mut *mut u8) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_RSA_PUBKEY(k: #[const_ptr_if(ossl300)] RSA, buf: *mut *mut u8) -> c_int;
|
||||
pub fn i2d_DSA_PUBKEY(a: #[const_ptr_if(ossl300)] DSA, pp: *mut *mut c_uchar) -> c_int;
|
||||
pub fn i2d_ECPrivateKey(ec_key: #[const_ptr_if(ossl300)] EC_KEY, pp: *mut *mut c_uchar) -> c_int;
|
||||
pub fn i2d_EC_PUBKEY(a: #[const_ptr_if(ossl300)] EC_KEY, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn d2i_PUBKEY(k: *mut *mut EVP_PKEY, buf: *mut *const u8, len: c_long) -> *mut EVP_PKEY;
|
||||
}
|
||||
|
||||
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
|
||||
extern "C" {
|
||||
pub fn d2i_RSA_PUBKEY(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
|
||||
pub fn d2i_DSA_PUBKEY(k: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
|
||||
pub fn d2i_EC_PUBKEY(
|
||||
a: *mut *mut EC_KEY,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut EC_KEY;
|
||||
|
||||
pub fn d2i_ECPrivateKey(
|
||||
k: *mut *mut EC_KEY,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut EC_KEY;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_ALGOR_get0(
|
||||
paobj: *mut #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT,
|
||||
pptype: *mut c_int,
|
||||
ppval: *mut #[const_ptr_if(any(ossl110, libressl))] c_void,
|
||||
alg: #[const_ptr_if(any(ossl110, libressl))] X509_ALGOR,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_gmtime_adj(time: *mut ASN1_TIME, adj: c_long) -> *mut ASN1_TIME;
|
||||
|
||||
pub fn X509_to_X509_REQ(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> *mut X509_REQ;
|
||||
|
||||
pub fn X509_ALGOR_free(x: *mut X509_ALGOR);
|
||||
|
||||
pub fn X509_REVOKED_new() -> *mut X509_REVOKED;
|
||||
pub fn X509_REVOKED_free(x: *mut X509_REVOKED);
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REVOKED_dup(rev: #[const_ptr_if(ossl300)] X509_REVOKED) -> *mut X509_REVOKED;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn d2i_X509_REVOKED(
|
||||
a: *mut *mut X509_REVOKED,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut X509_REVOKED;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509_REVOKED(x: #[const_ptr_if(ossl300)] X509_REVOKED, buf: *mut *mut u8) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_CRL_new() -> *mut X509_CRL;
|
||||
pub fn X509_CRL_free(x: *mut X509_CRL);
|
||||
pub fn d2i_X509_CRL(
|
||||
a: *mut *mut X509_CRL,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut X509_CRL;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509_CRL(x: #[const_ptr_if(ossl300)] X509_CRL, buf: *mut *mut u8) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_dup(x: #[const_ptr_if(ossl300)] X509_CRL) -> *mut X509_CRL;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_REQ_new() -> *mut X509_REQ;
|
||||
pub fn X509_REQ_free(x: *mut X509_REQ);
|
||||
pub fn d2i_X509_REQ(
|
||||
a: *mut *mut X509_REQ,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut X509_REQ;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509_REQ(x: #[const_ptr_if(ossl300)] X509_REQ, buf: *mut *mut u8) -> c_int;
|
||||
|
||||
pub fn X509_get0_signature(
|
||||
psig: *mut #[const_ptr_if(any(ossl110, libressl))] ASN1_BIT_STRING,
|
||||
palg: *mut #[const_ptr_if(any(ossl110, libressl))] X509_ALGOR,
|
||||
x: *const X509,
|
||||
);
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REQ_dup(x: #[const_ptr_if(ossl300)] X509_REQ) -> *mut X509_REQ;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
#[cfg(ossl102)]
|
||||
pub fn X509_get_signature_nid(x: *const X509) -> c_int;
|
||||
|
||||
pub fn X509_EXTENSION_free(ext: *mut X509_EXTENSION);
|
||||
|
||||
pub fn X509_NAME_ENTRY_free(x: *mut X509_NAME_ENTRY);
|
||||
|
||||
pub fn X509_NAME_new() -> *mut X509_NAME;
|
||||
pub fn X509_NAME_cmp(x: *const X509_NAME, y: *const X509_NAME) -> c_int;
|
||||
pub fn X509_NAME_free(x: *mut X509_NAME);
|
||||
|
||||
pub fn X509_new() -> *mut X509;
|
||||
pub fn X509_free(x: *mut X509);
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509(x: #[const_ptr_if(ossl300)] X509, buf: *mut *mut u8) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_NAME_dup(x: #[const_ptr_if(ossl300)] X509_NAME) -> *mut X509_NAME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_dup(x: #[const_ptr_if(ossl300)] X509) -> *mut X509;
|
||||
pub fn X509_NAME_add_entry(
|
||||
name: *mut X509_NAME,
|
||||
ne: #[const_ptr_if(any(ossl110, libressl))] X509_NAME_ENTRY,
|
||||
loc: c_int,
|
||||
set: c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn d2i_X509(a: *mut *mut X509, pp: *mut *const c_uchar, length: c_long) -> *mut X509;
|
||||
pub fn d2i_X509_bio(b: *mut BIO, a: *mut *mut X509) -> *mut X509;
|
||||
|
||||
pub fn X509_get_pubkey(x: *mut X509) -> *mut EVP_PKEY;
|
||||
|
||||
pub fn X509_set_version(x: *mut X509, version: c_long) -> c_int;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get_version(x: *const X509) -> c_long;
|
||||
pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int;
|
||||
pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER;
|
||||
pub fn X509_alias_get0(x: *mut X509, len: *mut c_int) -> *mut c_uchar;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_set_issuer_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_issuer_name_hash(x: *mut X509) -> c_ulong;
|
||||
pub fn X509_subject_name_hash(x: *mut X509) -> c_ulong;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_get_issuer_name(x: #[const_ptr_if(any(ossl110, libressl))] X509) -> *mut X509_NAME;
|
||||
pub fn X509_set_subject_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
|
||||
pub fn X509_get_subject_name(x: #[const_ptr_if(any(ossl110, libressl))] X509) -> *mut X509_NAME;
|
||||
}
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn X509_set1_notBefore(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
|
||||
pub fn X509_set1_notAfter(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn X509_set_notBefore(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
|
||||
pub fn X509_set_notAfter(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REQ_get_version(req: *const X509_REQ) -> c_long;
|
||||
pub fn X509_REQ_set_version(req: *mut X509_REQ, version: c_long) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_REQ_set_pubkey(req: *mut X509_REQ, pkey: *mut EVP_PKEY) -> c_int;
|
||||
pub fn X509_REQ_get_pubkey(req: *mut X509_REQ) -> *mut EVP_PKEY;
|
||||
pub fn X509_REQ_get_extensions(req: *mut X509_REQ) -> *mut stack_st_X509_EXTENSION;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_REQ_add_extensions(req: *mut X509_REQ, exts: #[const_ptr_if(ossl300)] stack_st_X509_EXTENSION)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_REQ_get_attr_count(req: *const X509_REQ) -> c_int;
|
||||
pub fn X509_REQ_get_attr_by_NID(req: *const X509_REQ, nid: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_REQ_get_attr(req: *const X509_REQ, loc: c_int) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_REQ_delete_attr(req: *mut X509_REQ, loc: c_int) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_REQ_add1_attr_by_txt(
|
||||
req: *mut X509_REQ,
|
||||
attrname: *const c_char,
|
||||
chtype: c_int,
|
||||
bytes: *const c_uchar,
|
||||
len: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509_REQ_add1_attr_by_NID(
|
||||
req: *mut X509_REQ,
|
||||
nid: c_int,
|
||||
chtype: c_int,
|
||||
bytes: *const c_uchar,
|
||||
len: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509_REQ_add1_attr_by_OBJ(
|
||||
req: *mut X509_REQ,
|
||||
obj: *const ASN1_OBJECT,
|
||||
chtype: c_int,
|
||||
bytes: *const c_uchar,
|
||||
len: c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_set_pubkey(x: *mut X509, pkey: *mut EVP_PKEY) -> c_int;
|
||||
pub fn X509_REQ_verify(req: *mut X509_REQ, pkey: *mut EVP_PKEY) -> c_int;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_getm_notBefore(x: *const X509) -> *mut ASN1_TIME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_getm_notAfter(x: *const X509) -> *mut ASN1_TIME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_up_ref(x: *mut X509) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REVOKED_get0_serialNumber(req: *const X509_REVOKED) -> *const ASN1_INTEGER;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REVOKED_get0_revocationDate(req: *const X509_REVOKED) -> *const ASN1_TIME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_REVOKED_get0_extensions(r: *const X509_REVOKED) -> *const stack_st_X509_EXTENSION;
|
||||
|
||||
pub fn X509_REVOKED_set_serialNumber(r: *mut X509_REVOKED, serial: *mut ASN1_INTEGER) -> c_int;
|
||||
pub fn X509_REVOKED_set_revocationDate(r: *mut X509_REVOKED, tm: *mut ASN1_TIME) -> c_int;
|
||||
|
||||
pub fn X509_CRL_sign(x: *mut X509_CRL, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
|
||||
pub fn X509_CRL_digest(
|
||||
x: *const X509_CRL,
|
||||
digest: *const EVP_MD,
|
||||
md: *mut c_uchar,
|
||||
len: *mut c_uint,
|
||||
) -> c_int;
|
||||
pub fn X509_CRL_verify(crl: *mut X509_CRL, pkey: *mut EVP_PKEY) -> c_int;
|
||||
pub fn X509_CRL_get0_by_cert(
|
||||
x: *mut X509_CRL,
|
||||
ret: *mut *mut X509_REVOKED,
|
||||
cert: *mut X509,
|
||||
) -> c_int;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_CRL_get0_by_serial(
|
||||
x: *mut X509_CRL,
|
||||
ret: *mut *mut X509_REVOKED,
|
||||
serial: #[const_ptr_if(ossl300)] ASN1_INTEGER,
|
||||
) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_get_REVOKED(crl: *mut X509_CRL) -> *mut stack_st_X509_REVOKED;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_get0_nextUpdate(x: *const X509_CRL) -> *const ASN1_TIME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_get0_lastUpdate(x: *const X509_CRL) -> *const ASN1_TIME;
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_get_issuer(x: *const X509_CRL) -> *mut X509_NAME;
|
||||
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get0_extensions(req: *const X509) -> *const stack_st_X509_EXTENSION;
|
||||
|
||||
pub fn X509_CRL_set_version(crl: *mut X509_CRL, version: c_long) -> c_int;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_CRL_set_issuer_name(crl: *mut X509_CRL, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_CRL_sort(crl: *mut X509_CRL) -> c_int;
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_CRL_up_ref(crl: *mut X509_CRL) -> c_int;
|
||||
pub fn X509_CRL_add0_revoked(crl: *mut X509_CRL, rev: *mut X509_REVOKED) -> c_int;
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn X509_CRL_set1_lastUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
|
||||
pub fn X509_CRL_set1_nextUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
|
||||
}
|
||||
} else {
|
||||
// ossl110 "#define"s these to the variants above
|
||||
extern "C" {
|
||||
pub fn X509_CRL_set_lastUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
|
||||
pub fn X509_CRL_set_nextUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_NAME_entry_count(n: #[const_ptr_if(any(ossl110, libressl))] X509_NAME) -> c_int;
|
||||
pub fn X509_NAME_get_index_by_NID(n: #[const_ptr_if(any(ossl300, libressl))] X509_NAME, nid: c_int, last_pos: c_int) -> c_int;
|
||||
pub fn X509_NAME_get_entry(n: #[const_ptr_if(any(ossl110, libressl))] X509_NAME, loc: c_int) -> *mut X509_NAME_ENTRY;
|
||||
pub fn X509_NAME_add_entry_by_NID(
|
||||
x: *mut X509_NAME,
|
||||
field: c_int,
|
||||
ty: c_int,
|
||||
bytes: #[const_ptr_if(any(ossl110, libressl))] c_uchar,
|
||||
len: c_int,
|
||||
loc: c_int,
|
||||
set: c_int,
|
||||
) -> c_int;
|
||||
pub fn i2d_X509_NAME(n: #[const_ptr_if(ossl300)] X509_NAME, buf: *mut *mut u8) -> c_int;
|
||||
pub fn X509_NAME_ENTRY_get_object(ne: #[const_ptr_if(any(ossl110, libressl))] X509_NAME_ENTRY) -> *mut ASN1_OBJECT;
|
||||
pub fn X509_NAME_ENTRY_get_data(ne: #[const_ptr_if(any(ossl110, libressl))] X509_NAME_ENTRY) -> *mut ASN1_STRING;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_NAME_add_entry_by_txt(
|
||||
x: *mut X509_NAME,
|
||||
field: *const c_char,
|
||||
ty: c_int,
|
||||
bytes: *const c_uchar,
|
||||
len: c_int,
|
||||
loc: c_int,
|
||||
set: c_int,
|
||||
) -> c_int;
|
||||
pub fn d2i_X509_NAME(
|
||||
n: *mut *mut X509_NAME,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut X509_NAME;
|
||||
}
|
||||
|
||||
// "raw" X509_EXTENSION related functions
|
||||
extern "C" {
|
||||
// in X509
|
||||
pub fn X509_delete_ext(x: *mut X509, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_add_ext(x: *mut X509, ext: *mut X509_EXTENSION, loc: c_int) -> c_int;
|
||||
pub fn X509_add1_ext_i2d(
|
||||
x: *mut X509,
|
||||
nid: c_int,
|
||||
value: *mut c_void,
|
||||
crit: c_int,
|
||||
flags: c_ulong,
|
||||
) -> c_int;
|
||||
// in X509_CRL
|
||||
pub fn X509_CRL_delete_ext(x: *mut X509_CRL, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_CRL_add_ext(x: *mut X509_CRL, ext: *mut X509_EXTENSION, loc: c_int) -> c_int;
|
||||
pub fn X509_CRL_add1_ext_i2d(
|
||||
x: *mut X509_CRL,
|
||||
nid: c_int,
|
||||
value: *mut c_void,
|
||||
crit: c_int,
|
||||
flags: c_ulong,
|
||||
) -> c_int;
|
||||
// in X509_REVOKED
|
||||
pub fn X509_REVOKED_delete_ext(x: *mut X509_REVOKED, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_REVOKED_add_ext(
|
||||
x: *mut X509_REVOKED,
|
||||
ext: *mut X509_EXTENSION,
|
||||
loc: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509_REVOKED_add1_ext_i2d(
|
||||
x: *mut X509_REVOKED,
|
||||
nid: c_int,
|
||||
value: *mut c_void,
|
||||
crit: c_int,
|
||||
flags: c_ulong,
|
||||
) -> c_int;
|
||||
// X509_EXTENSION stack
|
||||
// - these getters always used *const STACK
|
||||
pub fn X509v3_get_ext_count(x: *const stack_st_X509_EXTENSION) -> c_int;
|
||||
pub fn X509v3_get_ext_by_NID(
|
||||
x: *const stack_st_X509_EXTENSION,
|
||||
nid: c_int,
|
||||
lastpos: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509v3_get_ext_by_critical(
|
||||
x: *const stack_st_X509_EXTENSION,
|
||||
crit: c_int,
|
||||
lastpos: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509v3_get_ext(x: *const stack_st_X509_EXTENSION, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509v3_delete_ext(x: *mut stack_st_X509_EXTENSION, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509v3_add_ext(
|
||||
x: *mut *mut stack_st_X509_EXTENSION,
|
||||
ex: *mut X509_EXTENSION,
|
||||
loc: c_int,
|
||||
) -> *mut stack_st_X509_EXTENSION;
|
||||
// - X509V3_add1_i2d in x509v3.rs
|
||||
// X509_EXTENSION itself
|
||||
pub fn X509_EXTENSION_create_by_NID(
|
||||
ex: *mut *mut X509_EXTENSION,
|
||||
nid: c_int,
|
||||
crit: c_int,
|
||||
data: *mut ASN1_OCTET_STRING,
|
||||
) -> *mut X509_EXTENSION;
|
||||
pub fn X509_EXTENSION_set_critical(ex: *mut X509_EXTENSION, crit: c_int) -> c_int;
|
||||
pub fn X509_EXTENSION_set_data(ex: *mut X509_EXTENSION, data: *mut ASN1_OCTET_STRING) -> c_int;
|
||||
pub fn X509_EXTENSION_get_object(ext: *mut X509_EXTENSION) -> *mut ASN1_OBJECT;
|
||||
pub fn X509_EXTENSION_get_data(ext: *mut X509_EXTENSION) -> *mut ASN1_OCTET_STRING;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn i2d_X509_EXTENSION(ext: #[const_ptr_if(ossl300)] X509_EXTENSION, pp: *mut *mut c_uchar) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
// in X509
|
||||
pub fn X509_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl))] X509) -> c_int;
|
||||
pub fn X509_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl))] X509, nid: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl))] X509, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT, lastpos: c_int) -> c_int;
|
||||
pub fn X509_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl))] X509, crit: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_get_ext(x: #[const_ptr_if(any(ossl110, libressl))] X509, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_get_ext_d2i(
|
||||
x: #[const_ptr_if(any(ossl110, libressl))] X509,
|
||||
nid: c_int,
|
||||
crit: *mut c_int,
|
||||
idx: *mut c_int,
|
||||
) -> *mut c_void;
|
||||
// in X509_CRL
|
||||
pub fn X509_CRL_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL) -> c_int;
|
||||
pub fn X509_CRL_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL, nid: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_CRL_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT, lastpos: c_int) -> c_int;
|
||||
pub fn X509_CRL_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL, crit: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_CRL_get_ext(x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_CRL_get_ext_d2i(
|
||||
x: #[const_ptr_if(any(ossl110, libressl))] X509_CRL,
|
||||
nid: c_int,
|
||||
crit: *mut c_int,
|
||||
idx: *mut c_int,
|
||||
) -> *mut c_void;
|
||||
// in X509_REVOKED
|
||||
pub fn X509_REVOKED_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED) -> c_int;
|
||||
pub fn X509_REVOKED_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED, nid: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_REVOKED_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT, lastpos: c_int) -> c_int;
|
||||
pub fn X509_REVOKED_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED, crit: c_int, lastpos: c_int) -> c_int;
|
||||
pub fn X509_REVOKED_get_ext(x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED, loc: c_int) -> *mut X509_EXTENSION;
|
||||
pub fn X509_REVOKED_get_ext_d2i(
|
||||
x: #[const_ptr_if(any(ossl110, libressl))] X509_REVOKED,
|
||||
nid: c_int,
|
||||
crit: *mut c_int,
|
||||
idx: *mut c_int,
|
||||
) -> *mut c_void;
|
||||
// X509_EXTENSION stack
|
||||
pub fn X509v3_get_ext_by_OBJ(x: *const stack_st_X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT, lastpos: c_int) -> c_int;
|
||||
// X509_EXTENSION itself
|
||||
pub fn X509_EXTENSION_create_by_OBJ(ex: *mut *mut X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT, crit: c_int, data: *mut ASN1_OCTET_STRING) -> *mut X509_EXTENSION;
|
||||
pub fn X509_EXTENSION_set_object(ex: *mut X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl))] ASN1_OBJECT) -> c_int;
|
||||
pub fn X509_EXTENSION_get_critical(ex: #[const_ptr_if(any(ossl110, libressl))] X509_EXTENSION) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
pub fn X509_STORE_get0_objects(ctx: #[const_ptr_if(ossl300)] X509_STORE) -> *mut stack_st_X509_OBJECT;
|
||||
#[cfg(ossl300)]
|
||||
pub fn X509_STORE_get1_all_certs(ctx: *mut X509_STORE) -> *mut stack_st_X509;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(ossl110, libressl))]
|
||||
extern "C" {
|
||||
pub fn X509_OBJECT_get0_X509(x: *const X509_OBJECT) -> *mut X509;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
extern "C" {
|
||||
pub fn X509_OBJECT_free(a: *mut X509_OBJECT);
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn X509_OBJECT_free_contents(a: *mut X509_OBJECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_get_default_cert_file_env() -> *const c_char;
|
||||
pub fn X509_get_default_cert_file() -> *const c_char;
|
||||
pub fn X509_get_default_cert_dir_env() -> *const c_char;
|
||||
pub fn X509_get_default_cert_dir() -> *const c_char;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_cmp(a: *const X509, b: *const X509) -> c_int;
|
||||
pub fn X509_issuer_and_serial_cmp(a: *const X509, b: *const X509) -> c_int;
|
||||
pub fn X509_issuer_name_cmp(a: *const X509, b: *const X509) -> c_int;
|
||||
pub fn X509_subject_name_cmp(a: *const X509, b: *const X509) -> c_int;
|
||||
pub fn X509_CRL_cmp(a: *const X509_CRL, b: *const X509_CRL) -> c_int;
|
||||
pub fn X509_CRL_match(a: *const X509_CRL, b: *const X509_CRL) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_print(bio: *mut BIO, x509: *mut X509) -> c_int;
|
||||
pub fn X509_REQ_print(bio: *mut BIO, req: *mut X509_REQ) -> c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(libressl390)] {
|
||||
pub enum X509_PURPOSE {}
|
||||
} else {
|
||||
#[repr(C)]
|
||||
pub struct X509_PURPOSE {
|
||||
pub purpose: c_int,
|
||||
pub trust: c_int, // Default trust ID
|
||||
pub flags: c_int,
|
||||
pub check_purpose:
|
||||
Option<unsafe extern "C" fn(*const X509_PURPOSE, *const X509, c_int) -> c_int>,
|
||||
pub name: *mut c_char,
|
||||
pub sname: *mut c_char,
|
||||
pub usr_data: *mut c_void,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_PURPOSE_get_by_sname(sname: #[const_ptr_if(any(ossl110, libressl))] c_char) -> c_int;
|
||||
pub fn X509_PURPOSE_get_id(purpose: #[const_ptr_if(any(ossl110, libressl))] X509_PURPOSE) -> c_int;
|
||||
pub fn X509_PURPOSE_get0(idx: c_int) -> #[const_ptr_if(libressl390)] X509_PURPOSE;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_ATTRIBUTE_new() -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_ATTRIBUTE_free(attr: *mut X509_ATTRIBUTE);
|
||||
pub fn X509_ATTRIBUTE_create(
|
||||
nid: c_int,
|
||||
atrtype: c_int,
|
||||
value: *mut c_void,
|
||||
) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_ATTRIBUTE_create_by_NID(
|
||||
attr: *mut *mut X509_ATTRIBUTE,
|
||||
nid: c_int,
|
||||
atrtype: c_int,
|
||||
data: *const c_void,
|
||||
len: c_int,
|
||||
) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_ATTRIBUTE_create_by_OBJ(
|
||||
attr: *mut *mut X509_ATTRIBUTE,
|
||||
obj: *const ASN1_OBJECT,
|
||||
atrtype: c_int,
|
||||
data: *const c_void,
|
||||
len: c_int,
|
||||
) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_ATTRIBUTE_create_by_txt(
|
||||
attr: *mut *mut X509_ATTRIBUTE,
|
||||
atrname: *const c_char,
|
||||
atrtype: c_int,
|
||||
bytes: *const c_uchar,
|
||||
len: c_int,
|
||||
) -> *mut X509_ATTRIBUTE;
|
||||
pub fn X509_ATTRIBUTE_set1_object(attr: *mut X509_ATTRIBUTE, obj: *const ASN1_OBJECT) -> c_int;
|
||||
pub fn X509_ATTRIBUTE_set1_data(
|
||||
attr: *mut X509_ATTRIBUTE,
|
||||
attrtype: c_int,
|
||||
data: *const c_void,
|
||||
len: c_int,
|
||||
) -> c_int;
|
||||
pub fn X509_ATTRIBUTE_get0_data(
|
||||
attr: *mut X509_ATTRIBUTE,
|
||||
idx: c_int,
|
||||
atrtype: c_int,
|
||||
data: *mut c_void,
|
||||
) -> *mut c_void;
|
||||
pub fn X509_ATTRIBUTE_get0_object(attr: *mut X509_ATTRIBUTE) -> *mut ASN1_OBJECT;
|
||||
pub fn X509_ATTRIBUTE_get0_type(attr: *mut X509_ATTRIBUTE, idx: c_int) -> *mut ASN1_TYPE;
|
||||
pub fn d2i_X509_ATTRIBUTE(
|
||||
a: *mut *mut X509_ATTRIBUTE,
|
||||
pp: *mut *const c_uchar,
|
||||
length: c_long,
|
||||
) -> *mut X509_ATTRIBUTE;
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_ATTRIBUTE_count(
|
||||
attr: #[const_ptr_if(any(ossl110, libressl))] X509_ATTRIBUTE // const since OpenSSL v1.1.0
|
||||
) -> c_int;
|
||||
pub fn i2d_X509_ATTRIBUTE(x: #[const_ptr_if(ossl300)] X509_ATTRIBUTE, buf: *mut *mut u8) -> c_int;
|
||||
pub fn X509_ATTRIBUTE_dup(x: #[const_ptr_if(ossl300)] X509_ATTRIBUTE) -> *mut X509_ATTRIBUTE;
|
||||
}
|
||||
}
|
||||
129
wasm/openssl/vendor/openssl-sys/src/handwritten/x509_vfy.rs
vendored
Normal file
129
wasm/openssl/vendor/openssl-sys/src/handwritten/x509_vfy.rs
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
#[cfg(any(libressl, all(ossl102, not(ossl110))))]
|
||||
pub enum X509_VERIFY_PARAM_ID {}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_LOOKUP_meth_free(method: *mut X509_LOOKUP_METHOD);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_LOOKUP_hash_dir() -> #[const_ptr_if(libressl400)] X509_LOOKUP_METHOD;
|
||||
pub fn X509_LOOKUP_file() -> #[const_ptr_if(libressl400)] X509_LOOKUP_METHOD;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_LOOKUP_free(ctx: *mut X509_LOOKUP);
|
||||
pub fn X509_LOOKUP_ctrl(
|
||||
ctx: *mut X509_LOOKUP,
|
||||
cmd: c_int,
|
||||
argc: *const c_char,
|
||||
argl: c_long,
|
||||
ret: *mut *mut c_char,
|
||||
) -> c_int;
|
||||
pub fn X509_load_cert_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
|
||||
pub fn X509_load_crl_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_STORE_new() -> *mut X509_STORE;
|
||||
pub fn X509_STORE_free(store: *mut X509_STORE);
|
||||
|
||||
pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX;
|
||||
|
||||
pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX);
|
||||
pub fn X509_STORE_CTX_init(
|
||||
ctx: *mut X509_STORE_CTX,
|
||||
store: *mut X509_STORE,
|
||||
x509: *mut X509,
|
||||
chain: *mut stack_st_X509,
|
||||
) -> c_int;
|
||||
pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX);
|
||||
|
||||
pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int;
|
||||
|
||||
pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int;
|
||||
pub fn X509_STORE_set_flags(store: *mut X509_STORE, flags: c_ulong) -> c_int;
|
||||
pub fn X509_STORE_set_purpose(ctx: *mut X509_STORE, purpose: c_int) -> c_int;
|
||||
pub fn X509_STORE_set_trust(ctx: *mut X509_STORE, trust: c_int) -> c_int;
|
||||
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_STORE_add_lookup(
|
||||
store: *mut X509_STORE,
|
||||
meth: #[const_ptr_if(libressl400)] X509_LOOKUP_METHOD,
|
||||
) -> *mut X509_LOOKUP;
|
||||
pub fn X509_STORE_set1_param(store: *mut X509_STORE, pm: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_STORE_CTX_get_ex_data(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX, idx: c_int) -> *mut c_void;
|
||||
pub fn X509_STORE_CTX_get_error(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
|
||||
pub fn X509_STORE_CTX_get_error_depth(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
|
||||
pub fn X509_STORE_CTX_get_current_cert(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut X509;
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int);
|
||||
}
|
||||
cfg_if! {
|
||||
if #[cfg(any(ossl110, libressl))] {
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
extern "C" {
|
||||
pub fn X509_STORE_CTX_get_chain(ctx: *mut X509_STORE_CTX) -> *mut stack_st_X509;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM;
|
||||
pub fn X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM);
|
||||
|
||||
pub fn X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
|
||||
pub fn X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
|
||||
|
||||
pub fn X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t);
|
||||
|
||||
pub fn X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int);
|
||||
}
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509_VERIFY_PARAM_get_flags(param: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_ulong;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_VERIFY_PARAM_set1_host(
|
||||
param: *mut X509_VERIFY_PARAM,
|
||||
name: *const c_char,
|
||||
namelen: size_t,
|
||||
) -> c_int;
|
||||
pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint);
|
||||
pub fn X509_VERIFY_PARAM_set1_email(
|
||||
param: *mut X509_VERIFY_PARAM,
|
||||
email: *const c_char,
|
||||
emaillen: size_t,
|
||||
) -> c_int;
|
||||
pub fn X509_VERIFY_PARAM_set1_ip(
|
||||
param: *mut X509_VERIFY_PARAM,
|
||||
ip: *const c_uchar,
|
||||
iplen: size_t,
|
||||
) -> c_int;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int);
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int;
|
||||
pub fn X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int;
|
||||
}
|
||||
167
wasm/openssl/vendor/openssl-sys/src/handwritten/x509v3.rs
vendored
Normal file
167
wasm/openssl/vendor/openssl-sys/src/handwritten/x509v3.rs
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
use super::super::*;
|
||||
use crate::libc::*;
|
||||
|
||||
pub enum CONF_METHOD {}
|
||||
|
||||
extern "C" {
|
||||
pub fn GENERAL_NAME_new() -> *mut GENERAL_NAME;
|
||||
pub fn GENERAL_NAME_free(name: *mut GENERAL_NAME);
|
||||
pub fn GENERAL_NAME_set0_othername(
|
||||
gen: *mut GENERAL_NAME,
|
||||
oid: *mut ASN1_OBJECT,
|
||||
value: *mut ASN1_TYPE,
|
||||
) -> c_int;
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct ACCESS_DESCRIPTION {
|
||||
pub method: *mut ASN1_OBJECT,
|
||||
pub location: *mut GENERAL_NAME,
|
||||
}
|
||||
|
||||
stack!(stack_st_ACCESS_DESCRIPTION);
|
||||
|
||||
extern "C" {
|
||||
pub fn ACCESS_DESCRIPTION_free(ad: *mut ACCESS_DESCRIPTION);
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct AUTHORITY_KEYID {
|
||||
pub keyid: *mut ASN1_OCTET_STRING,
|
||||
pub issuer: *mut stack_st_GENERAL_NAME,
|
||||
pub serial: *mut ASN1_INTEGER,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn AUTHORITY_KEYID_free(akid: *mut AUTHORITY_KEYID);
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509V3_EXT_nconf_nid(
|
||||
conf: *mut CONF,
|
||||
ctx: *mut X509V3_CTX,
|
||||
ext_nid: c_int,
|
||||
value: #[const_ptr_if(any(ossl110, libressl))] c_char,
|
||||
) -> *mut X509_EXTENSION;
|
||||
pub fn X509V3_EXT_nconf(
|
||||
conf: *mut CONF,
|
||||
ctx: *mut X509V3_CTX,
|
||||
name: #[const_ptr_if(any(ossl110, libressl))] c_char,
|
||||
value: #[const_ptr_if(any(ossl110, libressl))] c_char,
|
||||
) -> *mut X509_EXTENSION;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int;
|
||||
pub fn X509_verify(req: *mut X509, pkey: *mut EVP_PKEY) -> c_int;
|
||||
|
||||
pub fn X509V3_set_nconf(ctx: *mut X509V3_CTX, conf: *mut CONF);
|
||||
|
||||
pub fn X509V3_set_ctx(
|
||||
ctx: *mut X509V3_CTX,
|
||||
issuer: *mut X509,
|
||||
subject: *mut X509,
|
||||
req: *mut X509_REQ,
|
||||
crl: *mut X509_CRL,
|
||||
flags: c_int,
|
||||
);
|
||||
|
||||
pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING;
|
||||
}
|
||||
|
||||
const_ptr_api! {
|
||||
extern "C" {
|
||||
pub fn X509V3_get_d2i(
|
||||
x: #[const_ptr_if(any(ossl110, libressl))] stack_st_X509_EXTENSION,
|
||||
nid: c_int,
|
||||
crit: *mut c_int,
|
||||
idx: *mut c_int,
|
||||
) -> *mut c_void;
|
||||
pub fn X509V3_extensions_print(out: *mut BIO, title: #[const_ptr_if(any(ossl110, libressl))] c_char, exts: #[const_ptr_if(any(ossl110, libressl))] stack_st_X509_EXTENSION, flag: c_ulong, indent: c_int) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#[cfg(not(libressl390))]
|
||||
pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int;
|
||||
pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void;
|
||||
pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION;
|
||||
pub fn X509V3_add1_i2d(
|
||||
x: *mut *mut stack_st_X509_EXTENSION,
|
||||
nid: c_int,
|
||||
value: *mut c_void,
|
||||
crit: c_int,
|
||||
flags: c_ulong,
|
||||
) -> c_int;
|
||||
pub fn X509V3_EXT_print(
|
||||
out: *mut BIO,
|
||||
ext: *mut X509_EXTENSION,
|
||||
flag: c_ulong,
|
||||
indent: c_int,
|
||||
) -> c_int;
|
||||
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get_pathlen(x: *mut X509) -> c_long;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get_extension_flags(x: *mut X509) -> u32;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get_key_usage(x: *mut X509) -> u32;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get_extended_key_usage(x: *mut X509) -> u32;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get0_subject_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
|
||||
#[cfg(ossl110)]
|
||||
pub fn X509_get0_authority_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
|
||||
#[cfg(ossl111d)]
|
||||
pub fn X509_get0_authority_issuer(x: *mut X509) -> *const stack_st_GENERAL_NAME;
|
||||
#[cfg(ossl111d)]
|
||||
pub fn X509_get0_authority_serial(x: *mut X509) -> *const ASN1_INTEGER;
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct DIST_POINT_NAME {
|
||||
pub type_: c_int,
|
||||
pub name: DIST_POINT_NAME_st_anon_union,
|
||||
pub dpname: *mut X509_NAME,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub union DIST_POINT_NAME_st_anon_union {
|
||||
pub fullname: *mut stack_st_GENERAL_NAME,
|
||||
pub relativename: *mut stack_st_X509_NAME_ENTRY,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct DIST_POINT {
|
||||
pub distpoint: *mut DIST_POINT_NAME,
|
||||
pub reasons: *mut ASN1_BIT_STRING,
|
||||
pub CRLissuer: *mut stack_st_GENERAL_NAME,
|
||||
pub dp_reasons: c_int,
|
||||
}
|
||||
stack!(stack_st_DIST_POINT);
|
||||
|
||||
extern "C" {
|
||||
pub fn DIST_POINT_free(dist_point: *mut DIST_POINT);
|
||||
pub fn DIST_POINT_NAME_free(dist_point: *mut DIST_POINT_NAME);
|
||||
}
|
||||
|
||||
#[cfg(ossl102)]
|
||||
extern "C" {
|
||||
pub fn X509_check_host(
|
||||
x: *mut X509,
|
||||
chk: *const c_char,
|
||||
chklen: usize,
|
||||
flags: c_uint,
|
||||
peername: *mut *mut c_char,
|
||||
) -> c_int;
|
||||
pub fn X509_check_email(
|
||||
x: *mut X509,
|
||||
chk: *const c_char,
|
||||
chklen: usize,
|
||||
flags: c_uint,
|
||||
) -> c_int;
|
||||
pub fn X509_check_ip(x: *mut X509, chk: *const c_uchar, chklen: usize, flags: c_uint) -> c_int;
|
||||
pub fn X509_check_ip_asc(x: *mut X509, ipasc: *const c_char, flags: c_uint) -> c_int;
|
||||
}
|
||||
Reference in New Issue
Block a user