diff options
author | Todd Short <tshort@akamai.com> | 2021-03-22 12:56:36 -0400 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-04-13 12:31:02 +0200 |
commit | 86a90dc749af91f8a7b8da6628c9ffca2bae3009 (patch) | |
tree | 19dcc6dd6c5960ab0e55a920d75517cb716e0f0a /test/clienthellotest.c | |
parent | f82f5392f39797c1cf3a5d114c0125f121b0f769 (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/14679)
Diffstat (limited to 'test/clienthellotest.c')
-rw-r--r-- | test/clienthellotest.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/clienthellotest.c b/test/clienthellotest.c index 8ae1e4d9c6..8106591213 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) { |