aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-04-28 22:16:29 -0700
committerSteven Fackler <[email protected]>2016-04-28 22:16:29 -0700
commitcaf9272c85ddc68071aac8a0a3aa2d88dd322427 (patch)
treef235ebe947e6a108bb0abde7ebf86de4993c63c5 /openssl-sys/src
parentMerge branch 'release' (diff)
downloadrust-openssl-caf9272c85ddc68071aac8a0a3aa2d88dd322427.tar.xz
rust-openssl-caf9272c85ddc68071aac8a0a3aa2d88dd322427.zip
Start on GeneralName
Diffstat (limited to 'openssl-sys/src')
-rw-r--r--openssl-sys/src/lib.rs49
1 files changed, 47 insertions, 2 deletions
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<unsafe extern "C" fn(*mut BIO,
c_int,
*const c_char,
@@ -64,6 +77,15 @@ pub struct BIO_METHOD {
unsafe impl Sync for BIO_METHOD {}
#[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)>,
+}
+
+#[repr(C)]
pub struct RSA {
pub pad: c_int,
pub version: c_long,
@@ -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<Mutex<()>> = 0 as *mut Vec<Mutex<()>>;
static mut GUARDS: *mut Vec<Option<MutexGuard<'static, ()>>> = 0 as *mut Vec<Option<MutexGuard<'static, ()>>>;
@@ -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;