diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 7 | ||||
-rw-r--r-- | g10/mainproc.c | 4 | ||||
-rw-r--r-- | g10/sig-check.c | 14 |
3 files changed, 21 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index bbaae1b1c..caad560e5 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +2001-03-28 Werner Koch <[email protected]> + + * 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 <[email protected]> * packet.h: Add a missing typedef to an enum. Thanks to Stefan Bellon. diff --git a/g10/mainproc.c b/g10/mainproc.c index 948643f05..76e7f4167 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -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 ); diff --git a/g10/sig-check.c b/g10/sig-check.c index 5282281d7..49cc72c32 100644 --- a/g10/sig-check.c +++ b/g10/sig-check.c @@ -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; } } |