aboutsummaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-04-06 11:27:26 +0000
committerWerner Koch <[email protected]>2015-04-06 11:27:26 +0000
commit2f099eb62ac6491675bbcccaca4e076b2d8e7ea0 (patch)
treef7f1d19d81177ca4b29147680e43545cd5c889b7 /g10/getkey.c
parentgpg: Rename a debug macro. (diff)
downloadgnupg-2f099eb62ac6491675bbcccaca4e076b2d8e7ea0.tar.gz
gnupg-2f099eb62ac6491675bbcccaca4e076b2d8e7ea0.zip
Fix use of DBG_CACHE and DBG_LOOKUP
* dirmngr/dirmngr.h (DBG_LOOKUP_VALUE): Change to 8192. * g10/options.h (DBG_LOOKUP_VALUE, DBG_LOOKUP): New. * g10/getkey.c: Use DBG_LOOKUP instead of DBG_CACHE at most places.
Diffstat (limited to '')
-rw-r--r--g10/getkey.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index d54bd57ee..998f111ac 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2373,7 +2373,7 @@ finish_lookup (GETKEY_CTX ctx)
}
}
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x)\n",
(ulong) keyid_from_pk (keyblock->pkt->pkt.public_key, NULL),
foundk ? "one" : "all", req_usage);
@@ -2400,43 +2400,43 @@ finish_lookup (GETKEY_CTX ctx)
if (foundk)
nextk = NULL; /* what a hack */
pk = k->pkt->pkt.public_key;
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tchecking subkey %08lX\n",
(ulong) keyid_from_pk (pk, NULL));
if (!pk->flags.valid)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tsubkey not valid\n");
continue;
}
if (pk->flags.revoked)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tsubkey has been revoked\n");
continue;
}
if (pk->has_expired)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tsubkey has expired\n");
continue;
}
if (pk->timestamp > curtime && !opt.ignore_valid_from)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tsubkey not yet valid\n");
continue;
}
if (!((pk->pubkey_usage & USAGE_MASK) & req_usage))
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tusage does not match: want=%x have=%x\n",
req_usage, pk->pubkey_usage);
continue;
}
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tsubkey might be fine\n");
/* In case a key has a timestamp of 0 set, we make sure
that it is used. A better change would be to compare
@@ -2455,33 +2455,33 @@ finish_lookup (GETKEY_CTX ctx)
if ((!latest_key && !(ctx->exact && foundk != keyblock)) || req_prim)
{
PKT_public_key *pk;
- if (DBG_CACHE && !foundk && !req_prim)
+ if (DBG_LOOKUP && !foundk && !req_prim)
log_debug ("\tno suitable subkeys found - trying primary\n");
pk = keyblock->pkt->pkt.public_key;
if (!pk->flags.valid)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tprimary key not valid\n");
}
else if (pk->flags.revoked)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tprimary key has been revoked\n");
}
else if (pk->has_expired)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tprimary key has expired\n");
}
else if (!((pk->pubkey_usage & USAGE_MASK) & req_usage))
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tprimary key usage does not match: "
"want=%x have=%x\n", req_usage, pk->pubkey_usage);
}
else /* Okay. */
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tprimary key may be used\n");
latest_key = keyblock;
latest_date = pk->timestamp;
@@ -2490,13 +2490,13 @@ finish_lookup (GETKEY_CTX ctx)
if (!latest_key)
{
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tno suitable key found - giving up\n");
return 0; /* Not found. */
}
found:
- if (DBG_CACHE)
+ if (DBG_LOOKUP)
log_debug ("\tusing key %08lX\n",
(ulong) keyid_from_pk (latest_key->pkt->pkt.public_key, NULL));