aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_tls.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-15 22:34:25 -0500
committerJack Lloyd <[email protected]>2016-11-15 22:34:25 -0500
commit43d16fe3a821fd694b4db8edc9e33ca8a1715d99 (patch)
tree4606ec79686f1b192bfc1ef7d0f23ef39f0c3795 /src/tests/unit_tls.cpp
parentdb3a868cb8c477dbd909bed53879f2124a443306 (diff)
Fix TLS corruption tests.
There is a simple bit flip corruption test for the TLS stack: we shouldn't negotiate correctly if any random bit gets flipped. But it turns out this is not entirely true as the record layer version field is effectively ignored except for distinguishing TLS vs DTLS. So a small bitflip in that field is sometimes ignored, causing the test to fail. Make sure we modify something in the body instead.
Diffstat (limited to 'src/tests/unit_tls.cpp')
-rw-r--r--src/tests/unit_tls.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp
index ab37cffd1..4ebc54252 100644
--- a/src/tests/unit_tls.cpp
+++ b/src/tests/unit_tls.cpp
@@ -407,7 +407,7 @@ Test::Result test_tls_handshake(Botan::TLS::Protocol_Version offer_version,
if(corrupt_server_data)
{
- input = Test::mutate_vec(input, true);
+ input = Test::mutate_vec(input, true, 5);
size_t needed = server->received_data(input.data(), input.size());
size_t total_consumed = needed;
@@ -438,7 +438,7 @@ Test::Result test_tls_handshake(Botan::TLS::Protocol_Version offer_version,
if(corrupt_client_data)
{
- input = Test::mutate_vec(input, true);
+ input = Test::mutate_vec(input, true, 5);
size_t needed = client->received_data(input.data(), input.size());
size_t total_consumed = 0;
@@ -695,7 +695,7 @@ Test::Result test_dtls_handshake(Botan::TLS::Protocol_Version offer_version,
{
try
{
- input = Test::mutate_vec(input, true);
+ input = Test::mutate_vec(input, true, 5);
size_t needed = server->received_data(input.data(), input.size());
if(needed > 0 && result.test_lt("Never requesting more than max protocol len", needed, 18*1024))
@@ -735,7 +735,7 @@ Test::Result test_dtls_handshake(Botan::TLS::Protocol_Version offer_version,
{
try
{
- input = Test::mutate_vec(input, true);
+ input = Test::mutate_vec(input, true, 5);
size_t needed = client->received_data(input.data(), input.size());
if(needed > 0 && result.test_lt("Never requesting more than max protocol len", needed, 18*1024))