1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-01 22:28:02 +02:00

g10: detects public key encryption packet error properly.

g10/mainproc.c (proc_pubkey_enc): Only allow relevant algorithms for
encryption.

--

(backported from 2.1 commit c771963140)
This commit is contained in:
NIIBE Yutaka 2015-05-19 10:47:42 +09:00
parent b3fd30451a
commit f3b00d88ef

View File

@ -401,9 +401,9 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
xfree(c->dek); c->dek = NULL;
}
}
else if( is_ELGAMAL(enc->pubkey_algo)
|| enc->pubkey_algo == PUBKEY_ALGO_DSA
|| is_RSA(enc->pubkey_algo)
else if( enc->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E
|| enc->pubkey_algo == PUBKEY_ALGO_RSA
|| enc->pubkey_algo == PUBKEY_ALGO_RSA_E
|| (RFC2440 && enc->pubkey_algo == PUBKEY_ALGO_ELGAMAL)) {
/* Note that we also allow type 20 Elgamal keys for decryption.
There are still a couple of those keys in active use as a