summaryrefslogtreecommitdiffstats
path: root/g10/pkclist.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2016-11-23 12:29:22 +0100
committerNeal H. Walfield <neal@g10code.com>2016-11-23 12:29:22 +0100
commit03a65a53231cc3132a50a1871e81a512c44da169 (patch)
tree5df81cf4f7fbeaeb24801c5acebd6ce3160e2adf /g10/pkclist.c
parentg10: Use es_fopen instead of open. (diff)
downloadgnupg2-03a65a53231cc3132a50a1871e81a512c44da169.tar.xz
gnupg2-03a65a53231cc3132a50a1871e81a512c44da169.zip
g10: Avoid gratuitously loading a keyblock when it is already available
* g10/trust.c (get_validity): Add new, optional parameter KB. Only load the keyblock if KB is NULL. Update callers. (get_validity): Likewise. * g10/trustdb.c (tdb_get_validity_core): Likewise. -- Signed-off-by: Neal H. Walfield <neal@g10code.com> GnuPG-bug-id: 2812
Diffstat (limited to 'g10/pkclist.c')
-rw-r--r--g10/pkclist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/pkclist.c b/g10/pkclist.c
index 51e8f274c..0426da890 100644
--- a/g10/pkclist.c
+++ b/g10/pkclist.c
@@ -569,7 +569,7 @@ check_signatures_trust (ctrl_t ctrl, PKT_signature *sig)
log_info(_("WARNING: this key might be revoked (revocation key"
" not present)\n"));
- trustlevel = get_validity (ctrl, pk, NULL, sig, 1);
+ trustlevel = get_validity (ctrl, NULL, pk, NULL, sig, 1);
if ( (trustlevel & TRUST_FLAG_REVOKED) )
{
@@ -872,7 +872,7 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
{
int trustlevel;
- trustlevel = get_validity (ctrl, pk, pk->user_id, NULL, 1);
+ trustlevel = get_validity (ctrl, NULL, pk, pk->user_id, NULL, 1);
if ( (trustlevel & TRUST_FLAG_DISABLED) )
{
/* Key has been disabled. */
@@ -1212,7 +1212,8 @@ build_pk_list (ctrl_t ctrl, strlist_t rcpts, PK_LIST *ret_pk_list)
{ /* Check validity of this key. */
int trustlevel;
- trustlevel = get_validity (ctrl, pk, pk->user_id, NULL, 1);
+ trustlevel =
+ get_validity (ctrl, NULL, pk, pk->user_id, NULL, 1);
if ( (trustlevel & TRUST_FLAG_DISABLED) )
{
tty_printf (_("Public key is disabled.\n") );