diff options
author | Jack Lloyd <[email protected]> | 2016-12-16 21:28:00 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-16 21:28:00 -0500 |
commit | 9539a0b88c476844fa77326d2c17bd8ecb20ecc2 (patch) | |
tree | 61aac26fc36f21428206f67dc2e1a65dfdbef817 /src/extra_tests | |
parent | bf57b43729321bca22a4d0f05a6a97c6bd22b28a (diff) |
Just expect a byte stream in the TLS fuzzer input, with no length fields.
Matches how OpenSSL/BoringSSL fuzzers work which is useful because fuzzer
corpus can be cross-pollinated among implementations.
[ci skip]
Diffstat (limited to 'src/extra_tests')
-rw-r--r-- | src/extra_tests/fuzzers/jigs/tls_client.cpp | 17 | ||||
-rw-r--r-- | src/extra_tests/fuzzers/jigs/tls_server.cpp | 13 |
2 files changed, 3 insertions, 27 deletions
diff --git a/src/extra_tests/fuzzers/jigs/tls_client.cpp b/src/extra_tests/fuzzers/jigs/tls_client.cpp index f70e1eb75..d3fbd069c 100644 --- a/src/extra_tests/fuzzers/jigs/tls_client.cpp +++ b/src/extra_tests/fuzzers/jigs/tls_client.cpp @@ -32,7 +32,6 @@ void fuzz(const uint8_t in[], size_t len) TLS::Policy policy; TLS::Protocol_Version client_offer = TLS::Protocol_Version::TLS_V12; TLS::Server_Information info("server.name", 443); - const std::vector<std::string> protocols_to_offer = { "fuzz/1.0", "http/1.1", "bunny/1.21.3" }; Fuzzer_TLS_Client_Creds creds; TLS::Client client(dev_null, @@ -44,23 +43,11 @@ void fuzz(const uint8_t in[], size_t len) policy, fuzzer_rng(), info, - client_offer, - protocols_to_offer); + client_offer); try { - while(len > 0) - { - const size_t write_len = in[0]; - const size_t left = len - 1; - - const size_t consumed = std::min(left, write_len); - - client.received_data(in + 1, consumed); - - in += consumed + 1; - len -= consumed + 1; - } + client.received_data(in, len); } catch(std::exception& e) { diff --git a/src/extra_tests/fuzzers/jigs/tls_server.cpp b/src/extra_tests/fuzzers/jigs/tls_server.cpp index acf7ce08e..a4e0d5f00 100644 --- a/src/extra_tests/fuzzers/jigs/tls_server.cpp +++ b/src/extra_tests/fuzzers/jigs/tls_server.cpp @@ -145,18 +145,7 @@ void fuzz(const uint8_t in[], size_t len) try { - while(len > 0) - { - const size_t write_len = in[0]; - const size_t left = len - 1; - - const size_t consumed = std::min(left, write_len); - - server.received_data(in + 1, consumed); - - in += consumed + 1; - len -= consumed + 1; - } + server.received_data(in, len); } catch(std::exception& e) { |