aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaresh Jayaram <c_njayar@qti.qualcomm.com>2014-04-24 22:21:27 +0530
committerSteve Kondik <shade@chemlab.org>2014-06-12 14:08:46 -0700
commitf01250d72955ed196a15c20605572d8d1ab8af79 (patch)
treefddf716e82dc7df041d42636dab1e35484ec3163
parent2fe7ba501cf927b9ed0df78c747ed4a25634b2ba (diff)
downloadandroid_external_wpa_supplicant_8-f01250d72955ed196a15c20605572d8d1ab8af79.tar.gz
android_external_wpa_supplicant_8-f01250d72955ed196a15c20605572d8d1ab8af79.tar.bz2
android_external_wpa_supplicant_8-f01250d72955ed196a15c20605572d8d1ab8af79.zip
Add SIM identifier to the network profile and cred block
This allows the specific SIM to be identified for authentication purposes in multi-SIM devices. This SIM number represents the index of the SIM slot. This SIM number shall be used for the authentication using the respective SIM for the Wi-Fi connection to the corresponding network. CRs-Fixed: 631880 Git-commit: 13f6a07efc3e737d8fcb8f7014cb961ce77e64ee Git-repo : git://w1.fi/srv/git/hostap.git Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Change-Id: I82becee92043e4da5a672353b1fdac6cf0bc531a
-rw-r--r--src/eap_peer/eap_config.h8
-rw-r--r--wpa_supplicant/README-HS202
-rw-r--r--wpa_supplicant/config.c8
-rw-r--r--wpa_supplicant/config.h8
-rw-r--r--wpa_supplicant/config_file.c5
-rw-r--r--wpa_supplicant/config_ssid.h1
-rw-r--r--wpa_supplicant/interworking.c1
-rw-r--r--wpa_supplicant/wpa_supplicant.conf2
8 files changed, 35 insertions, 0 deletions
diff --git a/src/eap_peer/eap_config.h b/src/eap_peer/eap_config.h
index 42f525b9..b8a0bd00 100644
--- a/src/eap_peer/eap_config.h
+++ b/src/eap_peer/eap_config.h
@@ -643,6 +643,14 @@ struct eap_peer_config {
* 2 = require valid OCSP stapling response
*/
int ocsp;
+
+ /**
+ * sim_num - User selected SIM identifier
+ *
+ * This variable is used for identifying which SIM is used if the system
+ * has more than one.
+ */
+ int sim_num;
};
diff --git a/wpa_supplicant/README-HS20 b/wpa_supplicant/README-HS20
index 7a570bdd..ce7554a8 100644
--- a/wpa_supplicant/README-HS20
+++ b/wpa_supplicant/README-HS20
@@ -197,6 +197,8 @@ Credentials can be pre-configured for automatic network selection:
# matching with the network. Multiple entries can be used to specify more
# than one SSID.
#
+# sim_num: Identifier for which SIM to use in multi-SIM devices
+#
# for example:
#
#cred={
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 97d59eb4..2b8b667a 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1565,6 +1565,7 @@ static const struct parse_data ssid_fields[] = {
{ INTe(engine) },
{ INTe(engine2) },
{ INT(eapol_flags) },
+ { INTe(sim_num) },
#endif /* IEEE8021X_EAPOL */
{ FUNC_KEY(wep_key0) },
{ FUNC_KEY(wep_key1) },
@@ -2033,6 +2034,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
ssid->eapol_flags = DEFAULT_EAPOL_FLAGS;
ssid->eap_workaround = DEFAULT_EAP_WORKAROUND;
ssid->eap.fragment_size = DEFAULT_FRAGMENT_SIZE;
+ ssid->eap.sim_num = DEFAULT_USER_SELECTED_SIM;
#endif /* IEEE8021X_EAPOL */
#ifdef CONFIG_HT_OVERRIDES
ssid->disable_ht = DEFAULT_DISABLE_HT;
@@ -2336,6 +2338,11 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
return 0;
}
+ if (os_strcmp(var, "sim_num") == 0) {
+ cred->sim_num = atoi(value);
+ return 0;
+ }
+
val = wpa_config_parse_string(value, &len);
if (val == NULL) {
wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "
@@ -2511,6 +2518,7 @@ struct wpa_cred * wpa_config_add_cred(struct wpa_config *config)
if (cred == NULL)
return NULL;
cred->id = id;
+ cred->sim_num = DEFAULT_USER_SELECTED_SIM;
if (last)
last->next = cred;
else
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index bce8d168..112dfa3e 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -210,6 +210,14 @@ struct wpa_cred {
size_t ssid_len;
} *excluded_ssid;
size_t num_excluded_ssid;
+
+ /**
+ * sim_num - User selected SIM identifier
+ *
+ * This variable is used for identifying which SIM is used if the system
+ * has more than one.
+ */
+ int sim_num;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 20935ce7..b4219581 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -219,6 +219,7 @@ static struct wpa_cred * wpa_config_read_cred(FILE *f, int *line, int id)
if (cred == NULL)
return NULL;
cred->id = id;
+ cred->sim_num = DEFAULT_USER_SELECTED_SIM;
while (wpa_config_get_line(buf, sizeof(buf), f, line, &pos)) {
if (os_strcmp(pos, "}") == 0) {
@@ -699,6 +700,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
INT_DEF(eap_workaround, DEFAULT_EAP_WORKAROUND);
STR(pac_file);
INT_DEFe(fragment_size, DEFAULT_FRAGMENT_SIZE);
+ INT_DEFe(sim_num, DEFAULT_USER_SELECTED_SIM);
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(frequency);
@@ -780,6 +782,9 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
fprintf(f, "\n");
}
}
+
+ if (cred->sim_num != DEFAULT_USER_SELECTED_SIM)
+ fprintf(f, "\tsim_num=%d\n", cred->sim_num);
}
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 3a442723..f3da0f17 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -33,6 +33,7 @@
#define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */
#define DEFAULT_AMPDU_FACTOR -1 /* no change */
#define DEFAULT_AMPDU_DENSITY -1 /* no change */
+#define DEFAULT_USER_SELECTED_SIM 1
struct psk_list_entry {
struct dl_list list;
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 06b08931..68bf6c36 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -859,6 +859,7 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
goto fail;
os_memcpy(ssid->ssid, ie + 2, ie[1]);
ssid->ssid_len = ie[1];
+ ssid->eap.sim_num = cred->sim_num;
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 6414f447..17cb1414 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -430,6 +430,8 @@ fast_reauth=1
# matching with the network. Multiple entries can be used to specify more
# than one SSID.
#
+# sim_num: Identifier for which SIM to use in multi-SIM devices
+#
# for example:
#
#cred={