opencryptoki / openssl-ibmca

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

test/provider: Do not link against libica use dlopen instead #112

Closed ifranzki closed 5 months ago

ifranzki commented 5 months ago

When an application links against libica (via -lica), then the libica library constructor runs before the program's main function. Libica's library constructor does initialize OpenSSL and thus parses the config file.

However, the test programs set up some OpenSSL configuration related environment variables within function check_libica() called from the the main function. If libica has already initialized OpenSSL prior to that, OpenSSL won't initialize again, and thus these environment variables have no effect.

Dynamically load libica (via dlopen) only after setting the environment variables.