summaryrefslogtreecommitdiff
path: root/src/charon/plugins/eap_md5/eap_md5.c
diff options
context:
space:
mode:
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;
}