diff options
Diffstat (limited to 'src/hashpwd.cpp')
-rw-r--r-- | src/hashpwd.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hashpwd.cpp b/src/hashpwd.cpp index 76e656a..4931d93 100644 --- a/src/hashpwd.cpp +++ b/src/hashpwd.cpp @@ -155,7 +155,7 @@ int badPassword(string &passwd) void usage(void) { cout << "usage:" << endl << - " hashpwd [-v] [[-d did] [-m mac] | [-p password]] salt" << endl << + " mts-hashpwd [-v] [[-d did] [-m mac] | [-p password]] salt" << endl << " -v verbose" << endl << " -d did Device ID (serial #)" << endl << " -m mac Ethernet mac address" << endl << @@ -177,7 +177,7 @@ int main(int argc, char **argv) { case 'v': v = 1; cout << " verbose" <<endl; break; case 'd': d = 1; did = optarg ; (v==1) && cout << "device-id is " << did << endl; break; case 'm': m = 1; mac = optarg ; (v==1) && cout << "Ethernet mac is " << mac << endl; break; - case 'p': p = 1; mac = optarg ; (v==1) && cout << "User defined password is \"" << pwd << "\"" << endl; break; + case 'p': p = 1; pwd = optarg ; (v==1) && cout << "User defined password is \"" << pwd << "\"" << endl; break; case '?': usage(); break; default: cout<<endl; abort(); } @@ -219,9 +219,10 @@ int main(int argc, char **argv) { SHA256_CTX sha256; unsigned char hash[SHA256_DIGEST_LENGTH]; - if (p) + if (p) { + ((v == 1)) && cout << "Password: " << pwd << endl; passwd_str = prefixStream.str() + pwd + salt; - else { + } else { passwd0 = did + "|" + mac; passwdnew = passwd0; |