summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2019-01-23 23:29:56 +0000
committertb <>2019-01-23 23:29:56 +0000
commit4a91b4654c78d359cb9e0cc479b358b673046f5d (patch)
tree00e8a6dabd3ac7eb9c0d1d00b72dadf795283d7c /src/lib
parent06e6b71d917b831ea28543a745e306fa001eaf62 (diff)
downloadopenbsd-4a91b4654c78d359cb9e0cc479b358b673046f5d.tar.gz
openbsd-4a91b4654c78d359cb9e0cc479b358b673046f5d.tar.bz2
openbsd-4a91b4654c78d359cb9e0cc479b358b673046f5d.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 'src/lib')
-rw-r--r--src/lib/libssl/tls13_handshake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c
index 5863b0363b..f9cb3e5b47 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.21 2019/01/23 11:11:52 tb Exp $ */ 1/* $OpenBSD: tls13_handshake.c,v 1.22 2019/01/23 23:29:56 tb 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>
@@ -246,14 +246,14 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = {
246 }, 246 },
247}; 247};
248 248
249#define NUM_HANDSHAKES (sizeof(handshakes) / sizeof(handshakes[0])) 249const size_t handshake_count = sizeof(handshakes) / sizeof(handshakes[0]);
250 250
251enum tls13_message_type 251enum tls13_message_type
252tls13_handshake_active_state(struct tls13_ctx *ctx) 252tls13_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;
255 255
256 if (hs.hs_type >= NUM_HANDSHAKES) 256 if (hs.hs_type >= handshake_count)
257 return INVALID; 257 return INVALID;
258 if (hs.message_number >= TLS13_NUM_MESSAGE_TYPES) 258 if (hs.message_number >= TLS13_NUM_MESSAGE_TYPES)
259 return INVALID; 259 return INVALID;