]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Start PT-TLS client
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 11 Oct 2013 07:51:31 +0000 (09:51 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 12 Feb 2014 09:51:38 +0000 (10:51 +0100)
src/libcharon/plugins/eap_tnc/eap_tnc.c

index 8ff32f6e9d491611d22ba636cf627b10c6396a83..6f6452229f7bc6df98396686e00cedbf7a4c455a 100644 (file)
@@ -24,6 +24,8 @@
 #include <tncifimv.h>
 #include <tncif_names.h>
 
+#include <pt_tls_client.h>
+
 /**
  * Maximum size of an EAP-TNC message
  */
@@ -213,6 +215,8 @@ METHOD(eap_method_t, is_mutual, bool,
 METHOD(eap_method_t, destroy, void,
        private_eap_tnc_t *this)
 {
+       pt_tls_client_t *pt_tls_client;
+       identification_t *server, *client;
        char *pdp_server;
        u_int16_t pdp_port;
        host_t *host;
@@ -223,11 +227,15 @@ METHOD(eap_method_t, destroy, void,
        if (pdp_server)
        {
                host = host_create_from_dns(pdp_server, AF_UNSPEC, pdp_port);
+               server = identification_create_from_string(pdp_server);
+               client = tls->get_peer_id(tls);
                if (host)
                {
                        DBG2(DBG_TNC, "TODO: setup PT-TLS connection to '%s' at %#H",
                                 pdp_server, host);
-                       host->destroy(host);
+                       pt_tls_client = pt_tls_client_create(host, server,
+                                                                                                client->clone(client));
+                       pt_tls_client->destroy(pt_tls_client);
                }
        }
        tls->destroy(tls);