From b404d4805fbf41fb05d23d2ece6fe5e3c8012c82 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 11 Oct 2018 13:06:02 -0700 Subject: [PATCH] Skip Server Supported Curve Extension Added a build option, WOLFSSL_ALLOW_SERVER_SC_EXT, that skips the client's parsing of the supported curve extension if sent by the server for sessions using < TLSv1.3. The server doesn't need to send it and the RFCs don't specify what should happen if it does in TLSv1.2, but it is sent in response from one particular Java based TLS server. --- src/tls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tls.c b/src/tls.c index d3fc46a75..48e244108 100644 --- a/src/tls.c +++ b/src/tls.c @@ -3627,8 +3627,13 @@ static int TLSX_SupportedCurve_Parse(WOLFSSL* ssl, byte* input, word16 length, word16 name; int ret; - if(!isRequest && !IsAtLeastTLSv1_3(ssl->version)) + if(!isRequest && !IsAtLeastTLSv1_3(ssl->version)) { +#ifdef WOLFSSL_ALLOW_SERVER_SC_EXT + return 0; +#else return BUFFER_ERROR; /* servers doesn't send this extension. */ +#endif + } if (OPAQUE16_LEN > length || length % OPAQUE16_LEN) return BUFFER_ERROR;