diff options
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r-- | g10/trustdb.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c index ae0a6cc1c..47c418688 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -1575,13 +1575,16 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode, } int -clean_sigs_from_uid(KBNODE keyblock,KBNODE uidnode,int noisy) +clean_sigs_from_uid(KBNODE keyblock,KBNODE uidnode,int noisy,int self_only) { int deleted=0; KBNODE node; + u32 keyid[2]; assert(keyblock->pkt->pkttype==PKT_PUBLIC_KEY); + keyid_from_pk(keyblock->pkt->pkt.public_key,keyid); + /* Passing in a 0 for current time here means that we'll never weed out an expired sig. This is correct behavior since we want to keep the most recent expired sig in a series. */ @@ -1607,12 +1610,15 @@ clean_sigs_from_uid(KBNODE keyblock,KBNODE uidnode,int noisy) node && node->pkt->pkttype==PKT_SIGNATURE; node=node->next) { + int keep=self_only?(node->pkt->pkt.signature->keyid[0]==keyid[0] + && node->pkt->pkt.signature->keyid[1]==keyid[1]):1; + /* Keep usable uid sigs ... */ - if(node->flag & (1<<8)) + if((node->flag & (1<<8)) && keep) continue; /* ... and usable revocations... */ - if(node->flag & (1<<11)) + if((node->flag & (1<<11)) && keep) continue; /* ... and sigs from unavailable keys. */ |