From feba11cf2ea1dee9cc6e30bf5953404c9c2c88c6 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Mon, 22 Mar 2021 12:56:36 -0400 Subject: 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 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14815) --- test/clienthellotest.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/clienthellotest.c') 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) { -- cgit v1.2.3