diff options
author | Martin Willi <martin@revosec.ch> | 2013-04-09 11:37:15 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2013-04-10 18:10:30 +0200 |
commit | 97d975b7bb7b5112238f07bc4bd49f34bf5b2fcc (patch) | |
tree | 70cd9deeab2d7f2b4c77843558a8dbf9eac0610c /src/libstrongswan | |
parent | 96a09ce226552229dd7a0c06966aab512ba020a7 (diff) | |
download | strongswan-97d975b7bb7b5112238f07bc4bd49f34bf5b2fcc.tar.bz2 strongswan-97d975b7bb7b5112238f07bc4bd49f34bf5b2fcc.tar.xz |
RSA_check_key() may return -1 if it fails
Diffstat (limited to 'src/libstrongswan')
-rw-r--r-- | src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c index fb86a6bf1..036f53d23 100644 --- a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c +++ b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c @@ -428,7 +428,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type, if (blob.ptr) { this->rsa = d2i_RSAPrivateKey(NULL, (const u_char**)&blob.ptr, blob.len); - if (this->rsa && RSA_check_key(this->rsa)) + if (this->rsa && RSA_check_key(this->rsa) == 1) { return &this->public; } @@ -450,7 +450,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type, this->rsa->dmq1 = BN_bin2bn((const u_char*)exp2.ptr, exp2.len, NULL); } this->rsa->iqmp = BN_bin2bn((const u_char*)coeff.ptr, coeff.len, NULL); - if (RSA_check_key(this->rsa)) + if (RSA_check_key(this->rsa) == 1) { return &this->public; } |