1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-06 23:17:47 +02:00

* sig-check.c (signature_check2): Sanity check that the md has a context

for the hash that the sig is expecting.  This can happen if a onepass sig
header does not match the actual sig, and also if the clearsign "Hash:"
header is missing or does not match the actual sig.
This commit is contained in:
David Shaw 2002-08-07 19:53:27 +00:00
parent bed4e0daa0
commit e703540328
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,11 @@
2002-08-07 David Shaw <dshaw@jabberwocky.com> 2002-08-07 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (signature_check2): Sanity check that the md has a
context for the hash that the sig is expecting. This can happen
if a onepass sig header does not match the actual sig, and also if
the clearsign "Hash:" header is missing or does not match the
actual sig.
* keyedit.c (menu_revsig): Properly show a uid is revoked without * keyedit.c (menu_revsig): Properly show a uid is revoked without
restarting gpg. This is Debian bug 124219, though their supplied restarting gpg. This is Debian bug 124219, though their supplied
patch will not do the right thing. patch will not do the right thing.

View File

@ -63,7 +63,17 @@ signature_check2( PKT_signature *sig, MD_HANDLE digest,
int rc=0; int rc=0;
*r_expiredate = 0; *r_expiredate = 0;
if( get_pubkey( pk, sig->keyid ) )
/* Sanity check that the md has a context for the hash that the
sig is expecting. This can happen if a onepass sig header does
not match the actual sig, and also if the clearsign "Hash:"
header is missing or does not match the actual sig. */
if(!md_algo_present(digest,sig->digest_algo)) {
log_info(_("WARNING: signature digest conflict in message\n"));
rc=G10ERR_BAD_SIGN;
}
else if( get_pubkey( pk, sig->keyid ) )
rc = G10ERR_NO_PUBKEY; rc = G10ERR_NO_PUBKEY;
else if(!pk->is_valid && else if(!pk->is_valid &&
(pk->main_keyid[0]!=pk->keyid[0] || (pk->main_keyid[0]!=pk->keyid[0] ||