aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tofu.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tofu.c')
-rw-r--r--g10/tofu.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/g10/tofu.c b/g10/tofu.c
index c183fc665..e63e98932 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2083,13 +2083,16 @@ build_conflict_set (ctrl_t ctrl, tofu_dbs_t dbs,
* policy to ask due to a conflict. */
for (iter = conflict_set; iter; iter = iter->next)
{
+ /* Fixme: Why the check against N+1? */
int l = strlen (iter->d);
- if (!(l == 2 * MAX_FINGERPRINT_LEN
- || l == 2 * MAX_FINGERPRINT_LEN + 1))
+ if (!(l == 2 * 20
+ || l == 2 * 20 + 1
+ || l == 2 * 32
+ || l == 2 * 32 + 1))
{
log_error (_("TOFU db corruption detected.\n"));
- print_further_info ("fingerprint '%s' is not %d characters long",
- iter->d, 2 * MAX_FINGERPRINT_LEN);
+ print_further_info ("fingerprint '%s' is %d characters long",
+ iter->d, l);
}
if (l >= 1 && iter->d[l - 1] == '!')
@@ -2469,10 +2472,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)))