aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-12-30 20:16:18 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-12 15:51:52 (GMT)
commit146f6c9a001186387872f6c19e1e3630ed3c15bc (patch)
tree0a898bd80c8de83fe154e8a893dbe33e1a7e0485 /wpa_supplicant/sme.c
parent8e31e9550ac708b94cd4a1f03833353c5488a031 (diff)
downloadhostap-146f6c9a001186387872f6c19e1e3630ed3c15bc.zip
hostap-146f6c9a001186387872f6c19e1e3630ed3c15bc.tar.gz
hostap-146f6c9a001186387872f6c19e1e3630ed3c15bc.tar.bz2
SAE: Add processing of the commit message
This adds validation of the received commit messages and key derivation for SAE. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index b3afa70..a5a90b5 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -401,24 +401,6 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_SAE
-static int sme_sae_process_commit(struct wpa_supplicant *wpa_s, const u8 *data,
- size_t len)
-{
- /* Check Finite Cyclic Group */
- if (len < 2)
- return -1;
- if (WPA_GET_LE16(data) != 19) {
- wpa_printf(MSG_DEBUG, "SAE: Unsupported Finite Cyclic Group %u",
- WPA_GET_LE16(data));
- return -1;
- }
-
- /* TODO */
-
- return 0;
-}
-
-
static int sme_sae_process_confirm(struct wpa_supplicant *wpa_s, const u8 *data,
size_t len)
{
@@ -451,8 +433,16 @@ static int sme_sae_auth(struct wpa_supplicant *wpa_s, u16 auth_transaction,
return -1;
if (wpa_s->sme.sae.state != SAE_COMMIT)
return -1;
- if (sme_sae_process_commit(wpa_s, data, len) < 0)
+ if (sae_parse_commit(&wpa_s->sme.sae, data, len) !=
+ WLAN_STATUS_SUCCESS)
return -1;
+
+ if (sae_process_commit(&wpa_s->sme.sae) < 0) {
+ wpa_printf(MSG_DEBUG, "SAE: Failed to process peer "
+ "commit");
+ return -1;
+ }
+
sme_send_authentication(wpa_s, wpa_s->current_bss,
wpa_s->current_ssid, 0);
return 0;