From a45ad0eba16a3c9e02177a4c07fa8292ba3e683b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 11 Dec 2007 17:14:05 +0000 Subject: Allow decryption using type 20 key. --- cipher/ChangeLog | 5 +++++ cipher/pubkey.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 07ab5bdcf..f3ff35b04 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +2007-12-11 Werner Koch + + * pubkey.c (check_pubkey_algo2): Hack to allow decryption using an + type 20 Elgamal key. + 2007-11-29 David Shaw * camellia-glue.c (camellia_get_info), cipher.c diff --git a/cipher/pubkey.c b/cipher/pubkey.c index 06642445a..4313cd62d 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -272,6 +272,12 @@ check_pubkey_algo2( int algo, unsigned use ) { int i; + /* Map type 20 Elgamal algorithm to type 16 if it is used for + decryption. This allows to use legacy type 20 Elgamal keys for + decryption. */ + if (algo == PUBKEY_ALGO_ELGAMAL && use == PUBKEY_USAGE_ENC) + algo = PUBKEY_ALGO_ELGAMAL_E; + do { for(i=0; pubkey_table[i].name; i++ ) if( pubkey_table[i].algo == algo ) { -- cgit v1.2.3