remove psk key when ephemeral selected

ephemeral is selected, `handshake->psk` must be removed.
Otherwise the encrypt key will be caculate fail.

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2022-07-30 23:22:08 +08:00
parent 56acc9421c
commit 5c28e7aa0e
3 changed files with 15 additions and 22 deletions

View file

@ -2498,6 +2498,13 @@ MBEDTLS_CHECK_RETURN_CRITICAL
int mbedtls_ssl_tls13_write_binders_of_pre_shared_key_ext(
mbedtls_ssl_context *ssl,
unsigned char *buf, unsigned char *end );
/**
* \brief Remove psk from handshake context
*
* \param[in] ssl SSL context
*/
void mbedtls_ssl_remove_psk( mbedtls_ssl_context *ssl );
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */
#endif /* ssl_misc.h */