summaryrefslogtreecommitdiffstats
path: root/providers/legacyprov.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-05-06 12:29:57 +0100
committerMatt Caswell <matt@openssl.org>2020-05-16 17:10:03 +0100
commitd40b42ab4c8a88740a2cc2a20c709fe869c4dd1e (patch)
tree0dfa4439f3de544d7e52abf56c578e10e5346458 /providers/legacyprov.c
parent827f04d5105e9bec0af214c42b8ad799fba5bb0d (diff)
Maintain strict type discipline between the core and providers
A provider could be linked against a different version of libcrypto than the version of libcrypto that loaded the provider. Different versions of libcrypto could define opaque types differently. It must never occur that a type created in one libcrypto is used directly by the other libcrypto. This will cause crashes. We can "cheat" for "built-in" providers that are part of libcrypto itself, because we know that the two libcrypto versions are the same - but not for other providers. To ensure this does not occur we use different types names for the handful of opaque types that are passed between the core and providers. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11758)
Diffstat (limited to 'providers/legacyprov.c')
-rw-r--r--providers/legacyprov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/providers/legacyprov.c b/providers/legacyprov.c
index 9a6ed6d836..886037cff9 100644
--- a/providers/legacyprov.c
+++ b/providers/legacyprov.c
@@ -170,7 +170,7 @@ static const OSSL_DISPATCH legacy_dispatch_table[] = {
{ 0, NULL }
};
-int OSSL_provider_init(const OSSL_PROVIDER *provider,
+int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
const OSSL_DISPATCH *in,
const OSSL_DISPATCH **out,
void **provctx)
@@ -206,7 +206,7 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider,
return 0;
}
PROV_CTX_set0_library_context(*provctx, libctx);
- PROV_CTX_set0_provider(*provctx, provider);
+ PROV_CTX_set0_handle(*provctx, handle);
*out = legacy_dispatch_table;