diff options
author | Jack Lloyd <[email protected]> | 2017-02-23 11:41:57 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-02-23 11:41:57 -0500 |
commit | 91de83110aee305f0e0d74a65278113c61af28d0 (patch) | |
tree | f25f2cbd0847fdb145f23976eec50141a8f131c8 /src | |
parent | b521e251b2786fa8a06a1d7de10072769b7d685d (diff) |
In CLI, if system RNG is available prefer it
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/cli.h | 9 | ||||
-rw-r--r-- | src/cli/utils.cpp | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/cli/cli.h b/src/cli/cli.h index 7e2d49f0f..c3dc8d849 100644 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -317,7 +317,14 @@ class Command m_spec_flags.insert("help"); m_spec_opts.insert(std::make_pair("output", "")); m_spec_opts.insert(std::make_pair("error-output", "")); - m_spec_opts.insert(std::make_pair("rng-type", "auto")); + + m_spec_opts.insert(std::make_pair("rng-type", +#if defined(BOTAN_HAS_SYSTEM_RNG) + "system" +#else + "auto" +#endif + )); } /* diff --git a/src/cli/utils.cpp b/src/cli/utils.cpp index 664f74eb8..c0af0332e 100644 --- a/src/cli/utils.cpp +++ b/src/cli/utils.cpp @@ -131,11 +131,11 @@ class Hash final : public Command const size_t buf_size = get_arg_sz("buf-size"); - auto files = get_arg_list("files"); + std::vector<std::string> files = get_arg_list("files"); if(files.empty()) files.push_back("-"); // read stdin if no arguments on command line - for(auto fsname : files) + for(const std::string& fsname : files) { try { |