summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index 89a9085249..71f97a8214 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_x509.c,v 1.53 2025/06/25 18:28:47 tb Exp $ */ 1/* $OpenBSD: t_x509.c,v 1.54 2025/07/01 06:46:39 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -106,6 +106,28 @@ X509_print(BIO *bp, X509 *x)
106} 106}
107LCRYPTO_ALIAS(X509_print); 107LCRYPTO_ALIAS(X509_print);
108 108
109static int
110x509_print_uids(BIO *bp, const X509 *x, int indent)
111{
112 const ASN1_BIT_STRING *issuerUID = NULL, *subjectUID = NULL;
113
114 X509_get0_uids(x, &issuerUID, &subjectUID);
115 if (issuerUID != NULL) {
116 if (BIO_printf(bp, "%*sIssuer Unique ID: ", indent, "") <= 0)
117 return 0;
118 if (!X509_signature_dump(bp, issuerUID, indent + 4))
119 return 0;
120 }
121 if (subjectUID != NULL) {
122 if (BIO_printf(bp, "%*sSubject Unique ID: ", indent, "") <= 0)
123 return 0;
124 if (!X509_signature_dump(bp, subjectUID, indent + 4))
125 return 0;
126 }
127
128 return 1;
129}
130
109int 131int
110X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) 132X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
111{ 133{
@@ -242,6 +264,11 @@ X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
242 } 264 }
243 } 265 }
244 266
267 if (!(cflag & X509_FLAG_NO_IDS)) {
268 if (!x509_print_uids(bp, x, 8))
269 goto err;
270 }
271
245 if (!(cflag & X509_FLAG_NO_EXTENSIONS)) 272 if (!(cflag & X509_FLAG_NO_EXTENSIONS))
246 X509V3_extensions_print(bp, "X509v3 extensions", 273 X509V3_extensions_print(bp, "X509v3 extensions",
247 ci->extensions, cflag, 8); 274 ci->extensions, cflag, 8);