make ticket_flags param types consistent

When ticket_flags used as parameter, use unsigned int,
instead of uint8_t or mbedtls_ssl_tls13_ticket_flags.Also
remove the definition of mbedtls_ssl_tls13_ticket_flags.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
This commit is contained in:
Pengyu Lv 2023-01-16 11:23:24 +08:00
parent 3643fdbab9
commit acecf9c95b
4 changed files with 5 additions and 8 deletions

View file

@ -809,8 +809,6 @@ typedef struct mbedtls_ssl_flight_item mbedtls_ssl_flight_item;
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
typedef uint8_t mbedtls_ssl_tls13_ticket_flags;
#define MBEDTLS_SSL_TLS1_3_TICKET_ALLOW_PSK_RESUMPTION \
MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK /* 1U << 0 */
#define MBEDTLS_SSL_TLS1_3_TICKET_ALLOW_PSK_EPHEMERAL_RESUMPTION \

View file

@ -58,7 +58,7 @@ void mbedtls_ssl_print_extension(const mbedtls_ssl_context *ssl,
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
void mbedtls_debug_print_ticket_flags(const mbedtls_ssl_context *ssl,
int level, const char *file, int line,
mbedtls_ssl_tls13_ticket_flags flag);
unsigned int flag);
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 && MBEDTLS_SSL_SESSION_TICKETS */
#define MBEDTLS_SSL_PRINT_EXTS(level, hs_msg_type, extensions_mask) \

View file

@ -2721,20 +2721,20 @@ int mbedtls_ssl_session_set_hostname(mbedtls_ssl_session *session,
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
static inline unsigned int mbedtls_ssl_session_get_ticket_flags(
mbedtls_ssl_session *session, uint8_t flags)
mbedtls_ssl_session *session, unsigned int flags)
{
return session->ticket_flags &
(flags & MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
}
static inline void mbedtls_ssl_session_set_ticket_flags(
mbedtls_ssl_session *session, uint8_t flags)
mbedtls_ssl_session *session, unsigned int flags)
{
session->ticket_flags |= (flags & MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
}
static inline void mbedtls_ssl_session_clear_ticket_flags(
mbedtls_ssl_session *session, uint8_t flags)
mbedtls_ssl_session *session, unsigned int flags)
{
session->ticket_flags &= ~(flags & MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
}

View file

@ -747,8 +747,7 @@ static const char *ticket_flag_name_table[] =
void mbedtls_debug_print_ticket_flags(
const mbedtls_ssl_context *ssl, int level,
const char *file, int line,
mbedtls_ssl_tls13_ticket_flags flag)
const char *file, int line, unsigned int flag)
{
size_t i;