mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 18:37:45 +00:00
Send DTLS-Alert in response to any failures during handshake. (#648)
This commit is contained in:
@@ -343,9 +343,24 @@ void Dtls::Process(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rval == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)
|
||||
switch (rval)
|
||||
{
|
||||
case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY:
|
||||
mbedtls_ssl_close_notify(&mSsl);
|
||||
break;
|
||||
|
||||
case MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED:
|
||||
case MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE:
|
||||
break;
|
||||
|
||||
default:
|
||||
if (mSsl.state != MBEDTLS_SSL_HANDSHAKE_OVER)
|
||||
{
|
||||
mbedtls_ssl_send_alert_message(&mSsl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
|
||||
MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
mbedtls_ssl_session_reset(&mSsl);
|
||||
|
||||
Reference in New Issue
Block a user