From 91de83110aee305f0e0d74a65278113c61af28d0 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 23 Feb 2017 11:41:57 -0500 Subject: In CLI, if system RNG is available prefer it --- src/cli/cli.h | 9 ++++++++- src/cli/utils.cpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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 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 { -- cgit v1.2.3