forked from wolfSSL/wolfssl
Check that HVR and HRR don't appear in the same connection
This commit is contained in:
@ -15682,6 +15682,12 @@ static int SanityCheckMsgReceived(WOLFSSL* ssl, byte type)
|
|||||||
WOLFSSL_ERROR_VERBOSE(DUPLICATE_MSG_E);
|
WOLFSSL_ERROR_VERBOSE(DUPLICATE_MSG_E);
|
||||||
return DUPLICATE_MSG_E;
|
return DUPLICATE_MSG_E;
|
||||||
}
|
}
|
||||||
|
if (ssl->msgsReceived.got_hello_retry_request) {
|
||||||
|
WOLFSSL_MSG("Received HelloVerifyRequest after a "
|
||||||
|
"HelloRetryRequest");
|
||||||
|
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
|
||||||
|
return VERSION_ERROR;
|
||||||
|
}
|
||||||
ssl->msgsReceived.got_hello_verify_request = 1;
|
ssl->msgsReceived.got_hello_verify_request = 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -5024,6 +5024,13 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
WOLFSSL_MSG("HelloRetryRequest format");
|
WOLFSSL_MSG("HelloRetryRequest format");
|
||||||
*extMsgType = hello_retry_request;
|
*extMsgType = hello_retry_request;
|
||||||
|
|
||||||
|
if (ssl->msgsReceived.got_hello_verify_request) {
|
||||||
|
WOLFSSL_MSG("Received HelloRetryRequest after a "
|
||||||
|
"HelloVerifyRequest");
|
||||||
|
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
|
||||||
|
return VERSION_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* A HelloRetryRequest comes in as an ServerHello for MiddleBox compat.
|
/* A HelloRetryRequest comes in as an ServerHello for MiddleBox compat.
|
||||||
* Found message to be a HelloRetryRequest.
|
* Found message to be a HelloRetryRequest.
|
||||||
* Don't allow more than one HelloRetryRequest or ServerHello.
|
* Don't allow more than one HelloRetryRequest or ServerHello.
|
||||||
|
Reference in New Issue
Block a user