Merge pull request #5327 from kareem-wolfssl/connectRetFix

Fix storage of SendBuffered's return code in wolfSSL_Connect.
This commit is contained in:
David Garske
2022-07-06 17:53:04 -07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@ -1969,7 +1969,7 @@ int Dtls13SetRecordNumberKeys(WOLFSSL* ssl, enum encrypt_side side)
{
RecordNumberCiphers* enc = NULL;
RecordNumberCiphers* dec = NULL;
byte *encKey, *decKey;
byte *encKey = NULL, *decKey = NULL;
int ret;
if (ssl == NULL) {

View File

@ -11983,7 +11983,8 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
&& ssl->error != WC_PENDING_E
#endif
) {
if ( (ssl->error = SendBuffered(ssl)) == 0) {
ret = SendBuffered(ssl);
if (ret == 0) {
if (ssl->fragOffset == 0 && !ssl->options.buildingMsg) {
if (advanceState) {
ssl->options.connectState++;
@ -12501,7 +12502,8 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
&& ssl->error != WC_PENDING_E
#endif
) {
if ( (ret = SendBuffered(ssl)) == 0) {
ret = SendBuffered(ssl);
if (ret == 0) {
/* fragOffset is non-zero when sending fragments. On the last
* fragment, fragOffset is zero again, and the state can be
* advanced. */