mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Check for errors from EVP_VerifyInit_ex(), or EVP_VerifyUpdate might
cause a segfault... This was uncovered because EVP_VerifyInit() may fail in FIPS mode if the wrong algorithm is chosen...
This commit is contained in:
parent
a229e3038e
commit
bf746f0f46
@ -150,7 +150,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
|
||||
goto err;
|
||||
}
|
||||
|
||||
EVP_VerifyInit_ex(&ctx,type, NULL);
|
||||
if (!EVP_VerifyInit_ex(&ctx,type, NULL))
|
||||
{
|
||||
ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
|
||||
ret=0;
|
||||
goto err;
|
||||
}
|
||||
EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
|
||||
|
||||
OPENSSL_cleanse(buf_in,(unsigned int)inl);
|
||||
|
Loading…
Reference in New Issue
Block a user