I have an odd situation in my application. I am using the EVP methods in OpenSSL to compute digests and perform encryption. At the end of it, I am performing an EVP_cleanup() in the destructor of my CryptoProvider class (the main gateway to my application). It unloads all the algorithms etc. from the OpenSSL state.
However, this makes it impossible for seamless usage of OpenSSL outside my application, if the client is using it for something else. It cleans up their work as well.
Now, I am left with these choices:
Ignore EVP_cleanup(). Will this result in leaks or other consequences?
Set up a static API for cleanup in my application, that the client must call towards the end of their lifetime, which is much after the lifetime of my application.
Just trust the client to call EVP_cleanup at the end of its lifetime.
What do you think you would do here?