EVP: Make EVP_PKEY_set_params() increment the dirty count
authorRichard Levitte <levitte@openssl.org>
Wed, 3 Feb 2021 12:50:23 +0000 (13:50 +0100)
committerPauli <ppzgs1@gmail.com>
Fri, 5 Feb 2021 05:53:29 +0000 (15:53 +1000)
commitf4a3799cc45cb986d5920403b3e0471678fee020
treeb384cdedc7955627fb20ddfc88f37671ac11c970
parent7dc67708c8ae6ec06c7fec34781225ed60b5e68d
EVP: Make EVP_PKEY_set_params() increment the dirty count

When the internal key is changed, we must count it as muted, so that
next time the affected key is considered for an operation, it gets
re-exported to the signing provider.  In other words, this will clear
the EVP_PKEY export cache when the next export attempt occurs.

This also updates evp_keymgmt_util_export_to_provider() to actually
look at the dirty count for provider native origin keys, and act
appropriately.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14056)
crypto/evp/keymgmt_lib.c
crypto/evp/p_lib.c