summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-08-28 06:18:44 +0000
committertb <>2024-08-28 06:18:44 +0000
commitccd3460b51b034ee30869bcb090738c757b3cb23 (patch)
tree420009f18f33455ff9c1740eee277659491ae018
parentde1c20338c8303d97973d7ccd003ff3d04a96c2a (diff)
downloadopenbsd-ccd3460b51b034ee30869bcb090738c757b3cb23.tar.gz
openbsd-ccd3460b51b034ee30869bcb090738c757b3cb23.tar.bz2
openbsd-ccd3460b51b034ee30869bcb090738c757b3cb23.zip
Avoid reaching into X509_ALGOR in ocsp_certid_print()
ok jsing
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_prn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_prn.c b/src/lib/libcrypto/ocsp/ocsp_prn.c
index 7e3175b613..fb7b9651d9 100644
--- a/src/lib/libcrypto/ocsp/ocsp_prn.c
+++ b/src/lib/libcrypto/ocsp/ocsp_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_prn.c,v 1.10 2023/07/08 10:44:00 beck Exp $ */ 1/* $OpenBSD: ocsp_prn.c,v 1.11 2024/08/28 06:18:44 tb Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -65,16 +65,20 @@
65#include <openssl/err.h> 65#include <openssl/err.h>
66#include <openssl/ocsp.h> 66#include <openssl/ocsp.h>
67#include <openssl/pem.h> 67#include <openssl/pem.h>
68#include <openssl/x509.h>
68 69
69#include "ocsp_local.h" 70#include "ocsp_local.h"
70 71
71static int 72static int
72ocsp_certid_print(BIO *bp, OCSP_CERTID* a, int indent) 73ocsp_certid_print(BIO *bp, OCSP_CERTID* a, int indent)
73{ 74{
75 const ASN1_OBJECT *aobj;
76
74 BIO_printf(bp, "%*sCertificate ID:\n", indent, ""); 77 BIO_printf(bp, "%*sCertificate ID:\n", indent, "");
75 indent += 2; 78 indent += 2;
76 BIO_printf(bp, "%*sHash Algorithm: ", indent, ""); 79 BIO_printf(bp, "%*sHash Algorithm: ", indent, "");
77 i2a_ASN1_OBJECT(bp, a->hashAlgorithm->algorithm); 80 X509_ALGOR_get0(&aobj, NULL, NULL, a->hashAlgorithm);
81 i2a_ASN1_OBJECT(bp, aobj);
78 BIO_printf(bp, "\n%*sIssuer Name Hash: ", indent, ""); 82 BIO_printf(bp, "\n%*sIssuer Name Hash: ", indent, "");
79 i2a_ASN1_STRING(bp, a->issuerNameHash, V_ASN1_OCTET_STRING); 83 i2a_ASN1_STRING(bp, a->issuerNameHash, V_ASN1_OCTET_STRING);
80 BIO_printf(bp, "\n%*sIssuer Key Hash: ", indent, ""); 84 BIO_printf(bp, "\n%*sIssuer Key Hash: ", indent, "");