From 68b3e412f49f7cfe0d00ebc66bce8d14a17439e8 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 17 Dec 2003 19:05:23 +0000 Subject: [PATCH] * 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. --- cipher/ChangeLog | 6 ++++++ cipher/dsa.c | 5 +---- cipher/dsa.h | 4 ++-- cipher/elgamal.c | 4 +--- cipher/elgamal.h | 5 ++--- cipher/pubkey.c | 12 ++++-------- cipher/rsa.c | 4 +--- cipher/rsa.h | 5 ++--- 8 files changed, 19 insertions(+), 26 deletions(-) diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 2bfcb91a9..a82966200 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,9 @@ +2003-12-17 David Shaw + + * 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 * pubkey.c (setup_pubkey_table): Don't allow signatures to and diff --git a/cipher/dsa.c b/cipher/dsa.c index d728a1b10..b243f333f 100644 --- a/cipher/dsa.c +++ b/cipher/dsa.c @@ -426,8 +426,7 @@ dsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ) } int -dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, - int (*cmp)(void *, MPI), void *opaquev ) +dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey ) { 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; } } - - diff --git a/cipher/dsa.h b/cipher/dsa.h index 89fd1f5a0..97e14e2b3 100644 --- a/cipher/dsa.h +++ b/cipher/dsa.h @@ -17,14 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef G10_DSA_H #define G10_DSA_H int dsa_generate( int algo, unsigned nbits, MPI *skey, MPI **retfactors ); int dsa_check_secret_key( int algo, 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 (*cmp)(void *, MPI), void *opaquev ); +int dsa_verify( int algo, MPI hash, MPI *data, MPI *pkey ); unsigned dsa_get_nbits( int algo, MPI *pkey ); const char *dsa_get_info( int algo, int *npkey, int *nskey, int *nenc, int *nsig, int *use ); diff --git a/cipher/elgamal.c b/cipher/elgamal.c index aff9a7e30..2ca784017 100644 --- a/cipher/elgamal.c +++ b/cipher/elgamal.c @@ -607,8 +607,7 @@ elg_sign( int algo, MPI *resarr, MPI data, MPI *skey ) } int -elg_verify( int algo, MPI hash, MPI *data, MPI *pkey, - int (*cmp)(void *, MPI), void *opaquev ) +elg_verify( int algo, MPI hash, MPI *data, MPI *pkey ) { ELG_public_key pk; @@ -627,7 +626,6 @@ elg_verify( int algo, MPI hash, MPI *data, MPI *pkey, } - unsigned int elg_get_nbits( int algo, MPI *pkey ) { diff --git a/cipher/elgamal.h b/cipher/elgamal.h index f104c2a52..6c8184219 100644 --- a/cipher/elgamal.h +++ b/cipher/elgamal.h @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef 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_decrypt( int algo, MPI *result, 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 (*cmp)(void *, MPI), void *opaquev ); +int elg_verify( int algo, MPI hash, MPI *data, MPI *pkey ); unsigned elg_get_nbits( int algo, MPI *pkey ); const char *elg_get_info( int algo, int *npkey, int *nskey, int *nenc, int *nsig, int *use ); - #endif /*G10_ELGAMAL_H*/ diff --git a/cipher/pubkey.c b/cipher/pubkey.c index f24c0894d..e3822709c 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -47,8 +47,7 @@ struct pubkey_table_s { int (*encrypt)( int algo, MPI *resarr, MPI data, MPI *pkey ); int (*decrypt)( int algo, MPI *result, 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 (*cmp)(void *, MPI), void *opaquev ); + int (*verify)( int algo, MPI hash, MPI *data, 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; } static int -dummy_verify( int algo, MPI hash, MPI *data, MPI *pkey, - int (*cmp)(void *, MPI), void *opaquev ) +dummy_verify( int algo, MPI hash, MPI *data, MPI *pkey ) { log_bug("no verify() for %d\n", algo ); return G10ERR_PUBKEY_ALGO; } #if 0 @@ -577,16 +575,14 @@ pubkey_sign( int algo, MPI *resarr, MPI data, MPI *skey ) * Return 0 if the signature is good */ int -pubkey_verify( int algo, MPI hash, MPI *data, MPI *pkey, - int (*cmp)(void *, MPI), void *opaquev ) +pubkey_verify( int algo, MPI hash, MPI *data, MPI *pkey ) { int i, rc; do { for(i=0; pubkey_table[i].name; i++ ) if( pubkey_table[i].algo == algo ) { - rc = (*pubkey_table[i].verify)( algo, hash, data, pkey, - cmp, opaquev ); + rc = (*pubkey_table[i].verify)( algo, hash, data, pkey ); goto ready; } } while( load_pubkey_modules() ); diff --git a/cipher/rsa.c b/cipher/rsa.c index 3ae530c55..7eb757a97 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -435,8 +435,7 @@ rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ) } int -rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, - int (*cmp)(void *opaque, MPI tmp), void *opaquev ) +rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey ) { RSA_public_key pk; MPI result; @@ -448,7 +447,6 @@ rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey, pk.e = pkey[1]; result = mpi_alloc( (160+BITS_PER_MPI_LIMB-1)/BITS_PER_MPI_LIMB); public( result, data[0], &pk ); - /*rc = (*cmp)( opaquev, result );*/ rc = mpi_cmp( result, hash )? G10ERR_BAD_SIGN:0; mpi_free(result); diff --git a/cipher/rsa.h b/cipher/rsa.h index 350a373ec..13c6e92e4 100644 --- a/cipher/rsa.h +++ b/cipher/rsa.h @@ -18,6 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef 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_decrypt( int algo, MPI *result, 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 (*cmp)(void *, MPI), void *opaquev ); +int rsa_verify( int algo, MPI hash, MPI *data, MPI *pkey ); unsigned rsa_get_nbits( int algo, MPI *pkey ); const char *rsa_get_info( int algo, int *npkey, int *nskey, int *nenc, int *nsig, int *use ); - #endif /*G10_RSA_H*/