aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tofu.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-09-27 07:42:13 +0000
committerWerner Koch <[email protected]>2017-09-27 07:42:13 +0000
commitecbbafb88d920e713439b6b1b8e1b41a6f8d0e38 (patch)
tree31bedb79a01bb220c3079e592b20ad4cb1211dd0 /g10/tofu.c
parentcommon: Add constant KEYGRIP_LEN. (diff)
downloadgnupg-ecbbafb88d920e713439b6b1b8e1b41a6f8d0e38.tar.gz
gnupg-ecbbafb88d920e713439b6b1b8e1b41a6f8d0e38.zip
gpg: Prepare for a longer fingerprint
* g10/card-util.c (change_cafpr): Use MAX_FINGERPRINT_LEN. * g10/cipher.c (write_header): Use snprintf. * g10/gpg.h (MAX_FINGERPRINT_LEN): Change to 32. (MAX_FORMATTED_FINGERPRINT_LEN): Change to 59 * g10/keyid.c (format_hexfingerprint): Add v5 fingerprint format. * g10/tofu.c (get_policy): Use MAX_FINGERPRINT_LEN for the buffer but keep the raw length for now. -- Note that this patch only increases the size of the buffer and adds a new formatting for v5 fingerprints. Moe work is required to fix internal data structures like those in trustdb.gpg and the tofu tables. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/tofu.c')
-rw-r--r--g10/tofu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/tofu.c b/g10/tofu.c
index c183fc665..ddd7f8cae 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2469,10 +2469,11 @@ get_policy (ctrl_t ctrl, tofu_dbs_t dbs, PKT_public_key *pk,
/* See if the key is signed by an ultimately trusted key. */
{
int fingerprint_raw_len = strlen (fingerprint) / 2;
- char fingerprint_raw[20];
+ char fingerprint_raw[MAX_FINGERPRINT_LEN];
int len = 0;
- if (fingerprint_raw_len != sizeof fingerprint_raw
+ /* FIXME(fingerprint) */
+ if (fingerprint_raw_len != 20 /*sizeof fingerprint_raw */
|| ((len = hex2bin (fingerprint,
fingerprint_raw, fingerprint_raw_len))
!= strlen (fingerprint)))