EVP: Take care of locks when downgrading an EVP_PKEY
authorRichard Levitte <levitte@openssl.org>
Fri, 25 Sep 2020 07:28:14 +0000 (09:28 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 13 Oct 2020 04:45:58 +0000 (06:45 +0200)
commita8154452e5f5404982a2f6e54d56b1a17b6a5c4d
tree12ea3366a206a5092745aceb703259b256d6157e
parent9f7505ab6a1ce76497654ea8cf6a74307da78989
EVP: Take care of locks when downgrading an EVP_PKEY

The temporary copy that's made didn't have a lock, which could end up
with a crash.  We now handle locks a bit better, and take extra care to
lock it and keep track of which lock is used where and which lock is
thrown away.

Fixes #12876

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12978)
crypto/evp/p_lib.c