mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
* packet.h, keyedit.c (menu_clean_uids_from_key), trustdb.c
(clean_uids_from_key): Fix display bug where sigs cleaned for other reasons caused a uid to appear as if it had been compacted.
This commit is contained in:
parent
ce1ce8910e
commit
843d5719e7
@ -1,5 +1,9 @@
|
|||||||
2005-11-10 David Shaw <dshaw@jabberwocky.com>
|
2005-11-10 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* packet.h, keyedit.c (menu_clean_uids_from_key), trustdb.c
|
||||||
|
(clean_uids_from_key): Fix display bug where sigs cleaned for
|
||||||
|
other reasons caused a uid to appear as if it had been compacted.
|
||||||
|
|
||||||
* packet.h: Move some flags to a bitfield. Change all callers.
|
* packet.h: Move some flags to a bitfield. Change all callers.
|
||||||
|
|
||||||
* options.h, import.c (parse_import_options,
|
* options.h, import.c (parse_import_options,
|
||||||
|
@ -3225,30 +3225,26 @@ menu_clean_uids_from_key(KBNODE keyblock)
|
|||||||
|
|
||||||
if(modified)
|
if(modified)
|
||||||
{
|
{
|
||||||
KBNODE node,uidnode=NULL;
|
KBNODE node;
|
||||||
|
|
||||||
for(node=keyblock->next;node;node=node->next)
|
for(node=keyblock->next;node;node=node->next)
|
||||||
{
|
{
|
||||||
if(node->pkt->pkttype==PKT_USER_ID)
|
if(node->pkt->pkttype==PKT_USER_ID
|
||||||
uidnode=node;
|
&& node->pkt->pkt.user_id->flags.compacted)
|
||||||
else if(uidnode && node->pkt->pkttype==PKT_SIGNATURE
|
|
||||||
&& is_deleted_kbnode(node))
|
|
||||||
{
|
{
|
||||||
const char *reason;
|
const char *reason;
|
||||||
char *user=utf8_to_native(uidnode->pkt->pkt.user_id->name,
|
char *user=utf8_to_native(node->pkt->pkt.user_id->name,
|
||||||
uidnode->pkt->pkt.user_id->len,0);
|
node->pkt->pkt.user_id->len,0);
|
||||||
|
|
||||||
if(uidnode->pkt->pkt.user_id->is_revoked)
|
if(node->pkt->pkt.user_id->is_revoked)
|
||||||
reason=_("revoked");
|
reason=_("revoked");
|
||||||
else if(uidnode->pkt->pkt.user_id->is_expired)
|
else if(node->pkt->pkt.user_id->is_expired)
|
||||||
reason=_("expired");
|
reason=_("expired");
|
||||||
else
|
else
|
||||||
reason=_("invalid");
|
reason=_("invalid");
|
||||||
|
|
||||||
tty_printf("User ID \"%s\" compacted: %s\n",user,reason);
|
tty_printf("User ID \"%s\" compacted: %s\n",user,reason);
|
||||||
|
|
||||||
uidnode=NULL;
|
|
||||||
|
|
||||||
xfree(user);
|
xfree(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,7 @@ typedef struct
|
|||||||
/* TODO: Move more flags here */
|
/* TODO: Move more flags here */
|
||||||
unsigned mdc:1;
|
unsigned mdc:1;
|
||||||
unsigned ks_modify:1;
|
unsigned ks_modify:1;
|
||||||
|
unsigned compacted:1;
|
||||||
} flags;
|
} flags;
|
||||||
char name[1];
|
char name[1];
|
||||||
} PKT_user_id;
|
} PKT_user_id;
|
||||||
|
@ -1667,8 +1667,9 @@ int
|
|||||||
clean_uids_from_key(KBNODE keyblock,int noisy)
|
clean_uids_from_key(KBNODE keyblock,int noisy)
|
||||||
{
|
{
|
||||||
int delete_until_next=0,deleting=0,deleted=0;
|
int delete_until_next=0,deleting=0,deleted=0;
|
||||||
KBNODE node,signode=NULL;
|
KBNODE node;
|
||||||
u32 keyid[2],sigdate=0;
|
u32 keyid[2],sigdate=0;
|
||||||
|
PKT_user_id *uid=NULL;
|
||||||
|
|
||||||
assert(keyblock->pkt->pkttype==PKT_PUBLIC_KEY);
|
assert(keyblock->pkt->pkttype==PKT_PUBLIC_KEY);
|
||||||
|
|
||||||
@ -1682,10 +1683,8 @@ clean_uids_from_key(KBNODE keyblock,int noisy)
|
|||||||
{
|
{
|
||||||
if(node->pkt->pkttype==PKT_USER_ID)
|
if(node->pkt->pkttype==PKT_USER_ID)
|
||||||
{
|
{
|
||||||
PKT_user_id *uid=node->pkt->pkt.user_id;
|
uid=node->pkt->pkt.user_id;
|
||||||
|
|
||||||
sigdate=0;
|
sigdate=0;
|
||||||
signode=NULL;
|
|
||||||
|
|
||||||
/* Skip valid user IDs, and non-self-signed user IDs if
|
/* Skip valid user IDs, and non-self-signed user IDs if
|
||||||
--allow-non-selfsigned-uid is set. */
|
--allow-non-selfsigned-uid is set. */
|
||||||
@ -1718,7 +1717,7 @@ clean_uids_from_key(KBNODE keyblock,int noisy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(node->pkt->pkttype==PKT_SIGNATURE)
|
else if(node->pkt->pkttype==PKT_SIGNATURE && uid)
|
||||||
{
|
{
|
||||||
PKT_signature *sig=node->pkt->pkt.signature;
|
PKT_signature *sig=node->pkt->pkt.signature;
|
||||||
|
|
||||||
@ -1727,13 +1726,11 @@ clean_uids_from_key(KBNODE keyblock,int noisy)
|
|||||||
if(IS_UID_SIG(sig) && sig->timestamp>sigdate
|
if(IS_UID_SIG(sig) && sig->timestamp>sigdate
|
||||||
&& keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1]
|
&& keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1]
|
||||||
&& check_key_signature(keyblock,node,NULL)==0)
|
&& check_key_signature(keyblock,node,NULL)==0)
|
||||||
{
|
sigdate=sig->timestamp;
|
||||||
sigdate=sig->timestamp;
|
|
||||||
signode=node;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(delete_until_next && !sig->flags.chosen_selfsig)
|
if(delete_until_next && !sig->flags.chosen_selfsig)
|
||||||
{
|
{
|
||||||
|
uid->flags.compacted=1;
|
||||||
delete_kbnode(node);
|
delete_kbnode(node);
|
||||||
if(deleting)
|
if(deleting)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user