mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
* packet.h: Move some flags to a bitfield. Change all callers.
This commit is contained in:
parent
477ded81a4
commit
ce1ce8910e
@ -1,5 +1,7 @@
|
||||
2005-11-10 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* packet.h: Move some flags to a bitfield. Change all callers.
|
||||
|
||||
* options.h, import.c (parse_import_options,
|
||||
clean_sigs_from_all_uids, import_one): Add import-minimal option.
|
||||
Similar to export-minimal, except it works on the way in.
|
||||
|
10
g10/getkey.c
10
g10/getkey.c
@ -1464,16 +1464,16 @@ fixup_uidnode ( KBNODE uidnode, KBNODE signode, u32 keycreated )
|
||||
}
|
||||
|
||||
/* see whether we have the MDC feature */
|
||||
uid->mdc_feature = 0;
|
||||
uid->flags.mdc = 0;
|
||||
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_FEATURES, &n);
|
||||
if (p && n && (p[0] & 0x01))
|
||||
uid->mdc_feature = 1;
|
||||
uid->flags.mdc = 1;
|
||||
|
||||
/* and the keyserver modify flag */
|
||||
uid->ks_modify = 1;
|
||||
uid->flags.ks_modify = 1;
|
||||
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KS_FLAGS, &n);
|
||||
if (p && n && (p[0] & 0x80))
|
||||
uid->ks_modify = 0;
|
||||
uid->flags.ks_modify = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2170,7 +2170,7 @@ merge_selfsigs( KBNODE keyblock )
|
||||
&& !k->pkt->pkt.user_id->attrib_data
|
||||
&& k->pkt->pkt.user_id->is_primary) {
|
||||
prefs = k->pkt->pkt.user_id->prefs;
|
||||
mdc_feature = k->pkt->pkt.user_id->mdc_feature;
|
||||
mdc_feature = k->pkt->pkt.user_id->flags.mdc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2350,17 +2350,17 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
|
||||
}
|
||||
tty_printf ("%s",compress_algo_to_string(COMPRESS_ALGO_NONE));
|
||||
}
|
||||
if(uid->mdc_feature || !uid->ks_modify)
|
||||
if(uid->flags.mdc || !uid->flags.ks_modify)
|
||||
{
|
||||
tty_printf ("\n ");
|
||||
tty_printf (_("Features: "));
|
||||
any=0;
|
||||
if(uid->mdc_feature)
|
||||
if(uid->flags.mdc)
|
||||
{
|
||||
tty_printf ("MDC");
|
||||
any=1;
|
||||
}
|
||||
if(!uid->ks_modify)
|
||||
if(!uid->flags.ks_modify)
|
||||
{
|
||||
if(any)
|
||||
tty_printf (", ");
|
||||
@ -2393,9 +2393,9 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
|
||||
prefs[i].type == PREFTYPE_ZIP ? 'Z':'?',
|
||||
prefs[i].value);
|
||||
}
|
||||
if (uid->mdc_feature)
|
||||
if (uid->flags.mdc)
|
||||
tty_printf (" [mdc]");
|
||||
if (!uid->ks_modify)
|
||||
if (!uid->flags.ks_modify)
|
||||
tty_printf (" [no-ks-modify]");
|
||||
tty_printf("\n");
|
||||
}
|
||||
@ -2534,9 +2534,9 @@ show_key_with_all_names_colon (KBNODE keyblock)
|
||||
prefs[j].type == PREFTYPE_ZIP ? 'Z':'?',
|
||||
prefs[j].value);
|
||||
}
|
||||
if (uid->mdc_feature)
|
||||
if (uid->flags.mdc)
|
||||
printf (",mdc");
|
||||
if (!uid->ks_modify)
|
||||
if (!uid->flags.ks_modify)
|
||||
printf (",no-ks-modify");
|
||||
}
|
||||
putchar (':');
|
||||
|
@ -530,8 +530,8 @@ PKT_user_id *keygen_get_std_prefs(void)
|
||||
uid->prefs[j].type=PREFTYPE_NONE;
|
||||
uid->prefs[j].value=0;
|
||||
|
||||
uid->mdc_feature=mdc_available;
|
||||
uid->ks_modify=ks_modify;
|
||||
uid->flags.mdc=mdc_available;
|
||||
uid->flags.ks_modify=ks_modify;
|
||||
|
||||
return uid;
|
||||
}
|
||||
|
11
g10/packet.h
11
g10/packet.h
@ -183,7 +183,8 @@ struct user_attribute {
|
||||
u32 len;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
int ref; /* reference counter */
|
||||
int len; /* length of the name */
|
||||
struct user_attribute *attribs;
|
||||
@ -200,10 +201,14 @@ typedef struct {
|
||||
int is_expired;
|
||||
u32 expiredate; /* expires at this date or 0 if not at all */
|
||||
prefitem_t *prefs; /* list of preferences (may be NULL)*/
|
||||
int mdc_feature;
|
||||
int ks_modify;
|
||||
u32 created; /* according to the self-signature */
|
||||
byte selfsigversion;
|
||||
struct
|
||||
{
|
||||
/* TODO: Move more flags here */
|
||||
unsigned mdc:1;
|
||||
unsigned ks_modify:1;
|
||||
} flags;
|
||||
char name[1];
|
||||
} PKT_user_id;
|
||||
|
||||
|
@ -1421,7 +1421,7 @@ select_mdc_from_pklist (PK_LIST pk_list)
|
||||
int mdc;
|
||||
|
||||
if (pkr->pk->user_id) /* selected by user ID */
|
||||
mdc = pkr->pk->user_id->mdc_feature;
|
||||
mdc = pkr->pk->user_id->flags.mdc;
|
||||
else
|
||||
mdc = pkr->pk->mdc_feature;
|
||||
if (!mdc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user