aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtnccs/plugins
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-08-09 22:10:37 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-08-15 23:34:22 +0200
commit97b1d39de5f1041497fe9de7b3c25d9d28947a50 (patch)
tree8509327b874c1ff58db9ca72ee2526d287c56fcb /src/libtnccs/plugins
parent6d6100c2bc83688080e24e4f8e25efea21ca9f08 (diff)
downloadstrongswan-97b1d39de5f1041497fe9de7b3c25d9d28947a50.tar.bz2
strongswan-97b1d39de5f1041497fe9de7b3c25d9d28947a50.tar.xz
Extract client identity and authentication type from SASL authentication
Diffstat (limited to 'src/libtnccs/plugins')
-rw-r--r--src/libtnccs/plugins/tnccs_11/tnccs_11.c8
-rw-r--r--src/libtnccs/plugins/tnccs_20/tnccs_20.c8
-rw-r--r--src/libtnccs/plugins/tnccs_dynamic/tnccs_dynamic.c12
3 files changed, 28 insertions, 0 deletions
diff --git a/src/libtnccs/plugins/tnccs_11/tnccs_11.c b/src/libtnccs/plugins/tnccs_11/tnccs_11.c
index 715586167..7fc7e6d76 100644
--- a/src/libtnccs/plugins/tnccs_11/tnccs_11.c
+++ b/src/libtnccs/plugins/tnccs_11/tnccs_11.c
@@ -525,6 +525,13 @@ METHOD(tls_t, get_server_id, identification_t*,
return this->server;
}
+METHOD(tls_t, set_peer_id, void,
+ private_tnccs_11_t *this, identification_t *id)
+{
+ DESTROY_IF(this->peer);
+ this->peer = id->clone(id);
+}
+
METHOD(tls_t, get_peer_id, identification_t*,
private_tnccs_11_t *this)
{
@@ -611,6 +618,7 @@ tnccs_t* tnccs_11_create(bool is_server,
.build = _build,
.is_server = _is_server,
.get_server_id = _get_server_id,
+ .set_peer_id = _set_peer_id,
.get_peer_id = _get_peer_id,
.get_purpose = _get_purpose,
.is_complete = _is_complete,
diff --git a/src/libtnccs/plugins/tnccs_20/tnccs_20.c b/src/libtnccs/plugins/tnccs_20/tnccs_20.c
index e5117e829..5d2d7ee25 100644
--- a/src/libtnccs/plugins/tnccs_20/tnccs_20.c
+++ b/src/libtnccs/plugins/tnccs_20/tnccs_20.c
@@ -834,6 +834,13 @@ METHOD(tls_t, get_server_id, identification_t*,
return this->server;
}
+METHOD(tls_t, set_peer_id, void,
+ private_tnccs_20_t *this, identification_t *id)
+{
+ DESTROY_IF(this->peer);
+ this->peer = id->clone(id);
+}
+
METHOD(tls_t, get_peer_id, identification_t*,
private_tnccs_20_t *this)
{
@@ -922,6 +929,7 @@ tnccs_t* tnccs_20_create(bool is_server,
.build = _build,
.is_server = _is_server,
.get_server_id = _get_server_id,
+ .set_peer_id = _set_peer_id,
.get_peer_id = _get_peer_id,
.get_purpose = _get_purpose,
.is_complete = _is_complete,
diff --git a/src/libtnccs/plugins/tnccs_dynamic/tnccs_dynamic.c b/src/libtnccs/plugins/tnccs_dynamic/tnccs_dynamic.c
index bc3112686..a52ffedbb 100644
--- a/src/libtnccs/plugins/tnccs_dynamic/tnccs_dynamic.c
+++ b/src/libtnccs/plugins/tnccs_dynamic/tnccs_dynamic.c
@@ -135,6 +135,17 @@ METHOD(tls_t, get_server_id, identification_t*,
return this->server;
}
+METHOD(tls_t, set_peer_id, void,
+ private_tnccs_dynamic_t *this, identification_t *id)
+{
+ DESTROY_IF(this->peer);
+ this->peer = id->clone(id);
+ if (this->tls)
+ {
+ this->tls->set_peer_id(this->tls, id);
+ }
+}
+
METHOD(tls_t, get_peer_id, identification_t*,
private_tnccs_dynamic_t *this)
{
@@ -208,6 +219,7 @@ tnccs_t* tnccs_dynamic_create(bool is_server,
.build = _build,
.is_server = _is_server,
.get_server_id = _get_server_id,
+ .set_peer_id = _set_peer_id,
.get_peer_id = _get_peer_id,
.get_purpose = _get_purpose,
.is_complete = _is_complete,