Skip to content

Commit 2d892f0

Browse files
Merge pull request #8861 from gasbytes/psk-handshake-failure-fix
tls13: clear tls1_3 on downgrade
2 parents 047f0bb + 92b6e2f commit 2d892f0

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
@@ -5142,6 +5142,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
51425142
/* Force client hello version 1.2 to work for static RSA. */
51435143
ssl->chVersion.minor = TLSv1_2_MINOR;
51445144
ssl->version.minor = TLSv1_2_MINOR;
5145+
ssl->options.tls1_3 = 0;
51455146

51465147
#ifdef WOLFSSL_DTLS13
51475148
if (ssl->options.dtls) {
@@ -5242,6 +5243,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
52425243
if (ssl->options.dtls) {
52435244
ssl->chVersion.minor = DTLSv1_2_MINOR;
52445245
ssl->version.minor = DTLSv1_2_MINOR;
5246+
ssl->options.tls1_3 = 0;
52455247
ret = Dtls13ClientDoDowngrade(ssl);
52465248
if (ret != 0)
52475249
return ret;
@@ -5255,6 +5257,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
52555257
return VERSION_ERROR;
52565258
}
52575259
#ifndef WOLFSSL_NO_TLS12
5260+
ssl->options.tls1_3 = 0;
52585261
return DoServerHello(ssl, input, inOutIdx, helloSz);
52595262
#else
52605263
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);

0 commit comments

Comments
 (0)