diff options
author | Martin Willi <martin@revosec.ch> | 2013-02-28 11:39:55 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-02-28 16:46:08 +0100 |
commit | 2de481e32b95c558b96237c25a15bf2baa375e93 (patch) | |
tree | ab8ddcd59c677b5426c9e826ced48f540c061d9b /src/libtls/tls.c | |
parent | 2ae0c9e6181421fc589798c64276a6310f13f1a2 (diff) | |
download | strongswan-2de481e32b95c558b96237c25a15bf2baa375e93.tar.bz2 strongswan-2de481e32b95c558b96237c25a15bf2baa375e93.tar.xz |
Delegate tls_t.get_{peer,server}_id to handshake layer
This allows to get updated peer identities if the peer can't authenticate,
or does when it is optional.
Diffstat (limited to 'src/libtls/tls.c')
-rw-r--r-- | src/libtls/tls.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/libtls/tls.c b/src/libtls/tls.c index 85a05a00b..6d33d843d 100644 --- a/src/libtls/tls.c +++ b/src/libtls/tls.c @@ -107,16 +107,6 @@ struct private_tls_t { bool is_server; /** - * Server identity - */ - identification_t *server; - - /** - * Peer identity - */ - identification_t *peer; - - /** * Negotiated TLS version */ tls_version_t version; @@ -362,13 +352,13 @@ METHOD(tls_t, is_server, bool, METHOD(tls_t, get_server_id, identification_t*, private_tls_t *this) { - return this->server; + return this->handshake->get_server_id(this->handshake); } METHOD(tls_t, get_peer_id, identification_t*, private_tls_t *this) { - return this->peer; + return this->handshake->get_peer_id(this->handshake); } METHOD(tls_t, get_version, tls_version_t, @@ -433,8 +423,6 @@ METHOD(tls_t, destroy, void, this->fragmentation->destroy(this->fragmentation); this->crypto->destroy(this->crypto); this->handshake->destroy(this->handshake); - DESTROY_IF(this->peer); - this->server->destroy(this->server); DESTROY_IF(this->application); this->alert->destroy(this->alert); @@ -480,8 +468,6 @@ tls_t *tls_create(bool is_server, identification_t *server, }, .is_server = is_server, .version = TLS_1_2, - .server = server->clone(server), - .peer = peer ? peer->clone(peer) : NULL, .application = application, .purpose = purpose, ); @@ -491,12 +477,12 @@ tls_t *tls_create(bool is_server, identification_t *server, if (is_server) { this->handshake = &tls_server_create(&this->public, this->crypto, - this->alert, this->server, this->peer)->handshake; + this->alert, server, peer)->handshake; } else { this->handshake = &tls_peer_create(&this->public, this->crypto, - this->alert, this->peer, this->server)->handshake; + this->alert, peer, server)->handshake; } this->fragmentation = tls_fragmentation_create(this->handshake, this->alert, this->application); |