mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 21:54:41 +02:00
tls13: clear tls1_3 on downgrade
Unset ssl->options.tls1_3 whenever we drop to TLS 1.2 so PSK handshakes don’t hit -326 VERSION_ERROR.
This commit is contained in:
@@ -5118,6 +5118,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
/* Force client hello version 1.2 to work for static RSA. */
|
/* Force client hello version 1.2 to work for static RSA. */
|
||||||
ssl->chVersion.minor = TLSv1_2_MINOR;
|
ssl->chVersion.minor = TLSv1_2_MINOR;
|
||||||
ssl->version.minor = TLSv1_2_MINOR;
|
ssl->version.minor = TLSv1_2_MINOR;
|
||||||
|
ssl->options.tls1_3 = 0;
|
||||||
|
|
||||||
#ifdef WOLFSSL_DTLS13
|
#ifdef WOLFSSL_DTLS13
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
@@ -5218,6 +5219,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
ssl->chVersion.minor = DTLSv1_2_MINOR;
|
ssl->chVersion.minor = DTLSv1_2_MINOR;
|
||||||
ssl->version.minor = DTLSv1_2_MINOR;
|
ssl->version.minor = DTLSv1_2_MINOR;
|
||||||
|
ssl->options.tls1_3 = 0;
|
||||||
ret = Dtls13ClientDoDowngrade(ssl);
|
ret = Dtls13ClientDoDowngrade(ssl);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -5231,6 +5233,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
return VERSION_ERROR;
|
return VERSION_ERROR;
|
||||||
}
|
}
|
||||||
#ifndef WOLFSSL_NO_TLS12
|
#ifndef WOLFSSL_NO_TLS12
|
||||||
|
ssl->options.tls1_3 = 0;
|
||||||
return DoServerHello(ssl, input, inOutIdx, helloSz);
|
return DoServerHello(ssl, input, inOutIdx, helloSz);
|
||||||
#else
|
#else
|
||||||
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
|
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
|
||||||
|
Reference in New Issue
Block a user