]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM DB: Remove unnecessary username prefix checks
authorJouni Malinen <j@w1.fi>
Sun, 2 Sep 2012 09:03:57 +0000 (12:03 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 2 Sep 2012 09:03:57 +0000 (12:03 +0300)
The EAP-SIM/AKA code is already validating the prefix and the following
lookup would not find matches if the prefix is incorrect, so there is no
need for the extra checks here.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_server/eap_sim_db.c

index e41c99fd47eb9840a9622294bcaa0e4a353bac9d..257013e3e6612fe225c163db2bb439036dd38f59 100644 (file)
@@ -1223,11 +1223,6 @@ eap_sim_db_get_permanent(struct eap_sim_db_data *data, const char *pseudonym)
 {
        struct eap_sim_pseudonym *p;
 
-       if (pseudonym[0] != EAP_SIM_PSEUDONYM_PREFIX &&
-           pseudonym[0] != EAP_AKA_PSEUDONYM_PREFIX &&
-           pseudonym[0] != EAP_AKA_PRIME_PSEUDONYM_PREFIX)
-               return NULL;
-
 #ifdef CONFIG_SQLITE
        if (data->sqlite_db)
                return db_get_pseudonym(data, pseudonym);
@@ -1256,11 +1251,6 @@ eap_sim_db_get_reauth_entry(struct eap_sim_db_data *data,
 {
        struct eap_sim_reauth *r;
 
-       if (reauth_id[0] != EAP_SIM_REAUTH_ID_PREFIX &&
-           reauth_id[0] != EAP_AKA_REAUTH_ID_PREFIX &&
-           reauth_id[0] != EAP_AKA_PRIME_REAUTH_ID_PREFIX)
-               return NULL;
-
 #ifdef CONFIG_SQLITE
        if (data->sqlite_db)
                return db_get_reauth(data, reauth_id);