Lines Matching full:engine
24 #include <openssl/engine.h>
92 ENGINE *engine; /* functional reference to the engine */
93 EVP_PKEY *private_key; /* the private key if using engine */
591 * tls_engine_load_dynamic_generic - load any openssl engine
592 * @pre: an array of commands and values that load an engine initialized
593 * in the engine specific function
595 * engine (or %NULL if not required)
596 * @id: the engine id of the engine to load (only required if post is not %NULL
598 * This function is a generic function that loads any openssl engine.
605 ENGINE *engine;
608 engine = ENGINE_by_id(id);
609 if (engine) {
610 ENGINE_free(engine);
611 wpa_printf(MSG_DEBUG, "ENGINE: engine '%s' is already "
617 engine = ENGINE_by_id(dynamic_id);
618 if (engine == NULL) {
619 wpa_printf(MSG_INFO, "ENGINE: Can't find engine %s [%s]",
625 /* Perform the pre commands. This will load the engine. */
627 wpa_printf(MSG_DEBUG, "ENGINE: '%s' '%s'", pre[0], pre[1]);
628 if (ENGINE_ctrl_cmd_string(engine, pre[0], pre[1], 0) == 0) {
629 wpa_printf(MSG_INFO, "ENGINE: ctrl cmd_string failed: "
632 ENGINE_free(engine);
639 * Free the reference to the "dynamic" engine. The loaded engine can
642 ENGINE_free(engine);
644 engine = ENGINE_by_id(id);
645 if (engine == NULL) {
646 wpa_printf(MSG_INFO, "ENGINE: Can't find engine %s [%s]",
652 wpa_printf(MSG_DEBUG, "ENGINE: '%s' '%s'", post[0], post[1]);
653 if (ENGINE_ctrl_cmd_string(engine, post[0], post[1], 0) == 0) {
654 wpa_printf(MSG_DEBUG, "ENGINE: ctrl cmd_string failed:"
657 ENGINE_remove(engine);
658 ENGINE_free(engine);
663 ENGINE_free(engine);
670 * tls_engine_load_dynamic_pkcs11 - load the pkcs11 engine provided by opensc
698 wpa_printf(MSG_DEBUG, "ENGINE: Loading pkcs11 Engine from %s",
706 * tls_engine_load_dynamic_opensc - load the opensc engine provided by opensc
726 wpa_printf(MSG_DEBUG, "ENGINE: Loading OpenSC Engine from %s",
823 wpa_printf(MSG_DEBUG, "ENGINE: Loading dynamic engine");
874 wpa_printf(MSG_ERROR, "ENGINE: Engine ID not set");
879 wpa_printf(MSG_ERROR, "ENGINE: Smartcard PIN not set");
884 wpa_printf(MSG_ERROR, "ENGINE: Key Id not set");
892 conn->engine = ENGINE_by_id(engine_id);
893 if (!conn->engine) {
894 wpa_printf(MSG_ERROR, "ENGINE: engine %s not available [%s]",
898 if (ENGINE_init(conn->engine) != 1) {
899 wpa_printf(MSG_ERROR, "ENGINE: engine init failed "
900 "(engine: %s) [%s]", engine_id,
904 wpa_printf(MSG_DEBUG, "ENGINE: engine initialized");
907 if (ENGINE_ctrl_cmd_string(conn->engine, "PIN", pin, 0) == 0) {
908 wpa_printf(MSG_ERROR, "ENGINE: cannot set pin [%s]",
914 conn->private_key = ENGINE_load_private_key(conn->engine,
917 wpa_printf(MSG_ERROR, "ENGINE: cannot load private key with id"
928 /* test if the engine supports a LOAD_CERT_CTRL */
929 if (!ENGINE_ctrl(conn->engine, ENGINE_CTRL_GET_CMD_FROM_NAME,
931 wpa_printf(MSG_ERROR, "ENGINE: engine does not support"
941 if (conn->engine) {
942 ENGINE_free(conn->engine);
943 conn->engine = NULL;
961 wpa_printf(MSG_DEBUG, "ENGINE: engine deinit");
966 if (conn->engine) {
967 ENGINE_finish(conn->engine);
968 conn->engine = NULL;
2068 if (!ENGINE_ctrl_cmd(conn->engine, "LOAD_CERT_CTRL",
2070 wpa_printf(MSG_ERROR, "ENGINE: cannot load client cert with id"
2076 wpa_printf(MSG_ERROR, "ENGINE: did not properly cert with id"
2102 wpa_printf(MSG_DEBUG, "ENGINE: SSL_use_certificate --> "
2135 "Failed to add CA certificate from engine "
2148 wpa_printf(MSG_DEBUG, "OpenSSL: %s - added CA certificate from engine "
2166 "ENGINE: cannot use private key for TLS");
2176 wpa_printf(MSG_ERROR, "SSL: Configuration uses engine, but "
2177 "engine support was not compiled in");
3199 if (params->engine) {
3200 wpa_printf(MSG_DEBUG, "SSL: Initializing TLS engine");
3213 if (params->engine && params->ca_cert_id) {
3223 if (params->engine && params->cert_id) {
3231 if (params->engine && params->key_id) {
3232 wpa_printf(MSG_DEBUG, "TLS: Using private key from engine");