opencryptoki / openssl-ibmca

OpenSSL engine and provider for libica.
Apache License 2.0
6 stars 15 forks source link

engine: Only register those algos specified with default_algorithms #102

Closed ifranzki closed 1 year ago

ifranzki commented 1 year ago

As part of OpenSSl initialization, the engine(s) configured in the OpenSSL config file are loaded, and its algorithms (methods) are registered according to the default_algorithms setting.

However, later during initialization, ENGINE_register_all_complete() is called which unconditionally registered all algorithms (methods) of the loaded engines again, unless the engine flag ENGINE_FLAGS_NO_REGISTER_ALL is set.

Set the ENGINE_FLAGS_NO_REGISTER_ALL flag during IBMCA engine initialization to avoid unconditional registration of all algorithms. We only want to register thise algorithms specified in the default_algorithms configuration setting.

Note that if the default_algorithms setting is omitted in the OpenSSL config file, then no algorithms will be registered.