1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-20 21:29:58 +01:00

* import.c (delete_inv_parts): Discard subkey signatures (0x18 and 0x28)

if found in the userid section of the key.
This commit is contained in:
David Shaw 2002-07-24 03:29:02 +00:00
parent 4623605645
commit eb5c0265e1
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2002-07-23 David Shaw <dshaw@jabberwocky.com>
* import.c (delete_inv_parts): Discard subkey signatures (0x18 and
0x28) if found in the userid section of the key.
* sig-check.c (signature_check2): Signatures made by invalid
subkeys (bad/missing binding sig) are also invalid.

View File

@ -1033,7 +1033,7 @@ static int
delete_inv_parts( const char *fname, KBNODE keyblock, u32 *keyid )
{
KBNODE node;
int nvalid=0, uid_seen=0;
int nvalid=0, uid_seen=0, subkey_seen=0;
for(node=keyblock->next; node; node = node->next ) {
if( node->pkt->pkttype == PKT_USER_ID ) {
@ -1074,6 +1074,8 @@ delete_inv_parts( const char *fname, KBNODE keyblock, u32 *keyid )
node = node->next;
}
}
else
subkey_seen = 1;
}
else if( node->pkt->pkttype == PKT_SIGNATURE
&& check_pubkey_algo( node->pkt->pkt.signature->pubkey_algo)
@ -1121,6 +1123,15 @@ delete_inv_parts( const char *fname, KBNODE keyblock, u32 *keyid )
}
}
}
else if( node->pkt->pkttype == PKT_SIGNATURE &&
(node->pkt->pkt.signature->sig_class == 0x18 ||
node->pkt->pkt.signature->sig_class == 0x28) &&
!subkey_seen ) {
log_error( _("key %08lX: subkey signature "
"in wrong place - skipped\n"),
(ulong)keyid[1]);
delete_kbnode( node );
}
else if( (node->flag & 4) ) /* marked for deletion */
delete_kbnode( node );
}