diff options
author | inoguchi <> | 2020-05-02 00:31:54 +0000 |
---|---|---|
committer | inoguchi <> | 2020-05-02 00:31:54 +0000 |
commit | 1d3c89be75bbddb0d38a97088d71b1bb685bacad (patch) | |
tree | e418df734e6b79498d074d98da875feb7930e02a | |
parent | 829a3b5141fe5548704743974f88860479a8ed2b (diff) | |
download | openbsd-1d3c89be75bbddb0d38a97088d71b1bb685bacad.tar.gz openbsd-1d3c89be75bbddb0d38a97088d71b1bb685bacad.tar.bz2 openbsd-1d3c89be75bbddb0d38a97088d71b1bb685bacad.zip |
Add const to TLS1.3 internal vectors
ok tb@
-rw-r--r-- | src/lib/libssl/tls13_handshake.c | 24 | ||||
-rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c index 0d3e64dee8..d324a7f4ba 100644 --- a/src/lib/libssl/tls13_handshake.c +++ b/src/lib/libssl/tls13_handshake.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_handshake.c,v 1.54 2020/04/29 01:16:49 inoguchi Exp $ */ | 1 | /* $OpenBSD: tls13_handshake.c,v 1.55 2020/05/02 00:30:55 inoguchi Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> |
4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> |
@@ -36,19 +36,19 @@ struct tls13_handshake_action { | |||
36 | int (*recv)(struct tls13_ctx *ctx, CBS *cbs); | 36 | int (*recv)(struct tls13_ctx *ctx, CBS *cbs); |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static enum tls13_message_type | 39 | static const enum tls13_message_type |
40 | tls13_handshake_active_state(struct tls13_ctx *ctx); | 40 | tls13_handshake_active_state(struct tls13_ctx *ctx); |
41 | 41 | ||
42 | static struct tls13_handshake_action * | 42 | static const struct tls13_handshake_action * |
43 | tls13_handshake_active_action(struct tls13_ctx *ctx); | 43 | tls13_handshake_active_action(struct tls13_ctx *ctx); |
44 | static int tls13_handshake_advance_state_machine(struct tls13_ctx *ctx); | 44 | static int tls13_handshake_advance_state_machine(struct tls13_ctx *ctx); |
45 | 45 | ||
46 | static int tls13_handshake_send_action(struct tls13_ctx *ctx, | 46 | static int tls13_handshake_send_action(struct tls13_ctx *ctx, |
47 | struct tls13_handshake_action *action); | 47 | const struct tls13_handshake_action *action); |
48 | static int tls13_handshake_recv_action(struct tls13_ctx *ctx, | 48 | static int tls13_handshake_recv_action(struct tls13_ctx *ctx, |
49 | struct tls13_handshake_action *action); | 49 | const struct tls13_handshake_action *action); |
50 | 50 | ||
51 | struct tls13_handshake_action state_machine[] = { | 51 | static const struct tls13_handshake_action state_machine[] = { |
52 | [CLIENT_HELLO] = { | 52 | [CLIENT_HELLO] = { |
53 | .handshake_type = TLS13_MT_CLIENT_HELLO, | 53 | .handshake_type = TLS13_MT_CLIENT_HELLO, |
54 | .sender = TLS13_HS_CLIENT, | 54 | .sender = TLS13_HS_CLIENT, |
@@ -143,7 +143,7 @@ struct tls13_handshake_action state_machine[] = { | |||
143 | }, | 143 | }, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | 146 | const enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { |
147 | [INITIAL] = { | 147 | [INITIAL] = { |
148 | CLIENT_HELLO, | 148 | CLIENT_HELLO, |
149 | SERVER_HELLO_RETRY_REQUEST, | 149 | SERVER_HELLO_RETRY_REQUEST, |
@@ -248,7 +248,7 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | |||
248 | 248 | ||
249 | const size_t handshake_count = sizeof(handshakes) / sizeof(handshakes[0]); | 249 | const size_t handshake_count = sizeof(handshakes) / sizeof(handshakes[0]); |
250 | 250 | ||
251 | static enum tls13_message_type | 251 | static const enum tls13_message_type |
252 | tls13_handshake_active_state(struct tls13_ctx *ctx) | 252 | tls13_handshake_active_state(struct tls13_ctx *ctx) |
253 | { | 253 | { |
254 | struct tls13_handshake_stage hs = ctx->handshake_stage; | 254 | struct tls13_handshake_stage hs = ctx->handshake_stage; |
@@ -261,7 +261,7 @@ tls13_handshake_active_state(struct tls13_ctx *ctx) | |||
261 | return handshakes[hs.hs_type][hs.message_number]; | 261 | return handshakes[hs.hs_type][hs.message_number]; |
262 | } | 262 | } |
263 | 263 | ||
264 | static struct tls13_handshake_action * | 264 | static const struct tls13_handshake_action * |
265 | tls13_handshake_active_action(struct tls13_ctx *ctx) | 265 | tls13_handshake_active_action(struct tls13_ctx *ctx) |
266 | { | 266 | { |
267 | enum tls13_message_type mt = tls13_handshake_active_state(ctx); | 267 | enum tls13_message_type mt = tls13_handshake_active_state(ctx); |
@@ -293,7 +293,7 @@ tls13_handshake_msg_record(struct tls13_ctx *ctx) | |||
293 | int | 293 | int |
294 | tls13_handshake_perform(struct tls13_ctx *ctx) | 294 | tls13_handshake_perform(struct tls13_ctx *ctx) |
295 | { | 295 | { |
296 | struct tls13_handshake_action *action; | 296 | const struct tls13_handshake_action *action; |
297 | int ret; | 297 | int ret; |
298 | 298 | ||
299 | for (;;) { | 299 | for (;;) { |
@@ -324,7 +324,7 @@ tls13_handshake_perform(struct tls13_ctx *ctx) | |||
324 | 324 | ||
325 | static int | 325 | static int |
326 | tls13_handshake_send_action(struct tls13_ctx *ctx, | 326 | tls13_handshake_send_action(struct tls13_ctx *ctx, |
327 | struct tls13_handshake_action *action) | 327 | const struct tls13_handshake_action *action) |
328 | { | 328 | { |
329 | ssize_t ret; | 329 | ssize_t ret; |
330 | CBB cbb; | 330 | CBB cbb; |
@@ -372,7 +372,7 @@ tls13_handshake_send_action(struct tls13_ctx *ctx, | |||
372 | 372 | ||
373 | static int | 373 | static int |
374 | tls13_handshake_recv_action(struct tls13_ctx *ctx, | 374 | tls13_handshake_recv_action(struct tls13_ctx *ctx, |
375 | struct tls13_handshake_action *action) | 375 | const struct tls13_handshake_action *action) |
376 | { | 376 | { |
377 | uint8_t msg_type; | 377 | uint8_t msg_type; |
378 | ssize_t ret; | 378 | ssize_t ret; |
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c index dac8fe088d..0bf1d19d91 100644 --- a/src/lib/libssl/tls13_record_layer.c +++ b/src/lib/libssl/tls13_record_layer.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_record_layer.c,v 1.31 2020/04/29 01:22:28 inoguchi Exp $ */ | 1 | /* $OpenBSD: tls13_record_layer.c,v 1.32 2020/05/02 00:31:54 inoguchi Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -166,7 +166,7 @@ tls13_record_layer_rbuf(struct tls13_record_layer *rl, CBS *cbs) | |||
166 | CBS_dup(&rl->rbuf_cbs, cbs); | 166 | CBS_dup(&rl->rbuf_cbs, cbs); |
167 | } | 167 | } |
168 | 168 | ||
169 | uint8_t tls13_max_seq_num[TLS13_RECORD_SEQ_NUM_LEN] = { | 169 | static const uint8_t tls13_max_seq_num[TLS13_RECORD_SEQ_NUM_LEN] = { |
170 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | 170 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
171 | }; | 171 | }; |
172 | 172 | ||