If set, the PGP <em/+encrypttoself/ flag is used when encrypting messages.
+<sect2>pgp_entry_format<label id="pgp_entry_format">
+<p>
+Type: format string<newline>
+Default: &dquot;%4n %t%f %4l/0x%k %-4a %2c %u&dquot;
+
+This variable allows you to customize the PGP key selection menu to
+your personal taste. This string is similar to <ref id="index_format"
+name="$index_format">, but has its own set of
+printf()-like sequences:
+
+<tscreen><verb>
+%n number
+%k key id
+%u user id
+%a algorithm
+%l key length
+%f flags
+%c capabilities
+%t trust/validity of the key-uid association
+%[<s>] date of the key where <s> is an strftime(3) expression
+</verb></tscreen>
+
+
<sect2>pgp_gpg<label id="pgp_gpg">
<p>
Type: string<newline>
}
case 6: /* timestamp (1998-02-28) */
+ {
+ char tstr[11];
+ struct tm time;
+ if (!p)
+ break;
+ time.tm_sec = 0;
+ time.tm_min = 0;
+ time.tm_hour = 12;
+ strncpy (tstr, p, 11);
+ tstr[4] = '\0';
+ time.tm_year = atoi (tstr)-1900;
+ tstr[7] = '\0';
+ time.tm_mon = (atoi (tstr+5))-1;
+ time.tm_mday = atoi (tstr+8);
+ k->gen_time = mutt_mktime (&time, 0);
break;
+ }
case 7: /* valid for n days */
break;
case 8: /* Local id */
struct pgp_uid *address;
int flags;
short keylen;
- unsigned long gen_time;
+ time_t gen_time;
const char *algorithm;
struct pgp_keyinfo *parent;
struct pgp_keyinfo *next;
*
* %n number
* %k key id %K key id of the principal key
- * %u uiser id
+ * %u user id
* %a algorithm %A algorithm of the princ. key
* %l length %L length of the princ. key
* %f flags %F flags of the princ. key
* %c capabilities %C capabilities of the princ. key
* %t trust/validity of the key-uid association
+ * %[...] date of key using strftime(3)
*/
typedef struct pgp_entry
switch (tolower (op))
{
+ case '[':
+
+ {
+ const char *cp;
+ char buf2[SHORT_STRING], *p;
+ int do_locales;
+ struct tm *tm;
+ size_t len;
+
+ p = dest;
+
+ cp = src;
+ if (*cp == '!')
+ {
+ do_locales = 0;
+ cp++;
+ }
+ else
+ do_locales = 1;
+
+ len = destlen - 1;
+ while (len > 0 && *cp != ']')
+ {
+ if (*cp == '%')
+ {
+ cp++;
+ if (len >= 2)
+ {
+ *p++ = '%';
+ *p++ = *cp;
+ len -= 2;
+ }
+ else
+ break; /* not enough space */
+ cp++;
+ }
+ else
+ {
+ *p++ = *cp++;
+ len--;
+ }
+ }
+ *p = 0;
+
+ if (do_locales && Locale)
+ setlocale (LC_TIME, Locale);
+
+ tm = localtime (&key->gen_time);
+
+ strftime (buf2, sizeof (buf2), dest, tm);
+
+ if (do_locales)
+ setlocale (LC_TIME, "C");
+
+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
+ snprintf (dest, destlen, fmt, buf2);
+ if (len > 0)
+ src = cp + 1;
+ }
+ break;
case 'n':
if (!optional)
{
unsigned char alg;
size_t expl;
unsigned long id;
- unsigned long gen_time = 0;
+ time_t gen_time = 0;
unsigned short exp_days = 0;
size_t j;
int i, k;
for (i = 0, j = 2; i < 4; i++)
gen_time = (gen_time << 8) + buff[j++];
+ p->gen_time = gen_time;
+
for (i = 0; i < 2; i++)
exp_days = (exp_days << 8) + buff[j++];
unsigned char alg;
unsigned char digest[SHA_DIGEST_LENGTH];
unsigned char scratch[LONG_STRING];
- unsigned long gen_time = 0;
+ time_t gen_time = 0;
unsigned long id;
int i, k;
short len;
static int pgp_parse_pgp2_sig (unsigned char *buff, size_t l, pgp_key_t * p)
{
unsigned char sigtype;
- long sig_gen_time;
+ time_t sig_gen_time;
unsigned long signerid;
size_t j;
int i;
unsigned char pkalg;
unsigned char hashalg;
unsigned char skt;
- long sig_gen_time = -1;
+ time_t sig_gen_time = -1;
long validity = -1;
long key_validity = -1;
long signerid = 0;