From a9f894773b4c7edcd80948c6ba70fa17f37e29be Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 22 Sep 2017 13:55:28 -0400 Subject: Test a couple more functions of PKCS11_RNG --- src/tests/test_pkcs11_high_level.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tests/test_pkcs11_high_level.cpp b/src/tests/test_pkcs11_high_level.cpp index 6cb7a2724..7b4f749fb 100644 --- a/src/tests/test_pkcs11_high_level.cpp +++ b/src/tests/test_pkcs11_high_level.cpp @@ -1378,8 +1378,8 @@ Test::Result test_rng_generate_random() TestSession test_session(true); PKCS11_RNG rng(test_session.session()); - result.confirm("RNG already seeded", rng.is_seeded()); + std::vector random(20); rng.randomize(random.data(), random.size()); result.test_ne("random data generated", random, std::vector(20)); @@ -1394,6 +1394,14 @@ Test::Result test_rng_add_entropy() PKCS11_RNG rng(test_session.session()); + result.confirm("RNG already seeded", rng.is_seeded()); + rng.clear(); + result.confirm("RNG ignores call to clear", rng.is_seeded()); + + result.test_eq("RNG ignores calls to reseed", + rng.reseed(Botan::Entropy_Sources::global_sources(), 256, std::chrono::milliseconds(300)), + 0); + auto random = Test::rng().random_vec(20); rng.add_entropy(random.data(), random.size()); result.test_success("entropy added"); -- cgit v1.2.3