Make the ASYNC code default libctx aware
authorMatt Caswell <matt@openssl.org>
Fri, 26 Jun 2020 10:00:25 +0000 (11:00 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 28 Jun 2020 08:55:52 +0000 (10:55 +0200)
commit6c689e58f70726cfa5533bc10f9669abce199fb8
tree102c08ba61faae7e9838b0f2481dc188227b2b20
parentcfbd76c1a9737617d4cf90d3a1af704241c97d98
Make the ASYNC code default libctx aware

Since the default libctx is now stored in a thread local variable
swapping in and out of fibres in the ASYNC code could mean that the
"current" default libctx can get confused. Therefore we ensure that
everytime we call async_fibre_swapcontext() we always restore the default
libctx to whatever it was the last time the fibre ran. Similarly when
async_fibre_swapcontext() returns we need to restore the current thread's
default libctx.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12228)
crypto/async/async.c
crypto/async/async_local.h
doc/man3/OPENSSL_CTX.pod