diff options
Diffstat (limited to 'src/widget-otp.c')
| -rw-r--r-- | src/widget-otp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/widget-otp.c b/src/widget-otp.c index d4c06fc..079f035 100644 --- a/src/widget-otp.c +++ b/src/widget-otp.c | |||
| @@ -115,6 +115,17 @@ otputil_widget_otp( | |||
| 115 | return(1); | 115 | return(1); |
| 116 | }; | 116 | }; |
| 117 | 117 | ||
| 118 | // set default hash | ||
| 119 | if (!(strncasecmp(cnf->argv[0], "otp-", 4))) | ||
| 120 | { | ||
| 121 | if ((hash = otputil_str2md(&cnf->argv[0][4])) == -1) | ||
| 122 | { | ||
| 123 | fprintf(stderr, "%s: unsupported hash algorithm\n", cnf->prog_name); | ||
| 124 | return(1); | ||
| 125 | }; | ||
| 126 | otputil_set_param(NULL, OTPUTIL_OPT_OTP_HASH, &hash); | ||
| 127 | }; | ||
| 128 | |||
| 118 | // initial processing of cli arguments | 129 | // initial processing of cli arguments |
| 119 | if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0) | 130 | if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0) |
| 120 | return((rc == -1) ? 0 : 1); | 131 | return((rc == -1) ? 0 : 1); |
