summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-10-21 14:55:54 +0000
committertb <>2022-10-21 14:55:54 +0000
commit4ece02810b9d1c118bdc7380f81968ee116f472e (patch)
treeb7dbae4be438038ffb34318119d8e355fc85b04a /src
parent4b5677c34b2bc1d878be9cdbdb02565a7bccb5b6 (diff)
downloadopenbsd-4ece02810b9d1c118bdc7380f81968ee116f472e.tar.gz
openbsd-4ece02810b9d1c118bdc7380f81968ee116f472e.tar.bz2
openbsd-4ece02810b9d1c118bdc7380f81968ee116f472e.zip
quic tlsext tests: use byte vector in place of string
While this doesn't actually change anything, it should appease Coverity. CID 358678 CID 358679
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/tlsext/tlsexttest.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c
index 331d554c0e..e5e3750aed 100644
--- a/src/regress/lib/libssl/tlsext/tlsexttest.c
+++ b/src/regress/lib/libssl/tlsext/tlsexttest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tlsexttest.c,v 1.76 2022/10/02 16:38:23 jsing Exp $ */ 1/* $OpenBSD: tlsexttest.c,v 1.77 2022/10/21 14:55:54 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -2028,9 +2028,7 @@ test_tlsext_sni_server(void)
2028 * QUIC transport parameters extension - RFC 90210 :) 2028 * QUIC transport parameters extension - RFC 90210 :)
2029 */ 2029 */
2030 2030
2031#define TEST_QUIC_TRANSPORT_DATA "0123456789abcdef" 2031static const unsigned char tlsext_quic_transport_data[] = {
2032
2033static unsigned char tlsext_quic_transport_data[] = {
2034 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 2032 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2035 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 2033 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
2036}; 2034};
@@ -2072,7 +2070,7 @@ test_tlsext_quic_transport_parameters_client(void)
2072 } 2070 }
2073 2071
2074 if (!SSL_set_quic_transport_params(ssl, 2072 if (!SSL_set_quic_transport_params(ssl,
2075 TEST_QUIC_TRANSPORT_DATA, strlen(TEST_QUIC_TRANSPORT_DATA))) { 2073 tlsext_quic_transport_data, sizeof(tlsext_quic_transport_data))) {
2076 FAIL("client failed to set QUIC parametes\n"); 2074 FAIL("client failed to set QUIC parametes\n");
2077 goto err; 2075 goto err;
2078 } 2076 }
@@ -2138,14 +2136,14 @@ test_tlsext_quic_transport_parameters_client(void)
2138 2136
2139 SSL_get_peer_quic_transport_params(ssl, &out_bytes, &out_bytes_len); 2137 SSL_get_peer_quic_transport_params(ssl, &out_bytes, &out_bytes_len);
2140 2138
2141 if (out_bytes_len != strlen(TEST_QUIC_TRANSPORT_DATA)) { 2139 if (out_bytes_len != sizeof(tlsext_quic_transport_data)) {
2142 FAIL("server_parse QUIC length differs, got %zu want %zu\n", 2140 FAIL("server_parse QUIC length differs, got %zu want %zu\n",
2143 out_bytes_len, 2141 out_bytes_len,
2144 sizeof(tlsext_quic_transport_data)); 2142 sizeof(tlsext_quic_transport_data));
2145 goto err; 2143 goto err;
2146 } 2144 }
2147 2145
2148 if (memcmp(out_bytes, TEST_QUIC_TRANSPORT_DATA, 2146 if (memcmp(out_bytes, tlsext_quic_transport_data,
2149 out_bytes_len) != 0) { 2147 out_bytes_len) != 0) {
2150 FAIL("server_parse QUIC differs from sent:\n"); 2148 FAIL("server_parse QUIC differs from sent:\n");
2151 fprintf(stderr, "received:\n"); 2149 fprintf(stderr, "received:\n");
@@ -2204,7 +2202,7 @@ test_tlsext_quic_transport_parameters_server(void)
2204 } 2202 }
2205 2203
2206 if (!SSL_set_quic_transport_params(ssl, 2204 if (!SSL_set_quic_transport_params(ssl,
2207 TEST_QUIC_TRANSPORT_DATA, strlen(TEST_QUIC_TRANSPORT_DATA))) { 2205 tlsext_quic_transport_data, sizeof(tlsext_quic_transport_data))) {
2208 FAIL("server failed to set QUIC parametes\n"); 2206 FAIL("server failed to set QUIC parametes\n");
2209 goto err; 2207 goto err;
2210 } 2208 }
@@ -2268,14 +2266,14 @@ test_tlsext_quic_transport_parameters_server(void)
2268 2266
2269 SSL_get_peer_quic_transport_params(ssl, &out_bytes, &out_bytes_len); 2267 SSL_get_peer_quic_transport_params(ssl, &out_bytes, &out_bytes_len);
2270 2268
2271 if (out_bytes_len != strlen(TEST_QUIC_TRANSPORT_DATA)) { 2269 if (out_bytes_len != sizeof(tlsext_quic_transport_data)) {
2272 FAIL("client QUIC length differs, got %zu want %zu\n", 2270 FAIL("client QUIC length differs, got %zu want %zu\n",
2273 out_bytes_len, 2271 out_bytes_len,
2274 sizeof(tlsext_quic_transport_data)); 2272 sizeof(tlsext_quic_transport_data));
2275 goto err; 2273 goto err;
2276 } 2274 }
2277 2275
2278 if (memcmp(out_bytes, TEST_QUIC_TRANSPORT_DATA, out_bytes_len) != 0) { 2276 if (memcmp(out_bytes, tlsext_quic_transport_data, out_bytes_len) != 0) {
2279 FAIL("client QUIC differs from sent:\n"); 2277 FAIL("client QUIC differs from sent:\n");
2280 fprintf(stderr, "received:\n"); 2278 fprintf(stderr, "received:\n");
2281 hexdump(data, dlen); 2279 hexdump(data, dlen);