From add20f8102d4e5a43957b62e59174378a23f4bc2 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 15 Apr 2019 19:23:20 +0100 Subject: [PATCH] Don't require a database connection for a key index We need an active keydb backend if we want to be able to lookup UIDs for signatures, but if we don't have one we can still index the key. Only use keyid2uid when we have a non-NULL dbctx. --- keyindex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyindex.c b/keyindex.c index 94f52f7..4883f63 100644 --- a/keyindex.c +++ b/keyindex.c @@ -222,7 +222,9 @@ int list_sigs(struct onak_dbctx *dbctx, while (sigs != NULL) { sigid = sig_keyid(sigs->packet); - uid = dbctx->keyid2uid(dbctx, sigid); + if (dbctx) { + uid = dbctx->keyid2uid(dbctx, sigid); + } if (sigs->packet->data[0] == 4 && sigs->packet->data[1] == 0x30) { /* It's a Type 4 sig revocation */ -- 2.39.5