Reset the rwstate before calling ASYNC_start_job()
authorMatt Caswell <matt@openssl.org>
Thu, 11 Nov 2021 16:59:43 +0000 (16:59 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 15 Nov 2021 14:44:44 +0000 (14:44 +0000)
commit5c09b61b8931e076ddbe0e186c87984cb3c071d9
tree20842e01989fc2e2abe4a76cd8796094fa0c2fd3
parentf6c418af502e11c88a3ecb6db1816ce27de0210a
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)

(cherry picked from commit 07f620e3acf0dd76a3a03ada9911c544aa483aa7)
ssl/ssl_lib.c