mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 13:44:41 +02:00
fix: tls13: hash using right version when downgrading
This commit is contained in:
@@ -33049,12 +33049,6 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
WOLFSSL_MSG("\tDowngrading to DTLSv1.2");
|
WOLFSSL_MSG("\tDowngrading to DTLSv1.2");
|
||||||
ssl->options.tls1_3 = 0;
|
ssl->options.tls1_3 = 0;
|
||||||
ssl->version.minor = DTLSv1_2_MINOR;
|
ssl->version.minor = DTLSv1_2_MINOR;
|
||||||
|
|
||||||
/* reset hashes, DTLSv1.2 will take care of the hashing
|
|
||||||
later */
|
|
||||||
ret = InitHandshakeHashes(ssl);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
else if (pv.minor == DTLS_MINOR) {
|
else if (pv.minor == DTLS_MINOR) {
|
||||||
WOLFSSL_MSG("\tDowngrading to DTLSv1.0");
|
WOLFSSL_MSG("\tDowngrading to DTLSv1.0");
|
||||||
|
@@ -5915,6 +5915,7 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
|
|
||||||
if (wantDowngrade) {
|
if (wantDowngrade) {
|
||||||
#ifndef WOLFSSL_NO_TLS12
|
#ifndef WOLFSSL_NO_TLS12
|
||||||
|
byte realMinor;
|
||||||
if (!ssl->options.downgrade) {
|
if (!ssl->options.downgrade) {
|
||||||
WOLFSSL_MSG("Client trying to connect with lesser version than "
|
WOLFSSL_MSG("Client trying to connect with lesser version than "
|
||||||
"TLS v1.3");
|
"TLS v1.3");
|
||||||
@@ -5928,7 +5929,10 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
ERROR_OUT(VERSION_ERROR, exit_dch);
|
ERROR_OUT(VERSION_ERROR, exit_dch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
realMinor = ssl->version.minor;
|
||||||
|
ssl->version.minor = args->pv.minor;
|
||||||
ret = HashInput(ssl, input + args->begin, helloSz);
|
ret = HashInput(ssl, input + args->begin, helloSz);
|
||||||
|
ssl->version.minor = realMinor;
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = DoClientHello(ssl, input, inOutIdx, helloSz);
|
ret = DoClientHello(ssl, input, inOutIdx, helloSz);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user