diff mbox series

[master,kirkstone] openssl: export OPENSSL_MODULES in SDK

Message ID 20220927101449.26828-1-Qi.Chen@windriver.com
State New, archived
Headers show
Series [master,kirkstone] openssl: export OPENSSL_MODULES in SDK | expand

Commit Message

ChenQi Sept. 27, 2022, 10:14 a.m. UTC
In current SDK, when running the following command in python
shell, we get an error.

$ python3
>>> from cryptography.hazmat.backends import openssl

The error message is as below:

  cryptography.exceptions.InternalError: Unknown OpenSSL error.

We could set OPENSSL_MODULES explicitly in nativesdk-openssl package
so that when SDK is set up, it's in environment and we can
get rid of the above error.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-connectivity/openssl/files/environment.d-openssl.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

Mikko Rapeli Sept. 27, 2022, 10:44 a.m. UTC | #1
Hi,

On Tue, 27 Sept 2022 at 13:15, Chen Qi <Qi.Chen@windriver.com> wrote:
>
> In current SDK, when running the following command in python
> shell, we get an error.
>
> $ python3
> >>> from cryptography.hazmat.backends import openssl
>
> The error message is as below:
>
>   cryptography.exceptions.InternalError: Unknown OpenSSL error.
>
> We could set OPENSSL_MODULES explicitly in nativesdk-openssl package
> so that when SDK is set up, it's in environment and we can
> get rid of the above error.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-connectivity/openssl/files/environment.d-openssl.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> index b9cc24a7ac..1a03556f3b 100644
> --- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> +++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
> @@ -1 +1,2 @@
>  export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
> +export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"

Also needs SSL_CERT_DIR, SSL_CERT_FILE and OPENSSL_ENGINES variables to be set.

Sadly all these are needed for openssl to work correctly.

Cheers,

-Mikko
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
index b9cc24a7ac..1a03556f3b 100644
--- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
+++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
@@ -1 +1,2 @@ 
 export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
+export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"