aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/otputil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/otputil.c')
-rw-r--r--src/otputil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/otputil.c b/src/otputil.c
index 2c56362..320e1f7 100644
--- a/src/otputil.c
+++ b/src/otputil.c
@@ -268,6 +268,7 @@ otputil_arguments(
268 uint64_t uval; 268 uint64_t uval;
269 char * endptr; 269 char * endptr;
270 int rc; 270 int rc;
271 int i;
271 272
272 // getopt options 273 // getopt options
273 static const char * short_opt = "+" TOTP_SHORT_OPT; 274 static const char * short_opt = "+" TOTP_SHORT_OPT;
@@ -343,6 +344,20 @@ otputil_arguments(
343 }; 344 };
344 break; 345 break;
345 346
347 case 'm':
348 if ((i = otputil_str2md(optarg)) == -1)
349 {
350 fprintf(stderr, "%s: message digest for `-m'\n", PROGRAM_NAME);
351 fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME);
352 return(1);
353 };
354 if ((rc = otputil_set_param(NULL, OTPUTIL_OPT_HMAC, &i)) != OTPUTIL_SUCCESS)
355 {
356 fprintf(stderr, "%s: otputil_set_param(OTPUTIL_OPT_HMAC): %s\n", PROGRAM_NAME, otputil_err2string(rc));
357 return(1);
358 };
359 break;
360
346 case 's': 361 case 's':
347 cnf->quiet = 1; 362 cnf->quiet = 1;
348 if ((cnf->verbose)) 363 if ((cnf->verbose))
@@ -555,6 +570,7 @@ otputil_widget_usage(
555 if ((strchr(short_opt, 'd'))) printf(" -d num number of digits in code\n"); 570 if ((strchr(short_opt, 'd'))) printf(" -d num number of digits in code\n");
556 if ((strchr(short_opt, 'k'))) printf(" -k string shared user key\n"); 571 if ((strchr(short_opt, 'k'))) printf(" -k string shared user key\n");
557 if ((strchr(short_opt, 'h'))) printf(" -h, --help print this help and exit\n"); 572 if ((strchr(short_opt, 'h'))) printf(" -h, --help print this help and exit\n");
573 if ((strchr(short_opt, 'm'))) printf(" -m hash use message digest hash\n");
558 if ((strchr(short_opt, 'q'))) printf(" -q, --quiet, --silent do not print messages\n"); 574 if ((strchr(short_opt, 'q'))) printf(" -q, --quiet, --silent do not print messages\n");
559 if ((strchr(short_opt, 'T'))) printf(" -T seconds current Unix time\n"); 575 if ((strchr(short_opt, 'T'))) printf(" -T seconds current Unix time\n");
560 if ((strchr(short_opt, 't'))) printf(" -t seconds Unix time start of time steps\n"); 576 if ((strchr(short_opt, 't'))) printf(" -t seconds Unix time start of time steps\n");