diff --git a/src/sniffer.c b/src/sniffer.c index b961f7bd7..a12dafe57 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -239,7 +239,8 @@ static const char* const msgTable[] = "Decrypt Keys Not Set Up", "Late Key Load Error", "Got Certificate Status msg", - "RSA Key Missing Error" + "RSA Key Missing Error", + "Secure Renegotiation Not Supported" }; @@ -1816,6 +1817,14 @@ static int DoHandShake(const byte* input, int* sslBytes, SetError(HANDSHAKE_INPUT_STR, error, session, FATAL_ERROR_STATE); return -1; } + + /* A session's arrays are released when the handshake is completed. */ + if (session->sslServer->arrays == NULL && + session->sslClient->arrays == NULL) { + + SetError(NO_SECURE_RENEGOTIATION, error, session, FATAL_ERROR_STATE); + return -1; + } switch (type) { case hello_verify_request: diff --git a/wolfssl/sniffer_error.h b/wolfssl/sniffer_error.h index ad89a50d9..56fada416 100644 --- a/wolfssl/sniffer_error.h +++ b/wolfssl/sniffer_error.h @@ -107,6 +107,7 @@ #define CLIENT_HELLO_LATE_KEY_STR 72 #define GOT_CERT_STATUS_STR 73 #define RSA_KEY_MISSING_STR 74 +#define NO_SECURE_RENEGOTIATION 75 /* !!!! also add to msgTable in sniffer.c and .rc file !!!! */ diff --git a/wolfssl/sniffer_error.rc b/wolfssl/sniffer_error.rc index 8bcd6926c..3c748193e 100644 --- a/wolfssl/sniffer_error.rc +++ b/wolfssl/sniffer_error.rc @@ -89,5 +89,6 @@ STRINGTABLE 72, "Late Key Load Error" 73, "Got Certificate Status msg" 74, "RSA Key Missing Error" + 75, "Secure Renegotiation Not Supported" }