Skip to content

Commit

Permalink
try fix no-ecx build
Browse files Browse the repository at this point in the history
  • Loading branch information
sftcd committed Dec 14, 2023
1 parent 7ac547d commit e9c58f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions fuzz/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
BIO *in;
BIO *out;
SSL_CTX *ctx;
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
/*
* This ECHConfigList has 6 entries with different versions,
* This ECHConfigList has 6 entries wit ,
* [13,10,9,13,10,13] - since our runtime no longer supports
* version 9 or 10, we should see 3 configs loaded.
*/
Expand Down Expand Up @@ -91,7 +91,7 @@ static const char echconfig[] =
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");
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
OPENSSL_assert(SSL_ech_set1_echconfig(client, (unsigned char *)echconfig,
strlen(echconfig)) == 1);
#endif
Expand Down
4 changes: 2 additions & 2 deletions fuzz/echclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
BIO *in;
BIO *out;
SSL_CTX *ctx;
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
unsigned char *echconfig = (unsigned char *)buf + len / 2;
#endif

Expand All @@ -77,7 +77,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
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");
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
if (SSL_ech_set1_echconfig(client, echconfig, len / 2) != 1)
goto end;
#endif
Expand Down
18 changes: 9 additions & 9 deletions fuzz/echserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <openssl/dh.h>
#include <openssl/err.h>
#include "fuzzer.h"
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
# include <internal/ech_helpers.h>
#endif

Expand Down Expand Up @@ -492,7 +492,7 @@ static int idx;
time_t time(time_t *t) TIME_IMPL(t)
#endif

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
static unsigned char s_echconfig[400];
static size_t s_echconfiglen = sizeof(s_echconfig);
static unsigned char config_id = 0;
Expand All @@ -513,7 +513,7 @@ static size_t hpke_infolen = 0;
int FuzzerInitialize(int *argc, char ***argv)
{
STACK_OF(SSL_COMP) *comp_methods;
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
static unsigned char *bin_echconfig;
static size_t bin_echconfiglen = 0;
#endif
Expand All @@ -528,7 +528,7 @@ int FuzzerInitialize(int *argc, char ***argv)
if (comp_methods != NULL)
sk_SSL_COMP_sort(comp_methods);

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
if (ossl_ech_make_echconfig(s_echconfig, &s_echconfiglen,
priv, &privlen,
ech_version, max_name_length,
Expand Down Expand Up @@ -563,7 +563,7 @@ int FuzzerInitialize(int *argc, char ***argv)
return 1;
}

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
/*
* We'll use the left-half of the input buffer as the
* outer CH, HPKE encrypt the right-half and add that
Expand Down Expand Up @@ -690,7 +690,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
DSA *dsakey = NULL;
#endif
uint8_t opt;
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
unsigned char *msgout = NULL;
size_t msgoutlen = 0;
#endif
Expand All @@ -709,7 +709,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
opt = (uint8_t)buf[len-1];
len--;

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
if ((opt & 0x02) != 0) {
/* half the time we'll fuzz the enable_buffer call */
ret = SSL_CTX_ech_server_enable_buffer(ctx, (unsigned char *)buf,
Expand Down Expand Up @@ -802,7 +802,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
SSL_set_bio(server, in, out);
SSL_set_accept_state(server);

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
ret = make_ch_with_ech(&msgout, &msgoutlen, buf, len);
OPENSSL_assert(ret == 1);
OPENSSL_assert((size_t)BIO_write(in, msgout, msgoutlen) == msgoutlen);
Expand Down Expand Up @@ -841,7 +841,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)

void FuzzerCleanup(void)
{
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
OPENSSL_free(hpke_info);
#endif
FuzzerClearRand();
Expand Down
8 changes: 4 additions & 4 deletions fuzz/echsplit.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int idx;
time_t time(time_t *t) TIME_IMPL(t)
#endif

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
static unsigned char s_echconfig[400];
static size_t s_echconfiglen = sizeof(s_echconfig);
static unsigned char priv[200];
Expand Down Expand Up @@ -69,7 +69,7 @@ int FuzzerInitialize(int *argc, char ***argv)
if (comp_methods != NULL)
sk_SSL_COMP_sort(comp_methods);

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
if (ossl_ech_make_echconfig(s_echconfig, &s_echconfiglen,
priv, &privlen,
ech_version, max_name_length,
Expand All @@ -89,7 +89,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
{
SSL_CTX *ctx;
int ret;
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
unsigned char *inner = NULL;
size_t innerlen = 0;
char *inner_sni = NULL, *outer_sni = NULL;
Expand All @@ -107,7 +107,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
ret = SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0");
OPENSSL_assert(ret == 1);

#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC)
#if !defined(OPENSSL_NO_ECH) && !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECX)
ret = SSL_CTX_ech_server_enable_buffer(ctx, (unsigned char *)echkeybuf,
echkeybuflen, SSL_ECH_USE_FOR_RETRY);
OPENSSL_assert(ret == 1);
Expand Down

0 comments on commit e9c58f1

Please sign in to comment.