summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-07-06 08:44:37 +0200
committerRichard Levitte <levitte@openssl.org>2021-07-07 15:38:21 +0200
commitd101700dffa710f3de0ab6465dff688f55214bcc (patch)
treede28cfa2c10ae3cf7fc031209c2526f193ce72f6 /crypto/ec
parent105c83150f15af3f78ea0758859062842bdbe30e (diff)
CRYPTO: Remove the check for built-in methods in the export_to function
That check was seen as necessary at the time, but other changes have been made since, so we now have better control on when we're handling legacy structures and methods, making it safe to run the export_to function on keys with foreign methods. The basic message is that foreign methods must set key structure values according to our standards no matter what, or not set them at all. This has really always been the case, but was harder to see at the time because of interaction with other bugs. Fixes #15927 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15996)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_ameth.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index c7fbaeab5e..9ca023bbe3 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -498,13 +498,6 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
|| (ecg = EC_KEY_get0_group(eckey)) == NULL)
return 0;
- /*
- * If the EC_KEY method is foreign, then we can't be sure of anything,
- * and can therefore not export or pretend to export.
- */
- if (EC_KEY_get_method(eckey) != EC_KEY_OpenSSL())
- return 0;
-
tmpl = OSSL_PARAM_BLD_new();
if (tmpl == NULL)
return 0;