diff options
| author | Mathijs van de Nes <[email protected]> | 2015-09-11 09:24:24 +0200 |
|---|---|---|
| committer | Mathijs van de Nes <[email protected]> | 2015-09-11 09:24:24 +0200 |
| commit | 87d5c0e4291051676d8e88513310e9eaa81aca0b (patch) | |
| tree | 679bfd03cbba77da9f41487cca462969fb5fdb1a /openssl/src | |
| parent | Add tests to ensure a panic occurs instead of segv (diff) | |
| download | rust-openssl-87d5c0e4291051676d8e88513310e9eaa81aca0b.tar.xz rust-openssl-87d5c0e4291051676d8e88513310e9eaa81aca0b.zip | |
Fix one call to RSA_size found by tests
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/crypto/pkey.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs index d59a9cfb..5bf0e81e 100644 --- a/openssl/src/crypto/pkey.rs +++ b/openssl/src/crypto/pkey.rs @@ -351,10 +351,10 @@ impl PKey { pub fn sign_with_hash(&self, s: &[u8], hash: hash::Type) -> Vec<u8> { unsafe { let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); - let len = ffi::RSA_size(rsa); if rsa.is_null() { panic!("Could not get RSA key for signing"); } + let len = ffi::RSA_size(rsa); let mut r = repeat(0u8).take(len as usize + 1).collect::<Vec<_>>(); let mut len = 0; |