summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2024-06-11 12:41:51 +0200
committerWerner Koch <wk@gnupg.org>2024-06-11 12:43:47 +0200
commitd81bb417c02f8d0d219258edcbd73336cc0c8db2 (patch)
tree7b43d9671e4bcf3d1337bb5902e4c5d9dc1cc7a2
parenttools: Make gpg-authcode-sign.sh more robust on network errors. (diff)
downloadgnupg2-d81bb417c02f8d0d219258edcbd73336cc0c8db2.tar.xz
gnupg2-d81bb417c02f8d0d219258edcbd73336cc0c8db2.zip
gpg: Do not bail out on secret keys with an unknown algo
* g10/getkey.c (lookup): Skip keys with unknown algos. -- If the local store has private keys with an algorithm not supported by thi version of gpg, gpg used to bail out. Thus decryption of proper messages was not possible. This fix skips such secret keys.
-rw-r--r--g10/getkey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index d97690a83..1fb9458a5 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -4027,6 +4027,8 @@ lookup (ctrl_t ctrl, getkey_ctx_t ctx, int want_secret,
rc = agent_probe_any_secret_key (ctrl, keyblock);
if (gpg_err_code(rc) == GPG_ERR_NO_SECKEY)
goto skip; /* No secret key available. */
+ if (gpg_err_code (rc) == GPG_ERR_PUBKEY_ALGO)
+ goto skip; /* Not implemented algo - skip. */
if (rc)
goto found; /* Unexpected error. */
}