aboutsummaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-04-12 09:11:09 +0000
committerWerner Koch <[email protected]>2019-04-12 09:11:09 +0000
commit60f384592144de53c9a5f5e11d7f73ce863aa94f (patch)
treed35b772046b32ce70680e6e9bc903d9d886d0176 /g10/packet.h
parentgpg: Accept also armored data from the WKD. (diff)
downloadgnupg-60f384592144de53c9a5f5e11d7f73ce863aa94f.tar.gz
gnupg-60f384592144de53c9a5f5e11d7f73ce863aa94f.zip
gpg: Cache a once computed fingerprint in PKT_public_key.
* g10/packet.h (PKT_public_key): Add fields fpr and fprlen. * g10/keyid.c (do_fingerprint_md): Remove. (compute_fingerprint): New. (keyid_from_pk): Simplify. (fingerprint_from_pk): Simplify. (hexfingerprint): Avoid using extra array. -- This is similar to what we are doing with the keyid for a long time. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/packet.h')
-rw-r--r--g10/packet.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/g10/packet.h b/g10/packet.h
index 41dd1a95a..d05a8f0f2 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -394,6 +394,7 @@ typedef struct
byte pubkey_algo;
byte pubkey_usage; /* for now only used to pass it to getkey() */
byte req_usage; /* hack to pass a request to getkey() */
+ byte fprlen; /* 0 or length of FPR. */
u32 has_expired; /* set to the expiration date if expired */
/* keyid of the primary key. Never access this value directly.
Instead, use pk_main_keyid(). */
@@ -401,6 +402,8 @@ typedef struct
/* keyid of this key. Never access this value directly! Instead,
use pk_keyid(). */
u32 keyid[2];
+ /* Fingerprint of the key. Only valid if FPRLEN is not 0. */
+ byte fpr[MAX_FINGERPRINT_LEN];
prefitem_t *prefs; /* list of preferences (may be NULL) */
struct
{