aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/pubkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher/pubkey.c')
-rw-r--r--cipher/pubkey.c6
1 files changed, 6 insertions, 0 deletions
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 ) {