set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
# read in the public key ring
-set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --list-keys %r"
+set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r"
# read in the secret key ring
-set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --list-secret-keys %r"
+set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r"
# fetch keys
# set pgp_getkeys_command="pkspxycwrap %r"
pgp_uid_t *uid = NULL;
int field = 0, is_uid = 0;
int is_pub = 0;
+ int is_fpr = 0;
char *pend, *p;
int trust = 0;
int flags = 0;
if (!*p && (field != 1) && (field != 10))
continue;
+ if (is_fpr && (field != 10))
+ continue;
+
switch (field)
{
case 1: /* record type */
*is_subkey = 1;
else if (!mutt_strcmp (p, "uid"))
is_uid = 1;
+ else if (!mutt_strcmp (p, "fpr"))
+ is_fpr = 1;
else
return NULL;
- if (!(is_uid || (*is_subkey && option (OPTPGPIGNORESUB))))
+ if (!(is_uid || is_fpr || (*is_subkey && option (OPTPGPIGNORESUB))))
memset (&tmp, 0, sizeof (tmp));
break;
if (!(pend && (*p || is_pub)))
break;
+ if (is_fpr)
+ {
+ /* don't let a subkey fpr overwrite an existing primary key fpr */
+ if (!tmp.fingerprint)
+ tmp.fingerprint = safe_strdup (p);
+ break;
+ }
+
/* ignore user IDs on subkeys */
if (!is_uid && (*is_subkey && option (OPTPGPIGNORESUB)))
break;
}
/* merge temp key back into real key */
- if (!(is_uid || (*is_subkey && option (OPTPGPIGNORESUB))))
+ if (!(is_uid || is_fpr || (*is_subkey && option (OPTPGPIGNORESUB))))
k = safe_malloc (sizeof (*k));
memcpy (k, &tmp, sizeof (*k));
/* fixup parentship of uids after mering the temp key into