implemented server side support for EAP-TTLS
[strongswan.git] / src / libcharon / plugins / eap_ttls / eap_ttls.c
index 1139a3f..ad3360d 100644 (file)
@@ -14,6 +14,8 @@
  */
 
 #include "eap_ttls.h"
+#include "eap_ttls_peer.h"
+#include "eap_ttls_server.h"
 
 #include <tls.h>
 
@@ -423,7 +425,8 @@ METHOD(eap_method_t, destroy, void,
  * Generic private constructor
  */
 static eap_ttls_t *eap_ttls_create(identification_t *server,
-                                                                identification_t *peer, bool is_server)
+                                                                  identification_t *peer, bool is_server,
+                                                                  tls_application_t *application)
 {
        private_eap_ttls_t *this;
 
@@ -439,19 +442,21 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
                .is_server = is_server,
        );
        /* MSK PRF ASCII constant label according to EAP-TTLS RFC 5281 */
-       this->tls = tls_create(is_server, server, peer, "ttls keying material");
-
+       this->tls = tls_create(is_server, server, peer, FALSE,
+                                                  "ttls keying material", application);
        return &this->public;
 }
 
 eap_ttls_t *eap_ttls_create_server(identification_t *server,
-                                                                identification_t *peer)
+                                                                  identification_t *peer)
 {
-       return eap_ttls_create(server, peer, TRUE);
+       return eap_ttls_create(server, peer, TRUE,
+                                                  &eap_ttls_server_create(server, peer)->application);
 }
 
 eap_ttls_t *eap_ttls_create_peer(identification_t *server,
-                                                          identification_t *peer)
+                                                                identification_t *peer)
 {
-       return eap_ttls_create(server, peer, FALSE);
+       return eap_ttls_create(server, peer, FALSE,
+                                                  &eap_ttls_peer_create(server, peer)->application);
 }