diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-09-24 01:43:49 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-09-24 01:43:49 +0200 |
commit | b6dcdbfc94c482f6c15ba725754fc9e827e41851 (patch) | |
tree | 9fec84d4564530bc97b42d56e01a64abb96adac3 /crypto/asn1/a_verify.c | |
parent | Add more return value checking attributes to evp.h and hmac.h (diff) | |
download | openssl-b6dcdbfc94c482f6c15ba725754fc9e827e41851.tar.xz openssl-b6dcdbfc94c482f6c15ba725754fc9e827e41851.zip |
Audit libcrypto for unchecked return values: fix all cases enountered
Diffstat (limited to 'crypto/asn1/a_verify.c')
-rw-r--r-- | crypto/asn1/a_verify.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c index cecdb13c70..d9332ee15d 100644 --- a/crypto/asn1/a_verify.c +++ b/crypto/asn1/a_verify.c @@ -101,8 +101,13 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, p=buf_in; i2d(data,&p); - EVP_VerifyInit_ex(&ctx,type, NULL); - EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); + if (!EVP_VerifyInit_ex(&ctx,type, NULL) + || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl)) + { + ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); + ret=0; + goto err; + } OPENSSL_cleanse(buf_in,(unsigned int)inl); OPENSSL_free(buf_in); @@ -173,7 +178,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat goto err; } - EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); + if (!EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl)) + { + ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); + ret=0; + goto err; + } OPENSSL_cleanse(buf_in,(unsigned int)inl); OPENSSL_free(buf_in); |