summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkn <>2022-07-17 19:40:38 +0000
committerkn <>2022-07-17 19:40:38 +0000
commit65b8ee53a9bd832506f5237be581adae68cf2f98 (patch)
tree07066fd14e1c1a2004936401c339536aef64e2d5 /src
parent1f0b3b022cc983380c8af99bd43237db4deaa00a (diff)
downloadopenbsd-65b8ee53a9bd832506f5237be581adae68cf2f98.tar.gz
openbsd-65b8ee53a9bd832506f5237be581adae68cf2f98.tar.bz2
openbsd-65b8ee53a9bd832506f5237be581adae68cf2f98.zip
Handle X509_check_purpose(3) and EVP_get_digestbyobj(3)
OK tb
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_verify.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_verify.c b/src/lib/libcrypto/ts/ts_rsp_verify.c
index ba916434b5..816d7000f3 100644
--- a/src/lib/libcrypto/ts/ts_rsp_verify.c
+++ b/src/lib/libcrypto/ts/ts_rsp_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_verify.c,v 1.26 2022/07/17 17:00:44 kn Exp $ */ 1/* $OpenBSD: ts_rsp_verify.c,v 1.27 2022/07/17 19:40:38 kn Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -381,7 +381,8 @@ TS_find_cert(STACK_OF(ESS_CERT_ID) *cert_ids, X509 *cert)
381 return -1; 381 return -1;
382 382
383 /* Recompute SHA1 hash of certificate if necessary (side effect). */ 383 /* Recompute SHA1 hash of certificate if necessary (side effect). */
384 X509_check_purpose(cert, -1, 0); 384 if (X509_check_purpose(cert, -1, 0) == -1)
385 return -1;
385 386
386 /* Look for cert in the cert_ids vector. */ 387 /* Look for cert in the cert_ids vector. */
387 for (i = 0; i < sk_ESS_CERT_ID_num(cert_ids); ++i) { 388 for (i = 0; i < sk_ESS_CERT_ID_num(cert_ids); ++i) {
@@ -416,6 +417,8 @@ TS_find_cert_v2(STACK_OF(ESS_CERT_ID_V2) *cert_ids, X509 *cert)
416 417
417 if (cid->hash_alg != NULL) 418 if (cid->hash_alg != NULL)
418 md = EVP_get_digestbyobj(cid->hash_alg->algorithm); 419 md = EVP_get_digestbyobj(cid->hash_alg->algorithm);
420 if (md == NULL)
421 return -1;
419 422
420 if (!X509_digest(cert, md, cert_digest, &len)) 423 if (!X509_digest(cert, md, cert_digest, &len))
421 return -1; 424 return -1;