Use correct value for pSz when setting the dhKeySize in the session.

This commit is contained in:
John Safranek
2021-10-18 09:42:57 -07:00
committed by Daniel Pouzzner
parent f2c4567164
commit 40e3cac695

View File

@ -6975,8 +6975,8 @@ static int TLSX_KeyShare_ProcessDh(WOLFSSL* ssl, KeyShareEntry* keyShareEntry)
} }
pSz = params->p_len; pSz = params->p_len;
#else #else
pSz = wc_DhGetNamedKeyMinSize(keyShareEntry->group); ret = wc_DhGetNamedKeyParamSize(keyShareEntry->group, &pSz, NULL, NULL);
if (pSz == 0) { if (ret != 0 || pSz == 0) {
return PEER_KEY_ERROR; return PEER_KEY_ERROR;
} }
#endif #endif