diff --git a/foo b/foo new file mode 100644 index 000000000..0418f5a1b --- /dev/null +++ b/foo @@ -0,0 +1 @@ +4986a00fa841e858b50ae0fa6cd617767801f102e2c7fda7071945790f9b39f53596065ff2f2382cbcdc5c7ddfa4a7603ba1811024c72cbaec88b1bd0b52f60dfe4c204e2186fae52897fea9101e9675f4f6468957b3b650c64d919ba9e70788 \ No newline at end of file diff --git a/one.cpp b/one.cpp index 069444945..9ebc83c12 100644 --- a/one.cpp +++ b/one.cpp @@ -822,7 +822,7 @@ static int idtool(int argc,char **argv) char hexbuf[1024]; printf("%s",Utils::hex(signature.data,ZT_C25519_SIGNATURE_LEN,hexbuf)); } else if (!strcmp(argv[1],"verify")) { - if (argc < 4) { + if (argc < 5) { idtoolPrintHelp(stdout,argv[0]); return 1; } @@ -844,8 +844,19 @@ static int idtool(int argc,char **argv) if ((signature.length() > ZT_ADDRESS_LENGTH)&&(id.verify(inf.data(),(unsigned int)inf.length(),signature.data(),(unsigned int)signature.length()))) { printf("%s signature valid" ZT_EOL_S,argv[3]); } else { - fprintf(stderr,"%s signature check FAILED" ZT_EOL_S,argv[3]); - return 1; + signature.clear(); + if (OSUtils::readFile(argv[4],signature)) { + signature.assign(buf,Utils::unhex(signature.c_str(),buf,(unsigned int)sizeof(buf))); + if ((signature.length() > ZT_ADDRESS_LENGTH)&&(id.verify(inf.data(),(unsigned int)inf.length(),signature.data(),(unsigned int)signature.length()))) { + printf("%s signature valid" ZT_EOL_S,argv[3]); + } else { + fprintf(stderr,"%s signature check FAILED" ZT_EOL_S,argv[3]); + return 1; + } + } else { + fprintf(stderr,"%s signature check FAILED" ZT_EOL_S,argv[3]); + return 1; + } } } else if (!strcmp(argv[1],"initmoon")) { if (argc < 3) { diff --git a/test.public b/test.public new file mode 100644 index 000000000..f051ab7a2 --- /dev/null +++ b/test.public @@ -0,0 +1 @@ +8309ba5aec:0:71f0813d24f343bfcee98a1274fde797f52a05614942f24b4bbab71af4b09148a83d7f7a20f36bb4021595f368de5fe9ee0dcd81bfed44ce56991d0fb1c20a02 \ No newline at end of file diff --git a/test.secret b/test.secret new file mode 100644 index 000000000..1a54b21f3 --- /dev/null +++ b/test.secret @@ -0,0 +1 @@ +8309ba5aec:0:71f0813d24f343bfcee98a1274fde797f52a05614942f24b4bbab71af4b09148a83d7f7a20f36bb4021595f368de5fe9ee0dcd81bfed44ce56991d0fb1c20a02:9b109956944f90f7302c2846395eaf09118d9c9cc0dfd5896157e351c52405abee77884e33b9fe7ee5423ec265005535a920bc10c4003779df340a2949ad8ac4 \ No newline at end of file