summaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-09-22 10:07:42 +0200
committerWerner Koch <wk@gnupg.org>2022-09-26 14:40:34 +0200
commit1b2ac21c4cf763be25bdd98c84d9b79b85a38315 (patch)
treeea2257cf8e9512b2f751072bd2798adb24553a4e /g10/mainproc.c
parentdirmngr: Factor out interrogate_ldap_dn function. (diff)
downloadgnupg2-1b2ac21c4cf763be25bdd98c84d9b79b85a38315.tar.xz
gnupg2-1b2ac21c4cf763be25bdd98c84d9b79b85a38315.zip
gpg: Don't consider unknown keys as non-compliant while decrypting.
* g10/mainproc.c (proc_encrypted): Change compliance logic. -- For the description of the proplem see https://dev.gnupg.org/T6205#163306 GnuPG-bug-id: 6205
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 0757fcd90..f8f3c15bc 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -753,15 +753,15 @@ proc_encrypted (CTX c, PACKET *pkt)
compliant = 0;
}
- /* Check that every public key used to encrypt the session key
+ /* Check that every known public key used to encrypt the session key
* is compliant. */
for (i = c->pkenc_list; i && compliant; i = i->next)
{
memset (pk, 0, sizeof *pk);
pk->pubkey_algo = i->pubkey_algo;
- if (get_pubkey (c->ctrl, pk, i->keyid) != 0
- || ! gnupg_pk_is_compliant (CO_DE_VS, pk->pubkey_algo, 0,
- pk->pkey, nbits_from_pk (pk), NULL))
+ if (!get_pubkey (c->ctrl, pk, i->keyid)
+ && !gnupg_pk_is_compliant (CO_DE_VS, pk->pubkey_algo, 0,
+ pk->pkey, nbits_from_pk (pk), NULL))
compliant = 0;
release_public_key_parts (pk);
}