summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2024-07-10 08:13:06 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2024-07-10 08:13:06 +0200
commit1e6b96577f681992249bbd39c157d9fc05df0ac4 (patch)
treefce632a305258b56c1e5dc5aa8d28d804ca32224
parentpo: Update Japanese Translation. (diff)
downloadgnupg2-1e6b96577f681992249bbd39c157d9fc05df0ac4.tar.xz
gnupg2-1e6b96577f681992249bbd39c157d9fc05df0ac4.zip
gpg: Fix agent_probe_any_secret_key.
* g10/call-agent.c (agent_probe_any_secret_key): No second keygrip is not an error. -- GnuPG-bug-id: 7195 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--g10/call-agent.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 3a4d35b07..54d8f62f1 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -2434,9 +2434,14 @@ agent_probe_any_secret_key (ctrl_t ctrl, kbnode_t keyblock)
nkeys++;
err = keygrip_from_pk (node->pkt->pkt.public_key, grip2, 1);
- if (err && gpg_err_code (err) != GPG_ERR_FALSE)
- return err;
- if (!err) /* Add the second keygrip from dual algos. */
+ if (err)
+ {
+ if (gpg_err_code (err) == GPG_ERR_FALSE) /* No second keygrip. */
+ err = 0;
+ else
+ return err;
+ }
+ else /* Add the second keygrip from dual algos. */
{
*p++ = ' ';
bin2hex (grip2, 20, p);