From caa783329b34c519c6f353e40b1c4cf4ef5d2d6a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 24 Jul 2025 12:30:01 +0200 Subject: gpgsm: Fix caching of the trustlist's flags. * sm/call-agent.c (istrusted_status_cb): Clear the helper flags. -- GnuPG-bug-id: 7738 Fixes-commit: 09d4b8f496dd461a21d5ba0297710d683b16def4 which introduced the caching but go the flags wrong. The fallout from this was that the qualified signature consent was show for non QES certificates. Other flags are almost always the same and thus no other harm was done. Backported-from-master: 67a3020d0f3beed89270f2d004c3da5ee9cbfc63 --- sm/call-agent.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sm/call-agent.c b/sm/call-agent.c index 75ae3f677..8efa392aa 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -960,6 +960,9 @@ istrusted_status_cb (void *opaque, const char *line) } else if ((s = has_leading_keyword (line, "TRUSTLISTFPR")) && *s) { + /* We see this only with the "LISTTRUSTED --status" command but + * not with ISTRUSTED. Thus the cache will only be filled by + * the former command. */ istrusted_cache_t ci; ci = xtrymalloc (sizeof *ci + strlen (s)); @@ -973,6 +976,9 @@ istrusted_status_cb (void *opaque, const char *line) ci->next = parm->cache; parm->cache = ci; + /* Also need to clear the parm's flags which will be copied to + * the cache. */ + memset (&parm->flags, 0, sizeof ci->flags); } return 0; } -- cgit v1.2.3