summaryrefslogtreecommitdiffstats
path: root/fuzz
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-10-12 16:56:00 +0100
committerMatt Caswell <matt@openssl.org>2023-10-23 10:08:22 +0100
commitf7620555189edb94cc5840814c0ab1864041c148 (patch)
tree3effc2465f3216ac8ebd236871e05e172e533948 /fuzz
parentd3bb8fe73df16e5a96dc94f1ab770b35b6694931 (diff)
Some cleanups in the quic-client fuzzer
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22368)
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/quic-client.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/fuzz/quic-client.c b/fuzz/quic-client.c
index 548ed7ec32..0d319d1c34 100644
--- a/fuzz/quic-client.c
+++ b/fuzz/quic-client.c
@@ -8,13 +8,7 @@
* or in the file LICENSE in the source distribution.
*/
-#include <time.h>
-#include <openssl/rand.h>
#include <openssl/ssl.h>
-#include <openssl/rsa.h>
-#include <openssl/dsa.h>
-#include <openssl/ec.h>
-#include <openssl/dh.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#include "fuzzer.h"
@@ -23,21 +17,6 @@
/* unused, to avoid warning. */
static int idx;
-#define FUZZTIME 1485898104
-
-#define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
-
-/*
- * This might not work in all cases (and definitely not on Windows
- * because of the way linkers are) and callees can still get the
- * current time instead of the fixed time. This will just result
- * in things not being fully reproducible and have a slightly
- * different coverage.
- */
-#if !defined(_WIN32)
-time_t time(time_t *t) TIME_IMPL(t)
-#endif
-
int FuzzerInitialize(int *argc, char ***argv)
{
STACK_OF(SSL_COMP) *comp_methods;
@@ -82,14 +61,9 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
ina.s_addr = htonl(0x7f000001UL);
- if (!BIO_ADDR_rawmake(peer_addr, AF_INET, &ina, sizeof(ina),
- htons(4433)))
+ if (!BIO_ADDR_rawmake(peer_addr, AF_INET, &ina, sizeof(ina), htons(4433)))
goto end;
- /*
- OPENSSL_assert(SSL_set_min_proto_version(client, 0) == 1);
- OPENSSL_assert(SSL_set_cipher_list(client, "ALL:eNULL:@SECLEVEL=0") == 1);
- */
SSL_set_tlsext_host_name(client, "localhost");
in = BIO_new(BIO_s_dgram_mem());
if (in == NULL)
@@ -118,7 +92,6 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
break;
if (size > 0)
- /* OPENSSL_assert((size_t)BIO_write(in, buf+2, size) == size); */
BIO_write(in, buf+2, size);
len -= size + 2;
buf += size + 2;