mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
gpg: Copy the AEAD prefs to the user ID struct.
* g10/getkey.c (fixup_uidnode): Copy the AEAD prefs. -- With this patch AEAD preferences are now properly created and displayed. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
278d874656
commit
112e02ee89
14
g10/getkey.c
14
g10/getkey.c
@ -2443,8 +2443,8 @@ fixup_uidnode (KBNODE uidnode, KBNODE signode, u32 keycreated)
|
|||||||
{
|
{
|
||||||
PKT_user_id *uid = uidnode->pkt->pkt.user_id;
|
PKT_user_id *uid = uidnode->pkt->pkt.user_id;
|
||||||
PKT_signature *sig = signode->pkt->pkt.signature;
|
PKT_signature *sig = signode->pkt->pkt.signature;
|
||||||
const byte *p, *sym, *hash, *zip;
|
const byte *p, *sym, *aead, *hash, *zip;
|
||||||
size_t n, nsym, nhash, nzip;
|
size_t n, nsym, naead, nhash, nzip;
|
||||||
|
|
||||||
sig->flags.chosen_selfsig = 1;/* We chose this one. */
|
sig->flags.chosen_selfsig = 1;/* We chose this one. */
|
||||||
uid->created = 0; /* Not created == invalid. */
|
uid->created = 0; /* Not created == invalid. */
|
||||||
@ -2499,6 +2499,9 @@ fixup_uidnode (KBNODE uidnode, KBNODE signode, u32 keycreated)
|
|||||||
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_SYM, &n);
|
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_SYM, &n);
|
||||||
sym = p;
|
sym = p;
|
||||||
nsym = p ? n : 0;
|
nsym = p ? n : 0;
|
||||||
|
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_AEAD, &n);
|
||||||
|
aead = p;
|
||||||
|
naead = p ? n : 0;
|
||||||
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_HASH, &n);
|
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_HASH, &n);
|
||||||
hash = p;
|
hash = p;
|
||||||
nhash = p ? n : 0;
|
nhash = p ? n : 0;
|
||||||
@ -2507,7 +2510,7 @@ fixup_uidnode (KBNODE uidnode, KBNODE signode, u32 keycreated)
|
|||||||
nzip = p ? n : 0;
|
nzip = p ? n : 0;
|
||||||
if (uid->prefs)
|
if (uid->prefs)
|
||||||
xfree (uid->prefs);
|
xfree (uid->prefs);
|
||||||
n = nsym + nhash + nzip;
|
n = nsym + naead + nhash + nzip;
|
||||||
if (!n)
|
if (!n)
|
||||||
uid->prefs = NULL;
|
uid->prefs = NULL;
|
||||||
else
|
else
|
||||||
@ -2519,6 +2522,11 @@ fixup_uidnode (KBNODE uidnode, KBNODE signode, u32 keycreated)
|
|||||||
uid->prefs[n].type = PREFTYPE_SYM;
|
uid->prefs[n].type = PREFTYPE_SYM;
|
||||||
uid->prefs[n].value = *sym++;
|
uid->prefs[n].value = *sym++;
|
||||||
}
|
}
|
||||||
|
for (; naead; naead--, n++)
|
||||||
|
{
|
||||||
|
uid->prefs[n].type = PREFTYPE_AEAD;
|
||||||
|
uid->prefs[n].value = *aead++;
|
||||||
|
}
|
||||||
for (; nhash; nhash--, n++)
|
for (; nhash; nhash--, n++)
|
||||||
{
|
{
|
||||||
uid->prefs[n].type = PREFTYPE_HASH;
|
uid->prefs[n].type = PREFTYPE_HASH;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user