1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* seskey.c (encode_md_value): Print an error message if a wrong

digest algorithm is used with DSA.  Changed all callers to cope
with a NULL return.  Problem noted by Imad R. Faiad.
This commit is contained in:
Werner Koch 2002-04-18 19:38:34 +00:00
parent 30c8d23aff
commit aedeefcc5f
4 changed files with 30 additions and 6 deletions

View file

@ -246,6 +246,8 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
sig->digest_start[1] = dp[1];
frame = encode_md_value( sk->pubkey_algo, md,
digest_algo, mpi_get_nbits(sk->skey[0]), 0 );
if (!frame)
return G10ERR_GENERAL;
rc = pubkey_sign( sk->pubkey_algo, sig->data, frame, sk->skey );
mpi_free(frame);
if (!rc && !opt.no_sig_create_check) {
@ -260,8 +262,12 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
frame = encode_md_value (pk->pubkey_algo, md,
sig->digest_algo,
mpi_get_nbits(pk->pkey[0]), 0);
rc = pubkey_verify (pk->pubkey_algo, frame, sig->data, pk->pkey,
NULL, NULL );
if (!frame)
rc = G10ERR_GENERAL;
else
rc = pubkey_verify (pk->pubkey_algo, frame,
sig->data, pk->pkey,
NULL, NULL );
mpi_free (frame);
}
if (rc)