diff options
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_vfy.c')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_vfy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_vfy.c b/src/lib/libcrypto/ocsp/ocsp_vfy.c index 4a0c3870d8..415d67e61c 100644 --- a/src/lib/libcrypto/ocsp/ocsp_vfy.c +++ b/src/lib/libcrypto/ocsp/ocsp_vfy.c | |||
@@ -308,6 +308,8 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid, | |||
308 | } | 308 | } |
309 | 309 | ||
310 | mdlen = EVP_MD_size(dgst); | 310 | mdlen = EVP_MD_size(dgst); |
311 | if (mdlen < 0) | ||
312 | return -1; | ||
311 | if ((cid->issuerNameHash->length != mdlen) || | 313 | if ((cid->issuerNameHash->length != mdlen) || |
312 | (cid->issuerKeyHash->length != mdlen)) | 314 | (cid->issuerKeyHash->length != mdlen)) |
313 | return 0; | 315 | return 0; |
@@ -316,7 +318,7 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid, | |||
316 | return -1; | 318 | return -1; |
317 | if (memcmp(md, cid->issuerNameHash->data, mdlen)) | 319 | if (memcmp(md, cid->issuerNameHash->data, mdlen)) |
318 | return 0; | 320 | return 0; |
319 | X509_pubkey_digest(cert, EVP_sha1(), md, NULL); | 321 | X509_pubkey_digest(cert, dgst, md, NULL); |
320 | if (memcmp(md, cid->issuerKeyHash->data, mdlen)) | 322 | if (memcmp(md, cid->issuerKeyHash->data, mdlen)) |
321 | return 0; | 323 | return 0; |
322 | 324 | ||