summaryrefslogtreecommitdiffstats
path: root/g10/keydb.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-08-07 05:46:09 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2020-08-07 06:02:47 +0200
commit373c975859a55f942276d6078f27ee33570bf2d5 (patch)
treec0f94f54047f2f3ae55ed89c010b3ea35f320246 /g10/keydb.h
parentgpg: Fix short key ID for v5key. (diff)
downloadgnupg2-373c975859a55f942276d6078f27ee33570bf2d5.tar.xz
gnupg2-373c975859a55f942276d6078f27ee33570bf2d5.zip
gpg: Fix trustdb for v5key.
* g10/keydb.h (fpr20_from_pk): New. * g10/keyid.c (fpr20_from_pk): New. * g10/tdbio.c (tdbio_search_trust_byfpr): Use fpr20_from_pk. * g10/trustdb.c (keyid_from_fpr20): New. (verify_own_keys): Use keyid_from_fpr20. (tdb_update_ownertrust): Use fpr20_from_pk. (update_min_ownertrust): Likewise. (update_validity): Likewise. -- For the compatibility of existing implementation, we keep the format of trustdb untouched. The format of trustdb uses 20-byte fingerprint for the trust record entry. To handle both of v4key (with 20-byte fingerprint) and v5 key (with 32-byte fingerprint), we introduce FPR20 fingerprint, internally. For v4key, FPR20 is as same as v4 fingerprint. For v5key, FPR20 is constructed from v5key fingerprint. GnuPG-bug-id: 5000 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/keydb.h')
-rw-r--r--g10/keydb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/keydb.h b/g10/keydb.h
index a6c70d682..5ef837be8 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -553,6 +553,7 @@ const char *colon_datestr_from_pk (PKT_public_key *pk);
const char *colon_datestr_from_sig (PKT_signature *sig);
const char *colon_expirestr_from_sig (PKT_signature *sig);
byte *fingerprint_from_pk( PKT_public_key *pk, byte *buf, size_t *ret_len );
+void fpr20_from_pk (PKT_public_key *pk, byte array[20]);
char *hexfingerprint (PKT_public_key *pk, char *buffer, size_t buflen);
char *format_hexfingerprint (const char *fingerprint,
char *buffer, size_t buflen);