summaryrefslogtreecommitdiff
path: root/src/mod_mbedtls.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-01-19 04:56:20 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2022-01-19 08:28:23 -0500
commit4f488255424825ec2e9e028550e5b0f0568e51ed (patch)
tree0d9c6ada248e50328e7d6f8a108cb91480da4f1c /src/mod_mbedtls.c
parent955c95bf51b16a0a0da990fe9e4f7b4b8291f54e (diff)
downloadlighttpd-git-4f488255424825ec2e9e028550e5b0f0568e51ed.tar.gz
[mod_mbedtls] remove use of out_left in mbedtls 3
remove use of ssl->out_left in mbedtls 3.0.0 Discussed in https://github.com/ARMmbed/mbedtls/issues/5331, the current implementations of mbedtls_net_send() and mbedtls_net_recv() return MBEDTLS_ERR_SSL_WANT_WRITE only when there is a partial write (though there is theoretical issue if writes are mixed with TLS alerts) x-ref: "issues migrating lighttpd mod_mbedtls to mbedtls 3.0.0" https://github.com/ARMmbed/mbedtls/issues/5331
Diffstat (limited to 'src/mod_mbedtls.c')
-rw-r--r--src/mod_mbedtls.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mod_mbedtls.c b/src/mod_mbedtls.c
index 8365f600..46af2eba 100644
--- a/src/mod_mbedtls.c
+++ b/src/mod_mbedtls.c
@@ -2005,7 +2005,9 @@ mod_mbedtls_ssl_write_err(connection *con, handler_ctx *hctx, int wr, size_t wr_
return -1;
}
+ #if MBEDTLS_VERSION_NUMBER < 0x03000000 /* mbedtls 3.00.0 */
if (0 != hctx->ssl.out_left) /* partial write; save attempted wr_len */
+ #endif
hctx->pending_write = wr_len;
return 0; /* try again later */
@@ -2024,7 +2026,10 @@ connection_write_cq_ssl (connection * const con, chunkqueue * const cq, off_t ma
if (hctx->pending_write) {
int wr = (int)hctx->pending_write;
- if (0 != ssl->out_left) {
+ #if MBEDTLS_VERSION_NUMBER < 0x03000000 /* mbedtls 3.00.0 */
+ if (0 != ssl->out_left)
+ #endif
+ {
/*(would prefer mbedtls_ssl_flush_output() from ssl_internal.h)*/
size_t data_len = hctx->pending_write;
wr = mbedtls_ssl_write(ssl, NULL, data_len);