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 From f82a1c4f75208c414a24deb2a6d90e0fc3981637 Mon Sep 17 00:00:00 2001 From: Chris Dawes Date: Thu, 5 May 2016 23:41:55 +0100 Subject: add rsa signature tests --- openssl-sys/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 3d7c59c3..0a762944 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -627,6 +627,12 @@ extern "C" { callback: Option, user_data: *mut c_void) -> c_int; pub fn PEM_write_bio_PUBKEY(bp: *mut BIO, x: *mut EVP_PKEY) -> c_int; + pub fn PEM_write_bio_RSAPrivateKey(bp: *mut BIO, rsa: *mut RSA, cipher: *const EVP_CIPHER, + kstr: *mut c_char, klen: c_int, + callback: Option, + user_data: *mut c_void) -> c_int; + pub fn PEM_write_bio_RSAPublicKey(bp: *mut BIO, rsa: *mut RSA) -> c_int; + pub fn PEM_write_bio_RSA_PUBKEY(bp: *mut BIO, rsa: *mut RSA) -> c_int; pub fn PEM_write_bio_X509(bio: *mut BIO, x509: *mut X509) -> c_int; pub fn PEM_write_bio_X509_REQ(bio: *mut BIO, x509: *mut X509_REQ) -> c_int; -- cgit v1.2.3 From 95051b060d5701d5c2282d92a7d9d955852e1e30 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 16 May 2016 23:04:03 -0700 Subject: Release v0.7.12 --- 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 b6f55832..0a422b7e 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.11")] +#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.12")] extern crate libc; -- cgit v1.2.3 From f6b612df5f32088b16d1252822f4cd7d4596c71c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 20 May 2016 15:57:57 -0700 Subject: Release v0.7.13 --- 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 0a422b7e..e6a7c488 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.12")] +#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.13")] extern crate libc; -- cgit v1.2.3 From 121169c1f57bf0b1130b400d9ed6431855fb2e73 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 1 Jul 2016 18:31:47 -0400 Subject: Set auto retry SSL_read returns a WANT_READ after a renegotiation by default which ends up bubbling up as a weird BUG error. Tell OpenSSL to just do the read again. --- openssl-sys/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index e6a7c488..bdcf71d4 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -270,8 +270,10 @@ pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: c_int = 53; pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG: c_int = 54; pub const SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55; pub const SSL_CTRL_EXTRA_CHAIN_CERT: c_int = 14; - pub const SSL_CTRL_SET_READ_AHEAD: c_int = 41; + +pub const SSL_MODE_AUTO_RETRY: c_long = 4; + pub const SSL_ERROR_NONE: c_int = 0; pub const SSL_ERROR_SSL: c_int = 1; pub const SSL_ERROR_SYSCALL: c_int = 5; -- cgit v1.2.3 From 5135fca87f1bbdb7bfd128fcc92781448c8da798 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 1 Jul 2016 18:43:39 -0400 Subject: Release v0.7.14 --- 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 bdcf71d4..ef327a93 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.13")] +#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.14")] extern crate libc; -- cgit v1.2.3 From 722a2bd673bac57faf450d5548a057481fa98cf0 Mon Sep 17 00:00:00 2001 From: Shaun Taheri Date: Fri, 22 Jul 2016 18:16:55 +0200 Subject: Set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag --- 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 ef327a93..96a24e48 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -272,6 +272,7 @@ pub const SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55; pub const SSL_CTRL_EXTRA_CHAIN_CERT: c_int = 14; pub const SSL_CTRL_SET_READ_AHEAD: c_int = 41; +pub const SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER: c_long = 2; pub const SSL_MODE_AUTO_RETRY: c_long = 4; pub const SSL_ERROR_NONE: c_int = 0; -- cgit v1.2.3 From 5ed77df197afc33c04569edcd3db5993a695fbae Mon Sep 17 00:00:00 2001 From: Onur Aslan Date: Fri, 29 Jul 2016 12:11:53 +0300 Subject: Implement save_der for X509 and X509Req --- openssl-sys/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 96a24e48..1e0d5fe5 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -841,6 +841,9 @@ extern "C" { pub fn X509_REQ_add_extensions(req: *mut X509_REQ, exts: *mut stack_st_X509_EXTENSION) -> c_int; pub fn X509_REQ_sign(x: *mut X509_REQ, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int; + pub fn i2d_X509_bio(b: *mut BIO, x: *mut X509) -> c_int; + pub fn i2d_X509_REQ_bio(b: *mut BIO, x: *mut X509_REQ) -> c_int; + pub fn i2d_RSA_PUBKEY(k: *mut RSA, buf: *const *mut u8) -> c_int; pub fn d2i_RSA_PUBKEY(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA; pub fn i2d_RSAPrivateKey(k: *mut RSA, buf: *const *mut u8) -> c_int; -- cgit v1.2.3 From a3a602be515cfc8fdd44a11b89fee012baec0e0b Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Tue, 17 May 2016 18:10:06 -0400 Subject: add low level dsa primitives --- openssl-sys/src/lib.rs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 96a24e48..168848ca 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -114,6 +114,28 @@ pub struct RSA { pub mt_blinding: *mut c_void, } +#[repr(C)] +pub struct DSA { + pub pad: c_int, + pub version: c_long, + pub write_params: c_int, + + pub p: *mut BIGNUM, + pub q: *mut BIGNUM, + pub g: *mut BIGNUM, + pub pub_key: *mut BIGNUM, + pub priv_key: *mut BIGNUM, + pub kinv: *mut BIGNUM, + pub r: *mut BIGNUM, + + pub flags: c_int, + pub _method_mont_p: *mut c_void, + pub references: c_int, + pub ex_data: *mut c_void, + pub meth: *const c_void, + pub engine: *const c_void, +} + #[repr(C)] pub struct EVP_PKEY { pub type_: c_int, @@ -626,16 +648,28 @@ extern "C" { pub fn PEM_read_bio_RSA_PUBKEY(bio: *mut BIO, rsa: *mut *mut RSA, callback: Option, user_data: *mut c_void) -> *mut RSA; pub fn PEM_write_bio_PrivateKey(bio: *mut BIO, pkey: *mut EVP_PKEY, cipher: *const EVP_CIPHER, - kstr: *mut c_char, klen: c_int, + kstr: *mut c_uchar, klen: c_int, callback: Option, user_data: *mut c_void) -> c_int; pub fn PEM_write_bio_PUBKEY(bp: *mut BIO, x: *mut EVP_PKEY) -> c_int; pub fn PEM_write_bio_RSAPrivateKey(bp: *mut BIO, rsa: *mut RSA, cipher: *const EVP_CIPHER, - kstr: *mut c_char, klen: c_int, + kstr: *mut c_uchar, klen: c_int, callback: Option, user_data: *mut c_void) -> c_int; pub fn PEM_write_bio_RSAPublicKey(bp: *mut BIO, rsa: *mut RSA) -> c_int; pub fn PEM_write_bio_RSA_PUBKEY(bp: *mut BIO, rsa: *mut RSA) -> c_int; + + pub fn PEM_read_bio_DSAPrivateKey(bp: *mut BIO, dsa: *mut *mut DSA, callback: Option, + user_data: *mut c_void) -> *mut DSA; + pub fn PEM_read_bio_DSA_PUBKEY(bp: *mut BIO, dsa: *mut *mut DSA, callback: Option, + user_data: *mut c_void) -> *mut DSA; + pub fn PEM_write_bio_DSAPrivateKey(bp: *mut BIO, dsa: *mut DSA, cipher: *const EVP_CIPHER, + kstr: *mut c_uchar, klen: c_int, callback: Option, + user_data: *mut c_void) -> c_int; + pub fn PEM_write_bio_DSA_PUBKEY(bp: *mut BIO, dsa: *mut DSA) -> c_int; + + + pub fn PEM_write_bio_X509(bio: *mut BIO, x509: *mut X509) -> c_int; pub fn PEM_write_bio_X509_REQ(bio: *mut BIO, x509: *mut X509_REQ) -> c_int; @@ -669,6 +703,18 @@ extern "C" { pub fn RSA_verify(t: c_int, m: *const u8, mlen: c_uint, sig: *const u8, siglen: c_uint, k: *mut RSA) -> c_int; + pub fn DSA_new() -> *mut DSA; + pub fn DSA_free(dsa: *mut DSA); + pub fn DSA_size(dsa: *const DSA) -> c_int; + pub fn DSA_generate_parameters_ex(dsa: *mut DSA, bits: c_int, seed: *const c_uchar, seed_len: c_int, + counter_ref: *mut c_int, h_ret: *mut c_ulong, + cb: *const c_void) -> c_int; + pub fn DSA_generate_key(dsa: *mut DSA) -> c_int; + pub fn DSA_sign(dummy: c_int, dgst: *const c_uchar, len: c_int, sigret: *mut c_uchar, + siglen: *mut c_uint, dsa: *mut DSA) -> c_int; + pub fn DSA_verify(dummy: c_int, dgst: *const c_uchar, len: c_int, sigbuf: *const c_uchar, + siglen: c_int, dsa: *mut DSA) -> c_int; + pub fn SSL_library_init() -> c_int; pub fn SSL_load_error_strings(); -- cgit v1.2.3