Merged the hostap_2.6 updates, and the Leap of Faith work, from the hostap_update...
[mech_eap.git] / libeap / src / eap_server / eap_server_gtc.c
index 79b9696..193a851 100644 (file)
@@ -2,14 +2,8 @@
  * hostapd / EAP-GTC (RFC 3748)
  * Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include "includes.h"
@@ -181,7 +175,7 @@ static void eap_gtc_process(struct eap_sm *sm, void *priv,
        }
 
        if (rlen != sm->user->password_len ||
-           os_memcmp(pos, sm->user->password, rlen) != 0) {
+           os_memcmp_const(pos, sm->user->password, rlen) != 0) {
                wpa_printf(MSG_DEBUG, "EAP-GTC: Done - Failure");
                data->state = FAILURE;
        } else {
@@ -208,7 +202,6 @@ static Boolean eap_gtc_isSuccess(struct eap_sm *sm, void *priv)
 int eap_server_gtc_register(void)
 {
        struct eap_method *eap;
-       int ret;
 
        eap = eap_server_method_alloc(EAP_SERVER_METHOD_INTERFACE_VERSION,
                                      EAP_VENDOR_IETF, EAP_TYPE_GTC, "GTC");
@@ -223,8 +216,5 @@ int eap_server_gtc_register(void)
        eap->isDone = eap_gtc_isDone;
        eap->isSuccess = eap_gtc_isSuccess;
 
-       ret = eap_server_method_register(eap);
-       if (ret)
-               eap_server_method_free(eap);
-       return ret;
+       return eap_server_method_register(eap);
 }