summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-10-23 09:54:16 +0100
committerMatt Caswell <matt@openssl.org>2023-10-24 17:37:19 +0100
commitb9b9f4886f87abd39535721243d4297fd45e558a (patch)
tree76533f9ce0f7fd16149769407c67cca05b44eca9 /ssl
parent86e11b1e78ad6937ef32d64ca34013306c9abc28 (diff)
Make sure we remember how much data we sent in the event of a retry
If a retry occurs we need to reset s->rlayer.wnum so that next time around we remember how much data we already sent. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22473)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/rec_layer_s3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 260d163a50..845eff9848 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -294,8 +294,10 @@ int ssl3_write_bytes(SSL *ssl, uint8_t type, const void *buf_, size_t len,
/* Retry needed */
i = HANDLE_RLAYER_WRITE_RETURN(s,
s->rlayer.wrlmethod->retry_write_records(s->rlayer.wrl));
- if (i <= 0)
+ if (i <= 0) {
+ s->rlayer.wnum = tot;
return i;
+ }
tot += s->rlayer.wpend_tot;
s->rlayer.wpend_tot = 0;
} /* else no retry required */
@@ -321,6 +323,7 @@ int ssl3_write_bytes(SSL *ssl, uint8_t type, const void *buf_, size_t len,
i = ssl->method->ssl_dispatch_alert(ssl);
if (i <= 0) {
/* SSLfatal() already called if appropriate */
+ s->rlayer.wnum = tot;
return i;
}
/* if it went, fall through and send more stuff */