summaryrefslogtreecommitdiffstats
path: root/include/crypto/evp.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-03-21 06:21:26 +0100
committerRichard Levitte <levitte@openssl.org>2020-03-25 17:01:10 +0100
commitacb90ba8ffe6a27f625607760e82842673eb9378 (patch)
treee2960e7bf66bf703ec58c26942462a1cbf27ed7b /include/crypto/evp.h
parent8243d8d1a17b700c9c48fc5660ff61245b1d14d2 (diff)
EVP: Downgrade keys rather than upgrade
Upgrading EVP_PKEYs from containing legacy keys to containing provider side keys proved to be risky, with a number of unpleasant corner cases, and with functions like EVP_PKEY_get0_DSA() failing unexpectedly. We therefore change course, and instead of upgrading legacy internal keys to provider side internal keys, we downgrade provider side internal keys to legacy ones. To be able to do this, we add |import_from| and make it a callback function designed for evp_keymgmt_export(). This means that evp_pkey_upgrade_to_provider() is replaced with evp_pkey_downgrade(). EVP_PKEY_copy_parameters() is the most deeply affected function of this change. Fixes #11366 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11375)
Diffstat (limited to 'include/crypto/evp.h')
-rw-r--r--include/crypto/evp.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index e5f9aad010..63b6dad9c6 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -630,10 +630,8 @@ void evp_app_cleanup_int(void);
void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
-void *evp_pkey_upgrade_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
- EVP_KEYMGMT **keymgmt,
- const char *propquery);
#ifndef FIPS_MODE
+int evp_pkey_downgrade(EVP_PKEY *pk);
void evp_pkey_free_legacy(EVP_PKEY *x);
#endif