Skip to content

Commit 223ebee

Browse files
committed
Support loading OpenSSL 3.0+ providers without -pkcs11module option (e.g., CNG)
1 parent 9b7dae4 commit 223ebee

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
### 2.10 (unreleased)
44

5-
- added PKCS#11 provider support (requires OpenSSL 3.0)
5+
- added PKCS#11 provider support (requires OpenSSL 3.0+)
6+
- added support for providers without specifying "-pkcs11module" option
7+
(OpenSSL 3.0+, e.g., for the upcoming CNG provider)
68
- added compatiblity with the CNG engine version 1.1 or later
79
- added the "-engineCtrl" option to control hardware and CNG engines
810
- added the '-blobFile' option to specify a file containing the blob content

osslsigncode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4316,6 +4316,12 @@ static int read_crypto_params(GLOBAL_OPTIONS *options)
43164316
}
43174317
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
43184318
else {
4319+
#if OPENSSL_VERSION_NUMBER>=0x30000000L
4320+
if (options->provider) {
4321+
/* Attempt to load a provider without a PKCS#11 module (e.g., for the CNG provider) */
4322+
(void)provider_load(options->provider);
4323+
}
4324+
#endif /* OPENSSL_VERSION_NUMBER>=0x30000000L */
43194325
/* Load the the private key ('-key' option) */
43204326
load_objects_from_store(options->keyfile, options->pass, &options->pkey, NULL, NULL);
43214327
}

0 commit comments

Comments
 (0)