Skip to content

Commit dd9b812

Browse files
olszomalmtrojnar
authored andcommitted
Support loading OpenSSL 3.0+ providers without -pkcs11module option (e.g., CNG)
1 parent 6b56aef commit dd9b812

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
@@ -3,7 +3,9 @@
33
### 2.10 (unreleased)
44

55
- added JavaScript signing
6-
- added PKCS#11 provider support (requires OpenSSL 3.0)
6+
- added PKCS#11 provider support (requires OpenSSL 3.0+)
7+
- added support for providers without specifying "-pkcs11module" option
8+
(OpenSSL 3.0+, e.g., for the upcoming CNG provider)
79
- added compatiblity with the CNG engine version 1.1 or later
810
- added the "-engineCtrl" option to control hardware and CNG engines
911
- 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
@@ -4317,6 +4317,12 @@ static int read_crypto_params(GLOBAL_OPTIONS *options)
43174317
}
43184318
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
43194319
else {
4320+
#if OPENSSL_VERSION_NUMBER>=0x30000000L
4321+
if (options->provider) {
4322+
/* Attempt to load a provider without a PKCS#11 module (e.g., for the CNG provider) */
4323+
(void)provider_load(options->provider);
4324+
}
4325+
#endif /* OPENSSL_VERSION_NUMBER>=0x30000000L */
43204326
/* Load the the private key ('-key' option) */
43214327
load_objects_from_store(options->keyfile, options->pass, &options->pkey, NULL, NULL);
43224328
}

0 commit comments

Comments
 (0)