remove duplicate defines, add comment

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21441)
This commit is contained in:
Pauli 2023-06-26 19:30:51 +10:00
parent 7b2a3a1e9d
commit 157c40e4d0

View File

@ -18,17 +18,22 @@
# ifndef OPENSSL_NO_QUIC
/* QUIC encryption levels. */
# define QUIC_ENC_LEVEL_INITIAL 0
# define QUIC_ENC_LEVEL_HANDSHAKE 1
# define QUIC_ENC_LEVEL_0RTT 2
# define QUIC_ENC_LEVEL_1RTT 3
# define QUIC_ENC_LEVEL_NUM 4
enum {
QUIC_ENC_LEVEL_INITIAL = 0,
QUIC_ENC_LEVEL_HANDSHAKE,
QUIC_ENC_LEVEL_0RTT,
QUIC_ENC_LEVEL_1RTT,
QUIC_ENC_LEVEL_NUM /* Must be the ultimate entry */
};
/* QUIC packet number spaces. */
# define QUIC_PN_SPACE_INITIAL 0
# define QUIC_PN_SPACE_HANDSHAKE 1
# define QUIC_PN_SPACE_APP 2
# define QUIC_PN_SPACE_NUM 3
enum {
QUIC_PN_SPACE_INITIAL = 0,
QUIC_PN_SPACE_HANDSHAKE,
/* New entries must go here, so that QUIC_PN_SPACE_APP is the penultimate */
QUIC_PN_SPACE_APP,
QUIC_PN_SPACE_NUM /* Must be the ultimate entry */
};
static ossl_unused ossl_inline uint32_t
ossl_quic_enc_level_to_pn_space(uint32_t enc_level)
@ -47,12 +52,6 @@ ossl_quic_enc_level_to_pn_space(uint32_t enc_level)
}
}
/* QUIC packet number spaces. */
# define QUIC_PN_SPACE_INITIAL 0
# define QUIC_PN_SPACE_HANDSHAKE 1
# define QUIC_PN_SPACE_APP 2
# define QUIC_PN_SPACE_NUM 3
/* QUIC packet number representation. */
typedef uint64_t QUIC_PN;
# define QUIC_PN_INVALID UINT64_MAX