mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-05-02 18:36:29 +00:00
ssl_write_handshake_msg(): Allow alert on client-side SSLv3
In SSLv3, the client sends a NoCertificate alert in response to a CertificateRequest if it doesn't have a CRT. This previously lead to failure in ssl_write_handshake_msg() which only accepted handshake or CCS records.
This commit is contained in:
parent
34aa187df6
commit
c83d2b3e09
|
@ -3051,10 +3051,18 @@ int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl )
|
||||||
*/
|
*/
|
||||||
if( ssl->out_msgtype != MBEDTLS_SSL_MSG_HANDSHAKE &&
|
if( ssl->out_msgtype != MBEDTLS_SSL_MSG_HANDSHAKE &&
|
||||||
ssl->out_msgtype != MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC )
|
ssl->out_msgtype != MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC )
|
||||||
|
{
|
||||||
|
/* In SSLv3, the client might send a NoCertificate alert. */
|
||||||
|
#if defined(MBEDTLS_SSL_PROTO_SSL3) && defined(MBEDTLS_SSL_CLI_C)
|
||||||
|
if( ! ( ssl->minor_ver == MBEDTLS_SSL_MINOR_VERSION_0 &&
|
||||||
|
ssl->out_msgtype == MBEDTLS_SSL_MSG_ALERT &&
|
||||||
|
ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT ) )
|
||||||
|
#endif /* MBEDTLS_SSL_PROTO_SSL3 && MBEDTLS_SSL_SRV_C */
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "should never happen" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 1, ( "should never happen" ) );
|
||||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( ssl->out_msgtype == MBEDTLS_SSL_MSG_HANDSHAKE &&
|
if( ssl->out_msgtype == MBEDTLS_SSL_MSG_HANDSHAKE &&
|
||||||
hs_type != MBEDTLS_SSL_HS_HELLO_REQUEST &&
|
hs_type != MBEDTLS_SSL_HS_HELLO_REQUEST &&
|
||||||
|
|
Loading…
Reference in a new issue