From 25f6f2247bfddf9e4d76fad832844d141b71e449 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 28 Aug 2024 06:18:44 +0000 Subject: [PATCH] Avoid reaching into X509_ALGOR in ocsp_certid_print() ok jsing --- lib/libcrypto/ocsp/ocsp_prn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ocsp/ocsp_prn.c b/lib/libcrypto/ocsp/ocsp_prn.c index 7e3175b6135..fb7b9651d96 100644 --- a/lib/libcrypto/ocsp/ocsp_prn.c +++ b/lib/libcrypto/ocsp/ocsp_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_prn.c,v 1.10 2023/07/08 10:44:00 beck Exp $ */ +/* $OpenBSD: ocsp_prn.c,v 1.11 2024/08/28 06:18:44 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -65,16 +65,20 @@ #include #include #include +#include #include "ocsp_local.h" static int ocsp_certid_print(BIO *bp, OCSP_CERTID* a, int indent) { + const ASN1_OBJECT *aobj; + BIO_printf(bp, "%*sCertificate ID:\n", indent, ""); indent += 2; BIO_printf(bp, "%*sHash Algorithm: ", indent, ""); - i2a_ASN1_OBJECT(bp, a->hashAlgorithm->algorithm); + X509_ALGOR_get0(&aobj, NULL, NULL, a->hashAlgorithm); + i2a_ASN1_OBJECT(bp, aobj); BIO_printf(bp, "\n%*sIssuer Name Hash: ", indent, ""); i2a_ASN1_STRING(bp, a->issuerNameHash, V_ASN1_OCTET_STRING); BIO_printf(bp, "\n%*sIssuer Key Hash: ", indent, ""); -- 2.20.1