From: Ian Jackson Date: Sat, 7 Dec 2019 14:01:57 +0000 (+0000) Subject: privcache: uncached_get: Introduce `defhash' local X-Git-Tag: v0.6.0~48 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=43efd469ee65291438e900f4777cba9d805c3689;p=secnet.git 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 --- 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: