aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-30 13:43:55 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-30 13:43:55 (GMT)
commit03ed332407cb2c2774593854d232ab1b2c67f952 (patch)
tree5eff947a10a7f2df5ff9b4e4a3ee51706118e7df /wpa_supplicant
parent0fab9ce67a2fc00518af33d5f6b2294a0174886e (diff)
downloadhostap-03ed332407cb2c2774593854d232ab1b2c67f952.zip
hostap-03ed332407cb2c2774593854d232ab1b2c67f952.tar.gz
hostap-03ed332407cb2c2774593854d232ab1b2c67f952.tar.bz2
Interworking: Allow cred blocks not to be saved to a file
The new cred block parameter 'temporary' can be used to indicate that a cred block is not to be saved to wpa_supplicant configuration file (e.g., "SET_CRED 0 temporary 1"). This is similar to the concept of temporary network blocks and allows cred blocks to be managed outside the wpa_supplicant config file when other parameters are still saved to the file written by wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/README-HS204
-rw-r--r--wpa_supplicant/config.c5
-rw-r--r--wpa_supplicant/config.h5
-rw-r--r--wpa_supplicant/config_file.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.conf2
5 files changed, 18 insertions, 0 deletions
diff --git a/wpa_supplicant/README-HS20 b/wpa_supplicant/README-HS20
index 61e4a4d..ad29ef7 100644
--- a/wpa_supplicant/README-HS20
+++ b/wpa_supplicant/README-HS20
@@ -109,6 +109,8 @@ Credentials can be pre-configured for automatic network selection:
#
# credential fields:
#
+# temporary: Whether this credential is temporary and not to be saved
+#
# priority: Priority group
# By default, all networks and credentials get the same priority group
# (0). This field can be used to give higher priority for credentials
@@ -269,6 +271,8 @@ OK
OK
> set_cred 0 priority 1
OK
+> set_cred 0 temporary 1
+OK
Add a SIM credential using a simulated SIM/USIM card for testing:
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 9ceaaf8..5301ed7 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2393,6 +2393,11 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
char *val;
size_t len;
+ if (os_strcmp(var, "temporary") == 0) {
+ cred->temporary = atoi(value);
+ return 0;
+ }
+
if (os_strcmp(var, "priority") == 0) {
cred->priority = atoi(value);
return 0;
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 068679e..e24772d 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -52,6 +52,11 @@ struct wpa_cred {
int id;
/**
+ * temporary - Whether this credential is temporary and not to be saved
+ */
+ int temporary;
+
+ /**
* priority - Priority group
*
* By default, all networks and credentials get the same priority group
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 7d32867..6312a77 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1110,6 +1110,8 @@ int wpa_config_write(const char *name, struct wpa_config *config)
wpa_config_write_global(f, config);
for (cred = config->cred; cred; cred = cred->next) {
+ if (cred->temporary)
+ continue;
fprintf(f, "\ncred={\n");
wpa_config_write_cred(f, cred);
fprintf(f, "}\n");
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 08b720f..9d3bf6d 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -342,6 +342,8 @@ fast_reauth=1
#
# credential fields:
#
+# temporary: Whether this credential is temporary and not to be saved
+#
# priority: Priority group
# By default, all networks and credentials get the same priority group
# (0). This field can be used to give higher priority for credentials