diff options
Diffstat (limited to 'src/cli/utils.cpp')
-rw-r--r-- | src/cli/utils.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cli/utils.cpp b/src/cli/utils.cpp index c0af0332e..76501add4 100644 --- a/src/cli/utils.cpp +++ b/src/cli/utils.cpp @@ -10,6 +10,7 @@ #include <botan/hash.h> #include <botan/cpuid.h> #include <botan/hex.h> +#include <botan/entropy_src.h> #if defined(BOTAN_HAS_BASE64_CODEC) #include <botan/base64.h> @@ -156,7 +157,7 @@ BOTAN_REGISTER_COMMAND("hash", Hash); class RNG final : public Command { public: - RNG() : Command("rng --system --rdrand *bytes") {} + RNG() : Command("rng --system --rdrand --entropy *bytes") {} void go() override { @@ -180,6 +181,15 @@ class RNG final : public Command return; #endif } + else if(flag_set("entropy")) + { +#if defined(BOTAN_HAS_AUTO_SEEDING_RNG) + rng.reset(new Botan::AutoSeeded_RNG(Botan::Entropy_Sources::global_sources())); +#else + error_output() << "auto_rng disabled in build\n"; + return; +#endif + } else { #if defined(BOTAN_HAS_AUTO_SEEDING_RNG) |