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