From 69436b6d412a6b5acb189f1d9d1d5a67e5009466 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 28 Nov 2018 10:53:44 -0800 Subject: [PATCH] Server Side Secure Renegotiation 1. Fix spelling typo in a comment. 2. Correct the server's check of its secure renegotiation extension. --- src/internal.c | 2 +- src/tls.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/internal.c b/src/internal.c index ff45f7d36..0ec0ec393 100644 --- a/src/internal.c +++ b/src/internal.c @@ -21119,7 +21119,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, if (IsEncryptionOn(ssl, 1)) sendSz += MAX_MSG_EXTRA; - /* check for avalaible size */ + /* check for available size */ if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) return ret; diff --git a/src/tls.c b/src/tls.c index a7f14de33..f932dfcec 100644 --- a/src/tls.c +++ b/src/tls.c @@ -4349,16 +4349,10 @@ static int TLSX_SecureRenegotiation_Parse(WOLFSSL* ssl, byte* input, if (isRequest) { #ifndef NO_WOLFSSL_SERVER if (ssl->secure_renegotiation == NULL) { - if (*input == 0) { - ret = 0; - } - else { - /* already in error state */ - WOLFSSL_MSG("SCR client verify data present"); - } + /* already in error state */ + WOLFSSL_MSG("server SCR not available"); } - else if (ssl->secure_renegotiation->enabled) { - + else if (!ssl->secure_renegotiation->enabled) { if (*input == 0) { input++; /* get past size */ @@ -4366,6 +4360,10 @@ static int TLSX_SecureRenegotiation_Parse(WOLFSSL* ssl, byte* input, TLSX_SetResponse(ssl, TLSX_RENEGOTIATION_INFO); ret = 0; } + else { + /* already in error state */ + WOLFSSL_MSG("SCR client verify data present"); + } } else if (*input == TLS_FINISHED_SZ) { input++; /* get past size */