Skip to content

Commit 92b6e2f

Browse files
committed
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.
1 parent 0bac2c2 commit 92b6e2f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tls13.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5118,6 +5118,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
51185118
/* Force client hello version 1.2 to work for static RSA. */
51195119
ssl->chVersion.minor = TLSv1_2_MINOR;
51205120
ssl->version.minor = TLSv1_2_MINOR;
5121+
ssl->options.tls1_3 = 0;
51215122

51225123
#ifdef WOLFSSL_DTLS13
51235124
if (ssl->options.dtls) {
@@ -5218,6 +5219,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
52185219
if (ssl->options.dtls) {
52195220
ssl->chVersion.minor = DTLSv1_2_MINOR;
52205221
ssl->version.minor = DTLSv1_2_MINOR;
5222+
ssl->options.tls1_3 = 0;
52215223
ret = Dtls13ClientDoDowngrade(ssl);
52225224
if (ret != 0)
52235225
return ret;
@@ -5231,6 +5233,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
52315233
return VERSION_ERROR;
52325234
}
52335235
#ifndef WOLFSSL_NO_TLS12
5236+
ssl->options.tls1_3 = 0;
52345237
return DoServerHello(ssl, input, inOutIdx, helloSz);
52355238
#else
52365239
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);

0 commit comments

Comments
 (0)