diff options
author | lloyd <[email protected]> | 2015-06-19 03:19:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-06-19 03:19:03 +0000 |
commit | 54c46bd8cb7fb9c8f3299e0727e528e8821150ed (patch) | |
tree | 8226ef9d673d7bc4997b5b04de319a4f8ec5b181 /src | |
parent | b022ea558f912b9237455e3b3db31a3c53e12be9 (diff) |
Add DTLS versions to TLS handshake smoke test
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/unit_tls.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp index 8e21cc484..f37bbe291 100644 --- a/src/tests/unit_tls.cpp +++ b/src/tests/unit_tls.cpp @@ -156,7 +156,8 @@ size_t basic_test_handshake(RandomNumberGenerator& rng, auto handshake_complete = [&](const TLS::Session& session) -> bool { if(session.version() != offer_version) - std::cout << "Wrong version negotiated\n"; + std::cout << "Offered " << offer_version.to_string() + << " got " << session.version().to_string() << "\n"; return true; }; @@ -194,7 +195,8 @@ size_t basic_test_handshake(RandomNumberGenerator& rng, creds, policy, rng, - next_protocol_chooser); + next_protocol_chooser, + offer_version.is_datagram_protocol()); TLS::Client client([&](const byte buf[], size_t sz) { c2s_q.insert(c2s_q.end(), buf, buf+sz); }, @@ -296,8 +298,10 @@ size_t test_tls() errors += basic_test_handshake(rng, TLS::Protocol_Version::TLS_V10, *basic_creds, default_policy); errors += basic_test_handshake(rng, TLS::Protocol_Version::TLS_V11, *basic_creds, default_policy); errors += basic_test_handshake(rng, TLS::Protocol_Version::TLS_V12, *basic_creds, default_policy); + errors += basic_test_handshake(rng, TLS::Protocol_Version::DTLS_V10, *basic_creds, default_policy); + errors += basic_test_handshake(rng, TLS::Protocol_Version::DTLS_V12, *basic_creds, default_policy); - test_report("TLS", 3, errors); + test_report("TLS", 5, errors); return errors; } |