Rename get_handshake_transcript

- Remove tls13 prefix
- Remove TLS1_3 macro wrap

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2021-09-14 11:12:51 +08:00
parent c7875b5f11
commit 000f976070
3 changed files with 24 additions and 28 deletions

View File

@ -1539,13 +1539,6 @@ void mbedtls_ssl_tls13_add_hs_msg_to_checksum( mbedtls_ssl_context *ssl,
unsigned char const *msg,
size_t msg_len );
/* Get handshake transcript */
int mbedtls_ssl_tls13_get_handshake_transcript( mbedtls_ssl_context *ssl,
const mbedtls_md_type_t md,
unsigned char *dst,
size_t dst_len,
size_t *olen );
#if defined(MBEDTLS_ECDH_C)
/*
* TLS 1.3 version of mbedtls_ecdh_read_public in ecdh.h
@ -1577,4 +1570,11 @@ int mbedtls_ssl_tls13_write_sig_alg_ext( mbedtls_ssl_context *ssl,
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
/* Get handshake transcript */
int mbedtls_ssl_get_handshake_transcript( mbedtls_ssl_context *ssl,
const mbedtls_md_type_t md,
unsigned char *dst,
size_t dst_len,
size_t *olen );
#endif /* ssl_misc.h */

View File

@ -6978,10 +6978,8 @@ exit:
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
#if defined(MBEDTLS_SHA384_C)
static int ssl_tls13_get_handshake_transcript_sha384( mbedtls_ssl_context *ssl,
static int ssl_get_handshake_transcript_sha384( mbedtls_ssl_context *ssl,
unsigned char *dst,
size_t dst_len,
size_t *olen )
@ -7039,7 +7037,7 @@ exit:
#endif /* MBEDTLS_SHA384_C */
#if defined(MBEDTLS_SHA256_C)
static int ssl_tls13_get_handshake_transcript_sha256( mbedtls_ssl_context *ssl,
static int ssl_get_handshake_transcript_sha256( mbedtls_ssl_context *ssl,
unsigned char *dst,
size_t dst_len,
size_t *olen )
@ -7096,7 +7094,7 @@ exit:
}
#endif /* MBEDTLS_SHA256_C */
int mbedtls_ssl_tls13_get_handshake_transcript( mbedtls_ssl_context *ssl,
int mbedtls_ssl_get_handshake_transcript( mbedtls_ssl_context *ssl,
const mbedtls_md_type_t md,
unsigned char *dst,
size_t dst_len,
@ -7105,20 +7103,18 @@ int mbedtls_ssl_tls13_get_handshake_transcript( mbedtls_ssl_context *ssl,
#if defined(MBEDTLS_SHA384_C)
if( md == MBEDTLS_MD_SHA384 )
{
return( ssl_tls13_get_handshake_transcript_sha384( ssl, dst, dst_len, olen ) );
return( ssl_get_handshake_transcript_sha384( ssl, dst, dst_len, olen ) );
}
else
#endif /* MBEDTLS_SHA512_C */
#if defined(MBEDTLS_SHA256_C)
if( md == MBEDTLS_MD_SHA256 )
{
return( ssl_tls13_get_handshake_transcript_sha256( ssl, dst, dst_len, olen ) );
return( ssl_get_handshake_transcript_sha256( ssl, dst, dst_len, olen ) );
}
else
#endif /* MBEDTLS_SHA256_C */
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
}
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
#endif /* MBEDTLS_SSL_TLS_C */

View File

@ -875,14 +875,14 @@ int mbedtls_ssl_tls13_generate_handshake_keys( mbedtls_ssl_context *ssl,
md_info = mbedtls_md_info_from_type( md_type );
md_size = mbedtls_md_get_size( md_info );
ret = mbedtls_ssl_tls13_get_handshake_transcript( ssl, md_type,
ret = mbedtls_ssl_get_handshake_transcript( ssl, md_type,
transcript,
sizeof( transcript ),
&transcript_len );
if( ret != 0 )
{
MBEDTLS_SSL_DEBUG_RET( 1,
"mbedtls_ssl_tls13_get_handshake_transcript",
"mbedtls_ssl_get_handshake_transcript",
ret );
return( ret );
}