diff options
author | Simon Warta <[email protected]> | 2015-12-08 17:25:03 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-09 15:28:07 +0100 |
commit | 1a0f3438a97b7913ccf444bc48510e0d145af551 (patch) | |
tree | bb4f275f5eba30076d9b48a9164c38b71e2a11e6 /src/cmd/bcrypt.cpp | |
parent | 0261351f68674105a40d1938a001ba65dda756ed (diff) |
Rename cmd/app -> cli
Diffstat (limited to 'src/cmd/bcrypt.cpp')
-rw-r--r-- | src/cmd/bcrypt.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/cmd/bcrypt.cpp b/src/cmd/bcrypt.cpp deleted file mode 100644 index 81f7c536e..000000000 --- a/src/cmd/bcrypt.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -* (C) 2014,2015 Jack Lloyd -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#include "apps.h" - -#if defined(BOTAN_HAS_BCRYPT) - -#include <botan/bcrypt.h> - -namespace { - -int bcrypt(const std::vector<std::string> &args) - { - if(args.size() == 2) - { - AutoSeeded_RNG rng; - - const std::string password = args[1]; - - std::cout << generate_bcrypt(password, rng, 12) << std::endl; - return 0; - } - else if(args.size() == 3) - { - const std::string password = args[1]; - const std::string hash = args[2]; - - if(hash.length() != 60) - std::cout << "Note: bcrypt '" << hash << "' has wrong length and cannot be valid" << std::endl; - - const bool ok = check_bcrypt(password, hash); - - std::cout << "Password is " << (ok ? "valid" : "NOT valid") << std::endl; - return (ok ? 0 : 1); - } - - std::cout << "Usage: " << args[0] << " password\n" - << " " << args[0] << " password passhash" << std::endl; - return 1; - } - -REGISTER_APP(bcrypt); - -} - -#endif |