-
Notifications
You must be signed in to change notification settings - Fork 611
Support non-RSA keys in OpenSSL-CAPI interop layer #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Anthony Rossi <[email protected]>
Signed-off-by: Anthony Rossi <[email protected]>
Signed-off-by: Anthony Rossi <[email protected]>
Signed-off-by: Anthony Rossi <[email protected]>
|
|
||
| // | ||
| // d2i_X509 incremements the the cert variable, so it must be stored in a temp. | ||
| // TODO: support CSP keys in addition to CNG keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How important is this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important enough for this PR, but a nice-to-have. AFAIK, this only works for software keys (no smartcard or TPM keys), and I think most software keys use the NCrypt Software KSP instead of the old CSP model.
There might be a user out there with a custom software CSP (particularly on pre-Windows 10 devices).
|
Do we have the necessary automated tests to validate all these changes? If not, what would it take to get there? There are a lot of changes I don't have the expertise to validate by CR and it'd prefer to have tests do the rest. |
Our existing tests that run OpenSSL on Windows exercise this code path by loading test certificates from the Windows Certificate Store. The existing PFX loading/parsing logic has validation on Linux, and this now exercises that code path on Windows as well. We don't have any test certificates with a chain length greater than 1, so the chain building logic is undertested (right now it just builds a chain with the end-entity certificate in it.) The chain building logic could be disabled until more extensive testing is available, if you prefer. |
Signed-off-by: Anthony Rossi <[email protected]>
Signed-off-by: Anthony Rossi <[email protected]>
Export the desired certificate from the Windows Certificate Store as a PFX and then import the PFX into OpenSSL. This avoids needing to know anything about the certificate, besides its exportability, and simplifies the code nicely.
Also builds the certificate chain and adds it to the PFX for better OpenSSL performance.
Only supports exportable keys using a Key Storage Provider (KSP). Private keys using the older Cryptographic Service Provider (CSP) framework may not work.
Fixes #1942