aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls/tls.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-08-12 23:56:44 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-08-12 23:58:54 +0200
commit1327839da8e92c101dbe160d6e82d83b5ed6e788 (patch)
tree87136a6eae9a99ae5b58eb8f8fac3297ccc3a7ee /src/libtls/tls.c
parent123a84d3dba9c5e88f101aab222db44e25db5a4a (diff)
downloadstrongswan-1327839da8e92c101dbe160d6e82d83b5ed6e788.tar.bz2
strongswan-1327839da8e92c101dbe160d6e82d83b5ed6e788.tar.xz
added generic TLS application data handler and specific EAP-TTLS instantiation
Diffstat (limited to 'src/libtls/tls.c')
-rw-r--r--src/libtls/tls.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libtls/tls.c b/src/libtls/tls.c
index f8f7e848e..24f442ca9 100644
--- a/src/libtls/tls.c
+++ b/src/libtls/tls.c
@@ -110,6 +110,11 @@ struct private_tls_t {
* TLS handshake protocol handler
*/
tls_handshake_t *handshake;
+
+ /**
+ * TLS application data handler
+ */
+ tls_application_t *application;
};
METHOD(tls_t, process, status_t,
@@ -164,6 +169,7 @@ METHOD(tls_t, destroy, void,
this->handshake->destroy(this->handshake);
this->peer->destroy(this->peer);
this->server->destroy(this->server);
+ DESTROY_IF(this->application);
free(this);
}
@@ -172,7 +178,8 @@ METHOD(tls_t, destroy, void,
* See header
*/
tls_t *tls_create(bool is_server, identification_t *server,
- identification_t *peer, char *msk_label)
+ identification_t *peer, char *msk_label,
+ tls_application_t *application)
{
private_tls_t *this;
@@ -191,6 +198,7 @@ tls_t *tls_create(bool is_server, identification_t *server,
.version = TLS_1_2,
.server = server->clone(server),
.peer = peer->clone(peer),
+ .application = application,
);
this->crypto = tls_crypto_create(&this->public, msk_label);
@@ -204,7 +212,8 @@ tls_t *tls_create(bool is_server, identification_t *server,
this->handshake = &tls_peer_create(&this->public, this->crypto,
this->peer, this->server)->handshake;
}
- this->fragmentation = tls_fragmentation_create(this->handshake);
+ this->fragmentation = tls_fragmentation_create(this->handshake,
+ this->application);
this->compression = tls_compression_create(this->fragmentation);
this->protection = tls_protection_create(&this->public, this->compression);
this->crypto->set_protection(this->crypto, this->protection);