summaryrefslogtreecommitdiffstats
path: root/lib/libssl/tls13_handshake.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2019-01-23 23:29:56 +0000
committertb <tb@openbsd.org>2019-01-23 23:29:56 +0000
commit3d0342197c70eb08d231dc8b0f3e61a2dc11051c (patch)
treeeffb61b7f4cc968424aea7aa9c9961f171dd23f7 /lib/libssl/tls13_handshake.c
parentremove special casing for IFT_MPLSTUNNEL now mpw is IFT_ETHER. (diff)
downloadwireguard-openbsd-3d0342197c70eb08d231dc8b0f3e61a2dc11051c.tar.xz
wireguard-openbsd-3d0342197c70eb08d231dc8b0f3e61a2dc11051c.zip
Rename NUM_HANDSHAKE to handshake_count and make it a variable
so it can be used from regress. Update regress accordingly. Make sure the print target generates the entire table as it currently is in tls13_handshake.c discussed with beck and jsing ok jsing
Diffstat (limited to 'lib/libssl/tls13_handshake.c')
-rw-r--r--lib/libssl/tls13_handshake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libssl/tls13_handshake.c b/lib/libssl/tls13_handshake.c
index 5863b0363be..f9cb3e5b476 100644
--- a/lib/libssl/tls13_handshake.c
+++ b/lib/libssl/tls13_handshake.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_handshake.c,v 1.21 2019/01/23 11:11:52 tb Exp $ */
+/* $OpenBSD: tls13_handshake.c,v 1.22 2019/01/23 23:29:56 tb Exp $ */
/*
* Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
@@ -246,14 +246,14 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = {
},
};
-#define NUM_HANDSHAKES (sizeof(handshakes) / sizeof(handshakes[0]))
+const size_t handshake_count = sizeof(handshakes) / sizeof(handshakes[0]);
enum tls13_message_type
tls13_handshake_active_state(struct tls13_ctx *ctx)
{
struct tls13_handshake_stage hs = ctx->handshake_stage;
- if (hs.hs_type >= NUM_HANDSHAKES)
+ if (hs.hs_type >= handshake_count)
return INVALID;
if (hs.message_number >= TLS13_NUM_MESSAGE_TYPES)
return INVALID;