forked from wolfSSL/wolfssl
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
|
#ifndef WOLFSSL_TLS13_DRAFT_18
|
||||||
else if (msgType == server_hello || msgType == hello_retry_request) {
|
else if (msgType == server_hello || msgType == hello_retry_request) {
|
||||||
output[0] = ssl->version.major;
|
#ifndef WOLFSSL_TLS13_FINAL
|
||||||
output[1] = ssl->version.minor;
|
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;
|
*pSz += OPAQUE16_LEN;
|
||||||
}
|
}
|
||||||
|
10
src/tls13.c
10
src/tls13.c
@@ -3713,8 +3713,14 @@ static int RestartHandshakeHashWithCookie(WOLFSSL* ssl, Cookie* cookie)
|
|||||||
hrrIdx += 2;
|
hrrIdx += 2;
|
||||||
c16toa(OPAQUE16_LEN, hrr + hrrIdx);
|
c16toa(OPAQUE16_LEN, hrr + hrrIdx);
|
||||||
hrrIdx += 2;
|
hrrIdx += 2;
|
||||||
hrr[hrrIdx++] = ssl->version.major;
|
/* TODO: [TLS13] Change to ssl->version.major and minor once final. */
|
||||||
hrr[hrrIdx++] = ssl->version.minor;
|
#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
|
#endif
|
||||||
/* Mandatory Cookie Extension */
|
/* Mandatory Cookie Extension */
|
||||||
c16toa(TLSX_COOKIE, hrr + hrrIdx);
|
c16toa(TLSX_COOKIE, hrr + hrrIdx);
|
||||||
|
Reference in New Issue
Block a user