diff options
Diffstat (limited to 'src/widget-totp.c')
| -rw-r--r-- | src/widget-totp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widget-totp.c b/src/widget-totp.c index fbd2293..0c5a41d 100644 --- a/src/widget-totp.c +++ b/src/widget-totp.c | |||
| @@ -115,15 +115,15 @@ otputil_widget_totp( | |||
| 115 | // initial processing of cli arguments | 115 | // initial processing of cli arguments |
| 116 | if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0) | 116 | if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0) |
| 117 | return((rc == -1) ? 0 : 1); | 117 | return((rc == -1) ? 0 : 1); |
| 118 | if ( ((cnf->pass)) && (cnf->argc > optind) ) | 118 | if ( ((cnf->otp_pass)) && (cnf->argc > optind) ) |
| 119 | { | 119 | { |
| 120 | fprintf(stderr, "%s: cannot specify code and use `-p'\n", cnf->prog_name); | 120 | fprintf(stderr, "%s: cannot specify code and use `-p'\n", cnf->prog_name); |
| 121 | fprintf(stderr, "Try `%s --help' for more information.\n", cnf->prog_name); | 121 | fprintf(stderr, "Try `%s --help' for more information.\n", cnf->prog_name); |
| 122 | return(1); | 122 | return(1); |
| 123 | }; | 123 | }; |
| 124 | cnf->pass = (cnf->argc > optind) ? cnf->argv[optind] : cnf->pass; | 124 | cnf->otp_pass = (cnf->argc > optind) ? cnf->argv[optind] : cnf->otp_pass; |
| 125 | 125 | ||
| 126 | if ((cnf->pass)) | 126 | if ((cnf->otp_pass)) |
| 127 | return(otputil_widget_totp_verify(cnf)); | 127 | return(otputil_widget_totp_verify(cnf)); |
| 128 | 128 | ||
| 129 | return(otputil_widget_totp_code(cnf)); | 129 | return(otputil_widget_totp_code(cnf)); |
| @@ -201,8 +201,8 @@ otputil_widget_totp_verbose( | |||
| 201 | printf(" UNIX Start Time: %" PRIu64 "\n", totp_t0 ); | 201 | printf(" UNIX Start Time: %" PRIu64 "\n", totp_t0 ); |
| 202 | printf(" UNIX Current Time: %" PRIu64 "\n", totp_time ); | 202 | printf(" UNIX Current Time: %" PRIu64 "\n", totp_time ); |
| 203 | printf(" Valid for: %" PRIu64 "s\n", otputil_timer(NULL)); | 203 | printf(" Valid for: %" PRIu64 "s\n", otputil_timer(NULL)); |
| 204 | if ((cnf->pass)) | 204 | if ((cnf->otp_pass)) |
| 205 | printf(" Expected Code: %s\n", cnf->pass ); | 205 | printf(" Expected Code: %s\n", cnf->otp_pass ); |
| 206 | printf(" Code: %s\n", code ); | 206 | printf(" Code: %s\n", code ); |
| 207 | if ((status)) | 207 | if ((status)) |
| 208 | printf(" Status: %s\n", status ); | 208 | printf(" Status: %s\n", status ); |
| @@ -228,7 +228,7 @@ otputil_widget_totp_verify( | |||
| 228 | return(1); | 228 | return(1); |
| 229 | }; | 229 | }; |
| 230 | 230 | ||
| 231 | rc = ((strcasecmp(cnf->pass, code))) ? 2 : 0; | 231 | rc = ((strcasecmp(cnf->otp_pass, code))) ? 2 : 0; |
| 232 | status = ((rc)) ? "invalid code" : "valid code"; | 232 | status = ((rc)) ? "invalid code" : "valid code"; |
| 233 | 233 | ||
| 234 | if ((cnf->verbose)) | 234 | if ((cnf->verbose)) |
