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

Fixed nasty Hash bug

This commit is contained in:
Werner Koch 2001-03-28 21:20:39 +00:00
parent f0b82cd352
commit ec742b7f58
11 changed files with 72 additions and 37 deletions

View file

@ -1,3 +1,10 @@
2001-03-28 Werner Koch <wk@gnupg.org>
* mainproc.c (do_check_sig): Allow direct key and subkey
revocation signature.
* sig-check.c (check_key_signature2): Check direct key signatures.
Print the signature class along with an error.
2001-03-27 Werner Koch <wk@gnupg.org>
* packet.h: Add a missing typedef to an enum. Thanks to Stefan Bellon.

View file

@ -609,8 +609,10 @@ do_check_sig( CTX c, KBNODE node, int *is_selfsig )
}
else if( (sig->sig_class&~3) == 0x10
|| sig->sig_class == 0x18
|| sig->sig_class == 0x1f
|| sig->sig_class == 0x20
|| sig->sig_class == 0x30 ) { /* classes 0x10..0x17,0x20,0x30 */
|| sig->sig_class == 0x28
|| sig->sig_class == 0x30 ) {
if( c->list->pkt->pkttype == PKT_PUBLIC_KEY
|| c->list->pkt->pkttype == PKT_PUBLIC_SUBKEY ) {
return check_key_signature( c->list, node, is_selfsig );

View file

@ -550,7 +550,7 @@ check_key_signature2( KBNODE root, KBNODE node, int *is_selfsig,
rc = G10ERR_SIG_CLASS;
}
}
else if( sig->sig_class == 0x18 ) {
else if( sig->sig_class == 0x18 ) { /* key binding */
KBNODE snode = find_prev_kbnode( root, node, PKT_PUBLIC_SUBKEY );
if( snode ) {
@ -573,7 +573,14 @@ check_key_signature2( KBNODE root, KBNODE node, int *is_selfsig,
rc = G10ERR_SIG_CLASS;
}
}
else {
else if( sig->sig_class == 0x1f ) { /* direct key signature */
md = md_open( algo, 0 );
hash_public_key( md, pk );
rc = do_check( pk, sig, md, r_expired );
cache_selfsig_result ( sig, rc );
md_close(md);
}
else { /* all other classes */
KBNODE unode = find_prev_kbnode( root, node, PKT_USER_ID );
if( unode ) {
@ -595,7 +602,8 @@ check_key_signature2( KBNODE root, KBNODE node, int *is_selfsig,
md_close(md);
}
else {
log_error("no user ID for key signature packet\n");
log_error("no user ID for key signature packet of class %02x\n",
sig->sig_class );
rc = G10ERR_SIG_CLASS;
}
}