diff options
| author | inoguchi <> | 2020-05-02 00:31:54 +0000 |
|---|---|---|
| committer | inoguchi <> | 2020-05-02 00:31:54 +0000 |
| commit | 2e6d47dd230cf0a1dc61aea57faf78019cf22858 (patch) | |
| tree | e418df734e6b79498d074d98da875feb7930e02a /src/lib/libssl/tls13_handshake.c | |
| parent | 1813a9138ee882b675662d47ed9fe6974bd433f3 (diff) | |
| download | openbsd-2e6d47dd230cf0a1dc61aea57faf78019cf22858.tar.gz openbsd-2e6d47dd230cf0a1dc61aea57faf78019cf22858.tar.bz2 openbsd-2e6d47dd230cf0a1dc61aea57faf78019cf22858.zip | |
Add const to TLS1.3 internal vectors
ok tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/tls13_handshake.c | 24 |
1 files changed, 12 insertions, 12 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; |
