Hello - I am using M2Crypto which wraps OpenSSL, but have translated my M2Crypto commands into OpenSSL methods. I do a set of commands to get the certificate and key off the USB eToken. I am unsure how to clean up my engines. Do I need to do all three of the followings commands: ENGINE_finish(), ENGINE_cleanup() and ENGINE_free? Is there a specific order they need to occur in? Thanks!
ENGINE_load_dynamic() dynamic = ENGINE_by_id("dynamic") ENGINE_ctrl_cmd_string("SO_PATH", "/usr/local/ssl/lib/engines/engine_pkcs11.so") ENGINE_ctrl_cmd_string("ID","pkcs11") ENGINE_ctrl_cmd_string("LIST_ADD", "1") ENGINE_ctrl_cmd_string("LOAD", None) pkcs = ENGINE_by_id("pkcs11") ENGINE_ctrl_cmd_string("MODULE_PATH", "/usr/lib/libeTPksc11.so") ENGINE_init(pkcs) # Get the certificate and key off the eToken ENGINE_ctrl_cmd_string("PIN", "password") cert = ENGINE_ctrl_cmd("LOAD_CERT_CTRL") key = ENGINE_load_private_key ENGINE_finish(dynamic) ENGINE_finish(pkcs) ENGINE_free(pkcs)