| 1 |
use super::super::*; |
| 2 |
use libc::time_t; |
| 3 |
use std::ffi::{c_char, c_int, c_long, c_uchar, c_void}; |
| 4 |
|
| 5 |
#[repr(C)] |
| 6 |
#[cfg(not(libressl430))] |
| 7 |
pub struct ASN1_ENCODING { |
| 8 |
pub enc: *mut c_uchar, |
| 9 |
pub len: c_long, |
| 10 |
pub modified: c_int, |
| 11 |
} |
| 12 |
|
| 13 |
extern "C" { |
| 14 |
pub fn ASN1_OBJECT_free(x: *mut ASN1_OBJECT); |
| 15 |
pub fn OBJ_dup(x: *const ASN1_OBJECT) -> *mut ASN1_OBJECT; |
| 16 |
} |
| 17 |
|
| 18 |
stack!(stack_st_ASN1_OBJECT); |
| 19 |
|
| 20 |
#[repr(C)] |
| 21 |
pub struct ASN1_TYPE { |
| 22 |
pub type_: c_int, |
| 23 |
pub value: ASN1_TYPE_value, |
| 24 |
} |
| 25 |
#[repr(C)] |
| 26 |
pub union ASN1_TYPE_value { |
| 27 |
pub ptr: *mut c_char, |
| 28 |
pub boolean: ASN1_BOOLEAN, |
| 29 |
pub asn1_string: *mut ASN1_STRING, |
| 30 |
pub object: *mut ASN1_OBJECT, |
| 31 |
pub integer: *mut ASN1_INTEGER, |
| 32 |
pub enumerated: *mut ASN1_ENUMERATED, |
| 33 |
pub bit_string: *mut ASN1_BIT_STRING, |
| 34 |
pub octet_string: *mut ASN1_OCTET_STRING, |
| 35 |
pub printablestring: *mut ASN1_PRINTABLESTRING, |
| 36 |
pub t61string: *mut ASN1_T61STRING, |
| 37 |
pub ia5string: *mut ASN1_IA5STRING, |
| 38 |
pub generalstring: *mut ASN1_GENERALSTRING, |
| 39 |
pub bmpstring: *mut ASN1_BMPSTRING, |
| 40 |
pub universalstring: *mut ASN1_UNIVERSALSTRING, |
| 41 |
pub utctime: *mut ASN1_UTCTIME, |
| 42 |
pub generalizedtime: *mut ASN1_GENERALIZEDTIME, |
| 43 |
pub visiblestring: *mut ASN1_VISIBLESTRING, |
| 44 |
pub utf8string: *mut ASN1_UTF8STRING, |
| 45 |
pub set: *mut ASN1_STRING, |
| 46 |
pub sequence: *mut ASN1_STRING, |
| 47 |
pub asn1_value: *mut ASN1_VALUE, |
| 48 |
} |
| 49 |
|
| 50 |
extern "C" { |
| 51 |
pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING; |
| 52 |
pub fn ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar; |
| 53 |
#[cfg(all(libressl, not(libressl430)))] |
| 54 |
pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar; |
| 55 |
pub fn ASN1_STRING_new() -> *mut ASN1_STRING; |
| 56 |
pub fn ASN1_OCTET_STRING_new() -> *mut ASN1_OCTET_STRING; |
| 57 |
pub fn ASN1_STRING_free(x: *mut ASN1_STRING); |
| 58 |
pub fn ASN1_STRING_length(x: *const ASN1_STRING) -> c_int; |
| 59 |
pub fn ASN1_STRING_set(x: *mut ASN1_STRING, data: *const c_void, len_in: c_int) -> c_int; |
| 60 |
pub fn ASN1_OCTET_STRING_set( |
| 61 |
x: *mut ASN1_OCTET_STRING, |
| 62 |
data: *const c_uchar, |
| 63 |
len_in: c_int, |
| 64 |
) -> c_int; |
| 65 |
|
| 66 |
pub fn ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING); |
| 67 |
pub fn ASN1_OCTET_STRING_free(x: *mut ASN1_OCTET_STRING); |
| 68 |
|
| 69 |
pub fn ASN1_GENERALIZEDTIME_new() -> *mut ASN1_GENERALIZEDTIME; |
| 70 |
pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME); |
| 71 |
pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int; |
| 72 |
pub fn ASN1_GENERALIZEDTIME_set_string( |
| 73 |
s: *mut ASN1_GENERALIZEDTIME, |
| 74 |
str: *const c_char, |
| 75 |
) -> c_int; |
| 76 |
pub fn ASN1_TIME_new() -> *mut ASN1_TIME; |
| 77 |
pub fn ASN1_TIME_diff( |
| 78 |
pday: *mut c_int, |
| 79 |
psec: *mut c_int, |
| 80 |
from: *const ASN1_TIME, |
| 81 |
to: *const ASN1_TIME, |
| 82 |
) -> c_int; |
| 83 |
pub fn ASN1_TIME_free(tm: *mut ASN1_TIME); |
| 84 |
pub fn ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int; |
| 85 |
pub fn ASN1_TIME_set(from: *mut ASN1_TIME, to: time_t) -> *mut ASN1_TIME; |
| 86 |
|
| 87 |
pub fn ASN1_INTEGER_free(x: *mut ASN1_INTEGER); |
| 88 |
pub fn ASN1_INTEGER_dup(a: *const ASN1_INTEGER) -> *mut ASN1_INTEGER; |
| 89 |
pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long; |
| 90 |
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; |
| 91 |
pub fn ASN1_INTEGER_cmp(a: *const ASN1_INTEGER, b: *const ASN1_INTEGER) -> c_int; |
| 92 |
pub fn BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER; |
| 93 |
pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM; |
| 94 |
|
| 95 |
pub fn ASN1_TIME_set_string(s: *mut ASN1_TIME, str: *const c_char) -> c_int; |
| 96 |
#[cfg(any(ossl111, libressl360))] |
| 97 |
pub fn ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int; |
| 98 |
|
| 99 |
pub fn ASN1_ENUMERATED_free(a: *mut ASN1_ENUMERATED); |
| 100 |
#[cfg(ossl110)] |
| 101 |
pub fn ASN1_ENUMERATED_get_int64(pr: *mut i64, a: *const ASN1_ENUMERATED) -> c_int; |
| 102 |
|
| 103 |
pub fn ASN1_TYPE_new() -> *mut ASN1_TYPE; |
| 104 |
pub fn ASN1_TYPE_set(a: *mut ASN1_TYPE, type_: c_int, value: *mut c_void); |
| 105 |
pub fn ASN1_TYPE_free(x: *mut ASN1_TYPE); |
| 106 |
pub fn d2i_ASN1_TYPE( |
| 107 |
k: *mut *mut ASN1_TYPE, |
| 108 |
buf: *mut *const u8, |
| 109 |
len: c_long, |
| 110 |
) -> *mut ASN1_TYPE; |
| 111 |
} |
| 112 |
|
| 113 |
const_ptr_api! { |
| 114 |
extern "C" { |
| 115 |
pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *const ASN1_STRING) -> c_int; |
| 116 |
pub fn ASN1_STRING_type(x: *const ASN1_STRING) -> c_int; |
| 117 |
pub fn ASN1_generate_v3(str: *const c_char, cnf: *mut X509V3_CTX) -> *mut ASN1_TYPE; |
| 118 |
pub fn i2d_ASN1_TYPE(a: #[const_ptr_if(ossl300)] ASN1_TYPE, pp: *mut *mut c_uchar) -> c_int; |
| 119 |
} |
| 120 |
} |