aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/eap_tls/tls
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-02-09 14:57:50 +0100
committerMartin Willi <martin@revosec.ch>2010-08-03 15:39:25 +0200
commit97abf95412026355bfc3158ce9bb917cd014e2d3 (patch)
treead43b16a96efc1ab12903ead061a74ccc170601f /src/charon/plugins/eap_tls/tls
parentc8a2fca58cface0de90723d2e820b9d64a4cc043 (diff)
downloadstrongswan-97abf95412026355bfc3158ce9bb917cd014e2d3.tar.bz2
strongswan-97abf95412026355bfc3158ce9bb917cd014e2d3.tar.xz
TLS stack keeps a copy of server/peer identities
Diffstat (limited to 'src/charon/plugins/eap_tls/tls')
-rw-r--r--src/charon/plugins/eap_tls/tls/tls.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/charon/plugins/eap_tls/tls/tls.c b/src/charon/plugins/eap_tls/tls/tls.c
index 7bc7869da..39a46e2ce 100644
--- a/src/charon/plugins/eap_tls/tls/tls.c
+++ b/src/charon/plugins/eap_tls/tls/tls.c
@@ -74,6 +74,16 @@ struct private_tls_t {
bool is_server;
/**
+ * Server identity
+ */
+ identification_t *server;
+
+ /**
+ * Peer identity
+ */
+ identification_t *peer;
+
+ /**
* Negotiated TLS version
*/
tls_version_t version;
@@ -148,6 +158,8 @@ METHOD(tls_t, destroy, void,
this->fragmentation->destroy(this->fragmentation);
this->crypto->destroy(this->crypto);
this->handshake->destroy(this->handshake);
+ this->peer->destroy(this->peer);
+ this->server->destroy(this->server);
free(this);
}
@@ -172,18 +184,20 @@ tls_t *tls_create(bool is_server, identification_t *server,
},
.is_server = is_server,
.version = TLS_1_2,
+ .server = server->clone(server),
+ .peer = peer->clone(peer),
);
this->crypto = tls_crypto_create(&this->public);
if (is_server)
{
this->handshake = &tls_server_create(&this->public, this->crypto,
- server, peer)->handshake;
+ this->server, this->peer)->handshake;
}
else
{
this->handshake = &tls_peer_create(&this->public, this->crypto,
- peer, server)->handshake;
+ this->peer, this->server)->handshake;
}
this->fragmentation = tls_fragmentation_create(this->handshake);
this->compression = tls_compression_create(this->fragmentation);