aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config_winreg.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-11-26 18:47:24 (GMT)
committerJouni Malinen <j@w1.fi>2008-11-26 18:47:24 (GMT)
commitf855f923a735c38b0ec918f3302173bf3e8e7a7f (patch)
treeb43ddb34a95893a58abea6f24c7ab4033ec89b36 /wpa_supplicant/config_winreg.c
parent2f4eb314547bcbeea9a4b89c0d20cf6a2fb553cc (diff)
downloadhostap-f855f923a735c38b0ec918f3302173bf3e8e7a7f.zip
hostap-f855f923a735c38b0ec918f3302173bf3e8e7a7f.tar.gz
hostap-f855f923a735c38b0ec918f3302173bf3e8e7a7f.tar.bz2
WPS: Moved UUID configuration from phase1 into global config area
Diffstat (limited to 'wpa_supplicant/config_winreg.c')
-rw-r--r--wpa_supplicant/config_winreg.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/wpa_supplicant/config_winreg.c b/wpa_supplicant/config_winreg.c
index 48e5c80..466908b 100644
--- a/wpa_supplicant/config_winreg.c
+++ b/wpa_supplicant/config_winreg.c
@@ -32,6 +32,7 @@
#include "includes.h"
#include "common.h"
+#include "uuid.h"
#include "config.h"
#ifndef WPA_KEY_ROOT
@@ -161,6 +162,26 @@ static char * wpa_config_read_reg_string(HKEY hk, const TCHAR *name)
}
+#ifdef CONFIG_WPS
+static int wpa_config_read_global_uuid(struct wpa_config *config, HKEY hk)
+{
+ char *str;
+ int ret = 0;
+
+ str = wpa_config_read_reg_string(hk, TEXT("uuid"));
+ if (str == NULL)
+ return 0;
+
+ if (uuid_str2bin(str, config->uuid))
+ ret = -1;
+
+ os_free(str);
+
+ return ret;
+}
+#endif /* CONFIG_WPS */
+
+
static int wpa_config_read_global(struct wpa_config *config, HKEY hk)
{
int errors = 0;
@@ -191,6 +212,11 @@ static int wpa_config_read_global(struct wpa_config *config, HKEY hk)
config->ctrl_interface = wpa_config_read_reg_string(
hk, TEXT("ctrl_interface"));
+#ifdef CONFIG_WPS
+ if (wpa_config_read_global_uuid(config, hk))
+ errors++;
+#endif /* CONFIG_WPS */
+
return errors ? -1 : 0;
}
@@ -492,6 +518,13 @@ static int wpa_config_write_global(struct wpa_config *config, HKEY hk)
wpa_config_write_reg_dword(hk, TEXT("update_config"),
config->update_config,
0);
+#ifdef CONFIG_WPS
+ if (is_nil_uuid(config->uuid)) {
+ char buf[40];
+ uuid_bin2str(config->uuid, buf, sizeof(buf));
+ wpa_config_write_reg_string(hk, "uuid", buf);
+ }
+#endif /* CONFIG_WPS */
return 0;
}