[openssl-dev] OPENSSL_cleanup additional

Roumen Petrov openssl at roumenpetrov.info
Tue Feb 23 20:25:27 UTC 2016


Hello,

I just finish tests with new initialization methods. Memory detection 
tool report a number of memory leaks.

Startup code is:
	OPENSSL_init_crypto(
	    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
	    OPENSSL_INIT_ADD_ALL_CIPHERS |
	    OPENSSL_INIT_ADD_ALL_DIGESTS |
	    OPENSSL_INIT_LOAD_CONFIG, NULL);

Default configuration describes a cryptographic module :
------------------
#[ default ]
openssl_conf = config

[ config ]
engines = engine_section

[ engine_section ]
engine1 = engine_conf1

[ engine_conf1 ]
engine_id = foo
...
------------------

At exit OPENSSL_cleanup is not enough.
It seems to me call of ENGINE_cleanup() and CONF_modules_unload(1) 
before cleanup suppress memory warnings.


Another point - why OPENSSL_config duplicate name of configuration file?


Regards,
Roumen


More information about the openssl-dev mailing list