Deleted Added
full compact
wpa_auth.c (302408) wpa_auth.c (324697)
1/*
2 * IEEE 802.11 RSN / WPA Authenticator
3 * Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8

--- 1879 unchanged lines hidden (view full) ---

1888 /* IEEE 802.11i does not clear TimeoutCtr here, but this is more
1889 * logical place than INITIALIZE since AUTHENTICATION2 can be
1890 * re-entered on ReAuthenticationRequest without going through
1891 * INITIALIZE. */
1892 sm->TimeoutCtr = 0;
1893}
1894
1895
1/*
2 * IEEE 802.11 RSN / WPA Authenticator
3 * Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8

--- 1879 unchanged lines hidden (view full) ---

1888 /* IEEE 802.11i does not clear TimeoutCtr here, but this is more
1889 * logical place than INITIALIZE since AUTHENTICATION2 can be
1890 * re-entered on ReAuthenticationRequest without going through
1891 * INITIALIZE. */
1892 sm->TimeoutCtr = 0;
1893}
1894
1895
1896static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
1897{
1898 if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
1899 wpa_printf(MSG_ERROR,
1900 "WPA: Failed to get random data for ANonce");
1901 sm->Disconnect = TRUE;
1902 return -1;
1903 }
1904 wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
1905 WPA_NONCE_LEN);
1906 sm->TimeoutCtr = 0;
1907 return 0;
1908}
1909
1910
1896SM_STATE(WPA_PTK, INITPMK)
1897{
1898 u8 msk[2 * PMK_LEN];
1899 size_t len = 2 * PMK_LEN;
1900
1901 SM_ENTRY_MA(WPA_PTK, INITPMK, wpa_ptk);
1902#ifdef CONFIG_IEEE80211R
1903 sm->xxkey_len = 0;

--- 505 unchanged lines hidden (view full) ---

2409 SM_ENTER(WPA_PTK, DISCONNECT);
2410 }
2411 else if (sm->DeauthenticationRequest)
2412 SM_ENTER(WPA_PTK, DISCONNECTED);
2413 else if (sm->AuthenticationRequest)
2414 SM_ENTER(WPA_PTK, AUTHENTICATION);
2415 else if (sm->ReAuthenticationRequest)
2416 SM_ENTER(WPA_PTK, AUTHENTICATION2);
1911SM_STATE(WPA_PTK, INITPMK)
1912{
1913 u8 msk[2 * PMK_LEN];
1914 size_t len = 2 * PMK_LEN;
1915
1916 SM_ENTRY_MA(WPA_PTK, INITPMK, wpa_ptk);
1917#ifdef CONFIG_IEEE80211R
1918 sm->xxkey_len = 0;

--- 505 unchanged lines hidden (view full) ---

2424 SM_ENTER(WPA_PTK, DISCONNECT);
2425 }
2426 else if (sm->DeauthenticationRequest)
2427 SM_ENTER(WPA_PTK, DISCONNECTED);
2428 else if (sm->AuthenticationRequest)
2429 SM_ENTER(WPA_PTK, AUTHENTICATION);
2430 else if (sm->ReAuthenticationRequest)
2431 SM_ENTER(WPA_PTK, AUTHENTICATION2);
2417 else if (sm->PTKRequest)
2418 SM_ENTER(WPA_PTK, PTKSTART);
2419 else switch (sm->wpa_ptk_state) {
2432 else if (sm->PTKRequest) {
2433 if (wpa_auth_sm_ptk_update(sm) < 0)
2434 SM_ENTER(WPA_PTK, DISCONNECTED);
2435 else
2436 SM_ENTER(WPA_PTK, PTKSTART);
2437 } else switch (sm->wpa_ptk_state) {
2420 case WPA_PTK_INITIALIZE:
2421 break;
2422 case WPA_PTK_DISCONNECT:
2423 SM_ENTER(WPA_PTK, DISCONNECTED);
2424 break;
2425 case WPA_PTK_DISCONNECTED:
2426 SM_ENTER(WPA_PTK, INITIALIZE);
2427 break;

--- 776 unchanged lines hidden (view full) ---

3204int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm)
3205{
3206 if (sm == NULL)
3207 return 0;
3208 return sm->wpa;
3209}
3210
3211
2438 case WPA_PTK_INITIALIZE:
2439 break;
2440 case WPA_PTK_DISCONNECT:
2441 SM_ENTER(WPA_PTK, DISCONNECTED);
2442 break;
2443 case WPA_PTK_DISCONNECTED:
2444 SM_ENTER(WPA_PTK, INITIALIZE);
2445 break;

--- 776 unchanged lines hidden (view full) ---

3222int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm)
3223{
3224 if (sm == NULL)
3225 return 0;
3226 return sm->wpa;
3227}
3228
3229
3230int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
3231{
3232 if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
3233 return 0;
3234 return sm->tk_already_set;
3235}
3236
3237
3212int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
3213 struct rsn_pmksa_cache_entry *entry)
3214{
3215 if (sm == NULL || sm->pmksa != entry)
3216 return -1;
3217 sm->pmksa = NULL;
3218 return 0;
3219}

--- 281 unchanged lines hidden ---
3238int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
3239 struct rsn_pmksa_cache_entry *entry)
3240{
3241 if (sm == NULL || sm->pmksa != entry)
3242 return -1;
3243 sm->pmksa = NULL;
3244 return 0;
3245}

--- 281 unchanged lines hidden ---