aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-08-20 07:59:36 +0000
committerWerner Koch <[email protected]>2014-08-20 07:59:36 +0000
commitcb680c5ea540738692a5c74951802b0fdc658e85 (patch)
treede04cf99fcc0e48e0faed7293701677ef678d212
parentspeedo: Get version numbers from online database. (diff)
downloadgnupg-cb680c5ea540738692a5c74951802b0fdc658e85.tar.gz
gnupg-cb680c5ea540738692a5c74951802b0fdc658e85.zip
gpg: Fix "can't handle public key algorithm" warning.
* g10/parse-packet.c (unknown_pubkey_warning): Check for encr/sign capabilities.
Diffstat (limited to '')
-rw-r--r--g10/parse-packet.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index c69393a3d..cfae788d5 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -195,12 +195,29 @@ unknown_pubkey_warning (int algo)
{
static byte unknown_pubkey_algos[256];
- algo &= 0xff;
- if (!unknown_pubkey_algos[algo])
+ /* First check whether the algorithm is usable but not suitable for
+ encryption/signing. */
+ if (pubkey_get_npkey (algo))
{
if (opt.verbose)
- log_info (_("can't handle public key algorithm %d\n"), algo);
- unknown_pubkey_algos[algo] = 1;
+ {
+ if (!pubkey_get_nsig (algo))
+ log_info ("public key algorithm %s not suitable for %s\n",
+ openpgp_pk_algo_name (algo), "signing");
+ if (!pubkey_get_nenc (algo))
+ log_info ("public key algorithm %s not suitable for %s\n",
+ openpgp_pk_algo_name (algo), "encryption");
+ }
+ }
+ else
+ {
+ algo &= 0xff;
+ if (!unknown_pubkey_algos[algo])
+ {
+ if (opt.verbose)
+ log_info (_("can't handle public key algorithm %d\n"), algo);
+ unknown_pubkey_algos[algo] = 1;
+ }
}
}