From 03004f8fcf7c70654de737fb34ffc4361b5ba411 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 8 May 2023 05:30:38 +0000 Subject: [PATCH] Avoid trailing whitespace in extension printing If an extension is non-critical, X509V3_extensions_print() would leave trailing whitespace. This can be trivially avoided. ok miod --- lib/libcrypto/x509/x509_prn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/x509/x509_prn.c b/lib/libcrypto/x509/x509_prn.c index 2d7afb9fcc4..3bf7c803e52 100644 --- a/lib/libcrypto/x509/x509_prn.c +++ b/lib/libcrypto/x509/x509_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_prn.c,v 1.5 2023/02/16 08:38:17 tb Exp $ */ +/* $OpenBSD: x509_prn.c,v 1.6 2023/05/08 05:30:38 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -178,7 +178,7 @@ X509V3_extensions_print(BIO *bp, const char *title, obj = X509_EXTENSION_get_object(ex); i2a_ASN1_OBJECT(bp, obj); j = X509_EXTENSION_get_critical(ex); - if (BIO_printf(bp, ": %s\n",j?"critical":"") <= 0) + if (BIO_printf(bp, ":%s\n", j ? " critical" : "") <= 0) return 0; if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { BIO_printf(bp, "%*s", indent + 4, ""); -- 2.20.1