From caf9272c85ddc68071aac8a0a3aa2d88dd322427 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 28 Apr 2016 22:16:29 -0700 Subject: Start on GeneralName --- openssl-sys/src/lib.rs | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index da0beca0..b4b97ce2 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -34,10 +34,23 @@ pub type X509_NAME = c_void; pub type X509_NAME_ENTRY = c_void; pub type X509_REQ = c_void; pub type X509_STORE_CTX = c_void; -pub type stack_st_X509_EXTENSION = c_void; -pub type stack_st_void = c_void; pub type bio_st = c_void; +#[repr(C)] +pub struct stack_st_X509_EXTENSION { + pub stack: _STACK, +} + +#[repr(C)] +pub struct stack_st_GENERAL_NAME { + pub stack: _STACK, +} + +#[repr(C)] +pub struct stack_st_void { + pub stack: _STACK, +} + pub type bio_info_cb = Option, +} + #[repr(C)] pub struct RSA { pub pad: c_int, @@ -178,6 +200,17 @@ pub struct X509V3_CTX { // Maybe more here } +#[repr(C)] +pub struct GENERAL_NAME { + pub type_: c_int, + pub d: *mut c_void, +} + +impl Copy for GENERAL_NAME {} +impl Clone for GENERAL_NAME { + fn clone(&self) -> GENERAL_NAME { *self } +} + impl Copy for X509V3_CTX {} impl Clone for X509V3_CTX { fn clone(&self) -> X509V3_CTX { *self } @@ -333,6 +366,16 @@ pub const X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: c_int = 45; pub const X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: c_int = 53; pub const X509_V_OK: c_int = 0; +pub const GEN_OTHERNAME: c_int = 0; +pub const GEN_EMAIL: c_int = 1; +pub const GEN_DNS: c_int = 2; +pub const GEN_X400: c_int = 3; +pub const GEN_DIRNAME: c_int = 4; +pub const GEN_EDIPARTY: c_int = 5; +pub const GEN_URI: c_int = 6; +pub const GEN_IPADD: c_int = 7; +pub const GEN_RID: c_int = 8; + static mut MUTEXES: *mut Vec> = 0 as *mut Vec>; static mut GUARDS: *mut Vec>> = 0 as *mut Vec>>; @@ -760,6 +803,8 @@ extern "C" { pub fn X509_NAME_ENTRY_get_data(ne: *mut X509_NAME_ENTRY) -> *mut ASN1_STRING; pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_char, s: *mut ASN1_STRING) -> c_int; + pub fn ASN1_STRING_length(x: *mut ASN1_STRING) -> c_int; + pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar; pub fn X509_STORE_CTX_get_current_cert(ct: *mut X509_STORE_CTX) -> *mut X509; pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; -- cgit v1.2.3