mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
GitHub issue #723
This commit is contained in:
parent
86637cda9f
commit
f12c0e79c9
4 changed files with 17 additions and 3 deletions
1
foo
Normal file
1
foo
Normal file
|
@ -0,0 +1 @@
|
||||||
|
4986a00fa841e858b50ae0fa6cd617767801f102e2c7fda7071945790f9b39f53596065ff2f2382cbcdc5c7ddfa4a7603ba1811024c72cbaec88b1bd0b52f60dfe4c204e2186fae52897fea9101e9675f4f6468957b3b650c64d919ba9e70788
|
17
one.cpp
17
one.cpp
|
@ -822,7 +822,7 @@ static int idtool(int argc,char **argv)
|
||||||
char hexbuf[1024];
|
char hexbuf[1024];
|
||||||
printf("%s",Utils::hex(signature.data,ZT_C25519_SIGNATURE_LEN,hexbuf));
|
printf("%s",Utils::hex(signature.data,ZT_C25519_SIGNATURE_LEN,hexbuf));
|
||||||
} else if (!strcmp(argv[1],"verify")) {
|
} else if (!strcmp(argv[1],"verify")) {
|
||||||
if (argc < 4) {
|
if (argc < 5) {
|
||||||
idtoolPrintHelp(stdout,argv[0]);
|
idtoolPrintHelp(stdout,argv[0]);
|
||||||
return 1;
|
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()))) {
|
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]);
|
printf("%s signature valid" ZT_EOL_S,argv[3]);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,"%s signature check FAILED" ZT_EOL_S,argv[3]);
|
signature.clear();
|
||||||
return 1;
|
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")) {
|
} else if (!strcmp(argv[1],"initmoon")) {
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
|
|
1
test.public
Normal file
1
test.public
Normal file
|
@ -0,0 +1 @@
|
||||||
|
8309ba5aec:0:71f0813d24f343bfcee98a1274fde797f52a05614942f24b4bbab71af4b09148a83d7f7a20f36bb4021595f368de5fe9ee0dcd81bfed44ce56991d0fb1c20a02
|
1
test.secret
Normal file
1
test.secret
Normal file
|
@ -0,0 +1 @@
|
||||||
|
8309ba5aec:0:71f0813d24f343bfcee98a1274fde797f52a05614942f24b4bbab71af4b09148a83d7f7a20f36bb4021595f368de5fe9ee0dcd81bfed44ce56991d0fb1c20a02:9b109956944f90f7302c2846395eaf09118d9c9cc0dfd5896157e351c52405abee77884e33b9fe7ee5423ec265005535a920bc10c4003779df340a2949ad8ac4
|
Loading…
Add table
Reference in a new issue