summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-03-08 16:59:26 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-03-08 16:59:26 +0000
commit93d693b3242821d66b5d24eee5945288147d34d4 (patch)
tree1fdb6633593068f10933e986251f3f492eb0813c
parent81004558110ad0364c75a8eff370e5492f705a9b (diff)
Some more c99 initializers for consistency and readability
-rw-r--r--regress/lib/libssl/handshake/handshake_table.c85
1 files changed, 62 insertions, 23 deletions
diff --git a/regress/lib/libssl/handshake/handshake_table.c b/regress/lib/libssl/handshake/handshake_table.c
index 5651c6deb74..b316734524b 100644
--- a/regress/lib/libssl/handshake/handshake_table.c
+++ b/regress/lib/libssl/handshake/handshake_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: handshake_table.c,v 1.16 2021/10/13 17:00:35 tb Exp $ */
+/* $OpenBSD: handshake_table.c,v 1.17 2022/03/08 16:59:25 tb Exp $ */
/*
* Copyright (c) 2019 Theo Buehler <tb@openbsd.org>
*
@@ -84,52 +84,91 @@ struct child {
uint8_t illegal;
};
-#define DEFAULT 0x00
-
static struct child stateinfo[][TLS13_NUM_MESSAGE_TYPES] = {
[CLIENT_HELLO] = {
- {SERVER_HELLO_RETRY_REQUEST, DEFAULT, 0, 0},
- {SERVER_HELLO, WITHOUT_HRR, 0, 0},
+ {
+ .mt = SERVER_HELLO_RETRY_REQUEST,
+ },
+ {
+ .mt = SERVER_HELLO,
+ .flag = WITHOUT_HRR,
+ },
},
[SERVER_HELLO_RETRY_REQUEST] = {
- {CLIENT_HELLO_RETRY, DEFAULT, 0, 0},
+ {
+ .mt = CLIENT_HELLO_RETRY,
+ },
},
[CLIENT_HELLO_RETRY] = {
- {SERVER_HELLO, DEFAULT, 0, 0},
+ {
+ .mt = SERVER_HELLO,
+ },
},
[SERVER_HELLO] = {
- {SERVER_ENCRYPTED_EXTENSIONS, DEFAULT, 0, 0},
+ {
+ .mt = SERVER_ENCRYPTED_EXTENSIONS,
+ },
},
[SERVER_ENCRYPTED_EXTENSIONS] = {
- {SERVER_CERTIFICATE_REQUEST, DEFAULT, 0, 0},
- {SERVER_CERTIFICATE, WITHOUT_CR, 0, 0},
- {SERVER_FINISHED, WITH_PSK, 0, 0},
+ {
+ .mt = SERVER_CERTIFICATE_REQUEST,
+ },
+ { .mt = SERVER_CERTIFICATE,
+ .flag = WITHOUT_CR,
+ },
+ {
+ .mt = SERVER_FINISHED,
+ .flag = WITH_PSK,
+ },
},
[SERVER_CERTIFICATE_REQUEST] = {
- {SERVER_CERTIFICATE, DEFAULT, 0, 0},
+ {
+ .mt = SERVER_CERTIFICATE,
+ },
},
[SERVER_CERTIFICATE] = {
- {SERVER_CERTIFICATE_VERIFY, DEFAULT, 0, 0},
+ {
+ .mt = SERVER_CERTIFICATE_VERIFY,
+ },
},
[SERVER_CERTIFICATE_VERIFY] = {
- {SERVER_FINISHED, DEFAULT, 0, 0},
+ {
+ .mt = SERVER_FINISHED,
+ },
},
[SERVER_FINISHED] = {
- {CLIENT_FINISHED, DEFAULT, WITHOUT_CR | WITH_PSK, 0},
- {CLIENT_CERTIFICATE, DEFAULT, 0, WITHOUT_CR | WITH_PSK},
+ {
+ .mt = CLIENT_FINISHED,
+ .forced = WITHOUT_CR | WITH_PSK,
+ },
+ {
+ .mt = CLIENT_CERTIFICATE,
+ .illegal = WITHOUT_CR | WITH_PSK,
+ },
},
[CLIENT_CERTIFICATE] = {
- {CLIENT_FINISHED, DEFAULT, 0, 0},
- {CLIENT_CERTIFICATE_VERIFY, WITH_CCV, 0, 0},
+ {
+ .mt = CLIENT_FINISHED,
+ },
+ {
+ .mt = CLIENT_CERTIFICATE_VERIFY,
+ .flag = WITH_CCV,
+ },
},
[CLIENT_CERTIFICATE_VERIFY] = {
- {CLIENT_FINISHED, DEFAULT, 0, 0},
+ {
+ .mt = CLIENT_FINISHED,
+ },
},
[CLIENT_FINISHED] = {
- {APPLICATION_DATA, DEFAULT, 0, 0},
+ {
+ .mt = APPLICATION_DATA,
+ },
},
[APPLICATION_DATA] = {
- {0, DEFAULT, 0, 0},
+ {
+ .mt = 0,
+ },
},
};
@@ -469,10 +508,10 @@ main(int argc, char *argv[])
},
};
struct child start = {
- CLIENT_HELLO, DEFAULT, 0, 0,
+ .mt = CLIENT_HELLO,
};
struct child end = {
- APPLICATION_DATA, DEFAULT, 0, 0,
+ .mt = APPLICATION_DATA,
};
struct child path[TLS13_NUM_MESSAGE_TYPES] = {{0}};
uint8_t flags = NEGOTIATED;