1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-21 21:39:58 +01:00

* pubkey.c (setup_pubkey_table): Only include RSA if USE_RSA is defined.

(pubkey_get_npkey): Return 2 for RSA even if it isn't available so we can
at least handle RSA keys.

----------------------------------------------------------------------
pubkey.c CVS:
----------------------------------------------------------------------
This commit is contained in:
David Shaw 2003-12-01 00:43:51 +00:00
parent 1f1da8c8c3
commit 6048620ea5
2 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,14 @@
2003-11-30 David Shaw <dshaw@jabberwocky.com>
* pubkey.c (setup_pubkey_table): Only include RSA if USE_RSA is
defined.
(pubkey_get_npkey): Return 2 for RSA even if it isn't available so
we can at least handle RSA keys.
2003-11-27 Werner Koch <wk@gnupg.org> 2003-11-27 Werner Koch <wk@gnupg.org>
* pubkey.c (pubkey_sign): Return an error if an ElGamal key is used. * pubkey.c (pubkey_sign): Return an error if an ElGamal key is
used.
* elgamal.c (gen_k): New arg SMALL_K. * elgamal.c (gen_k): New arg SMALL_K.
(sign): Use it here with SMALL_K set to false (sign): Use it here with SMALL_K set to false

View File

@ -1,5 +1,5 @@
/* pubkey.c - pubkey dispatcher /* pubkey.c - pubkey dispatcher
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -152,6 +152,7 @@ setup_pubkey_table(void)
BUG(); BUG();
i++; i++;
#ifdef USE_RSA
pubkey_table[i].algo = PUBKEY_ALGO_RSA; pubkey_table[i].algo = PUBKEY_ALGO_RSA;
pubkey_table[i].name = rsa_get_info( pubkey_table[i].algo, pubkey_table[i].name = rsa_get_info( pubkey_table[i].algo,
&pubkey_table[i].npkey, &pubkey_table[i].npkey,
@ -203,6 +204,7 @@ setup_pubkey_table(void)
if( !pubkey_table[i].name ) if( !pubkey_table[i].name )
BUG(); BUG();
i++; i++;
#endif /* USE_RSA */
for( ; i < TABLE_SIZE; i++ ) for( ; i < TABLE_SIZE; i++ )
pubkey_table[i].name = NULL; pubkey_table[i].name = NULL;
@ -325,6 +327,8 @@ pubkey_get_npkey( int algo )
if( pubkey_table[i].algo == algo ) if( pubkey_table[i].algo == algo )
return pubkey_table[i].npkey; return pubkey_table[i].npkey;
} while( load_pubkey_modules() ); } while( load_pubkey_modules() );
if( is_RSA(algo) ) /* special hack, so that we are able to */
return 2; /* see the RSA keyids */
return 0; return 0;
} }
@ -559,4 +563,3 @@ pubkey_verify( int algo, MPI hash, MPI *data, MPI *pkey,
ready: ready:
return rc; return rc;
} }