aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/widget-hotp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget-hotp.c')
-rw-r--r--src/widget-hotp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widget-hotp.c b/src/widget-hotp.c
index 123878f..af1e51e 100644
--- a/src/widget-hotp.c
+++ b/src/widget-hotp.c
@@ -114,15 +114,15 @@ otputil_widget_hotp(
114 // initial processing of cli arguments 114 // initial processing of cli arguments
115 if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0) 115 if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0)
116 return((rc == -1) ? 0 : 1); 116 return((rc == -1) ? 0 : 1);
117 if ( ((cnf->pass)) && (cnf->argc > optind) ) 117 if ( ((cnf->otp_pass)) && (cnf->argc > optind) )
118 { 118 {
119 fprintf(stderr, "%s: cannot specify code and use `-p'\n", cnf->prog_name); 119 fprintf(stderr, "%s: cannot specify code and use `-p'\n", cnf->prog_name);
120 fprintf(stderr, "Try `%s --help' for more information.\n", cnf->prog_name); 120 fprintf(stderr, "Try `%s --help' for more information.\n", cnf->prog_name);
121 return(1); 121 return(1);
122 }; 122 };
123 cnf->pass = (cnf->argc > optind) ? cnf->argv[optind] : cnf->pass; 123 cnf->otp_pass = (cnf->argc > optind) ? cnf->argv[optind] : cnf->otp_pass;
124 124
125 if ((cnf->pass)) 125 if ((cnf->otp_pass))
126 return(otputil_widget_hotp_verify(cnf)); 126 return(otputil_widget_hotp_verify(cnf));
127 127
128 return(otputil_widget_hotp_code(cnf)); 128 return(otputil_widget_hotp_code(cnf));
@@ -180,8 +180,8 @@ otputil_widget_hotp_verbose(
180 printf(" HMAC Hash: hmac-%s\n", otputil_md2str(hotp_hmac)); 180 printf(" HMAC Hash: hmac-%s\n", otputil_md2str(hotp_hmac));
181 printf(" Shared Key: %s\n", otp_kstr ); 181 printf(" Shared Key: %s\n", otp_kstr );
182 printf(" Counter: %" PRIu64 "\n", hotp_c ); 182 printf(" Counter: %" PRIu64 "\n", hotp_c );
183 if ((cnf->pass)) 183 if ((cnf->otp_pass))
184 printf(" Expected Code: %s\n", cnf->pass ); 184 printf(" Expected Code: %s\n", cnf->otp_pass );
185 printf(" Code: %s\n", code ); 185 printf(" Code: %s\n", code );
186 if ((status)) 186 if ((status))
187 printf(" Status: %s\n", status ); 187 printf(" Status: %s\n", status );
@@ -207,7 +207,7 @@ otputil_widget_hotp_verify(
207 return(1); 207 return(1);
208 }; 208 };
209 209
210 rc = ((strcasecmp(cnf->pass, code))) ? 2 : 0; 210 rc = ((strcasecmp(cnf->otp_pass, code))) ? 2 : 0;
211 status = ((rc)) ? "invalid code" : "valid code"; 211 status = ((rc)) ? "invalid code" : "valid code";
212 212
213 if ((cnf->verbose)) 213 if ((cnf->verbose))