Closed ueno closed 1 week ago
then a) why did
free_ossl_objects
get called in the first place and/or b) why is EVP_MD_free not also replaced with an "alternative TLS lib" variant?
Let me answer (b) first: the objects being freed here (i.e., fetched algorithm implementations) are exclusively used by the OpenSSL implementation, not used nor needed for alternative TLS lib variants.
For (a), to avoid calling free_ossl_objects
entirely, liboqs needs to know which objects are used and which are not, as the current mechanism allows partial override (OpenSSL for SHA3 but GnuTLS for SHA2, ...).
the current mechanism allows partial override
That's the explanation I've been looking for, Thanks @ueno .
When OQS_DLOPENOPENSSL is designated and low-level primitives are overridden with OQS_set_callbacks, OQSdestroy still indirectly calls EVP_free from OpenSSL. This adds a extra NULL check to avoid that.