aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-27 12:50:23 -0400
committerJack Lloyd <[email protected]>2016-10-27 12:50:23 -0400
commita8463b2edbabc3a4754562ed269b11834897a4f1 (patch)
tree441091313f14b291571d1a8ab26c648467eb4be1 /src
parent27133c6689d6910a34436a91d934a93836dddaeb (diff)
More tests for session managers.
Using sqlite3 for one and memory for another meant only half of each implementation was tested. Instead use sqlite3 for a while, then switch to in-memory, to ensure both are covered.
Diffstat (limited to 'src')
-rw-r--r--src/tests/unit_tls.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp
index 080422cab..8a074db0c 100644
--- a/src/tests/unit_tls.cpp
+++ b/src/tests/unit_tls.cpp
@@ -926,10 +926,13 @@ class TLS_Unit_Tests : public Test
client_ses.reset(
new Botan::TLS::Session_Manager_SQLite("pass", rng, ":memory:", 5,
std::chrono::seconds(2)));
+ server_ses.reset(
+ new Botan::TLS::Session_Manager_SQLite("pass", rng, ":memory:", 10,
+ std::chrono::seconds(4)));
#else
client_ses.reset(new Botan::TLS::Session_Manager_In_Memory(rng));
-#endif
server_ses.reset(new Botan::TLS::Session_Manager_In_Memory(rng));
+#endif
std::unique_ptr<Botan::Credentials_Manager> creds(create_creds(rng));
std::vector<Test::Result> results;
@@ -956,6 +959,8 @@ class TLS_Unit_Tests : public Test
#if defined(BOTAN_HAS_SEED)
test_all_versions(results, *client_ses, *server_ses, *creds, "RSA", "SEED", "SHA-1", etm_setting);
#endif
+
+ server_ses->remove_all();
}
test_modern_versions(results, *client_ses, *server_ses, *creds, "DH", "AES-128", "SHA-256");
@@ -968,6 +973,8 @@ class TLS_Unit_Tests : public Test
test_modern_versions(results, *client_ses, *server_ses, *creds, "RSA", "AES-128/GCM");
test_modern_versions(results, *client_ses, *server_ses, *creds, "ECDH", "AES-128/GCM");
+ client_ses->remove_all();
+
test_modern_versions(results, *client_ses, *server_ses, *creds, "ECDH", "AES-128/GCM", "AEAD",
{ { "signature_methods", "RSA" } });
@@ -984,6 +991,11 @@ class TLS_Unit_Tests : public Test
std::unique_ptr<Botan::Credentials_Manager> creds_with_client_cert(create_creds(rng, true));
test_modern_versions(results, *client_ses, *server_ses, *creds_with_client_cert, "ECDH", "AES-256/GCM");
+#if defined(BOTAN_HAS_TLS_SQLITE3_SESSION_MANAGER)
+ client_ses.reset(new Botan::TLS::Session_Manager_In_Memory(rng));
+ server_ses.reset(new Botan::TLS::Session_Manager_In_Memory(rng));
+#endif
+
#if defined(BOTAN_HAS_AEAD_OCB)
test_modern_versions(results, *client_ses, *server_ses, *creds, "ECDH", "AES-128/OCB(12)");
#endif