diff options
| author | kinichiro <kinichiro.inoguchi@gmail.com> | 2017-12-30 20:15:56 +0900 |
|---|---|---|
| committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2017-12-30 20:15:56 +0900 |
| commit | 861a6ca1db1f3ce95c649274a58ea38c2c4ac4a0 (patch) | |
| tree | 6636647ccbadb6ca8fde799aaac489ab34c7c683 | |
| parent | 52c39d42ea083506575ab75929dfa1edddd94c08 (diff) | |
| download | portable-861a6ca1db1f3ce95c649274a58ea38c2c4ac4a0.tar.gz portable-861a6ca1db1f3ce95c649274a58ea38c2c4ac4a0.tar.bz2 portable-861a6ca1db1f3ce95c649274a58ea38c2c4ac4a0.zip | |
Modify regress tests/tlsexttest.c for 0 sized array
- Windows and hp-ux ANSI compiler can not handle 0 sized array initialization.
| -rw-r--r-- | patches/tlsexttest.c.patch | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/patches/tlsexttest.c.patch b/patches/tlsexttest.c.patch index 12d473b..981fc95 100644 --- a/patches/tlsexttest.c.patch +++ b/patches/tlsexttest.c.patch | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | --- tests/tlsexttest.c.orig Sun Sep 3 00:44:51 2017 | 1 | --- tests/tlsexttest.c.orig 2017-12-30 20:03:09.279079726 +0900 |
| 2 | +++ tests/tlsexttest.c Sun Sep 3 00:47:06 2017 | 2 | +++ tests/tlsexttest.c 2017-12-30 20:07:21.849939140 +0900 |
| 3 | @@ -1676,7 +1676,9 @@ static unsigned char tlsext_sni_clienthello[] = { | 3 | @@ -1676,7 +1676,9 @@ static unsigned char tlsext_sni_clienthe |
| 4 | }; | 4 | }; |
| 5 | 5 | ||
| 6 | static unsigned char tlsext_sni_serverhello[] = { | 6 | static unsigned char tlsext_sni_serverhello[] = { |
| @@ -39,3 +39,73 @@ | |||
| 39 | if (!tlsext_sni_serverhello_parse(ssl, &cbs, &alert)) { | 39 | if (!tlsext_sni_serverhello_parse(ssl, &cbs, &alert)) { |
| 40 | FAIL("failed to parse serverhello SNI\n"); | 40 | FAIL("failed to parse serverhello SNI\n"); |
| 41 | goto err; | 41 | goto err; |
| 42 | @@ -2741,7 +2743,10 @@ unsigned char tlsext_clienthello_default | ||
| 43 | 0x03, 0x01, 0x03, 0x03, 0x02, 0x01, 0x02, 0x03, | ||
| 44 | }; | ||
| 45 | |||
| 46 | -unsigned char tlsext_clienthello_disabled[] = {}; | ||
| 47 | +unsigned char tlsext_clienthello_disabled[] = { | ||
| 48 | + 0x00 | ||
| 49 | +}; | ||
| 50 | +const size_t sizeof_tlsext_clienthello_disabled = 0; | ||
| 51 | |||
| 52 | static int | ||
| 53 | test_tlsext_clienthello_build(void) | ||
| 54 | @@ -2806,18 +2811,18 @@ test_tlsext_clienthello_build(void) | ||
| 55 | if (!CBB_finish(&cbb, &data, &dlen)) | ||
| 56 | errx(1, "failed to finish CBB"); | ||
| 57 | |||
| 58 | - if (dlen != sizeof(tlsext_clienthello_disabled)) { | ||
| 59 | + if (dlen != sizeof_tlsext_clienthello_disabled) { | ||
| 60 | FAIL("got clienthello extensions with length %zu, " | ||
| 61 | "want length %zu\n", dlen, | ||
| 62 | - sizeof(tlsext_clienthello_disabled)); | ||
| 63 | + sizeof_tlsext_clienthello_disabled); | ||
| 64 | compare_data(data, dlen, tlsext_clienthello_disabled, | ||
| 65 | - sizeof(tlsext_clienthello_disabled)); | ||
| 66 | + sizeof_tlsext_clienthello_disabled); | ||
| 67 | goto err; | ||
| 68 | } | ||
| 69 | if (memcmp(data, tlsext_clienthello_disabled, dlen) != 0) { | ||
| 70 | FAIL("clienthello extensions differs:\n"); | ||
| 71 | compare_data(data, dlen, tlsext_clienthello_disabled, | ||
| 72 | - sizeof(tlsext_clienthello_disabled)); | ||
| 73 | + sizeof_tlsext_clienthello_disabled); | ||
| 74 | goto err; | ||
| 75 | } | ||
| 76 | |||
| 77 | @@ -2832,7 +2837,10 @@ test_tlsext_clienthello_build(void) | ||
| 78 | return (failure); | ||
| 79 | } | ||
| 80 | |||
| 81 | -unsigned char tlsext_serverhello_default[] = {}; | ||
| 82 | +unsigned char tlsext_serverhello_default[] = { | ||
| 83 | + 0x00 | ||
| 84 | +}; | ||
| 85 | +const size_t sizeof_tlsext_serverhello_default = 0; | ||
| 86 | |||
| 87 | unsigned char tlsext_serverhello_enabled[] = { | ||
| 88 | 0x00, 0x13, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, | ||
| 89 | @@ -2872,18 +2880,18 @@ test_tlsext_serverhello_build(void) | ||
| 90 | if (!CBB_finish(&cbb, &data, &dlen)) | ||
| 91 | errx(1, "failed to finish CBB"); | ||
| 92 | |||
| 93 | - if (dlen != sizeof(tlsext_serverhello_default)) { | ||
| 94 | + if (dlen != sizeof_tlsext_serverhello_default) { | ||
| 95 | FAIL("got serverhello extensions with length %zu, " | ||
| 96 | "want length %zu\n", dlen, | ||
| 97 | - sizeof(tlsext_serverhello_default)); | ||
| 98 | + sizeof_tlsext_serverhello_default); | ||
| 99 | compare_data(data, dlen, tlsext_serverhello_default, | ||
| 100 | - sizeof(tlsext_serverhello_default)); | ||
| 101 | + sizeof_tlsext_serverhello_default); | ||
| 102 | goto err; | ||
| 103 | } | ||
| 104 | if (memcmp(data, tlsext_serverhello_default, dlen) != 0) { | ||
| 105 | FAIL("serverhello extensions differs:\n"); | ||
| 106 | compare_data(data, dlen, tlsext_serverhello_default, | ||
| 107 | - sizeof(tlsext_serverhello_default)); | ||
| 108 | + sizeof_tlsext_serverhello_default); | ||
| 109 | goto err; | ||
| 110 | } | ||
| 111 | |||
