Repository navigation
Closed as not planned
Labels
branch: 3.0Applies to openssl-3.0 branch (EOL)branch: 3.1Applies to openssl-3.1 (EOL)branch: 3.2Applies to openssl-3.2 (EOL)branch: masterApplies to master branchtriaged: bugThe issue/pr is/fixes a bug
Description
I ran into this because I was curious why sometimes
empty SSL-write are happening in non-ktls sockets,
I try this with openssl-3.1.1:
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 3baf820..d306fc1 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -1145,6 +1145,8 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
s->rlayer.wpend_type = type;
s->rlayer.wpend_ret = totlen;
+ if (!RECORD_LAYER_write_pending(&s->rlayer))
+ printf("### NO WRITE PENDING ###\n");
/* we now just need to write the buffer */
return ssl3_write_pending(s, type, buf, totlen, written);
err:
@@ -1194,6 +1196,9 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_
return i;
BIO_set_ktls_ctrl_msg(s->wbio, type);
}
+ if (!BIO_get_ktls_send(s->wbio)
+ && SSL3_BUFFER_get_left(&wb[currbuf]) == 0)
+ printf("### EMPTY WRITE ###\n");
i = BIO_write(s->wbio, (char *)
&(SSL3_BUFFER_get_buf(&wb[currbuf])
[SSL3_BUFFER_get_offset(&wb[currbuf])]),
and make test TESTS=test_sslapi V=1 shows this
# Subtest: test_pipelining
1..6
ok 460 - iteration 1
ok 461 - iteration 2
ok 462 - iteration 3
ok 463 - iteration 4
### NO WRITE PENDING ###
### EMPTY WRITE ###
ok 464 - iteration 5
ok 465 - iteration 6
ok 86 - test_pipelining
while empty write requests are mostly harmless,
a wrong result of RECORD_LAYER_write_pending is it not.
Metadata
Metadata
Assignees
Labels
branch: 3.0Applies to openssl-3.0 branch (EOL)branch: 3.1Applies to openssl-3.1 (EOL)branch: 3.2Applies to openssl-3.2 (EOL)branch: masterApplies to master branchtriaged: bugThe issue/pr is/fixes a bug
Activity
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
Fix RECORD_LAYER_write_pending wrong result with pipelining
nhorman commentedon Jun 6, 2024
Marking as inactive, to be closed at the end of the 3.4 dev cycle, barring further updates.