From ebb87f08f7cb3b5402cea1d7ad7e3ef559bd3451 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Thu, 17 Jan 2013 23:32:34 +0100 Subject: Make IKE/EAP IDs available to TNC server/client --- .../plugins/tnccs_dynamic/tnccs_dynamic.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/libcharon/plugins/tnccs_dynamic/tnccs_dynamic.c') diff --git a/src/libcharon/plugins/tnccs_dynamic/tnccs_dynamic.c b/src/libcharon/plugins/tnccs_dynamic/tnccs_dynamic.c index 03795a947..0fbb2f67e 100644 --- a/src/libcharon/plugins/tnccs_dynamic/tnccs_dynamic.c +++ b/src/libcharon/plugins/tnccs_dynamic/tnccs_dynamic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Andreas Steffen + * Copyright (C) 2011-2013 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -31,6 +31,16 @@ struct private_tnccs_dynamic_t { */ tls_t public; + /** + * Server identity + */ + identification_t *server; + + /** + * Client identity + */ + identification_t *peer; + /** * Detected TNC IF-TNCCS stack */ @@ -76,7 +86,8 @@ METHOD(tls_t, process, status_t, type = determine_tnccs_protocol(*(char*)buf); DBG1(DBG_TNC, "%N protocol detected dynamically", tnccs_type_names, type); - this->tls = (tls_t*)tnc->tnccs->create_instance(tnc->tnccs, type, TRUE); + this->tls = (tls_t*)tnc->tnccs->create_instance(tnc->tnccs, type, TRUE, + this->server, this->peer); if (!this->tls) { DBG1(DBG_TNC, "N% protocol not supported", tnccs_type_names, type); @@ -120,13 +131,16 @@ METHOD(tls_t, destroy, void, private_tnccs_dynamic_t *this) { DESTROY_IF(this->tls); + this->server->destroy(this->server); + this->peer->destroy(this->peer); free(this); } /** * See header */ -tls_t *tnccs_dynamic_create(bool is_server) +tls_t *tnccs_dynamic_create(bool is_server, identification_t *server, + identification_t *peer) { private_tnccs_dynamic_t *this; @@ -140,6 +154,8 @@ tls_t *tnccs_dynamic_create(bool is_server) .get_eap_msk = _get_eap_msk, .destroy = _destroy, }, + .server = server->clone(server), + .peer = peer->clone(peer), ); return &this->public; -- cgit v1.2.3