summaryrefslogtreecommitdiffstats
path: root/test/clienthellotest.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2021-03-22 12:56:36 -0400
committerTomas Mraz <tomas@openssl.org>2021-04-13 12:29:37 +0200
commitfeba11cf2ea1dee9cc6e30bf5953404c9c2c88c6 (patch)
tree48bee7ecfe5b83d7ea2cd24747f6c817ccd877bf /test/clienthellotest.c
parent3ab736acb89c277bd174f958591c65c66d611c72 (diff)
Handle set_alpn_protos inputs better.
It's possible to set an invalid protocol list that will be sent in a ClientHello. This validates the inputs to make sure this does not happen. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14815)
Diffstat (limited to 'test/clienthellotest.c')
-rw-r--r--test/clienthellotest.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/clienthellotest.c b/test/clienthellotest.c
index 2b92395bac..2f6d336dbc 100644
--- a/test/clienthellotest.c
+++ b/test/clienthellotest.c
@@ -45,10 +45,16 @@
static const char *sessionfile = NULL;
/* Dummy ALPN protocols used to pad out the size of the ClientHello */
+/* ASCII 'O' = 79 = 0x4F = EBCDIC '|'*/
+#ifdef CHARSET_EBCDIC
static const char alpn_prots[] =
- "0123456789012345678901234567890123456789012345678901234567890123456789"
- "0123456789012345678901234567890123456789012345678901234567890123456789"
- "01234567890123456789";
+ "|1234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ "|1234567890123456789012345678901234567890123456789012345678901234567890123456789";
+#else
+static const char alpn_prots[] =
+ "O1234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ "O1234567890123456789012345678901234567890123456789012345678901234567890123456789";
+#endif
static int test_client_hello(int currtest)
{