Support loading OpenSSL 3.0+ providers without -pkcs11module option (e.g., CNG)

This commit is contained in:
olszomal
2025-06-03 10:47:05 +02:00
committed by Michał Trojnara
parent 6b56aef073
commit dd9b81281f
2 changed files with 9 additions and 1 deletions

View File

@ -4317,6 +4317,12 @@ static int read_crypto_params(GLOBAL_OPTIONS *options)
}
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
else {
#if OPENSSL_VERSION_NUMBER>=0x30000000L
if (options->provider) {
/* Attempt to load a provider without a PKCS#11 module (e.g., for the CNG provider) */
(void)provider_load(options->provider);
}
#endif /* OPENSSL_VERSION_NUMBER>=0x30000000L */
/* Load the the private key ('-key' option) */
load_objects_from_store(options->keyfile, options->pass, &options->pkey, NULL, NULL);
}