pgp support: fix handling of PGP 5 subkeys, algorithm 20.
#ifdef USE_IMAP
short notfolder;
#endif
+ unsigned tagged : 1;
};
struct browser_state
k = NULL;
while (fgets (buf, sizeof (buf) - 1, fp))
{
- kk = parse_pub_line (buf, &is_sub, k);
- if (!kk)
+ if (!(kk = parse_pub_line (buf, &is_sub, k)))
continue;
/* Only append kk to the list if it's new. */
if (k)
kend = &k->next;
*kend = k = kk;
-
+
if (is_sub)
{
- k->flags |= KEYFLAG_SUBKEY;
- k->parent = mainkey;
+ pgp_uid_t **l;
+
+ k->flags |= KEYFLAG_SUBKEY;
+ k->parent = mainkey;
+ for (l = &k->address; *l; l = &(*l)->next)
+ ;
+ *l = pgp_copy_uids (mainkey->address, k);
}
else
mainkey = k;
}
}
+
if (ferror (fp))
mutt_perror ("fgets");
const char Copyright[] = N_("\
Copyright (C) 1996-9 Michael R. Elkins <me@cs.hmc.edu>\n\
+Copyright (C) 1996-9 Brandon Long <blong@fiction.net>\n\
Copyright (C) 1997-9 Thomas Roessler <roessler@guug.de>\n\
Copyright (C) 1998-9 Werner Koch <wk@isil.d.shuttle.de>\n\
\n\
struct utsname uts;
printf ("Mutt %s (%s)\n", MUTT_VERSION, ReleaseDate);
- puts (_(Notice));
+ puts (Notice);
uname (&uts);
#define PGPSIGN 2
#define PGPKEY 4
-#define KEYFLAG_CANSIGN (1 << 0)
-#define KEYFLAG_CANENCRYPT (1 << 1)
-#define KEYFLAG_EXPIRED (1 << 8)
-#define KEYFLAG_REVOKED (1 << 9)
-#define KEYFLAG_DISABLED (1 << 10)
-#define KEYFLAG_SUBKEY (1 << 11)
-#define KEYFLAG_CRITICAL (1 << 12)
-#define KEYFLAG_PREFER_ENCRYPTION (1 << 13)
-#define KEYFLAG_PREFER_SIGNING (1 << 14)
+#define KEYFLAG_CANSIGN (1 << 0)
+#define KEYFLAG_CANENCRYPT (1 << 1)
+#define KEYFLAG_EXPIRED (1 << 8)
+#define KEYFLAG_REVOKED (1 << 9)
+#define KEYFLAG_DISABLED (1 << 10)
+#define KEYFLAG_SUBKEY (1 << 11)
+#define KEYFLAG_CRITICAL (1 << 12)
+#define KEYFLAG_PREFER_ENCRYPTION (1 << 13)
+#define KEYFLAG_PREFER_SIGNING (1 << 14)
#define KEYFLAG_CANTUSE (KEYFLAG_DISABLED|KEYFLAG_REVOKED|KEYFLAG_EXPIRED)
#define KEYFLAG_RESTRICTIONS (KEYFLAG_CANTUSE|KEYFLAG_CRITICAL)
{
char *keyid;
struct pgp_uid *address;
- short flags;
+ int flags;
short keylen;
unsigned long gen_time;
const char *algorithm;
pgp_key_t *pgp_getkeybystr (struct pgp_vinfo *pgp, char *, short, pgp_ring_t);
pgp_key_t *pgp_remove_key (pgp_key_t **, pgp_key_t *);
+pgp_uid_t *pgp_copy_uids (pgp_uid_t *, pgp_key_t *);
+
short pgp_canencrypt (unsigned char);
short pgp_cansign (unsigned char);
short pgp_get_abilities (unsigned char);
* Copyright (C) 1996,1997 Michael R. Elkins <me@cs.hmc.edu>
* Copyright (c) 1998,1999 Thomas Roessler <roessler@guug.de>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later
+ * version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
+ * 02139, USA.
*/
#include "mutt.h"
{
case 1:
case 3:
- case 16:
case 17:
case 20:
return 1;
*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;
{
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;
}
pgp_parse_sig (buff, l, p);
break;
}
-
+
case PT_TRUST:
{
dprint (5, (debugfile, "PT_TRUST: "));
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;