summaryrefslogtreecommitdiff
path: root/src/charon/plugins/eap_md5/eap_md5.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
commit8b80ab5a6950ce6515f477624794defd7531642a (patch)
treeaa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/charon/plugins/eap_md5/eap_md5.c
parentdb67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff)
downloadvyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz
vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
Diffstat (limited to 'src/charon/plugins/eap_md5/eap_md5.c')
-rw-r--r--src/charon/plugins/eap_md5/eap_md5.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/charon/plugins/eap_md5/eap_md5.c b/src/charon/plugins/eap_md5/eap_md5.c
index 990d64011..0781e024b 100644
--- a/src/charon/plugins/eap_md5/eap_md5.c
+++ b/src/charon/plugins/eap_md5/eap_md5.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: eap_md5.c 3806 2008-04-15 05:56:35Z martin $
+ * $Id: eap_md5.c 4276 2008-08-22 10:44:51Z martin $
*/
#include "eap_md5.h"
@@ -242,6 +242,8 @@ static bool is_mutual(private_eap_md5_t *this)
*/
static void destroy(private_eap_md5_t *this)
{
+ this->peer->destroy(this->peer);
+ this->server->destroy(this->server);
chunk_free(&this->challenge);
free(this);
}
@@ -262,10 +264,10 @@ static private_eap_md5_t *eap_md5_create_generic(identification_t *server,
this->public.eap_method_interface.destroy = (void(*)(eap_method_t*))destroy;
/* private data */
- this->peer = peer;
- this->server = server;
+ this->peer = peer->clone(peer);
+ this->server = server->clone(server);
this->challenge = chunk_empty;
- this->identifier = random();
+ this->identifier = 0;
return this;
}
@@ -280,6 +282,11 @@ eap_md5_t *eap_md5_create_server(identification_t *server, identification_t *pee
this->public.eap_method_interface.initiate = (status_t(*)(eap_method_t*,eap_payload_t**))initiate_server;
this->public.eap_method_interface.process = (status_t(*)(eap_method_t*,eap_payload_t*,eap_payload_t**))process_server;
+ /* generate a non-zero identifier */
+ do {
+ this->identifier = random();
+ } while (!this->identifier);
+
return &this->public;
}