aboutsummaryrefslogtreecommitdiff
path: root/patches/tlsexttest.c.patch
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2017-09-03 00:51:08 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2017-09-03 01:16:36 +0900
commit512573f0de049eec6dc34c13ddbe28ba42e825fe (patch)
tree436750cad3cc4872f39ed6988711c570c67e9c7a /patches/tlsexttest.c.patch
parentf4d2b810cb7037fb393378dbae7b9cece77829fd (diff)
downloadportable-512573f0de049eec6dc34c13ddbe28ba42e825fe.tar.gz
portable-512573f0de049eec6dc34c13ddbe28ba42e825fe.tar.bz2
portable-512573f0de049eec6dc34c13ddbe28ba42e825fe.zip
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.
Diffstat (limited to 'patches/tlsexttest.c.patch')
-rw-r--r--patches/tlsexttest.c.patch41
1 files changed, 41 insertions, 0 deletions
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 @@
1--- tests/tlsexttest.c.orig Sun Sep 3 00:44:51 2017
2+++ tests/tlsexttest.c Sun Sep 3 00:47:06 2017
3@@ -1676,7 +1676,9 @@ static unsigned char tlsext_sni_clienthello[] = {
4 };
5
6 static unsigned char tlsext_sni_serverhello[] = {
7+ 0x00
8 };
9+const size_t sizeof_tlsext_sni_serverhello = 0;
10
11 static int
12 test_tlsext_sni_clienthello(void)
13@@ -1839,9 +1841,9 @@ test_tlsext_sni_serverhello(void)
14 if (!CBB_finish(&cbb, &data, &dlen))
15 errx(1, "failed to finish CBB");
16
17- if (dlen != sizeof(tlsext_sni_serverhello)) {
18+ if (dlen != sizeof_tlsext_sni_serverhello) {
19 FAIL("got serverhello SNI with length %zu, "
20- "want length %zu\n", dlen, sizeof(tlsext_sni_serverhello));
21+ "want length %zu\n", dlen, sizeof_tlsext_sni_serverhello);
22 goto err;
23 }
24
25@@ -1850,14 +1852,14 @@ test_tlsext_sni_serverhello(void)
26 fprintf(stderr, "received:\n");
27 hexdump(data, dlen);
28 fprintf(stderr, "test data:\n");
29- hexdump(tlsext_sni_serverhello, sizeof(tlsext_sni_serverhello));
30+ hexdump(tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello);
31 goto err;
32 }
33
34 free(ssl->session->tlsext_hostname);
35 ssl->session->tlsext_hostname = NULL;
36
37- CBS_init(&cbs, tlsext_sni_serverhello, sizeof(tlsext_sni_serverhello));
38+ CBS_init(&cbs, tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello);
39 if (!tlsext_sni_serverhello_parse(ssl, &cbs, &alert)) {
40 FAIL("failed to parse serverhello SNI\n");
41 goto err;