mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
[mbedtls] call mbedtls_ssl_set_hostname on setup (#11416)
Due to CVE-2025-27809, on newer versions of mbedtls, handshake will fail unless hostname is set earlier. TLS clients are not affected if they operate in a closed ecosystem where the trusted certificate authority only issues certificates to trusted hosts. In this case, `mbedtls_ssl_set_hostname` with nullptr should be called to avoid failures. Signed-off-by: Maciej Baczmanski <[email protected]>
This commit is contained in:
@@ -311,6 +311,13 @@ Error SecureSession::Setup(void)
|
||||
VerifyOrExit(rval == 0);
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||
if (!mIsServer)
|
||||
{
|
||||
mbedtls_ssl_set_hostname(&mSsl, nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
mReceiveMessage = nullptr;
|
||||
mMessageSubType = Message::kSubTypeNone;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user