diff --git a/src/tls.c b/src/tls.c index df8ac64f5..0b76ae8d9 100644 --- a/src/tls.c +++ b/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; } diff --git a/src/tls13.c b/src/tls13.c index 75bc5ddc1..9bf209ff3 100644 --- a/src/tls13.c +++ b/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);