aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/psk.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-01 17:03:39 -0500
committerJack Lloyd <[email protected]>2018-12-01 17:03:39 -0500
commit803106b0aa320f62f639751e8405807810650af4 (patch)
tree2e9e775afc80f38b91ef8ba501d14bc6238d2cea /src/cli/psk.cpp
parent45f643a1ab837c0965f6182a62493f41bf714e68 (diff)
Support getting a passphrase from most of the cli tools
Diffstat (limited to 'src/cli/psk.cpp')
-rw-r--r--src/cli/psk.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cli/psk.cpp b/src/cli/psk.cpp
index 45a5918d8..83b60225d 100644
--- a/src/cli/psk.cpp
+++ b/src/cli/psk.cpp
@@ -27,7 +27,7 @@ class PSK_Tool_Base : public Command
void go() override
{
const std::string db_filename = get_arg("db");
- const Botan::secure_vector<uint8_t> db_key = Botan::hex_decode_locked(get_arg("db_key"));
+ const Botan::secure_vector<uint8_t> db_key = Botan::hex_decode_locked(get_passphrase_arg("Database key", "db_key"));
std::shared_ptr<Botan::SQL_Database> db = std::make_shared<Botan::Sqlite3_Database>(db_filename);
Botan::Encrypted_PSK_Database_SQL psk(db_key, db, "psk");
@@ -53,8 +53,8 @@ class PSK_Tool_Set final : public PSK_Tool_Base
void psk_operation(Botan::PSK_Database& db) override
{
const std::string name = get_arg("name");
- Botan::secure_vector<uint8_t> key = Botan::hex_decode_locked(get_arg("psk"));
- db.set_vec(name, key);
+ const Botan::secure_vector<uint8_t> psk = Botan::hex_decode_locked(get_passphrase_arg("PSK", "psk"));
+ db.set_vec(name, psk);
}
};