mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Return TLS 1.3 draft version in ServerHello
This commit is contained in:
14
src/tls.c
14
src/tls.c
@@ -4751,8 +4751,18 @@ static int TLSX_SupportedVersions_Write(void* data, byte* output,
|
||||
}
|
||||
#ifndef WOLFSSL_TLS13_DRAFT_18
|
||||
else if (msgType == server_hello || msgType == hello_retry_request) {
|
||||
output[0] = ssl->version.major;
|
||||
output[1] = ssl->version.minor;
|
||||
#ifndef WOLFSSL_TLS13_FINAL
|
||||
if (ssl->version.major == SSLv3_MAJOR &&
|
||||
ssl->version.minor == TLSv1_3_MINOR) {
|
||||
output[0] = TLS_DRAFT_MAJOR;
|
||||
output[1] = TLS_DRAFT_MINOR;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
output[0] = ssl->version.major;
|
||||
output[1] = ssl->version.minor;
|
||||
}
|
||||
|
||||
*pSz += OPAQUE16_LEN;
|
||||
}
|
||||
|
10
src/tls13.c
10
src/tls13.c
@@ -3713,8 +3713,14 @@ static int RestartHandshakeHashWithCookie(WOLFSSL* ssl, Cookie* cookie)
|
||||
hrrIdx += 2;
|
||||
c16toa(OPAQUE16_LEN, hrr + hrrIdx);
|
||||
hrrIdx += 2;
|
||||
hrr[hrrIdx++] = ssl->version.major;
|
||||
hrr[hrrIdx++] = ssl->version.minor;
|
||||
/* TODO: [TLS13] Change to ssl->version.major and minor once final. */
|
||||
#ifdef WOLFSSL_TLS13_FINAL
|
||||
hrr[hrrIdx++] = ssl->version.major;
|
||||
hrr[hrrIdx++] = ssl->version.minor;
|
||||
#else
|
||||
hrr[hrrIdx++] = TLS_DRAFT_MAJOR;
|
||||
hrr[hrrIdx++] = TLS_DRAFT_MINOR;
|
||||
#endif
|
||||
#endif
|
||||
/* Mandatory Cookie Extension */
|
||||
c16toa(TLSX_COOKIE, hrr + hrrIdx);
|
||||
|
Reference in New Issue
Block a user