OpenSSL 1.1.1-pre2
This commit is contained in:
+7
-16
@@ -76,7 +76,7 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
ret = 1;
|
||||
err:
|
||||
EVP_MD_CTX_free(ctx);
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -86,7 +86,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
{
|
||||
EVP_MD_CTX *ctx = NULL;
|
||||
unsigned char *buf_in = NULL;
|
||||
int ret = -1, inl;
|
||||
int ret = -1, inl = 0;
|
||||
|
||||
int mdnid, pknid;
|
||||
|
||||
@@ -156,24 +156,15 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = EVP_DigestVerifyUpdate(ctx, buf_in, inl);
|
||||
|
||||
OPENSSL_clear_free(buf_in, (unsigned int)inl);
|
||||
|
||||
if (!ret) {
|
||||
ret = EVP_DigestVerify(ctx, signature->data, (size_t)signature->length,
|
||||
buf_in, inl);
|
||||
if (ret <= 0) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
goto err;
|
||||
}
|
||||
ret = -1;
|
||||
|
||||
if (EVP_DigestVerifyFinal(ctx, signature->data,
|
||||
(size_t)signature->length) <= 0) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
ret = 1;
|
||||
err:
|
||||
OPENSSL_clear_free(buf_in, (unsigned int)inl);
|
||||
EVP_MD_CTX_free(ctx);
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user