15b9c547cSRui Paulo /* 25b9c547cSRui Paulo * WPA Supplicant - Mesh RSN routines 35b9c547cSRui Paulo * Copyright (c) 2013-2014, cozybit, Inc. All rights reserved. 45b9c547cSRui Paulo * 55b9c547cSRui Paulo * This software may be distributed under the terms of the BSD license. 65b9c547cSRui Paulo * See README for more details. 75b9c547cSRui Paulo */ 85b9c547cSRui Paulo 95b9c547cSRui Paulo #ifndef MESH_RSN_H 105b9c547cSRui Paulo #define MESH_RSN_H 115b9c547cSRui Paulo 125b9c547cSRui Paulo struct mesh_rsn { 135b9c547cSRui Paulo struct wpa_supplicant *wpa_s; 145b9c547cSRui Paulo struct wpa_authenticator *auth; 15*780fb4a2SCy Schubert unsigned int pairwise_cipher; 16*780fb4a2SCy Schubert unsigned int group_cipher; 17*780fb4a2SCy Schubert u8 mgtk[WPA_TK_MAX_LEN]; 18*780fb4a2SCy Schubert size_t mgtk_len; 19*780fb4a2SCy Schubert u8 mgtk_key_id; 20*780fb4a2SCy Schubert unsigned int mgmt_group_cipher; 21*780fb4a2SCy Schubert u8 igtk_key_id; 22*780fb4a2SCy Schubert u8 igtk[WPA_TK_MAX_LEN]; 23*780fb4a2SCy Schubert size_t igtk_len; 245b9c547cSRui Paulo #ifdef CONFIG_SAE 255b9c547cSRui Paulo struct wpabuf *sae_token; 265b9c547cSRui Paulo int sae_group_index; 275b9c547cSRui Paulo #endif /* CONFIG_SAE */ 285b9c547cSRui Paulo }; 295b9c547cSRui Paulo 305b9c547cSRui Paulo struct mesh_rsn * mesh_rsn_auth_init(struct wpa_supplicant *wpa_s, 315b9c547cSRui Paulo struct mesh_conf *conf); 325b9c547cSRui Paulo int mesh_rsn_auth_sae_sta(struct wpa_supplicant *wpa_s, struct sta_info *sta); 335b9c547cSRui Paulo int mesh_rsn_derive_mtk(struct wpa_supplicant *wpa_s, struct sta_info *sta); 345b9c547cSRui Paulo void mesh_rsn_get_pmkid(struct mesh_rsn *rsn, struct sta_info *sta, u8 *pmkid); 355b9c547cSRui Paulo void mesh_rsn_init_ampe_sta(struct wpa_supplicant *wpa_s, 365b9c547cSRui Paulo struct sta_info *sta); 375b9c547cSRui Paulo int mesh_rsn_protect_frame(struct mesh_rsn *rsn, struct sta_info *sta, 385b9c547cSRui Paulo const u8 *cat, struct wpabuf *buf); 395b9c547cSRui Paulo int mesh_rsn_process_ampe(struct wpa_supplicant *wpa_s, struct sta_info *sta, 405b9c547cSRui Paulo struct ieee802_11_elems *elems, const u8 *cat, 41*780fb4a2SCy Schubert const u8 *chosen_pmk, 425b9c547cSRui Paulo const u8 *start, size_t elems_len); 435b9c547cSRui Paulo void mesh_auth_timer(void *eloop_ctx, void *user_data); 445b9c547cSRui Paulo 455b9c547cSRui Paulo #endif /* MESH_RSN_H */ 46