aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tofu.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tofu.c')
-rw-r--r--g10/tofu.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/g10/tofu.c b/g10/tofu.c
index 091d5b0d0..762b19b7a 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)))
@@ -3210,7 +3214,7 @@ show_statistics (tofu_dbs_t dbs,
*p = ' ';
}
- log_string (GPGRT_LOG_INFO, msg);
+ log_string (GPGRT_LOGLVL_INFO, msg);
xfree (msg);
if (policy == TOFU_POLICY_AUTO)
@@ -3275,7 +3279,7 @@ show_warning (const char *fingerprint, strlist_t user_id_list)
log_fatal ("format failed: %s\n",
gpg_strerror (gpg_error_from_syserror()));
xfree (tmpmsg);
- log_string (GPGRT_LOG_INFO, text);
+ log_string (GPGRT_LOGLVL_INFO, text);
xfree (text);
es_free (set_policy_command);