X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps_test.c;h=f83307fe5c68cf98f7ffee45a997c06177b205f6;hb=eca357ed916c9782a64a68a2f30b144d84027795;hp=95bfda86dd297019d9ba1466813cb646ac27b367;hpb=266afc6c63d3d02584feb24b69063f97057daac8;p=tinc diff --git a/src/sptps_test.c b/src/sptps_test.c index 95bfda86..f83307fe 100644 --- a/src/sptps_test.c +++ b/src/sptps_test.c @@ -35,6 +35,7 @@ bool send_request(void *c, const char *msg, ...) { return false; } struct list_t *connection_list = NULL; bool send_meta(void *c, const char *msg , int len) { return false; } char *logfilename = NULL; +bool do_detach = false; struct timeval now; static bool verbose; @@ -271,11 +272,19 @@ int main(int argc, char *argv[]) { crypto_init(); FILE *fp = fopen(argv[1], "r"); + if(!fp) { + fprintf(stderr, "Could not open %s: %s\n", argv[1], strerror(errno)); + return 1; + } if(!(mykey = ecdsa_read_pem_private_key(fp))) return 1; fclose(fp); fp = fopen(argv[2], "r"); + if(!fp) { + fprintf(stderr, "Could not open %s: %s\n", argv[2], strerror(errno)); + return 1; + } if(!(hiskey = ecdsa_read_pem_public_key(fp))) return 1; fclose(fp);