aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls
diff options
context:
space:
mode:
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