mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-26 03:35:35 +00:00
add session serialization load buf
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
534ff400d4
commit
6e8fec2908
@ -3273,27 +3273,51 @@ ssl_serialize_session_save_buf_size:1023:"data_files/server5.crt"
|
||||
|
||||
Session serialization, load buffer size: no ticket, no cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2
|
||||
ssl_serialize_session_load_buf_size:0:""
|
||||
ssl_serialize_session_load_buf_size:0:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
Session serialization, load buffer size: small ticket, no cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||
ssl_serialize_session_load_buf_size:42:""
|
||||
ssl_serialize_session_load_buf_size:42:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
Session serialization, load buffer size: large ticket, no cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||
ssl_serialize_session_load_buf_size:1023:""
|
||||
ssl_serialize_session_load_buf_size:1023:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
Session serialization, load buffer size: no ticket, cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||
ssl_serialize_session_load_buf_size:0:"data_files/server5.crt"
|
||||
ssl_serialize_session_load_buf_size:0:"data_files/server5.crt":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
Session serialization, load buffer size: small ticket, cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||
ssl_serialize_session_load_buf_size:42:"data_files/server5.crt"
|
||||
ssl_serialize_session_load_buf_size:42:"data_files/server5.crt":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
Session serialization, load buffer size: large ticket, cert
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||
ssl_serialize_session_load_buf_size:1023:"data_files/server5.crt"
|
||||
ssl_serialize_session_load_buf_size:1023:"data_files/server5.crt":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_2
|
||||
|
||||
TLS 1.3: CLI: Session serialization, load buffer size: no ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_CLI_C
|
||||
ssl_serialize_session_load_buf_size:0:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
TLS 1.3: CLI: Session serialization, load buffer size: small ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||
ssl_serialize_session_load_buf_size:42:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
TLS 1.3: CLI: Session serialization, load buffer size: large ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||
ssl_serialize_session_load_buf_size:1023:"":MBEDTLS_SSL_IS_CLIENT:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
TLS 1.3: SRV: Session serialization, load buffer size: no ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_SRV_C
|
||||
ssl_serialize_session_load_buf_size:0:"":MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
TLS 1.3: SRV: Session serialization, load buffer size: small ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_SRV_C
|
||||
ssl_serialize_session_load_buf_size:42:"":MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
TLS 1.3: SRV: Session serialization, load buffer size: large ticket
|
||||
depends_on:MBEDTLS_SSL_PROTO_TLS1_3:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_SRV_C
|
||||
ssl_serialize_session_load_buf_size:1023:"":MBEDTLS_SSL_IS_SERVER:MBEDTLS_SSL_VERSION_TLS1_3
|
||||
|
||||
Constant-flow HMAC: MD5
|
||||
depends_on:MBEDTLS_MD5_C
|
||||
|
@ -4854,7 +4854,8 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void ssl_serialize_session_load_buf_size( int ticket_len, char *crt_file )
|
||||
void ssl_serialize_session_load_buf_size( int ticket_len, char *crt_file,
|
||||
int endpoint_type, int tls_version )
|
||||
{
|
||||
mbedtls_ssl_session session;
|
||||
unsigned char *good_buf = NULL, *bad_buf = NULL;
|
||||
@ -4867,7 +4868,20 @@ void ssl_serialize_session_load_buf_size( int ticket_len, char *crt_file )
|
||||
mbedtls_ssl_session_init( &session );
|
||||
|
||||
/* Prepare serialized session data */
|
||||
TEST_ASSERT( ssl_tls12_populate_session( &session, ticket_len, crt_file ) == 0 );
|
||||
((void) endpoint_type);
|
||||
((void) tls_version);
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||
if(tls_version == MBEDTLS_SSL_VERSION_TLS1_3)
|
||||
{
|
||||
TEST_ASSERT( ssl_tls13_populate_session(
|
||||
&session, 0, endpoint_type ) == 0 );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
TEST_ASSERT( ssl_tls12_populate_session(
|
||||
&session, ticket_len, crt_file ) == 0 );
|
||||
}
|
||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &good_len )
|
||||
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||
TEST_ASSERT( ( good_buf = mbedtls_calloc( 1, good_len ) ) != NULL );
|
||||
|
Loading…
x
Reference in New Issue
Block a user