aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-07 13:07:25 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-07 13:07:25 (GMT)
commit986de33d5c3e11dd08a26ed65eacede8b75aa339 (patch)
treea4cf15f08916a4ac42216e2f1c080fc784a27cc5 /wpa_supplicant
parent771e2f7b3302f7741594f9c669a225f5aa64f9e9 (diff)
downloadhostap-986de33d5c3e11dd08a26ed65eacede8b75aa339.zip
hostap-986de33d5c3e11dd08a26ed65eacede8b75aa339.tar.gz
hostap-986de33d5c3e11dd08a26ed65eacede8b75aa339.tar.bz2
Convert remaining SSID routines from char* to u8*
This makes it more explicit that the SSID is not a null terminated C string. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ap.c1
-rw-r--r--wpa_supplicant/config.c3
-rw-r--r--wpa_supplicant/wpa_passphrase.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c8
4 files changed, 6 insertions, 8 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index f9e0045..80c1783 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -150,7 +150,6 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
return -1;
}
os_memcpy(bss->ssid.ssid, ssid->ssid, ssid->ssid_len);
- bss->ssid.ssid[ssid->ssid_len] = '\0';
bss->ssid.ssid_len = ssid->ssid_len;
bss->ssid.ssid_set = 1;
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 94052c5..c09f310 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2308,8 +2308,7 @@ char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var)
void wpa_config_update_psk(struct wpa_ssid *ssid)
{
#ifndef CONFIG_NO_PBKDF2
- pbkdf2_sha1(ssid->passphrase,
- (char *) ssid->ssid, ssid->ssid_len, 4096,
+ pbkdf2_sha1(ssid->passphrase, ssid->ssid, ssid->ssid_len, 4096,
ssid->psk, PMK_LEN);
wpa_hexdump_key(MSG_MSGDUMP, "PSK (from passphrase)",
ssid->psk, PMK_LEN);
diff --git a/wpa_supplicant/wpa_passphrase.c b/wpa_supplicant/wpa_passphrase.c
index a9ec236..9b568f0 100644
--- a/wpa_supplicant/wpa_passphrase.c
+++ b/wpa_supplicant/wpa_passphrase.c
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
return 1;
}
- pbkdf2_sha1(passphrase, ssid, os_strlen(ssid), 4096, psk, 32);
+ pbkdf2_sha1(passphrase, (u8 *) ssid, os_strlen(ssid), 4096, psk, 32);
printf("network={\n");
printf("\tssid=\"%s\"\n", ssid);
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 61fbec9..9a42570 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1097,8 +1097,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
if (bss && ssid->bssid_set && ssid->ssid_len == 0 &&
ssid->passphrase) {
u8 psk[PMK_LEN];
- pbkdf2_sha1(ssid->passphrase, (char *) bss->ssid,
- bss->ssid_len, 4096, psk, PMK_LEN);
+ pbkdf2_sha1(ssid->passphrase, bss->ssid, bss->ssid_len,
+ 4096, psk, PMK_LEN);
wpa_hexdump_key(MSG_MSGDUMP, "PSK (from passphrase)",
psk, PMK_LEN);
wpa_sm_set_pmk(wpa_s->wpa, psk, PMK_LEN);
@@ -1131,8 +1131,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
#ifndef CONFIG_NO_PBKDF2
if (wpabuf_len(pw) >= 8 && wpabuf_len(pw) < 64 && bss)
{
- pbkdf2_sha1(pw_str, (char *) bss->ssid,
- bss->ssid_len, 4096, psk, PMK_LEN);
+ pbkdf2_sha1(pw_str, bss->ssid, bss->ssid_len,
+ 4096, psk, PMK_LEN);
os_memset(pw_str, 0, sizeof(pw_str));
wpa_hexdump_key(MSG_MSGDUMP, "PSK (from "
"external passphrase)",