aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys/src
diff options
context:
space:
mode:
authorOvermind JIANG <[email protected]>2015-11-18 11:36:34 +0800
committerOvermind JIANG <[email protected]>2015-11-18 11:36:34 +0800
commit3c6c4a7b3df9082188ec45f3e636440abfc5c563 (patch)
treefcc183e68b243b708e18275053db579d92dd6cc2 /openssl-sys/src
parentRemove unecessary build dependency (diff)
downloadrust-openssl-3c6c4a7b3df9082188ec45f3e636440abfc5c563.tar.xz
rust-openssl-3c6c4a7b3df9082188ec45f3e636440abfc5c563.zip
Fix a leak when using `EVP_PKEY_get1_RSA`.
`EVP_PKEY_get1_RSA` returns a RSA structure with its reference count increased by 1 and therefore we need to call `RSA_free` after finishing using that value.
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 018f8bca..239f8d9e 100644
--- a/openssl-sys/src/lib.rs
+++ b/openssl-sys/src/lib.rs
@@ -482,6 +482,7 @@ extern "C" {
pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int;
+ pub fn RSA_free(rsa: *mut RSA);
pub fn RSA_generate_key(modsz: c_int, e: c_ulong, cb: *const c_void, cbarg: *const c_void) -> *mut RSA;
pub fn RSA_generate_key_ex(rsa: *mut RSA, bits: c_int, e: *mut BIGNUM, cb: *const c_void) -> c_int;
pub fn RSA_private_decrypt(flen: c_int, from: *const u8, to: *mut u8, k: *mut RSA,