Lines Matching refs:group
46 struct wpa_group *group);
49 struct wpa_group *group);
51 struct wpa_group *group);
56 struct wpa_group *group);
58 struct wpa_group *group);
60 struct wpa_group *group);
258 if (random_get_bytes(wpa_auth->group->GMK, WPA_GMK_LEN)) { in wpa_rekey_gmk()
264 wpa_auth->group->GMK, WPA_GMK_LEN); in wpa_rekey_gmk()
277 struct wpa_group *group, *next; in wpa_rekey_gtk() local
280 group = wpa_auth->group; in wpa_rekey_gtk()
281 while (group) { in wpa_rekey_gtk()
282 wpa_group_get(wpa_auth, group); in wpa_rekey_gtk()
284 group->GTKReKey = TRUE; in wpa_rekey_gtk()
286 group->changed = FALSE; in wpa_rekey_gtk()
287 wpa_group_sm_step(wpa_auth, group); in wpa_rekey_gtk()
288 } while (group->changed); in wpa_rekey_gtk()
290 next = group->next; in wpa_rekey_gtk()
291 wpa_group_put(wpa_auth, group); in wpa_rekey_gtk()
292 group = next; in wpa_rekey_gtk()
330 struct wpa_group *group) in wpa_group_init_gmk_and_counter() argument
336 if (random_get_bytes(group->GMK, WPA_GMK_LEN) < 0) in wpa_group_init_gmk_and_counter()
338 wpa_hexdump_key(MSG_DEBUG, "GMK", group->GMK, WPA_GMK_LEN); in wpa_group_init_gmk_and_counter()
346 ptr = (unsigned long) group; in wpa_group_init_gmk_and_counter()
352 group->Counter, WPA_NONCE_LEN) < 0) in wpa_group_init_gmk_and_counter()
355 group->Counter, WPA_NONCE_LEN); in wpa_group_init_gmk_and_counter()
364 struct wpa_group *group; in wpa_group_init() local
366 group = os_zalloc(sizeof(struct wpa_group)); in wpa_group_init()
367 if (group == NULL) in wpa_group_init()
370 group->GTKAuthenticator = TRUE; in wpa_group_init()
371 group->vlan_id = vlan_id; in wpa_group_init()
372 group->GTK_len = wpa_cipher_key_len(wpa_auth->conf.wpa_group); in wpa_group_init()
386 if (wpa_group_init_gmk_and_counter(wpa_auth, group) < 0) { in wpa_group_init()
389 os_free(group); in wpa_group_init()
393 group->GInit = TRUE; in wpa_group_init()
399 wpa_group_sm_step(wpa_auth, group); in wpa_group_init()
400 group->GInit = FALSE; in wpa_group_init()
401 wpa_group_sm_step(wpa_auth, group); in wpa_group_init()
404 return group; in wpa_group_init()
436 wpa_auth->group = wpa_group_init(wpa_auth, 0, 1); in wpa_init()
437 if (wpa_auth->group == NULL) { in wpa_init()
447 os_free(wpa_auth->group); in wpa_init()
457 os_free(wpa_auth->group); in wpa_init()
492 struct wpa_group *group = wpa_auth->group; in wpa_init_keys() local
496 wpa_group_sm_step(wpa_auth, group); in wpa_init_keys()
497 group->GInit = FALSE; in wpa_init_keys()
498 wpa_group_sm_step(wpa_auth, group); in wpa_init_keys()
499 if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) in wpa_init_keys()
511 struct wpa_group *group, *prev; in wpa_deinit() local
530 group = wpa_auth->group; in wpa_deinit()
531 while (group) { in wpa_deinit()
532 prev = group; in wpa_deinit()
533 group = group->next; in wpa_deinit()
549 struct wpa_group *group; in wpa_reconfig() local
563 group = wpa_auth->group; in wpa_reconfig()
564 group->GTK_len = wpa_cipher_key_len(wpa_auth->conf.wpa_group); in wpa_reconfig()
565 group->GInit = TRUE; in wpa_reconfig()
566 wpa_group_sm_step(wpa_auth, group); in wpa_reconfig()
567 group->GInit = FALSE; in wpa_reconfig()
568 wpa_group_sm_step(wpa_auth, group); in wpa_reconfig()
580 if (wpa_auth->group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) in wpa_auth_sta_init()
591 sm->group = wpa_auth->group; in wpa_auth_sta_init()
592 wpa_group_get(sm->wpa_auth, sm->group); in wpa_auth_sta_init()
674 sm->group->GKeyDoneStations--; in wpa_free_sta_sm()
683 wpa_group_put(sm->wpa_auth, sm->group); in wpa_free_sta_sm()
807 struct wpa_state_machine *sm, int group) in wpa_receive_error_report() argument
813 group); in wpa_receive_error_report()
815 if (group && wpa_auth->conf.wpa_group != WPA_CIPHER_TKIP) { in wpa_receive_error_report()
819 } else if (!group && sm->pairwise != WPA_CIPHER_TKIP) { in wpa_receive_error_report()
1141 if (sm->group->reject_4way_hs_for_entropy) { in wpa_receive()
1564 sm->group->Counter + WPA_NONCE_LEN - 16, 16); in __wpa_send_eapol()
1565 inc_byte_array(sm->group->Counter, WPA_NONCE_LEN); in __wpa_send_eapol()
1736 sm->group->GKeyDoneStations--; in wpa_auth_sm_event()
1801 sm->group->GKeyDoneStations--; in SM_STATE()
1848 struct wpa_group *group) in wpa_group_ensure_init() argument
1850 if (group->first_sta_seen) in wpa_group_ensure_init()
1864 group->reject_4way_hs_for_entropy = TRUE; in wpa_group_ensure_init()
1866 group->first_sta_seen = TRUE; in wpa_group_ensure_init()
1867 group->reject_4way_hs_for_entropy = FALSE; in wpa_group_ensure_init()
1870 if (wpa_group_init_gmk_and_counter(wpa_auth, group) < 0 || in wpa_group_ensure_init()
1871 wpa_gtk_update(wpa_auth, group) < 0 || in wpa_group_ensure_init()
1872 wpa_group_config_group_keys(wpa_auth, group) < 0) { in wpa_group_ensure_init()
1874 group->first_sta_seen = FALSE; in wpa_group_ensure_init()
1875 group->reject_4way_hs_for_entropy = TRUE; in wpa_group_ensure_init()
1884 wpa_group_ensure_init(sm->wpa_auth, sm->group); in SM_STATE()
2343 gsm = sm->group; in fils_encrypt_assoc()
2633 struct wpa_group *gsm = sm->group; in ieee80211w_kde_add()
2683 struct wpa_group *gsm = sm->group; in SM_STATE()
3046 struct wpa_group *gsm = sm->group; in SM_STATE()
3116 sm->group->GKeyDoneStations--; in SM_STATE()
3131 sm->group->GKeyDoneStations--; in SM_STATE()
3173 struct wpa_group *group) in wpa_gtk_update() argument
3177 os_memcpy(group->GNonce, group->Counter, WPA_NONCE_LEN); in wpa_gtk_update()
3178 inc_byte_array(group->Counter, WPA_NONCE_LEN); in wpa_gtk_update()
3179 if (wpa_gmk_to_gtk(group->GMK, "Group key expansion", in wpa_gtk_update()
3180 wpa_auth->addr, group->GNonce, in wpa_gtk_update()
3181 group->GTK[group->GN - 1], group->GTK_len) < 0) in wpa_gtk_update()
3184 group->GTK[group->GN - 1], group->GTK_len); in wpa_gtk_update()
3190 os_memcpy(group->GNonce, group->Counter, WPA_NONCE_LEN); in wpa_gtk_update()
3191 inc_byte_array(group->Counter, WPA_NONCE_LEN); in wpa_gtk_update()
3192 if (wpa_gmk_to_gtk(group->GMK, "IGTK key expansion", in wpa_gtk_update()
3193 wpa_auth->addr, group->GNonce, in wpa_gtk_update()
3194 group->IGTK[group->GN_igtk - 4], len) < 0) in wpa_gtk_update()
3197 group->IGTK[group->GN_igtk - 4], len); in wpa_gtk_update()
3206 struct wpa_group *group) in wpa_group_gtk_init() argument
3209 "GTK_INIT (VLAN-ID %d)", group->vlan_id); in wpa_group_gtk_init()
3210 group->changed = FALSE; /* GInit is not cleared here; avoid loop */ in wpa_group_gtk_init()
3211 group->wpa_group_state = WPA_GROUP_GTK_INIT; in wpa_group_gtk_init()
3214 os_memset(group->GTK, 0, sizeof(group->GTK)); in wpa_group_gtk_init()
3215 group->GN = 1; in wpa_group_gtk_init()
3216 group->GM = 2; in wpa_group_gtk_init()
3218 group->GN_igtk = 4; in wpa_group_gtk_init()
3219 group->GM_igtk = 5; in wpa_group_gtk_init()
3222 wpa_gtk_update(wpa_auth, group); in wpa_group_gtk_init()
3228 if (ctx != NULL && ctx != sm->group) in wpa_group_update_sta()
3252 sm->group->GKeyDoneStations++; in wpa_group_update_sta()
3280 struct wpa_group *gsm = sm->group; in wpa_wnmsleep_gtk_subelem()
3312 struct wpa_group *gsm = sm->group; in wpa_wnmsleep_igtk_subelem()
3343 struct wpa_group *group) in wpa_group_setkeys() argument
3348 "SETKEYS (VLAN-ID %d)", group->vlan_id); in wpa_group_setkeys()
3349 group->changed = TRUE; in wpa_group_setkeys()
3350 group->wpa_group_state = WPA_GROUP_SETKEYS; in wpa_group_setkeys()
3351 group->GTKReKey = FALSE; in wpa_group_setkeys()
3352 tmp = group->GM; in wpa_group_setkeys()
3353 group->GM = group->GN; in wpa_group_setkeys()
3354 group->GN = tmp; in wpa_group_setkeys()
3356 tmp = group->GM_igtk; in wpa_group_setkeys()
3357 group->GM_igtk = group->GN_igtk; in wpa_group_setkeys()
3358 group->GN_igtk = tmp; in wpa_group_setkeys()
3363 wpa_gtk_update(wpa_auth, group); in wpa_group_setkeys()
3365 if (group->GKeyDoneStations) { in wpa_group_setkeys()
3368 group->GKeyDoneStations); in wpa_group_setkeys()
3369 group->GKeyDoneStations = 0; in wpa_group_setkeys()
3371 wpa_auth_for_each_sta(wpa_auth, wpa_group_update_sta, group); in wpa_group_setkeys()
3373 group->GKeyDoneStations); in wpa_group_setkeys()
3378 struct wpa_group *group) in wpa_group_config_group_keys() argument
3382 if (wpa_auth_set_key(wpa_auth, group->vlan_id, in wpa_group_config_group_keys()
3384 broadcast_ether_addr, group->GN, in wpa_group_config_group_keys()
3385 group->GTK[group->GN - 1], group->GTK_len) < 0) in wpa_group_config_group_keys()
3397 wpa_auth_set_key(wpa_auth, group->vlan_id, alg, in wpa_group_config_group_keys()
3398 broadcast_ether_addr, group->GN_igtk, in wpa_group_config_group_keys()
3399 group->IGTK[group->GN_igtk - 4], len) < 0) in wpa_group_config_group_keys()
3410 if (sm->group == ctx) { in wpa_group_disconnect_cb()
3422 struct wpa_group *group) in wpa_group_fatal_failure() argument
3425 group->changed = TRUE; in wpa_group_fatal_failure()
3426 group->wpa_group_state = WPA_GROUP_FATAL_FAILURE; in wpa_group_fatal_failure()
3427 wpa_auth_for_each_sta(wpa_auth, wpa_group_disconnect_cb, group); in wpa_group_fatal_failure()
3432 struct wpa_group *group) in wpa_group_setkeysdone() argument
3435 "SETKEYSDONE (VLAN-ID %d)", group->vlan_id); in wpa_group_setkeysdone()
3436 group->changed = TRUE; in wpa_group_setkeysdone()
3437 group->wpa_group_state = WPA_GROUP_SETKEYSDONE; in wpa_group_setkeysdone()
3439 if (wpa_group_config_group_keys(wpa_auth, group) < 0) { in wpa_group_setkeysdone()
3440 wpa_group_fatal_failure(wpa_auth, group); in wpa_group_setkeysdone()
3449 struct wpa_group *group) in wpa_group_sm_step() argument
3451 if (group->GInit) { in wpa_group_sm_step()
3452 wpa_group_gtk_init(wpa_auth, group); in wpa_group_sm_step()
3453 } else if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) { in wpa_group_sm_step()
3455 } else if (group->wpa_group_state == WPA_GROUP_GTK_INIT && in wpa_group_sm_step()
3456 group->GTKAuthenticator) { in wpa_group_sm_step()
3457 wpa_group_setkeysdone(wpa_auth, group); in wpa_group_sm_step()
3458 } else if (group->wpa_group_state == WPA_GROUP_SETKEYSDONE && in wpa_group_sm_step()
3459 group->GTKReKey) { in wpa_group_sm_step()
3460 wpa_group_setkeys(wpa_auth, group); in wpa_group_sm_step()
3461 } else if (group->wpa_group_state == WPA_GROUP_SETKEYS) { in wpa_group_sm_step()
3462 if (group->GKeyDoneStations == 0) in wpa_group_sm_step()
3463 wpa_group_setkeysdone(wpa_auth, group); in wpa_group_sm_step()
3464 else if (group->GTKReKey) in wpa_group_sm_step()
3465 wpa_group_setkeys(wpa_auth, group); in wpa_group_sm_step()
3489 sm->wpa_auth->group->changed = FALSE; in wpa_sm_step()
3497 wpa_group_sm_step(sm->wpa_auth, sm->group); in wpa_sm_step()
3498 } while (sm->changed || sm->wpa_auth->group->changed); in wpa_sm_step()
3529 struct wpa_group *group; in wpa_gtk_rekey() local
3534 group = wpa_auth->group; in wpa_gtk_rekey()
3537 tmp = group->GM; in wpa_gtk_rekey()
3538 group->GM = group->GN; in wpa_gtk_rekey()
3539 group->GN = tmp; in wpa_gtk_rekey()
3541 tmp = group->GM_igtk; in wpa_gtk_rekey()
3542 group->GM_igtk = group->GN_igtk; in wpa_gtk_rekey()
3543 group->GN_igtk = tmp; in wpa_gtk_rekey()
3545 wpa_gtk_update(wpa_auth, group); in wpa_gtk_rekey()
3546 wpa_group_config_group_keys(wpa_auth, group); in wpa_gtk_rekey()
3641 wpa_auth->group->wpa_group_state); in wpa_get_mib()
3945 struct wpa_group *group) in wpa_group_free() argument
3947 struct wpa_group *prev = wpa_auth->group; in wpa_group_free()
3950 group->vlan_id); in wpa_group_free()
3953 if (prev->next == group) { in wpa_group_free()
3955 prev->next = group->next; in wpa_group_free()
3956 os_free(group); in wpa_group_free()
3967 struct wpa_group *group) in wpa_group_get() argument
3970 if (wpa_auth->group == group) in wpa_group_get()
3973 group->references++; in wpa_group_get()
3979 struct wpa_group *group) in wpa_group_put() argument
3982 if (wpa_auth->group == group) in wpa_group_put()
3985 group->references--; in wpa_group_put()
3986 if (group->references) in wpa_group_put()
3988 wpa_group_free(wpa_auth, group); in wpa_group_put()
3999 struct wpa_group *group; in wpa_auth_add_group() local
4001 if (wpa_auth == NULL || wpa_auth->group == NULL) in wpa_auth_add_group()
4006 group = wpa_group_init(wpa_auth, vlan_id, 0); in wpa_auth_add_group()
4007 if (group == NULL) in wpa_auth_add_group()
4010 group->next = wpa_auth->group->next; in wpa_auth_add_group()
4011 wpa_auth->group->next = group; in wpa_auth_add_group()
4013 return group; in wpa_auth_add_group()
4025 struct wpa_group *group; in wpa_auth_ensure_group() local
4030 group = wpa_auth->group; in wpa_auth_ensure_group()
4031 while (group) { in wpa_auth_ensure_group()
4032 if (group->vlan_id == vlan_id) in wpa_auth_ensure_group()
4034 group = group->next; in wpa_auth_ensure_group()
4037 if (group == NULL) { in wpa_auth_ensure_group()
4038 group = wpa_auth_add_group(wpa_auth, vlan_id); in wpa_auth_ensure_group()
4039 if (group == NULL) in wpa_auth_ensure_group()
4047 wpa_group_get(wpa_auth, group); in wpa_auth_ensure_group()
4048 group->num_setup_iface++; in wpa_auth_ensure_group()
4050 if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) in wpa_auth_ensure_group()
4065 struct wpa_group *group; in wpa_auth_release_group() local
4071 group = wpa_auth->group; in wpa_auth_release_group()
4072 while (group) { in wpa_auth_release_group()
4073 if (group->vlan_id == vlan_id) in wpa_auth_release_group()
4075 group = group->next; in wpa_auth_release_group()
4078 if (group == NULL) in wpa_auth_release_group()
4085 if (group->num_setup_iface <= 0) { in wpa_auth_release_group()
4091 group->num_setup_iface--; in wpa_auth_release_group()
4093 if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) in wpa_auth_release_group()
4096 if (group->references > 1) { in wpa_auth_release_group()
4103 wpa_group_put(wpa_auth, group); in wpa_auth_release_group()
4111 struct wpa_group *group; in wpa_auth_sta_set_vlan() local
4116 group = sm->wpa_auth->group; in wpa_auth_sta_set_vlan()
4117 while (group) { in wpa_auth_sta_set_vlan()
4118 if (group->vlan_id == vlan_id) in wpa_auth_sta_set_vlan()
4120 group = group->next; in wpa_auth_sta_set_vlan()
4123 if (group == NULL) { in wpa_auth_sta_set_vlan()
4124 group = wpa_auth_add_group(sm->wpa_auth, vlan_id); in wpa_auth_sta_set_vlan()
4125 if (group == NULL) in wpa_auth_sta_set_vlan()
4129 if (sm->group == group) in wpa_auth_sta_set_vlan()
4132 if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) in wpa_auth_sta_set_vlan()
4138 wpa_group_get(sm->wpa_auth, group); in wpa_auth_sta_set_vlan()
4139 wpa_group_put(sm->wpa_auth, sm->group); in wpa_auth_sta_set_vlan()
4140 sm->group = group; in wpa_auth_sta_set_vlan()
4212 struct wpa_group *group; in wpa_auth_reconfig_group_keys() local
4216 for (group = wpa_auth->group; group; group = group->next) in wpa_auth_reconfig_group_keys()
4217 wpa_group_config_group_keys(wpa_auth, group); in wpa_auth_reconfig_group_keys()