]> git.ipfire.org Git - thirdparty/curl.git/commit
openssl: fix pkcs11 provider available check
authorPiotr Nakraszewicz <piotr.nakraszewicz@consult.red>
Wed, 2 Jul 2025 12:29:43 +0000 (14:29 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 4 Jul 2025 06:28:46 +0000 (08:28 +0200)
commite022da0e8301b0bcc905cd2ca09879ca860e0332
tree1cf77a44000fdac716699590d567a1ca83ea13bb
parent42fdc65a989d9e57c418eb56770ab8e31736d56a
openssl: fix pkcs11 provider available check

Commit f2ce6c46 among other things added the use of own library context
instead of the default context. Default context has access to OpenSSL
configuration file, own context doesn't have it.
Therefore if a pkcs11 provider is loaded via config file, the function
OSSL_PROVIDER_available() incorrectly detects the provider as
unavailable.

Fix this by loading the OpenSSL config to the library context according
to OpenSSL documentation:
"OSSL_LIB_CTX_load_config() loads a configuration file using the given
ctx. This can be used to associate a library context with providers that
are loaded from a configuration."

Moreover use the provider_loaded flag instead of provider pointer to
determine if a provider is available, as the latter is not set when the
provider is loaded from a configuration.

Closes #17804
lib/vtls/openssl.c