chiark / gitweb /
rsa1: Drop filename from two error messages
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Oct 2019 22:14:48 +0000 (23:14 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:49 +0000 (21:56 +0000)
The scheme loading interface doesn't provide the filename (and it will
handle logging it if need be).  For the rsapriv_apply closure, the
config location will allow one to find the filename which seems
sufficient to me.

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

diff --git a/rsa.c b/rsa.c
index 63816ee232b3638963bacc6b29a97fd477ae5ffa..d5d80ff6664dbcb0e0a1d0a07960c67fb3bcbf92 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -391,8 +391,7 @@ static void rsapriv_dispose(void *sst)
 
 static struct rsapriv *rsa_loadpriv_core(struct rsapriv_load_ctx *l,
                                         FILE *f, struct cloc loc,
-                                        bool_t do_validity_check,
-                                        const char *filename)
+                                        bool_t do_validity_check)
 {
     struct rsapriv *st=0;
     long length;
@@ -437,8 +436,7 @@ static struct rsapriv *rsa_loadpriv_core(struct rsapriv_load_ctx *l,
     b=safe_malloc(length,"rsapriv_apply");
     if (fread(b,length,1,f)!=1 || memcmp(b,AUTHFILE_ID_STRING,length)!=0) {
        LDUNSUP_FILE("failed to read magic ID"
-                          " string from SSH1 private keyfile \"%s\"\n",
-                          filename);
+                    " string from SSH1 private keyfile\n");
     }
     FREE(b);
 
@@ -596,8 +594,8 @@ static struct rsapriv *rsa_loadpriv_core(struct rsapriv_load_ctx *l,
     
 done_checks:
     if (!valid) {
-       LDFATAL("file \"%s\" does not contain a "
-                "valid RSA key!\n",filename);
+       LDFATAL("file does not contain a "
+                "valid RSA key!\n");
     }
 
 assume_valid:
@@ -678,7 +676,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
        do_validity_check=False;
     }
 
-    st=rsa_loadpriv_core(l,f,loc,do_validity_check,filename);
+    st=rsa_loadpriv_core(l,f,loc,do_validity_check);
     fclose(f);
     return new_closure(&st->cl);
 }