Maintentance: DTLS

1. Client wasn't skipping a handshake state when the server sends a
hello without a hello verify. It ended up resetting the handshake hash
and resending Hello with its next messages.
This commit is contained in:
John Safranek
2019-12-19 11:48:05 -08:00
parent 51f956490f
commit 6c7e86f366

View File

@ -11572,6 +11572,8 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
#endif #endif
#ifdef WOLFSSL_DTLS #ifdef WOLFSSL_DTLS
if (ssl->options.serverState ==
SERVER_HELLOVERIFYREQUEST_COMPLETE) {
if (IsDtlsNotSctpMode(ssl)) { if (IsDtlsNotSctpMode(ssl)) {
/* re-init hashes, exclude first hello and verify request */ /* re-init hashes, exclude first hello and verify request */
if ((ssl->error = InitHandshakeHashes(ssl)) != 0) { if ((ssl->error = InitHandshakeHashes(ssl)) != 0) {
@ -11583,6 +11585,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
return WOLFSSL_FATAL_ERROR; return WOLFSSL_FATAL_ERROR;
} }
} }
}
#endif #endif
ssl->options.connectState = HELLO_AGAIN_REPLY; ssl->options.connectState = HELLO_AGAIN_REPLY;