1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-23 15:07:03 +01:00

* dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify), rsa.h,

rsa.c (rsa_verify), pubkey.c (dummy_verify, pubkey_verify): Remove old
unused code.
This commit is contained in:
David Shaw 2003-12-17 19:05:23 +00:00
parent 64dd0c4226
commit 68b3e412f4
8 changed files with 19 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2003-12-17 David Shaw <dshaw@localhost.localdomain>
* dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify),
rsa.h, rsa.c (rsa_verify), pubkey.c (dummy_verify, pubkey_verify):
Remove old unused code.
2003-12-03 David Shaw <dshaw@jabberwocky.com> 2003-12-03 David Shaw <dshaw@jabberwocky.com>
* pubkey.c (setup_pubkey_table): Don't allow signatures to and * pubkey.c (setup_pubkey_table): Don't allow signatures to and

View File

@ -426,8 +426,7 @@ dsa_sign( int algo, MPI *resarr, MPI data, MPI *skey )
} }
int int
dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey )
int (*cmp)(void *, MPI), void *opaquev )
{ {
DSA_public_key pk; DSA_public_key pk;
@ -479,5 +478,3 @@ dsa_get_info( int algo, int *npkey, int *nskey, int *nenc, int *nsig,
default: *use = 0; return NULL; default: *use = 0; return NULL;
} }
} }

View File

@ -17,14 +17,14 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifndef G10_DSA_H #ifndef G10_DSA_H
#define G10_DSA_H #define G10_DSA_H
int dsa_generate( int algo, unsigned nbits, MPI *skey, MPI **retfactors ); int dsa_generate( int algo, unsigned nbits, MPI *skey, MPI **retfactors );
int dsa_check_secret_key( int algo, MPI *skey ); int dsa_check_secret_key( int algo, MPI *skey );
int dsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ); int dsa_sign( int algo, MPI *resarr, MPI data, MPI *skey );
int dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, int dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey );
int (*cmp)(void *, MPI), void *opaquev );
unsigned dsa_get_nbits( int algo, MPI *pkey ); unsigned dsa_get_nbits( int algo, MPI *pkey );
const char *dsa_get_info( int algo, int *npkey, int *nskey, const char *dsa_get_info( int algo, int *npkey, int *nskey,
int *nenc, int *nsig, int *use ); int *nenc, int *nsig, int *use );

View File

@ -607,8 +607,7 @@ elg_sign( int algo, MPI *resarr, MPI data, MPI *skey )
} }
int int
elg_verify( int algo, MPI hash, MPI *data, MPI *pkey, elg_verify( int algo, MPI hash, MPI *data, MPI *pkey )
int (*cmp)(void *, MPI), void *opaquev )
{ {
ELG_public_key pk; ELG_public_key pk;
@ -627,7 +626,6 @@ elg_verify( int algo, MPI hash, MPI *data, MPI *pkey,
} }
unsigned int unsigned int
elg_get_nbits( int algo, MPI *pkey ) elg_get_nbits( int algo, MPI *pkey )
{ {

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifndef G10_ELGAMAL_H #ifndef G10_ELGAMAL_H
#define G10_ELGAMAL_H #define G10_ELGAMAL_H
@ -25,11 +26,9 @@ int elg_check_secret_key( int algo, MPI *skey );
int elg_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey ); int elg_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey );
int elg_decrypt( int algo, MPI *result, MPI *data, MPI *skey ); int elg_decrypt( int algo, MPI *result, MPI *data, MPI *skey );
int elg_sign( int algo, MPI *resarr, MPI data, MPI *skey ); int elg_sign( int algo, MPI *resarr, MPI data, MPI *skey );
int elg_verify( int algo, MPI hash, MPI *data, MPI *pkey, int elg_verify( int algo, MPI hash, MPI *data, MPI *pkey );
int (*cmp)(void *, MPI), void *opaquev );
unsigned elg_get_nbits( int algo, MPI *pkey ); unsigned elg_get_nbits( int algo, MPI *pkey );
const char *elg_get_info( int algo, int *npkey, int *nskey, const char *elg_get_info( int algo, int *npkey, int *nskey,
int *nenc, int *nsig, int *use ); int *nenc, int *nsig, int *use );
#endif /*G10_ELGAMAL_H*/ #endif /*G10_ELGAMAL_H*/

View File

@ -47,8 +47,7 @@ struct pubkey_table_s {
int (*encrypt)( int algo, MPI *resarr, MPI data, MPI *pkey ); int (*encrypt)( int algo, MPI *resarr, MPI data, MPI *pkey );
int (*decrypt)( int algo, MPI *result, MPI *data, MPI *skey ); int (*decrypt)( int algo, MPI *result, MPI *data, MPI *skey );
int (*sign)( int algo, MPI *resarr, MPI data, MPI *skey ); int (*sign)( int algo, MPI *resarr, MPI data, MPI *skey );
int (*verify)( int algo, MPI hash, MPI *data, MPI *pkey, int (*verify)( int algo, MPI hash, MPI *data, MPI *pkey );
int (*cmp)(void *, MPI), void *opaquev );
unsigned (*get_nbits)( int algo, MPI *pkey ); unsigned (*get_nbits)( int algo, MPI *pkey );
}; };
@ -79,8 +78,7 @@ dummy_sign( int algo, MPI *resarr, MPI data, MPI *skey )
{ log_bug("no sign() for %d\n", algo ); return G10ERR_PUBKEY_ALGO; } { log_bug("no sign() for %d\n", algo ); return G10ERR_PUBKEY_ALGO; }
static int static int
dummy_verify( int algo, MPI hash, MPI *data, MPI *pkey, dummy_verify( int algo, MPI hash, MPI *data, MPI *pkey )
int (*cmp)(void *, MPI), void *opaquev )
{ log_bug("no verify() for %d\n", algo ); return G10ERR_PUBKEY_ALGO; } { log_bug("no verify() for %d\n", algo ); return G10ERR_PUBKEY_ALGO; }
#if 0 #if 0
@ -577,16 +575,14 @@ pubkey_sign( int algo, MPI *resarr, MPI data, MPI *skey )
* Return 0 if the signature is good * Return 0 if the signature is good
*/ */
int int
pubkey_verify( int algo, MPI hash, MPI *data, MPI *pkey, pubkey_verify( int algo, MPI hash, MPI *data, MPI *pkey )
int (*cmp)(void *, MPI), void *opaquev )
{ {
int i, rc; int i, rc;
do { do {
for(i=0; pubkey_table[i].name; i++ ) for(i=0; pubkey_table[i].name; i++ )
if( pubkey_table[i].algo == algo ) { if( pubkey_table[i].algo == algo ) {
rc = (*pubkey_table[i].verify)( algo, hash, data, pkey, rc = (*pubkey_table[i].verify)( algo, hash, data, pkey );
cmp, opaquev );
goto ready; goto ready;
} }
} while( load_pubkey_modules() ); } while( load_pubkey_modules() );

View File

@ -435,8 +435,7 @@ rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey )
} }
int int
rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey )
int (*cmp)(void *opaque, MPI tmp), void *opaquev )
{ {
RSA_public_key pk; RSA_public_key pk;
MPI result; MPI result;
@ -448,7 +447,6 @@ rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey,
pk.e = pkey[1]; pk.e = pkey[1];
result = mpi_alloc( (160+BITS_PER_MPI_LIMB-1)/BITS_PER_MPI_LIMB); result = mpi_alloc( (160+BITS_PER_MPI_LIMB-1)/BITS_PER_MPI_LIMB);
public( result, data[0], &pk ); public( result, data[0], &pk );
/*rc = (*cmp)( opaquev, result );*/
rc = mpi_cmp( result, hash )? G10ERR_BAD_SIGN:0; rc = mpi_cmp( result, hash )? G10ERR_BAD_SIGN:0;
mpi_free(result); mpi_free(result);

View File

@ -18,6 +18,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifndef G10_RSA_H #ifndef G10_RSA_H
#define G10_RSA_H #define G10_RSA_H
@ -26,11 +27,9 @@ int rsa_check_secret_key( int algo, MPI *skey );
int rsa_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey ); int rsa_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey );
int rsa_decrypt( int algo, MPI *result, MPI *data, MPI *skey ); int rsa_decrypt( int algo, MPI *result, MPI *data, MPI *skey );
int rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ); int rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey );
int rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, int rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey );
int (*cmp)(void *, MPI), void *opaquev );
unsigned rsa_get_nbits( int algo, MPI *pkey ); unsigned rsa_get_nbits( int algo, MPI *pkey );
const char *rsa_get_info( int algo, int *npkey, int *nskey, const char *rsa_get_info( int algo, int *npkey, int *nskey,
int *nenc, int *nsig, int *use ); int *nenc, int *nsig, int *use );
#endif /*G10_RSA_H*/ #endif /*G10_RSA_H*/