summaryrefslogtreecommitdiffstats
path: root/pgppubring.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-02-09 23:04:28 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-02-09 23:04:28 +0000
commitef27d6dd7737e9bcd4f131c4c8853f4fb9a4cd01 (patch)
tree062ade84e3dda7bdc60d54dbbb2e1e94f7d230bc /pgppubring.c
parentcb5d7ef45ca9df14c24a0002baea9183c93a2451 (diff)
browser.h: re-insert the "tagged" component.
pgp support: fix handling of PGP 5 subkeys, algorithm 20.
Diffstat (limited to 'pgppubring.c')
-rw-r--r--pgppubring.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/pgppubring.c b/pgppubring.c
index ff878e1b..39cd6358 100644
--- a/pgppubring.c
+++ b/pgppubring.c
@@ -183,7 +183,6 @@ short pgp_cansign (unsigned char type)
{
case 1:
case 3:
- case 16:
case 17:
case 20:
return 1;
@@ -408,6 +407,23 @@ void pgp_free_uid (pgp_uid_t ** upp)
*upp = NULL;
}
+pgp_uid_t *pgp_copy_uids (pgp_uid_t *up, pgp_key_t *parent)
+{
+ pgp_uid_t *l = NULL;
+ pgp_uid_t **lp = &l;
+
+ for (; up; up = up->next)
+ {
+ *lp = safe_calloc (1, sizeof (pgp_uid_t));
+ (*lp)->trust = up->trust;
+ (*lp)->addr = safe_strdup (up->addr);
+ (*lp)->parent = parent;
+ lp = &(*lp)->next;
+ }
+
+ return l;
+}
+
static void _pgp_free_key (pgp_key_t ** kpp)
{
pgp_key_t *kp;
@@ -895,7 +911,11 @@ static pgp_key_t *pgp_parse_keyblock (FILE * fp)
{
p->flags |= KEYFLAG_SUBKEY;
if (p != root)
- p->parent = root;
+ {
+ p->parent = root;
+ p->address = pgp_copy_uids (root->address, p);
+ while (*addr) addr = &(*addr)->next;
+ }
}
break;
}
@@ -906,7 +926,7 @@ static pgp_key_t *pgp_parse_keyblock (FILE * fp)
pgp_parse_sig (buff, l, p);
break;
}
-
+
case PT_TRUST:
{
dprint (5, (debugfile, "PT_TRUST: "));
@@ -943,7 +963,7 @@ static pgp_key_t *pgp_parse_keyblock (FILE * fp)
dprint (5, (debugfile, "\"%s\"\n", chr));
mutt_decode_utf8_string (chr, chs);
- *addr = uid = safe_calloc (sizeof (pgp_uid_t), 1); /* XXX */
+ *addr = uid = safe_calloc (1, sizeof (pgp_uid_t)); /* XXX */
uid->addr = chr;
uid->parent = p;
uid->trust = 0;