- fix error handling of alloc failure during rrsig verification.

git-svn-id: file:///svn/unbound/trunk@2693 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2012-06-21 07:22:01 +00:00
parent 7090975243
commit 6ba973a8bd
2 changed files with 9 additions and 6 deletions

View file

@ -1,3 +1,6 @@
21 June 2012: Wouter
- fix error handling of alloc failure during rrsig verification.
20 June 2012: Wouter 20 June 2012: Wouter
- work on --with-nss build option (for now, --with-libunbound-only). - work on --with-nss build option (for now, --with-libunbound-only).

View file

@ -299,7 +299,7 @@ setup_key_digest(int algo, EVP_PKEY** evp_key, const EVP_MD** digest_type,
*evp_key = EVP_PKEY_new(); *evp_key = EVP_PKEY_new();
if(!*evp_key) { if(!*evp_key) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
dsa = ldns_key_buf2dsa_raw(key, keylen); dsa = ldns_key_buf2dsa_raw(key, keylen);
if(!dsa) { if(!dsa) {
@ -326,7 +326,7 @@ setup_key_digest(int algo, EVP_PKEY** evp_key, const EVP_MD** digest_type,
*evp_key = EVP_PKEY_new(); *evp_key = EVP_PKEY_new();
if(!*evp_key) { if(!*evp_key) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
rsa = ldns_key_buf2rsa_raw(key, keylen); rsa = ldns_key_buf2rsa_raw(key, keylen);
if(!rsa) { if(!rsa) {
@ -358,7 +358,7 @@ setup_key_digest(int algo, EVP_PKEY** evp_key, const EVP_MD** digest_type,
*evp_key = EVP_PKEY_new(); *evp_key = EVP_PKEY_new();
if(!*evp_key) { if(!*evp_key) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
rsa = ldns_key_buf2rsa_raw(key, keylen); rsa = ldns_key_buf2rsa_raw(key, keylen);
if(!rsa) { if(!rsa) {
@ -726,7 +726,7 @@ nss_setup_key_digest(int algo, SECKEYPublicKey** pubkey, HASH_HashType* htype,
*evp_key = EVP_PKEY_new(); *evp_key = EVP_PKEY_new();
if(!*evp_key) { if(!*evp_key) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
dsa = ldns_key_buf2dsa_raw(key, keylen); dsa = ldns_key_buf2dsa_raw(key, keylen);
if(!dsa) { if(!dsa) {
@ -755,7 +755,7 @@ nss_setup_key_digest(int algo, SECKEYPublicKey** pubkey, HASH_HashType* htype,
*pubkey = nss_buf2rsa(key, keylen); *pubkey = nss_buf2rsa(key, keylen);
if(!*pubkey) { if(!*pubkey) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
/* select SHA version */ /* select SHA version */
#if defined(HAVE_EVP_SHA256) && defined(USE_SHA2) #if defined(HAVE_EVP_SHA256) && defined(USE_SHA2)
@ -775,7 +775,7 @@ nss_setup_key_digest(int algo, SECKEYPublicKey** pubkey, HASH_HashType* htype,
*pubkey = nss_buf2rsa(key, keylen); *pubkey = nss_buf2rsa(key, keylen);
if(!*pubkey) { if(!*pubkey) {
log_err("verify: malloc failure in crypto"); log_err("verify: malloc failure in crypto");
return sec_status_unchecked; return 0;
} }
*htype = HASH_AlgMD5; *htype = HASH_AlgMD5;