From 97abf95412026355bfc3158ce9bb917cd014e2d3 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 9 Feb 2010 14:57:50 +0100 Subject: TLS stack keeps a copy of server/peer identities --- src/charon/plugins/eap_tls/tls/tls.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/charon/plugins/eap_tls/tls/tls.c') 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 @@ -73,6 +73,16 @@ struct private_tls_t { */ bool is_server; + /** + * Server identity + */ + identification_t *server; + + /** + * Peer identity + */ + identification_t *peer; + /** * Negotiated TLS 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); -- cgit v1.2.3