mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-14 00:40:50 +00:00
dtls_server: allow unexpected messages during handshake
If MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE happens during the handshake, don't show it as an "error". It might be an error, but it might also be a fact of life if it happens during the second or more handshake: it can be a duplicated packet or a close_notify alert from the previous connection, which is hard to avoid and harmless. Fixes #9652. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
55b43e5cfb
commit
62163142a0
@ -291,7 +291,14 @@ reset:
|
||||
ret = 0;
|
||||
goto reset;
|
||||
} else if (ret != 0) {
|
||||
printf(" failed\n ! mbedtls_ssl_handshake returned -0x%x\n\n", (unsigned int) -ret);
|
||||
printf(" failed\n ! mbedtls_ssl_handshake returned -0x%x\n", (unsigned int) -ret);
|
||||
if (ret == MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE) {
|
||||
printf(" An unexpected message was received from our peer. If this happened at\n");
|
||||
printf(" the beginning of the handshake, this is likely a duplicated packet or\n");
|
||||
printf(" a close_notify alert from the previous connection, which is harmless.\n");
|
||||
ret = 0;
|
||||
}
|
||||
printf("\n");
|
||||
goto reset;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user