aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-01-20 23:36:31 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-02-11 15:30:44 +0100
commitbd1ee5bdc43979824e883f0c11d509700d8e9d4c (patch)
tree59508623649a1aff04106f005f48dc98ba247efe /src/libtls
parentebb87f08f7cb3b5402cea1d7ad7e3ef559bd3451 (diff)
downloadstrongswan-bd1ee5bdc43979824e883f0c11d509700d8e9d4c.tar.bz2
strongswan-bd1ee5bdc43979824e883f0c11d509700d8e9d4c.tar.xz
make AR identities available to IMVs via IF-IMV 1.4 draft
Diffstat (limited to 'src/libtls')
-rw-r--r--src/libtls/tls.c14
-rw-r--r--src/libtls/tls.h14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/libtls/tls.c b/src/libtls/tls.c
index dea08e3eb..85a05a00b 100644
--- a/src/libtls/tls.c
+++ b/src/libtls/tls.c
@@ -359,6 +359,18 @@ METHOD(tls_t, is_server, bool,
return this->is_server;
}
+METHOD(tls_t, get_server_id, identification_t*,
+ private_tls_t *this)
+{
+ return this->server;
+}
+
+METHOD(tls_t, get_peer_id, identification_t*,
+ private_tls_t *this)
+{
+ return this->peer;
+}
+
METHOD(tls_t, get_version, tls_version_t,
private_tls_t *this)
{
@@ -457,6 +469,8 @@ tls_t *tls_create(bool is_server, identification_t *server,
.process = _process,
.build = _build,
.is_server = _is_server,
+ .get_server_id = _get_server_id,
+ .get_peer_id = _get_peer_id,
.get_version = _get_version,
.set_version = _set_version,
.get_purpose = _get_purpose,
diff --git a/src/libtls/tls.h b/src/libtls/tls.h
index 6b4876f73..c8186b829 100644
--- a/src/libtls/tls.h
+++ b/src/libtls/tls.h
@@ -193,6 +193,20 @@ struct tls_t {
bool (*is_server)(tls_t *this);
/**
+ * Return the server identity
+ *
+ * @return Server identity
+ */
+ identification_t* (*get_server_id)(tls_t *this);
+
+ /**
+ * Return the peer identity
+ *
+ * @return Peer identity
+ */
+ identification_t* (*get_peer_id)(tls_t *this);
+
+ /**
* Get the negotiated TLS/SSL version.
*
* @return negotiated TLS version