summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-11-11 16:59:43 +0000
committerMatt Caswell <matt@openssl.org>2021-11-15 14:37:08 +0000
commit07f620e3acf0dd76a3a03ada9911c544aa483aa7 (patch)
tree9ea25375deb6efd5a9a37ff5b50fb022fefec993 /ssl
parent7a9b09feaa07f79522f7affccbca4236da2443e5 (diff)
Reset the rwstate before calling ASYNC_start_job()
If an async job pauses while processing a TLS connection then the rwstate gets set to SSL_ASYNC_PAUSED. When resuming the job we should reset the rwstate back to SSL_NOTHING. In fact we can do this unconditionally since if we're about to call ASYNC_start_job() then either we are about to start the async job for the first time (in which case the rwstate should already by SSL_NOTHING), or we are restarting it after a pause (in which case reseting it to SSL_NOTHING is the correct action). Fixes #16809 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17013)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 3d20305170..aaedb4ae94 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1770,6 +1770,8 @@ static int ssl_start_async_job(SSL *s, struct ssl_async_args *args,
(s->waitctx, ssl_async_wait_ctx_cb, s))
return -1;
}
+
+ s->rwstate = SSL_NOTHING;
switch (ASYNC_start_job(&s->job, s->waitctx, &ret, func, args,
sizeof(struct ssl_async_args))) {
case ASYNC_ERR: