summaryrefslogtreecommitdiffstats
path: root/test/helpers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2024-06-04 16:47:32 +0200
committerMatt Caswell <matt@openssl.org>2024-06-27 11:30:51 +0200
commit9925c97a8e8c9887765a0979c35b516bc8c3af85 (patch)
tree8ededd97ca45d6163e2e62095b5f45a55a2071eb /test/helpers
parentAdd a test for SSL_select_next_proto (diff)
downloadopenssl-9925c97a8e8c9887765a0979c35b516bc8c3af85.tar.xz
openssl-9925c97a8e8c9887765a0979c35b516bc8c3af85.zip
Allow an empty NPN/ALPN protocol list in the tests
Allow ourselves to configure an empty NPN/ALPN protocol list and test what happens if we do. Follow on from CVE-2024-5535 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24716)
Diffstat (limited to 'test/helpers')
-rw-r--r--test/helpers/handshake.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c
index e0422469e4..6b1629b942 100644
--- a/test/helpers/handshake.c
+++ b/test/helpers/handshake.c
@@ -348,6 +348,12 @@ static int parse_protos(const char *protos, unsigned char **out, size_t *outlen)
len = strlen(protos);
+ if (len == 0) {
+ *out = NULL;
+ *outlen = 0;
+ return 1;
+ }
+
/* Should never have reuse. */
if (!TEST_ptr_null(*out)
/* Test values are small, so we omit length limit checks. */