chiark / gitweb /
Import release 0.1.0
[secnet.git] / rsa.c
diff --git a/rsa.c b/rsa.c
index d1107a952ef1a0e0ce9198a66ee17e0a6e61c31e..0b6f1478837d556fa377ec2d83226f95f9669da9 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -228,8 +228,15 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
 
     f=fopen(filename,"rb");
     if (!f) {
-       fatal_perror("rsa-private (%s:%d): cannot open file \"%s\"",
-                    loc.file,loc.line,filename);
+       if (just_check_config) {
+           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);
+           goto assume_valid;
+       } else {
+           fatal_perror("rsa-private (%s:%d): cannot open file \"%s\"",
+                        loc.file,loc.line,filename);
+       }
     }
 
     /* Check that the ID string is correct */
@@ -327,6 +334,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
     free(c);
     mpz_clear(&e);
 
+assume_valid:
     return new_closure(&st->cl);
 }