Change cookie parameters for dtls and tls 1.3
Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c
index 91791b8..c52c6c2 100644
--- a/library/ssl_tls13_client.c
+++ b/library/ssl_tls13_client.c
@@ -671,10 +671,10 @@
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, cookie_len );
MBEDTLS_SSL_DEBUG_BUF( 3, "cookie extension", p, cookie_len );
- mbedtls_free( handshake->verify_cookie );
+ mbedtls_free( handshake->cookie );
handshake->hrr_cookie_len = 0;
- handshake->verify_cookie = mbedtls_calloc( 1, cookie_len );
- if( handshake->verify_cookie == NULL )
+ handshake->cookie = mbedtls_calloc( 1, cookie_len );
+ if( handshake->cookie == NULL )
{
MBEDTLS_SSL_DEBUG_MSG( 1,
( "alloc failed ( %ud bytes )",
@@ -682,7 +682,7 @@
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
}
- memcpy( handshake->verify_cookie, p, cookie_len );
+ memcpy( handshake->cookie, p, cookie_len );
handshake->hrr_cookie_len = cookie_len;
return( 0 );
@@ -697,14 +697,14 @@
*out_len = 0;
- if( ssl->handshake->verify_cookie == NULL )
+ if( ssl->handshake->cookie == NULL )
{
MBEDTLS_SSL_DEBUG_MSG( 3, ( "no cookie to send; skip extension" ) );
return( 0 );
}
MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, cookie",
- ssl->handshake->verify_cookie,
+ ssl->handshake->cookie,
ssl->handshake->hrr_cookie_len );
MBEDTLS_SSL_CHK_BUF_PTR( p, end, ssl->handshake->hrr_cookie_len + 6 );
@@ -717,7 +717,7 @@
p += 6;
/* Cookie */
- memcpy( p, ssl->handshake->verify_cookie, ssl->handshake->hrr_cookie_len );
+ memcpy( p, ssl->handshake->cookie, ssl->handshake->hrr_cookie_len );
*out_len = ssl->handshake->hrr_cookie_len + 6;