From 819085364238b2d078580068b92b477a3c0d3e9a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 30 Sep 2024 18:33:26 +0200 Subject: gpgsm: Silence the fingerprint output in quiet mode. * sm/certchain.c (ask_marktrusted): Avoid fingerprint printing in quiet mode -- And also don't print it anymore after the agent told us that the feature has been disabled. --- sm/certchain.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sm/certchain.c b/sm/certchain.c index a9c541fb7..a6dd9c3f8 100644 --- a/sm/certchain.c +++ b/sm/certchain.c @@ -1527,13 +1527,17 @@ ask_marktrusted (ctrl_t ctrl, ksba_cert_t cert, int listmode) { static int no_more_questions; int rc; - char *fpr; int success = 0; - fpr = gpgsm_get_fingerprint_string (cert, GCRY_MD_SHA1); - es_fflush (es_stdout); - log_info (_("fingerprint=%s\n"), fpr? fpr : "?"); - xfree (fpr); + if (opt.quiet || no_more_questions) + es_fflush (es_stdout); + else + { + char *fpr = gpgsm_get_fingerprint_string (cert, GCRY_MD_SHA1); + es_fflush (es_stdout); + log_info (_("fingerprint=%s\n"), fpr? fpr : "?"); + xfree (fpr); + } if (no_more_questions) rc = gpg_error (GPG_ERR_NOT_SUPPORTED); -- cgit v1.2.3