diff options
author | NIIBE Yutaka <[email protected]> | 2015-05-19 01:47:42 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2015-05-19 01:47:42 +0000 |
commit | f3b00d88efa25e23f70b757cf99302af77d3d7ae (patch) | |
tree | d2878d224ab538d6f3a319fe669369662e8c54e9 | |
parent | g10: Improve handling of no corresponding public key. (diff) | |
download | gnupg-f3b00d88efa25e23f70b757cf99302af77d3d7ae.tar.gz gnupg-f3b00d88efa25e23f70b757cf99302af77d3d7ae.zip |
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 c771963140cad7c1c25349bcde27e427effc0058)
-rw-r--r-- | g10/mainproc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index 2cf6dbce2..a773fde19 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -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 |