From 996d61bcc6257249327faa4eba00f2f311c73035 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 27 Nov 2003 14:47:59 +0000 Subject: * pubkey.c (pubkey_sign): Return an error if an ElGamal key is used. * elgamal.c (gen_k): New arg SMALL_K. (sign): Use it here with SMALL_K set to false (do_encrypt): and here with SMALL_K set to true. --- cipher/pubkey.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cipher/pubkey.c') diff --git a/cipher/pubkey.c b/cipher/pubkey.c index 853c518be..3ab84e4a3 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -518,6 +518,9 @@ pubkey_sign( int algo, MPI *resarr, MPI data, MPI *skey ) log_mpidump(" data:", data ); } + if (is_ELGAMAL (algo)) + return G10ERR_UNU_SECKEY; + do { for(i=0; pubkey_table[i].name; i++ ) if( pubkey_table[i].algo == algo ) { -- cgit v1.2.3