aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-08-17 19:30:57 -0700
committerSteven Fackler <[email protected]>2016-08-17 19:30:57 -0700
commitcd69343d67081ab9c070f21d58918433a44f97bf (patch)
tree34367513c37714a94cad3ccd0326f82ee796795b /openssl-sys/src
parentIgnore flickering test on windows (diff)
downloadrust-openssl-cd69343d67081ab9c070f21d58918433a44f97bf.tar.xz
rust-openssl-cd69343d67081ab9c070f21d58918433a44f97bf.zip
Fix SslContext::add_extra_chain_cert
SSL_CTX_add_extra_chain_cert assumes ownership of the certificate, so the method really needs to take an X509 by value. Work around this by manually cloning the cert. This method has been around for over a year but I'm guessing nobody actually used it since it produces a nice double free into segfault!
Diffstat (limited to 'openssl-sys/src')
-rw-r--r--openssl-sys/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs
index ab29f55c..be9de412 100644
--- a/openssl-sys/src/lib.rs
+++ b/openssl-sys/src/lib.rs
@@ -1073,6 +1073,7 @@ 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 d2i_X509(a: *mut *mut X509, pp: *mut *mut c_uchar, length: c_long) -> *mut X509;
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;