mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Introduce TLS 1.3 labels in a single place
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
@ -20,25 +20,31 @@
|
||||
#define MBEDTLS_SSL_TLS1_3_KEYS_H
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
|
||||
#define MBEDTLS_SSL_TLS1_3_LABEL_LIST \
|
||||
const unsigned char finished [ sizeof("finished") - 1 ]; \
|
||||
const unsigned char resumption [ sizeof("resumption") - 1 ]; \
|
||||
const unsigned char traffic_upd [ sizeof("traffic upd") - 1 ]; \
|
||||
const unsigned char export [ sizeof("exporter") - 1 ]; \
|
||||
const unsigned char key [ sizeof("key") - 1 ]; \
|
||||
const unsigned char iv [ sizeof("iv") - 1 ]; \
|
||||
const unsigned char sn [ sizeof("sn") - 1 ]; \
|
||||
const unsigned char c_hs_traffic[ sizeof("c hs traffic") - 1 ]; \
|
||||
const unsigned char c_ap_traffic[ sizeof("c ap traffic") - 1 ]; \
|
||||
const unsigned char c_e_traffic [ sizeof("c e traffic") - 1 ]; \
|
||||
const unsigned char s_hs_traffic[ sizeof("s hs traffic") - 1 ]; \
|
||||
const unsigned char s_ap_traffic[ sizeof("s ap traffic") - 1 ]; \
|
||||
const unsigned char s_e_traffic [ sizeof("s e traffic") - 1 ]; \
|
||||
const unsigned char exp_master [ sizeof("exp master") - 1 ]; \
|
||||
const unsigned char res_master [ sizeof("res master") - 1 ]; \
|
||||
const unsigned char ext_binder [ sizeof("ext binder") - 1 ]; \
|
||||
const unsigned char res_binder [ sizeof("res binder") - 1 ]; \
|
||||
const unsigned char derived [ sizeof("derived") - 1 ]; \
|
||||
|
||||
/* This requires LABEL( name, string ) to be defined at the point of use.
|
||||
* See e.g. the definition of mbedtls_ssl_tls1_3_labels_union below. */
|
||||
#define MBEDTLS_SSL_TLS1_3_LABEL_LIST \
|
||||
LABEL( finished , "finished" ) \
|
||||
LABEL( resumption , "resumption" ) \
|
||||
LABEL( traffic_upd , "traffic upd" ) \
|
||||
LABEL( export , "exporter" ) \
|
||||
LABEL( key , "key" ) \
|
||||
LABEL( iv , "iv" ) \
|
||||
LABEL( sn , "sn" ) \
|
||||
LABEL( c_hs_traffic, "c hs traffic" ) \
|
||||
LABEL( c_ap_traffic, "c ap traffic" ) \
|
||||
LABEL( c_e_traffic , "c e traffic" ) \
|
||||
LABEL( s_hs_traffic, "s hs traffic" ) \
|
||||
LABEL( s_ap_traffic, "s ap traffic" ) \
|
||||
LABEL( s_e_traffic , "s e traffic" ) \
|
||||
LABEL( exp_master , "exp master" ) \
|
||||
LABEL( res_master , "res master" ) \
|
||||
LABEL( ext_binder , "ext binder" ) \
|
||||
LABEL( res_binder , "res binder" ) \
|
||||
LABEL( derived , "derived" )
|
||||
|
||||
#define LABEL( name, string ) \
|
||||
const unsigned char name [ sizeof(string) - 1 ];
|
||||
|
||||
union mbedtls_ssl_tls1_3_labels_union
|
||||
{
|
||||
@ -48,6 +54,8 @@ struct mbedtls_ssl_tls1_3_labels_struct
|
||||
{
|
||||
MBEDTLS_SSL_TLS1_3_LABEL_LIST
|
||||
};
|
||||
#undef LABEL
|
||||
|
||||
extern const struct mbedtls_ssl_tls1_3_labels_struct mbedtls_ssl_tls1_3_labels;
|
||||
|
||||
#define MBEDTLS_SSL_TLS1_3_LBL_WITH_LEN( LABEL ) \
|
||||
|
Reference in New Issue
Block a user