1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-08 12:44:23 +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>
* 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
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;
}
}

View File

@ -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 );

View File

@ -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 )
{

View File

@ -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*/

View File

@ -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() );

View File

@ -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);

View File

@ -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*/