fix naming issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c
index 6280f72..4d8302b 100644
--- a/library/ssl_tls13_server.c
+++ b/library/ssl_tls13_server.c
@@ -205,9 +205,9 @@
* } PreSharedKeyExtension;
*/
MBEDTLS_CHECK_RETURN_CRITICAL
-static int ssl_tls13_parse_offered_psks_ext( mbedtls_ssl_context *ssl,
- const unsigned char *buf,
- const unsigned char *end )
+static int ssl_tls13_parse_pre_shared_key_ext( mbedtls_ssl_context *ssl,
+ const unsigned char *buf,
+ const unsigned char *end )
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
const unsigned char *p = buf;
@@ -238,6 +238,7 @@
{
uint16_t identity_len;
const unsigned char *identity;
+
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, identities_end, 2 );
identity_len = MBEDTLS_GET_UINT16_BE( p, 0 );
p += 2;
@@ -375,10 +376,10 @@
* }
* } PreSharedKeyExtension;
*/
-static int ssl_tls13_write_selected_identity_ext( mbedtls_ssl_context *ssl,
- unsigned char *buf,
- unsigned char *end,
- size_t *olen )
+static int ssl_tls13_write_server_pre_shared_key_ext( mbedtls_ssl_context *ssl,
+ unsigned char *buf,
+ unsigned char *end,
+ size_t *olen )
{
unsigned char *p = (unsigned char*)buf;
size_t selected_identity;
@@ -1223,12 +1224,12 @@
{
ssl->handshake->update_checksum( ssl, buf,
pre_shared_key_ext_start - buf );
- ret = ssl_tls13_parse_offered_psks_ext( ssl,
- pre_shared_key_ext_start,
- pre_shared_key_ext_end );
+ ret = ssl_tls13_parse_pre_shared_key_ext( ssl,
+ pre_shared_key_ext_start,
+ pre_shared_key_ext_end );
if( ret != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, ( "ssl_tls13_parse_offered_psks_ext" ),
+ MBEDTLS_SSL_DEBUG_RET( 1, ( "ssl_tls13_parse_pre_shared_key_ext" ),
ret );
return( ret );
}
@@ -1705,10 +1706,10 @@
mbedtls_ssl_tls13_some_psk_enabled( ssl ) ) );
if( mbedtls_ssl_tls13_some_psk_enabled( ssl ) )
{
- ret = ssl_tls13_write_selected_identity_ext( ssl, p, end, &output_len );
+ ret = ssl_tls13_write_server_pre_shared_key_ext( ssl, p, end, &output_len );
if( ret != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "ssl_tls13_write_selected_identity_ext",
+ MBEDTLS_SSL_DEBUG_RET( 1, "ssl_tls13_write_server_pre_shared_key_ext",
ret );
return( ret );
}