From 512573f0de049eec6dc34c13ddbe28ba42e825fe Mon Sep 17 00:00:00 2001 From: kinichiro Date: Sun, 3 Sep 2017 00:51:08 +0900 Subject: [PATCH] Add patch for regress tlsexttest Some compiler does not support 0 sized array. This patch changes 0 sized array to have NULL and using variable instead of sizeof function. --- patches/tlsexttest.c.patch | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 patches/tlsexttest.c.patch diff --git a/patches/tlsexttest.c.patch b/patches/tlsexttest.c.patch new file mode 100644 index 0000000..12d473b --- /dev/null +++ b/patches/tlsexttest.c.patch @@ -0,0 +1,41 @@ +--- tests/tlsexttest.c.orig Sun Sep 3 00:44:51 2017 ++++ tests/tlsexttest.c Sun Sep 3 00:47:06 2017 +@@ -1676,7 +1676,9 @@ static unsigned char tlsext_sni_clienthello[] = { + }; + + static unsigned char tlsext_sni_serverhello[] = { ++ 0x00 + }; ++const size_t sizeof_tlsext_sni_serverhello = 0; + + static int + test_tlsext_sni_clienthello(void) +@@ -1839,9 +1841,9 @@ test_tlsext_sni_serverhello(void) + if (!CBB_finish(&cbb, &data, &dlen)) + errx(1, "failed to finish CBB"); + +- if (dlen != sizeof(tlsext_sni_serverhello)) { ++ if (dlen != sizeof_tlsext_sni_serverhello) { + FAIL("got serverhello SNI with length %zu, " +- "want length %zu\n", dlen, sizeof(tlsext_sni_serverhello)); ++ "want length %zu\n", dlen, sizeof_tlsext_sni_serverhello); + goto err; + } + +@@ -1850,14 +1852,14 @@ test_tlsext_sni_serverhello(void) + fprintf(stderr, "received:\n"); + hexdump(data, dlen); + fprintf(stderr, "test data:\n"); +- hexdump(tlsext_sni_serverhello, sizeof(tlsext_sni_serverhello)); ++ hexdump(tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello); + goto err; + } + + free(ssl->session->tlsext_hostname); + ssl->session->tlsext_hostname = NULL; + +- CBS_init(&cbs, tlsext_sni_serverhello, sizeof(tlsext_sni_serverhello)); ++ CBS_init(&cbs, tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello); + if (!tlsext_sni_serverhello_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse serverhello SNI\n"); + goto err;