mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Improvement to wolfSSL_write to not allow for VERIFY_MAC_ERROR
or DECRYPT_ERROR
errors. This resolves possible end user application implentation issue where a wolfSSL_read failure isn't handled and a wolfSSL_write is done anyways.
This commit is contained in:
@ -15223,14 +15223,18 @@ int SendData(WOLFSSL* ssl, const void* data, int sz)
|
|||||||
ssl->error = 0;
|
ssl->error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_DTLS
|
/* don't allow write after decrypt or mac error */
|
||||||
if (ssl->options.dtls) {
|
if (ssl->error == VERIFY_MAC_ERROR || ssl->error == DECRYPT_ERROR) {
|
||||||
/* In DTLS mode, we forgive some errors and allow the session
|
/* For DTLS allow these possible errors and allow the session
|
||||||
* to continue despite them. */
|
to continue despite them */
|
||||||
if (ssl->error == VERIFY_MAC_ERROR || ssl->error == DECRYPT_ERROR)
|
if (ssl->options.dtls) {
|
||||||
ssl->error = 0;
|
ssl->error = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
WOLFSSL_MSG("Not allowing write after decrypt or mac error");
|
||||||
|
return WOLFSSL_FATAL_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* WOLFSSL_DTLS */
|
|
||||||
|
|
||||||
#ifdef WOLFSSL_EARLY_DATA
|
#ifdef WOLFSSL_EARLY_DATA
|
||||||
if (ssl->earlyData != no_early_data) {
|
if (ssl->earlyData != no_early_data) {
|
||||||
|
Reference in New Issue
Block a user