diff options
author | NIIBE Yutaka <[email protected]> | 2015-05-19 01:32:07 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2015-05-19 01:32:07 +0000 |
commit | c771963140cad7c1c25349bcde27e427effc0058 (patch) | |
tree | b72cea08a59839a9b65329181ac1073626891783 | |
parent | tests: More OpenPGP test keys (diff) | |
download | gnupg-c771963140cad7c1c25349bcde27e427effc0058.tar.gz gnupg-c771963140cad7c1c25349bcde27e427effc0058.zip |
g10: detects public key encryption packet error properly.
g10/mainproc.c (proc_pubkey_enc): Only allow relevant algorithms for
encryption.
-rw-r--r-- | g10/mainproc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index e72d07640..c90b9e333 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -406,12 +406,10 @@ proc_pubkey_enc (CTX c, PACKET *pkt) c->dek = NULL; } } - else if (is_ELGAMAL(enc->pubkey_algo) - || enc->pubkey_algo == PUBKEY_ALGO_DSA - || enc->pubkey_algo == PUBKEY_ALGO_ECDSA - || enc->pubkey_algo == PUBKEY_ALGO_EDDSA + else if (enc->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E || enc->pubkey_algo == PUBKEY_ALGO_ECDH - || is_RSA (enc->pubkey_algo) + || enc->pubkey_algo == PUBKEY_ALGO_RSA + || enc->pubkey_algo == PUBKEY_ALGO_RSA_E || enc->pubkey_algo == PUBKEY_ALGO_ELGAMAL) { /* Note that we also allow type 20 Elgamal keys for decryption. |