]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM DB: Remove unneeded SQLite value copying
authorJouni Malinen <j@w1.fi>
Sat, 1 Sep 2012 18:26:26 +0000 (21:26 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 1 Sep 2012 18:26:26 +0000 (21:26 +0300)
These fields are used only as the search key, so the value is already
known and does not need to be copied from the database.

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

src/eap_server/eap_sim_db.c

index 5353acbbfb84eac4253d595b096ec702dbbd6ed7..474b17269db2a388a65208a0c6b9ba1980b589a4 100644 (file)
@@ -204,20 +204,11 @@ static int get_pseudonym_cb(void *ctx, int argc, char *argv[], char *col[])
 {
        struct eap_sim_db_data *data = ctx;
        int i;
-       size_t len;
 
        for (i = 0; i < argc; i++) {
                if (os_strcmp(col[i], "permanent") == 0 && argv[i]) {
                        os_strlcpy(data->db_tmp_identity, argv[i],
                                   sizeof(data->db_tmp_identity));
-               } else if (os_strcmp(col[i], "pseudonym") == 0 && argv[i]) {
-                       len = os_strlen(argv[i]);
-                       if (len >= sizeof(data->db_tmp_pseudonym_str))
-                               continue;
-                       os_memcpy(data->db_tmp_pseudonym_str, argv[i], len);
-                       data->db_tmp_pseudonym_str[len] = '\0';
-                       data->db_tmp_pseudonym.pseudonym =
-                               data->db_tmp_pseudonym_str;
                }
        }
 
@@ -316,7 +307,6 @@ static int get_reauth_cb(void *ctx, int argc, char *argv[], char *col[])
 {
        struct eap_sim_db_data *data = ctx;
        int i;
-       size_t len;
        struct eap_sim_reauth *reauth = &data->db_tmp_reauth;
 
        for (i = 0; i < argc; i++) {
@@ -324,13 +314,6 @@ static int get_reauth_cb(void *ctx, int argc, char *argv[], char *col[])
                        os_strlcpy(data->db_tmp_identity, argv[i],
                                   sizeof(data->db_tmp_identity));
                        reauth->permanent = data->db_tmp_identity;
-               } else if (os_strcmp(col[i], "reauth_id") == 0 && argv[i]) {
-                       len = os_strlen(argv[i]);
-                       if (len >= sizeof(data->db_tmp_pseudonym_str))
-                               continue;
-                       os_memcpy(data->db_tmp_pseudonym_str, argv[i], len);
-                       data->db_tmp_pseudonym_str[len] = '\0';
-                       reauth->reauth_id = data->db_tmp_pseudonym_str;
                } else if (os_strcmp(col[i], "counter") == 0 && argv[i]) {
                        reauth->counter = atoi(argv[i]);
                } else if (os_strcmp(col[i], "mk") == 0 && argv[i]) {