From 2062d48dd2fa5645889f2fda06c84de7bf546806 Mon Sep 17 00:00:00 2001 From: Charlie Ozinga Date: Thu, 14 Apr 2016 03:44:43 -0600 Subject: Add 1DES symm ciphers (des-cbc, des-ecb, des-cfb, des-ofb) 1DES is well and truly dead for actual sensitive information, (its keysize is too small for modern purposes), but it can still find use in backwards compatiblity or educational applications. --- openssl-sys/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index e9a99274..958d0ebe 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -527,6 +527,11 @@ extern "C" { pub fn EVP_aes_256_cfb8() -> *const EVP_CIPHER; pub fn EVP_rc4() -> *const EVP_CIPHER; + pub fn EVP_des_cbc() -> *const EVP_CIPHER; + pub fn EVP_des_ecb() -> *const EVP_CIPHER; + pub fn EVP_des_cfb() -> *const EVP_CIPHER; + pub fn EVP_des_ofb() -> *const EVP_CIPHER; + 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; -- cgit v1.2.3 From 5682c044696bacb6600617433826141b0a08cd66 Mon Sep 17 00:00:00 2001 From: Charlie Ozinga Date: Tue, 19 Apr 2016 17:28:19 -0600 Subject: Remove des_cfb and des_ofb, since they appear on limit platforms --- openssl-sys/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 958d0ebe..8b7bdd09 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -529,8 +529,6 @@ extern "C" { pub fn EVP_des_cbc() -> *const EVP_CIPHER; pub fn EVP_des_ecb() -> *const EVP_CIPHER; - pub fn EVP_des_cfb() -> *const EVP_CIPHER; - pub fn EVP_des_ofb() -> *const EVP_CIPHER; pub fn EVP_BytesToKey(typ: *const EVP_CIPHER, md: *const EVP_MD, salt: *const u8, data: *const u8, datalen: c_int, -- cgit v1.2.3 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 From 32722e18501b06fbd51a8871f8bea0cddb4b132c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 29 Apr 2016 21:15:32 -0700 Subject: Add accessors for x509 subject alt names --- openssl-sys/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index b4b97ce2..573966ed 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -794,6 +794,7 @@ extern "C" { pub fn X509_sign(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int; pub fn X509_get_pubkey(x: *mut X509) -> *mut EVP_PKEY; pub fn X509_to_X509_REQ(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> *mut X509_REQ; + pub fn X509_get_ext_d2i(x: *mut X509, nid: c_int, crit: *mut c_int, idx: *mut c_int) -> *mut c_void; pub fn X509_EXTENSION_free(ext: *mut X509_EXTENSION); -- cgit v1.2.3 From 62a7dd10e588d7636c7720af6786efaa7015246b Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 25 Apr 2016 22:26:46 -0700 Subject: Add Ssl::set_verify It also uses a better, closure based API than the existing callback methods. --- openssl-sys/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 1e7097b8..070ed6c6 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -700,6 +700,16 @@ extern "C" { pub fn SSL_get_version(ssl: *mut SSL) -> *const c_char; pub fn SSL_state_string(ssl: *mut SSL) -> *const c_char; pub fn SSL_state_string_long(ssl: *mut SSL) -> *const c_char; + pub fn SSL_set_verify(ssl: *mut SSL, + mode: c_int, + verify_callback: Option c_int>); + pub fn SSL_get_ex_new_index(argl: c_long, argp: *const c_void, + new_func: Option, + dup_func: Option, + free_func: Option) + -> 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: *mut SSL, idx: c_int) -> *mut c_void; pub fn SSL_get_servername(ssl: *const SSL, name_type: c_long) -> *const c_char; -- cgit v1.2.3 From 7b73003b6753020f9c5184145536f541c9d8d5ea Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 30 Apr 2016 09:27:50 -0700 Subject: Add X509StoreContext::error_depth --- openssl-sys/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 070ed6c6..3d7c59c3 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -823,6 +823,7 @@ extern "C" { 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; pub fn X509_STORE_CTX_get_ex_data(ctx: *mut X509_STORE_CTX, idx: c_int) -> *mut c_void; + pub fn X509_STORE_CTX_get_error_depth(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509V3_EXT_conf_nid(conf: *mut c_void, ctx: *mut X509V3_CTX, ext_nid: c_int, value: *mut c_char) -> *mut X509_EXTENSION; pub fn X509V3_EXT_conf(conf: *mut c_void, ctx: *mut X509V3_CTX, name: *mut c_char, value: *mut c_char) -> *mut X509_EXTENSION; -- cgit v1.2.3 From 78122a9d686e23c8d5cab21a26fb3061c550bcec Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 5 May 2016 13:32:27 -0700 Subject: Release v0.7.11 --- openssl-sys/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 3d7c59c3..85e81951 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -1,6 +1,6 @@ #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow(dead_code)] -#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.10")] +#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.11")] extern crate libc; -- cgit v1.2.3