This path in TLSX_KeyShare_Choose should not be taken normally

This commit is contained in:
Juliusz Sosinowicz
2023-02-21 14:17:44 +01:00
parent 06749144d5
commit cbedae2f55

View File

@ -9110,13 +9110,14 @@ int TLSX_KeyShare_Choose(const WOLFSSL *ssl, TLSX* extensions,
list = (KeyShareEntry*)extension->data;
if (extension && extension->resp == 1) {
int ret = 0;
/* Outside of the async case this path should not be taken. */
int ret = INCOMPLETE_DATA;
#ifdef WOLFSSL_ASYNC_CRYPT
/* in async case make sure key generation is finalized */
serverKSE = (KeyShareEntry*)extension->data;
if (serverKSE->lastRet == WC_PENDING_E) {
if (serverKSE && serverKSE->lastRet == WC_PENDING_E) {
if (ssl->options.serverState == SERVER_HELLO_RETRY_REQUEST_COMPLETE)
*doHelloRetry = 1;
*searched = 1;
ret = TLSX_KeyShare_GenKey((WOLFSSL*)ssl, serverKSE);
}
#endif