Fix one call to RSA_size found by tests

This commit is contained in:
Mathijs van de Nes 2015-09-11 09:24:24 +02:00
parent 3be32528e5
commit 87d5c0e429
1 changed files with 1 additions and 1 deletions

View File

@ -351,10 +351,10 @@ impl PKey {
pub fn sign_with_hash(&self, s: &[u8], hash: hash::Type) -> Vec<u8> { pub fn sign_with_hash(&self, s: &[u8], hash: hash::Type) -> Vec<u8> {
unsafe { unsafe {
let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); let rsa = ffi::EVP_PKEY_get1_RSA(self.evp);
let len = ffi::RSA_size(rsa);
if rsa.is_null() { if rsa.is_null() {
panic!("Could not get RSA key for signing"); 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 r = repeat(0u8).take(len as usize + 1).collect::<Vec<_>>();
let mut len = 0; let mut len = 0;