1 use libc::*;
2 
3 use *;
4 
5 pub const V_ASN1_UTCTIME: c_int = 23;
6 pub const V_ASN1_GENERALIZEDTIME: c_int = 24;
7 
8 pub const MBSTRING_FLAG: c_int = 0x1000;
9 pub const MBSTRING_UTF8: c_int = MBSTRING_FLAG;
10 pub const MBSTRING_ASC: c_int = MBSTRING_FLAG | 1;
11 pub const MBSTRING_BMP: c_int = MBSTRING_FLAG | 2;
12 pub const MBSTRING_UNIV: c_int = MBSTRING_FLAG | 4;
13 
14 #[repr(C)]
15 pub struct ASN1_ENCODING {
16     pub enc: *mut c_uchar,
17     pub len: c_long,
18     pub modified: c_int,
19 }
20 
21 extern "C" {
ASN1_OBJECT_free(x: *mut ASN1_OBJECT)22     pub fn ASN1_OBJECT_free(x: *mut ASN1_OBJECT);
23 }
24 
25 stack!(stack_st_ASN1_OBJECT);
26 
27 extern "C" {
ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING28     pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING;
29     #[cfg(any(ossl110, libressl273))]
ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar30     pub fn ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar;
31     #[cfg(any(all(ossl101, not(ossl110)), libressl))]
ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar32     pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar;
33 
ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING)34     pub fn ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING);
35 
ASN1_STRING_free(x: *mut ASN1_STRING)36     pub fn ASN1_STRING_free(x: *mut ASN1_STRING);
ASN1_STRING_length(x: *const ASN1_STRING) -> c_int37     pub fn ASN1_STRING_length(x: *const ASN1_STRING) -> c_int;
38 
ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME)39     pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME);
ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int40     pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int;
ASN1_TIME_new() -> *mut ASN1_TIME41     pub fn ASN1_TIME_new() -> *mut ASN1_TIME;
ASN1_TIME_free(tm: *mut ASN1_TIME)42     pub fn ASN1_TIME_free(tm: *mut ASN1_TIME);
ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int43     pub fn ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int;
44 
ASN1_INTEGER_free(x: *mut ASN1_INTEGER)45     pub fn ASN1_INTEGER_free(x: *mut ASN1_INTEGER);
ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long46     pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long;
ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int47     pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER48     pub fn BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER;
ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM49     pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM;
50 
ASN1_TIME_set_string(s: *mut ASN1_TIME, str: *const c_char) -> c_int51     pub fn ASN1_TIME_set_string(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
52     #[cfg(ossl111)]
ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int53     pub fn ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
54 }
55 
56 cfg_if! {
57     if #[cfg(any(ossl110, libressl280))] {
58         extern "C" {
59             pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *const ASN1_STRING) -> c_int;
60         }
61     } else {
62         extern "C" {
63             pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *mut ASN1_STRING) -> c_int;
64         }
65     }
66 }
67