-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the required wrapper to the static library to enable dynamic loading of the provider. The build now generates a shared library "libparsec_openssl_provider_shared.so" which has the required symbols that enables openssl to dynamically load the provider. Signed-off-by: Gowtham Suresh Kumar <[email protected]>
- Loading branch information
1 parent
9d20d57
commit 2aec6a4
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
name = "parsec-openssl-provider-shared" | ||
version = "0.1.0" | ||
authors = ["Parsec Project Contributors"] | ||
description = "A parsec openssl provider dynamic library" | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
keywords = ["security", "service"] | ||
categories = ["cryptography", "hardware-support"] | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
openssl-sys = "0.9.98" | ||
openssl-sys2 = { path = "../openssl-sys2" } | ||
parsec-openssl-provider = { path ="../parsec-openssl-provider" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023 Contributors to the Parsec project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use parsec_openssl_provider; | ||
|
||
#[allow(non_upper_case_globals)] | ||
#[allow(non_snake_case)] | ||
#[allow(dead_code)] | ||
#[no_mangle] | ||
// The function name needs to be unique for dynamic libraries as the openssl core | ||
// looks for OSSL_provider_init symbol while loading the provider. | ||
extern "C" fn OSSL_provider_init( | ||
handle: *const openssl_sys2::OSSL_CORE_HANDLE, | ||
in_: *const openssl_sys2::OSSL_DISPATCH, | ||
out: *mut *const openssl_sys2::OSSL_DISPATCH, | ||
provctx: *mut *mut std::os::raw::c_void, | ||
) -> ::std::os::raw::c_int { | ||
parsec_openssl_provider::parsec_provider_provider_init(handle, in_, out, provctx) | ||
} |