mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
* packet.h, getkey.c (fixup_uidnode, merge_selfsigs_subkey): Keep track of
which self-sig we actually chose. * keyedit.c (menu_expire, menu_set_primary_uid, menu_set_preferences): Use it here to avoid updating non-used self-sigs and possibly promoting an old self-sig into consideration again.
This commit is contained in:
parent
8e5f3ce846
commit
2980b7129f
@ -1,3 +1,13 @@
|
||||
2004-03-22 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* packet.h, getkey.c (fixup_uidnode, merge_selfsigs_subkey): Keep
|
||||
track of which self-sig we actually chose.
|
||||
|
||||
* keyedit.c (menu_expire, menu_set_primary_uid,
|
||||
menu_set_preferences): Use it here to avoid updating non-used
|
||||
self-sigs and possibly promoting an old self-sig into
|
||||
consideration again.
|
||||
|
||||
2004-03-18 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keygen.c (write_keybinding, do_generate_keypair,
|
||||
|
@ -1266,6 +1266,7 @@ fixup_uidnode ( KBNODE uidnode, KBNODE signode, u32 keycreated )
|
||||
const byte *p, *sym, *hash, *zip;
|
||||
size_t n, nsym, nhash, nzip;
|
||||
|
||||
sig->flags.chosen_selfsig = 1; /* we chose this one */
|
||||
uid->created = 0; /* not created == invalid */
|
||||
if ( IS_UID_REV ( sig ) ) {
|
||||
uid->is_revoked = 1;
|
||||
@ -1887,6 +1888,7 @@ merge_selfsigs_subkey( KBNODE keyblock, KBNODE subnode )
|
||||
|
||||
subpk->is_valid = 1;
|
||||
sig = signode->pkt->pkt.signature;
|
||||
sig->flags.chosen_selfsig=1; /* so we know which selfsig we chose later */
|
||||
|
||||
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_FLAGS, &n );
|
||||
if ( p && n ) {
|
||||
|
@ -2637,7 +2637,9 @@ menu_expire( KBNODE pub_keyblock, KBNODE sec_keyblock )
|
||||
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1]
|
||||
&& ( (mainkey && uid
|
||||
&& uid->created && (sig->sig_class&~3) == 0x10)
|
||||
|| (!mainkey && sig->sig_class == 0x18) ) ) {
|
||||
|| (!mainkey && sig->sig_class == 0x18) )
|
||||
&& sig->flags.chosen_selfsig )
|
||||
{
|
||||
/* this is a selfsignature which is to be replaced */
|
||||
PKT_signature *newsig;
|
||||
PACKET *newpkt;
|
||||
@ -2777,8 +2779,10 @@ menu_set_primary_uid ( KBNODE pub_keyblock, KBNODE sec_keyblock )
|
||||
else if ( main_pk && uid && node->pkt->pkttype == PKT_SIGNATURE ) {
|
||||
PKT_signature *sig = node->pkt->pkt.signature;
|
||||
if ( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1]
|
||||
&& (uid && (sig->sig_class&~3) == 0x10)
|
||||
&& attribute == (uid->attrib_data!=NULL)) {
|
||||
&& (uid && (sig->sig_class&~3) == 0x10)
|
||||
&& attribute == (uid->attrib_data!=NULL)
|
||||
&& sig->flags.chosen_selfsig )
|
||||
{
|
||||
if(sig->version < 4) {
|
||||
char *user=utf8_to_native(uid->name,strlen(uid->name),0);
|
||||
|
||||
@ -2887,7 +2891,8 @@ menu_set_preferences (KBNODE pub_keyblock, KBNODE sec_keyblock )
|
||||
&& node->pkt->pkttype == PKT_SIGNATURE ) {
|
||||
PKT_signature *sig = node->pkt->pkt.signature;
|
||||
if ( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1]
|
||||
&& (uid && (sig->sig_class&~3) == 0x10) ) {
|
||||
&& (uid && (sig->sig_class&~3) == 0x10)
|
||||
&& sig->flags.chosen_selfsig ) {
|
||||
if( sig->version < 4 ) {
|
||||
char *user=utf8_to_native(uid->name,strlen(uid->name),0);
|
||||
|
||||
|
@ -125,6 +125,7 @@ typedef struct {
|
||||
struct {
|
||||
unsigned checked:1; /* signature has been checked */
|
||||
unsigned valid:1; /* signature is good (if checked is set) */
|
||||
unsigned chosen_selfsig:1; /* a selfsig that is the chosen one */
|
||||
unsigned unknown_critical:1;
|
||||
unsigned exportable:1;
|
||||
unsigned revocable:1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user