mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Fix "can't handle public key algorithm" warning.
* g10/parse-packet.c (unknown_pubkey_warning): Check for encr/sign capabilities.
This commit is contained in:
parent
31649e72fd
commit
cb680c5ea5
1 changed files with 21 additions and 4 deletions
|
@ -195,6 +195,22 @@ unknown_pubkey_warning (int algo)
|
||||||
{
|
{
|
||||||
static byte unknown_pubkey_algos[256];
|
static byte unknown_pubkey_algos[256];
|
||||||
|
|
||||||
|
/* First check whether the algorithm is usable but not suitable for
|
||||||
|
encryption/signing. */
|
||||||
|
if (pubkey_get_npkey (algo))
|
||||||
|
{
|
||||||
|
if (opt.verbose)
|
||||||
|
{
|
||||||
|
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;
|
algo &= 0xff;
|
||||||
if (!unknown_pubkey_algos[algo])
|
if (!unknown_pubkey_algos[algo])
|
||||||
{
|
{
|
||||||
|
@ -202,6 +218,7 @@ unknown_pubkey_warning (int algo)
|
||||||
log_info (_("can't handle public key algorithm %d\n"), algo);
|
log_info (_("can't handle public key algorithm %d\n"), algo);
|
||||||
unknown_pubkey_algos[algo] = 1;
|
unknown_pubkey_algos[algo] = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue