Lines Matching refs:ENGINE
28 #include <openssl/engine.h>
71 ENGINE *engine; /* functional reference to the engine */
72 EVP_PKEY *private_key; /* the private key if using engine */
543 * tls_engine_load_dynamic_generic - load any openssl engine
544 * @pre: an array of commands and values that load an engine initialized
545 * in the engine specific function
547 * engine (or %NULL if not required)
548 * @id: the engine id of the engine to load (only required if post is not %NULL
550 * This function is a generic function that loads any openssl engine.
557 ENGINE *engine;
560 engine = ENGINE_by_id(id);
561 if (engine) {
562 ENGINE_free(engine);
563 wpa_printf(MSG_DEBUG, "ENGINE: engine '%s' is already "
569 engine = ENGINE_by_id(dynamic_id);
570 if (engine == NULL) {
571 wpa_printf(MSG_INFO, "ENGINE: Can't find engine %s [%s]",
577 /* Perform the pre commands. This will load the engine. */
579 wpa_printf(MSG_DEBUG, "ENGINE: '%s' '%s'", pre[0], pre[1]);
580 if (ENGINE_ctrl_cmd_string(engine, pre[0], pre[1], 0) == 0) {
581 wpa_printf(MSG_INFO, "ENGINE: ctrl cmd_string failed: "
584 ENGINE_free(engine);
591 * Free the reference to the "dynamic" engine. The loaded engine can
594 ENGINE_free(engine);
596 engine = ENGINE_by_id(id);
597 if (engine == NULL) {
598 wpa_printf(MSG_INFO, "ENGINE: Can't find engine %s [%s]",
604 wpa_printf(MSG_DEBUG, "ENGINE: '%s' '%s'", post[0], post[1]);
605 if (ENGINE_ctrl_cmd_string(engine, post[0], post[1], 0) == 0) {
606 wpa_printf(MSG_DEBUG, "ENGINE: ctrl cmd_string failed:"
609 ENGINE_remove(engine);
610 ENGINE_free(engine);
615 ENGINE_free(engine);
622 * tls_engine_load_dynamic_pkcs11 - load the pkcs11 engine provided by opensc
650 wpa_printf(MSG_DEBUG, "ENGINE: Loading pkcs11 Engine from %s",
658 * tls_engine_load_dynamic_opensc - load the opensc engine provided by opensc
678 ENGINE: Loading OpenSC Engine from %s",
753 wpa_printf(MSG_DEBUG, "ENGINE: Loading dynamic engine");
797 wpa_printf(MSG_ERROR, "ENGINE: Engine ID not set");
801 wpa_printf(MSG_ERROR, "ENGINE: Smartcard PIN not set");
805 wpa_printf(MSG_ERROR, "ENGINE: Key Id not set");
810 conn->engine = ENGINE_by_id(engine_id);
811 if (!conn->engine) {
812 wpa_printf(MSG_ERROR, "ENGINE: engine %s not available [%s]",
816 if (ENGINE_init(conn->engine) != 1) {
817 wpa_printf(MSG_ERROR, "ENGINE: engine init failed "
818 "(engine: %s) [%s]", engine_id,
822 wpa_printf(MSG_DEBUG, "ENGINE: engine initialized");
824 if (ENGINE_ctrl_cmd_string(conn->engine, "PIN", pin, 0) == 0) {
825 wpa_printf(MSG_ERROR, "ENGINE: cannot set pin [%s]",
830 conn->private_key = ENGINE_load_private_key(conn->engine,
833 wpa_printf(MSG_ERROR, "ENGINE: cannot load private key with id"
844 /* test if the engine supports a LOAD_CERT_CTRL */
845 if (!ENGINE_ctrl(conn->engine, ENGINE_CTRL_GET_CMD_FROM_NAME,
847 wpa_printf(MSG_ERROR, "ENGINE: engine does not support"
857 if (conn->engine) {
858 ENGINE_free(conn->engine);
859 conn->engine = NULL;
877 wpa_printf(MSG_DEBUG, "ENGINE: engine deinit");
882 if (conn->engine) {
883 ENGINE_finish(conn->engine);
884 conn->engine = NULL;
1832 if (!ENGINE_ctrl_cmd(conn->engine, "LOAD_CERT_CTRL",
1834 wpa_printf(MSG_ERROR, "ENGINE: cannot load client cert with id"
1840 wpa_printf(MSG_ERROR, "ENGINE: did not properly cert with id"
1866 wpa_printf(MSG_DEBUG, "ENGINE: SSL_use_certificate --> "
1899 "Failed to add CA certificate from engine "
1912 wpa_printf(MSG_DEBUG, "OpenSSL: %s - added CA certificate from engine "
1928 "ENGINE: cannot use private key for TLS");
1938 wpa_printf(MSG_ERROR, "SSL: Configuration uses engine, but "
1939 "engine support was not compiled in");
2691 if (params->engine) {
2692 wpa_printf(MSG_DEBUG, "SSL: Initializing TLS engine");
2704 if (params->engine && params->ca_cert_id) {
2714 if (params->engine && params->cert_id) {
2722 if (params->engine && params->key_id) {
2723 wpa_printf(MSG_DEBUG, "TLS: Using private key from engine");