Ensure the EVP_PKEY operation_cache is appropriately locked
authorMatt Caswell <matt@openssl.org>
Wed, 27 Jan 2021 17:18:27 +0000 (17:18 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 2 Feb 2021 12:21:33 +0000 (12:21 +0000)
commit0b07db6f56e0240de6cc2ea122eee6431459ef20
tree6303ccd6e4831899954437de1e7e5702ec3779ef
parent40994605140b9fcbe98a786dc75bdc1b9e9fee3f
Ensure the EVP_PKEY operation_cache is appropriately locked

The EVP_PKEY operation_cache caches references to provider side key
objects that have previously been exported for this EVP_PKEY, and their
associated key managers. The cache may be updated from time to time as the
EVP_PKEY is exported to more providers. Since an EVP_PKEY may be shared by
multiple threads simultaneously we must be careful to ensure the cache
updates are locked.

Fixes #13818

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13987)
crypto/evp/keymgmt_lib.c
crypto/evp/p_lib.c
doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
include/crypto/evp.h