Load default openssl config when possible#333
Conversation
This may be needed if an application tries to use ciphers the have been moved to the legacy provider and therefore normally fetching them would fail. Signed-off-by: Simo Sorce <simo@redhat.com>
Kryoptic creates a new context to avoid influencing (or being influenced by) applications, however it should at least load the default configuration so it conforms to things like the system-wide crypto policy on OSs that have that feature. Signed-off-by: Simo Sorce <simo@redhat.com>
43a148b to
1de3511
Compare
|
the pkcs11-provider integration test failure is a recursion when we try to load the pkcs11 provider into the kryoptic's openssl context? |
In that case, I think doing this in the kryoptic pkcs11 module is not that great idea :) But for any other users of ossl bindings, ye, this looks good to me. |
This is why I had created a new context an not loaded the default config in the first place ... sounds like we should revert this commit and rethink the strategy. There are two reasons we wanted to load the default config:
Perhaps we should create a custom configuration file for kryoptic that loads just crypto-policies snippets but only the default provider. That would take care of both 1 and 2 w/o the risk of pulling in other providers that may break it? |
|
That makes it much more complicated, but likely only reasonable solution. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request modifies the OsslContext to automatically load the default OpenSSL configuration file and adds support for managing OpenSSL providers. It introduces a providers vector to track loaded modules, a method to load the legacy provider, and logic to unload providers when the context is dropped. The review feedback highlights a typo in the changelog and suggests using the trace_ossl! macro to improve error logging when provider loading fails.
Description
Changes kryoptic (in non-fips builds) to try to load the default openssl configuration on the custom context.
Because the configuration file could be missing for "legitimate" reasons, we do not treat as fatal the failure to load the default configuration.
Fixes #319
Checklist
This is not a code changeReviewer's checklist: