From e57a2e65d93f8a400b4b643f023e4095f26fd9f6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 13 May 2025 15:18:39 +0200 Subject: [PATCH] gpgsm: Just print a note for an empty subject during import. * sm/certchain.c (gpgsm_walk_cert_chain): Handle an empty subject. -- During import a certificate was imported but gpgsm used log_error when trying to figure out whether this is a root cert. This patch changes this to just print a note. GnuPG-bug-id: 7171 --- sm/certchain.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sm/certchain.c b/sm/certchain.c index 9d0fe684b..0c19eb0e8 100644 --- a/sm/certchain.c +++ b/sm/certchain.c @@ -1074,14 +1074,10 @@ gpgsm_walk_cert_chain (ctrl_t ctrl, ksba_cert_t start, ksba_cert_t *r_next) err = gpg_error (GPG_ERR_BAD_CERT); goto leave; } - if (!subject) - { - log_error ("no subject found in certificate\n"); - err = gpg_error (GPG_ERR_BAD_CERT); - goto leave; - } + if (!subject && !opt.quiet) + log_info ("Note: no subject found in certificate\n"); - if (is_root_cert (start, issuer, subject)) + if (subject && is_root_cert (start, issuer, subject)) { err = gpg_error (GPG_ERR_NOT_FOUND); /* we are at the root */ goto leave;