diff options
author | Jack Lloyd <[email protected]> | 2015-12-27 00:22:14 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-12-27 00:22:14 -0500 |
commit | d27416e791c9aed684efe0d6071fe66a43cf7af0 (patch) | |
tree | 8da077c7ac4a0b4d7c368e63591716d4b665f224 /src/cli/tls_client.cpp | |
parent | b36cb4b4ab944f91fbf34d730806fc74640cd2f8 (diff) |
Add Command::rng()
for when a command wants an RNG but doesn't much care what kind.
This adds a place where a future --rng-type= option can be consulted
to eg use the system RNG or a user seeded DRBG.
Diffstat (limited to 'src/cli/tls_client.cpp')
-rw-r--r-- | src/cli/tls_client.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cli/tls_client.cpp b/src/cli/tls_client.cpp index 1f69473c1..0d584dee0 100644 --- a/src/cli/tls_client.cpp +++ b/src/cli/tls_client.cpp @@ -9,7 +9,6 @@ #if defined(BOTAN_HAS_TLS) && defined(BOTAN_TARGET_OS_HAS_SOCKETS) #include <botan/tls_client.h> -#include <botan/auto_rng.h> #include <botan/hex.h> #if defined(BOTAN_HAS_TLS_SQLITE3_SESSION_MANAGER) @@ -44,7 +43,6 @@ class TLS_Client : public Command void go() override { - Botan::AutoSeeded_RNG rng; Botan::TLS::Policy policy; // TODO read from a file // TODO client cert auth @@ -57,12 +55,12 @@ class TLS_Client : public Command if(!sessions_db.empty()) { - session_mgr.reset(new Botan::TLS::Session_Manager_SQLite(sessions_passphrase, rng, sessions_db)); + session_mgr.reset(new Botan::TLS::Session_Manager_SQLite(sessions_passphrase, rng(), sessions_db)); } #endif if(!session_mgr) { - session_mgr.reset(new Botan::TLS::Session_Manager_In_Memory(rng)); + session_mgr.reset(new Botan::TLS::Session_Manager_In_Memory(rng())); } Basic_Credentials_Manager creds; @@ -96,7 +94,7 @@ class TLS_Client : public Command *session_mgr, creds, policy, - rng, + rng(), Botan::TLS::Server_Information(host, port), version, protocols_to_offer); |