Merge pull request #8661 from BensonLiou/use_init_api

use mbedtls_ssl_session_init() to init session variable
This commit is contained in:
Janos Follath 2024-02-19 15:49:34 +00:00 committed by GitHub
commit 028a38b7cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -4737,7 +4737,7 @@ const mbedtls_x509_crt *mbedtls_ssl_get_peer_cert(const mbedtls_ssl_context *ssl
* \param ssl The SSL context representing the connection for which to * \param ssl The SSL context representing the connection for which to
* to export a session structure for later resumption. * to export a session structure for later resumption.
* \param session The target structure in which to store the exported session. * \param session The target structure in which to store the exported session.
* This must have been initialized with mbedtls_ssl_init_session() * This must have been initialized with mbedtls_ssl_session_init()
* but otherwise be unused. * but otherwise be unused.
* *
* \note This function can handle a variety of mechanisms for session * \note This function can handle a variety of mechanisms for session

View file

@ -833,7 +833,7 @@ int main(int argc, char *argv[])
mbedtls_net_init(&server_fd); mbedtls_net_init(&server_fd);
mbedtls_ssl_init(&ssl); mbedtls_ssl_init(&ssl);
mbedtls_ssl_config_init(&conf); mbedtls_ssl_config_init(&conf);
memset(&saved_session, 0, sizeof(mbedtls_ssl_session)); mbedtls_ssl_session_init(&saved_session);
rng_init(&rng); rng_init(&rng);
#if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
mbedtls_x509_crt_init(&cacert); mbedtls_x509_crt_init(&cacert);