1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add mbedtls_ssl_get_session_pointer()

Avoid useless copy with mbedtls_ssl_get_session() before serialising.

Used in ssl_client2 for testing and demonstrating usage, but unfortunately
that means mbedtls_ssl_get_session() is no longer tested, which will be fixed
in the next commit.
This commit is contained in:
Manuel Pégourié-Gonnard
2019-05-20 11:12:28 +02:00
committed by Jarno Lamsa
parent 21548638b7
commit b5e4e0a395
3 changed files with 27 additions and 13 deletions

View File

@ -9834,6 +9834,14 @@ int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl,
}
#endif /* MBEDTLS_SSL_CLI_C */
const mbedtls_ssl_session *mbedtls_ssl_get_session_pointer( const mbedtls_ssl_context *ssl )
{
if( ssl == NULL )
return( NULL );
return( ssl->session );
}
/*
* Serialize a session in the following format:
* (in the presentation language of TLS, RFC 8446 section 3)