Don't set encrypt side if sending early data

Make check to see if early data has been or is going to be sent.
Last message encrypted with this key is EndOfEarlyData message.
This commit is contained in:
Sean Parkinson
2021-01-14 09:44:09 +10:00
parent d7aa8e1795
commit 5a4dfc1a29

View File

@@ -7190,6 +7190,13 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
ENCRYPT_AND_DECRYPT_SIDE, 1)) != 0) {
return ret;
}
#ifdef WOLFSSL_EARLY_DATA
if (ssl->earlyData != no_early_data) {
if ((ret = SetKeysSide(ssl, DECRYPT_SIDE_ONLY)) != 0)
return ret;
}
else
#endif
if ((ret = SetKeysSide(ssl, ENCRYPT_AND_DECRYPT_SIDE)) != 0)
return ret;
}