1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpgsm: Silence messages about dirmngr cache lookup failed.

* sm/certchain.c (find_up_dirmngr): Skip if we know that there is no
dirmngr.
This commit is contained in:
Werner Koch 2024-09-30 18:47:31 +02:00
parent 8190853642
commit 0e283a0ebc
No known key found for this signature in database
GPG Key ID: AF99952165A3D8C5

View File

@ -795,6 +795,7 @@ static int
find_up_dirmngr (ctrl_t ctrl, KEYDB_HANDLE kh,
ksba_sexp_t serialno, const char *issuer, int subject_mode)
{
static int no_dirmngr;
int rc;
strlist_t names = NULL;
struct find_up_store_certs_s find_up_store_certs_parm;
@ -805,6 +806,12 @@ find_up_dirmngr (ctrl_t ctrl, KEYDB_HANDLE kh,
find_up_store_certs_parm.ctrl = ctrl;
find_up_store_certs_parm.count = 0;
if (no_dirmngr)
{
rc = GPG_ERR_NO_DIRMNGR;
goto leave;
}
if (opt.verbose)
log_info (_("looking up issuer from the Dirmngr cache\n"));
if (subject_mode)
@ -834,8 +841,13 @@ find_up_dirmngr (ctrl_t ctrl, KEYDB_HANDLE kh,
log_info (_("number of matching certificates: %d\n"),
find_up_store_certs_parm.count);
if (rc && opt.verbose)
{
log_info (_("dirmngr cache-only key lookup failed: %s\n"),
gpg_strerror (rc));
}
if (gpg_err_code (rc) == GPG_ERR_NO_DIRMNGR)
no_dirmngr = 1;
leave:
return ((!rc && find_up_store_certs_parm.count)
? 0 : gpg_error (GPG_ERR_NOT_FOUND));
}