summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2021-06-27 16:33:30 +0000
committerjsing <>2021-06-27 16:33:30 +0000
commitbd8d8d2fe089759c219c706fe9bed068791f93e6 (patch)
tree25a09dc44bd1cc94186e323f6985f9103c05b1b6 /src
parent901aaafd1fa76eb80960da9b8a413b56edb6ad6d (diff)
downloadopenbsd-bd8d8d2fe089759c219c706fe9bed068791f93e6.tar.gz
openbsd-bd8d8d2fe089759c219c706fe9bed068791f93e6.tar.bz2
openbsd-bd8d8d2fe089759c219c706fe9bed068791f93e6.zip
Tweak some data types and sprinkle some const.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/client/clienttest.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/regress/lib/libssl/client/clienttest.c b/src/regress/lib/libssl/client/clienttest.c
index a58019a2b6..17c678b1cc 100644
--- a/src/regress/lib/libssl/client/clienttest.c
+++ b/src/regress/lib/libssl/client/clienttest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clienttest.c,v 1.28 2021/02/08 17:21:50 jsing Exp $ */ 1/* $OpenBSD: clienttest.c,v 1.29 2021/06/27 16:33:30 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -32,7 +32,7 @@
32#define SSL3_RANDOM_OFFSET (SSL3_HM_OFFSET + 2) 32#define SSL3_RANDOM_OFFSET (SSL3_HM_OFFSET + 2)
33#define SSL3_CIPHER_OFFSET (SSL3_HM_OFFSET + 37) 33#define SSL3_CIPHER_OFFSET (SSL3_HM_OFFSET + 37)
34 34
35static unsigned char cipher_list_dtls1[] = { 35static const uint8_t cipher_list_dtls1[] = {
36 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 36 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85,
37 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 37 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84,
38 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 38 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45,
@@ -40,7 +40,7 @@ static unsigned char cipher_list_dtls1[] = {
40 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, 40 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff,
41}; 41};
42 42
43static unsigned char client_hello_dtls1[] = { 43static const uint8_t client_hello_dtls1[] = {
44 0x16, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 44 0x16, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
45 0x00, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 45 0x00, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00,
46 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -60,7 +60,7 @@ static unsigned char client_hello_dtls1[] = {
60 0x00, 60 0x00,
61}; 61};
62 62
63static unsigned char cipher_list_tls10[] = { 63static const uint8_t cipher_list_tls10[] = {
64 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 64 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85,
65 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 65 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84,
66 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 66 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45,
@@ -69,7 +69,7 @@ static unsigned char cipher_list_tls10[] = {
69 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, 69 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff,
70}; 70};
71 71
72static unsigned char client_hello_tls10[] = { 72static const uint8_t client_hello_tls10[] = {
73 0x16, 0x03, 0x01, 0x00, 0x73, 0x01, 0x00, 0x00, 73 0x16, 0x03, 0x01, 0x00, 0x73, 0x01, 0x00, 0x00,
74 0x6f, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 74 0x6f, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
75 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -87,7 +87,7 @@ static unsigned char client_hello_tls10[] = {
87 0x00, 0x18, 0x00, 0x19, 0x00, 0x23, 0x00, 0x00, 87 0x00, 0x18, 0x00, 0x19, 0x00, 0x23, 0x00, 0x00,
88}; 88};
89 89
90static unsigned char cipher_list_tls11[] = { 90static const uint8_t cipher_list_tls11[] = {
91 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 91 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85,
92 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 92 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84,
93 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 93 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45,
@@ -96,7 +96,7 @@ static unsigned char cipher_list_tls11[] = {
96 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, 96 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff,
97}; 97};
98 98
99static unsigned char client_hello_tls11[] = { 99static const uint8_t client_hello_tls11[] = {
100 0x16, 0x03, 0x01, 0x00, 0x73, 0x01, 0x00, 0x00, 100 0x16, 0x03, 0x01, 0x00, 0x73, 0x01, 0x00, 0x00,
101 0x6f, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 101 0x6f, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -114,7 +114,7 @@ static unsigned char client_hello_tls11[] = {
114 0x00, 0x18, 0x00, 0x19, 0x00, 0x23, 0x00, 0x00, 114 0x00, 0x18, 0x00, 0x19, 0x00, 0x23, 0x00, 0x00,
115}; 115};
116 116
117static unsigned char cipher_list_tls12_aes[] = { 117static const uint8_t cipher_list_tls12_aes[] = {
118 0xc0, 0x30, 0xc0, 0x2c, 0xc0, 0x28, 0xc0, 0x24, 118 0xc0, 0x30, 0xc0, 0x2c, 0xc0, 0x28, 0xc0, 0x24,
119 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x9f, 0x00, 0x6b, 119 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x9f, 0x00, 0x6b,
120 0x00, 0x39, 0xcc, 0xa9, 0xcc, 0xa8, 0xcc, 0xaa, 120 0x00, 0x39, 0xcc, 0xa9, 0xcc, 0xa8, 0xcc, 0xaa,
@@ -129,7 +129,7 @@ static unsigned char cipher_list_tls12_aes[] = {
129 0x00, 0x0a, 0x00, 0xff, 129 0x00, 0x0a, 0x00, 0xff,
130}; 130};
131 131
132static unsigned char cipher_list_tls12_chacha[] = { 132static const uint8_t cipher_list_tls12_chacha[] = {
133 0xcc, 0xa9, 0xcc, 0xa8, 0xcc, 0xaa, 0xc0, 0x30, 133 0xcc, 0xa9, 0xcc, 0xa8, 0xcc, 0xaa, 0xc0, 0x30,
134 0xc0, 0x2c, 0xc0, 0x28, 0xc0, 0x24, 0xc0, 0x14, 134 0xc0, 0x2c, 0xc0, 0x28, 0xc0, 0x24, 0xc0, 0x14,
135 0xc0, 0x0a, 0x00, 0x9f, 0x00, 0x6b, 0x00, 0x39, 135 0xc0, 0x0a, 0x00, 0x9f, 0x00, 0x6b, 0x00, 0x39,
@@ -144,7 +144,7 @@ static unsigned char cipher_list_tls12_chacha[] = {
144 0x00, 0x0a, 0x00, 0xff, 144 0x00, 0x0a, 0x00, 0xff,
145}; 145};
146 146
147static unsigned char client_hello_tls12[] = { 147static const uint8_t client_hello_tls12[] = {
148 0x16, 0x03, 0x01, 0x00, 0xbd, 0x01, 0x00, 0x00, 148 0x16, 0x03, 0x01, 0x00, 0xbd, 0x01, 0x00, 0x00,
149 0xb9, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 149 0xb9, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -173,14 +173,14 @@ static unsigned char client_hello_tls12[] = {
173}; 173};
174 174
175struct client_hello_test { 175struct client_hello_test {
176 const unsigned char *desc; 176 const uint8_t *desc;
177 const int protocol; 177 const int protocol;
178 const size_t random_start; 178 const size_t random_start;
179 const SSL_METHOD *(*ssl_method)(void); 179 const SSL_METHOD *(*ssl_method)(void);
180 const long ssl_options; 180 const long ssl_options;
181}; 181};
182 182
183static struct client_hello_test client_hello_tests[] = { 183static const struct client_hello_test client_hello_tests[] = {
184 { 184 {
185 .desc = "DTLSv1 client", 185 .desc = "DTLSv1 client",
186 .protocol = DTLS1_VERSION, 186 .protocol = DTLS1_VERSION,
@@ -289,7 +289,7 @@ static struct client_hello_test client_hello_tests[] = {
289 (sizeof(client_hello_tests) / sizeof(*client_hello_tests)) 289 (sizeof(client_hello_tests) / sizeof(*client_hello_tests))
290 290
291static void 291static void
292hexdump(const unsigned char *buf, size_t len) 292hexdump(const uint8_t *buf, size_t len)
293{ 293{
294 size_t i; 294 size_t i;
295 295
@@ -313,7 +313,7 @@ static int
313make_client_hello(int protocol, char **out, size_t *outlen) 313make_client_hello(int protocol, char **out, size_t *outlen)
314{ 314{
315 size_t client_hello_len, cipher_list_len, cipher_list_offset; 315 size_t client_hello_len, cipher_list_len, cipher_list_offset;
316 const char *client_hello, *cipher_list; 316 const uint8_t *client_hello, *cipher_list;
317 char *p; 317 char *p;
318 318
319 *out = NULL; 319 *out = NULL;
@@ -372,7 +372,7 @@ make_client_hello(int protocol, char **out, size_t *outlen)
372} 372}
373 373
374static int 374static int
375client_hello_test(int testno, struct client_hello_test *cht) 375client_hello_test(int testno, const struct client_hello_test *cht)
376{ 376{
377 BIO *rbio = NULL, *wbio = NULL; 377 BIO *rbio = NULL, *wbio = NULL;
378 SSL_CTX *ssl_ctx = NULL; 378 SSL_CTX *ssl_ctx = NULL;