Add verbose mode flag
This commit is contained in:
parent
871befaf01
commit
642effa07b
1 changed files with 5 additions and 1 deletions
6
main.c
6
main.c
|
@ -59,7 +59,7 @@ void unit_tests()
|
||||||
sha256string(testhash, (uint8_t*) "abc", 3);
|
sha256string(testhash, (uint8_t*) "abc", 3);
|
||||||
char testbuf[65];
|
char testbuf[65];
|
||||||
bintohex(testbuf, 32, testhash);
|
bintohex(testbuf, 32, testhash);
|
||||||
if (strcmp(testbuf,
|
if (strcmp(testbuf,
|
||||||
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")) {
|
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")) {
|
||||||
fprintf(stderr, "SHA256 test failed\n");
|
fprintf(stderr, "SHA256 test failed\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -83,6 +83,7 @@ main(int argc, char *argv[])
|
||||||
char * keyfile = NULL;
|
char * keyfile = NULL;
|
||||||
uint8_t* passwd = NULL;
|
uint8_t* passwd = NULL;
|
||||||
int numbers_only = 0;
|
int numbers_only = 0;
|
||||||
|
int verbose = 0;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
#ifdef NEED_WARN_PROGNAME
|
#ifdef NEED_WARN_PROGNAME
|
||||||
|
@ -116,6 +117,9 @@ main(int argc, char *argv[])
|
||||||
case 't':
|
case 't':
|
||||||
unit_tests();
|
unit_tests();
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
verbose = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue