chiark / gitweb /
rsa: Do not crash with -j if key file does not exist
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 May 2020 12:42:09 +0000 (13:42 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 May 2020 19:00:52 +0000 (20:00 +0100)
This was messed up by 58913a3b93a6
  rsa1: Break rsa_loadpriv_core out of rsapriv_apply
where the early exit path should have been handled in both places but
wasn't.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
rsa.c

diff --git a/rsa.c b/rsa.c
index 6a89b21156242eba81ac7dfa78b4904106e1b2aa..1d3c0e80b4fe69628e723680ced15a55618898a2 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -793,6 +793,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
            Message(M_WARNING,"rsa-private (%s:%d): cannot open keyfile "
                    "\"%s\"; assuming it's valid while we check the "
                    "rest of the configuration\n",loc.file,loc.line,filename);
+           return NULL;
        } else {
            fatal_perror("rsa-private (%s:%d): cannot open file \"%s\"",
                         loc.file,loc.line,filename);