From 43efd469ee65291438e900f4777cba9d805c3689 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Dec 2019 14:01:57 +0000 Subject: [PATCH] privcache: uncached_get: Introduce `defhash' local This is a bit more convenient and will also make a future commit much easier too read. Signed-off-by: Ian Jackson --- privcache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/privcache.c b/privcache.c index 3197329..a5a67a5 100644 --- a/privcache.c +++ b/privcache.c @@ -46,6 +46,7 @@ static struct sigprivkey_if *uncached_get(struct privcache *st, sprintf(st->path.write_here, SIGKEYID_PR_FMT, SIGKEYID_PR_VAL(id)); const char *path=st->path.buffer; + struct hash_if *defhash=st->defhash; f = fopen(path,"rb"); if (!f) { @@ -94,7 +95,7 @@ static struct sigprivkey_if *uncached_get(struct privcache *st, if (!ok) goto out; /* loadpriv will have logged */ if (sigpriv->sethash) { - if (!st->defhash) { + if (!defhash) { slilog(log,M_ERR, "private key %s requires `hash' config key for privcache to load", path); @@ -102,7 +103,7 @@ static struct sigprivkey_if *uncached_get(struct privcache *st, sigpriv=0; goto out; } - sigpriv->sethash(sigpriv->st,st->defhash); + sigpriv->sethash(sigpriv->st,defhash); } out: -- 2.30.2