diff options
author | Richard Levitte <levitte@openssl.org> | 2020-12-11 11:01:09 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-12-17 12:02:08 +0100 |
commit | 6963979f5c0f95b2152ef74645faa7344e33284d (patch) | |
tree | ff97ca1102560458f90bc3e16db622055aec41fd /crypto/ec | |
parent | e77c13f8b73ff937819d6551ddd616fe01b989d0 (diff) |
DECODER: Adjust the library context of keys in our decoders
Because decoders are coupled with keymgmts from the same provider,
ours need to produce provider side keys the same way. Since our
keymgmts create key data with the provider library context, so must
our decoders.
We solve with functions to adjust the library context of decoded keys,
and use them.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13661)
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec_key.c | 6 | ||||
-rw-r--r-- | crypto/ec/ecx_key.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index da3d6f04a2..d03c75e8aa 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -659,6 +659,12 @@ const char *ec_key_get0_propq(const EC_KEY *key) return key->propq; } +void ec_key_set0_libctx(EC_KEY *key, OSSL_LIB_CTX *libctx) +{ + key->libctx = libctx; + /* Do we need to propagate this to the group? */ +} + const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) { return key->group; diff --git a/crypto/ec/ecx_key.c b/crypto/ec/ecx_key.c index db74a40c97..2b9386d522 100644 --- a/crypto/ec/ecx_key.c +++ b/crypto/ec/ecx_key.c @@ -73,6 +73,11 @@ void ecx_key_free(ECX_KEY *key) OPENSSL_free(key); } +void ecx_key_set0_libctx(ECX_KEY *key, OSSL_LIB_CTX *libctx) +{ + key->libctx = libctx; +} + int ecx_key_up_ref(ECX_KEY *key) { int i; |