Lines Matching refs:hapd
27 struct hostapd_data *hapd = priv; in hapd_macsec_init() local
29 if (!hapd->driver->macsec_init) in hapd_macsec_init()
31 return hapd->driver->macsec_init(hapd->drv_priv, params); in hapd_macsec_init()
37 struct hostapd_data *hapd = priv; in hapd_macsec_deinit() local
39 if (!hapd->driver->macsec_deinit) in hapd_macsec_deinit()
41 return hapd->driver->macsec_deinit(hapd->drv_priv); in hapd_macsec_deinit()
47 struct hostapd_data *hapd = priv; in hapd_macsec_get_capability() local
49 if (!hapd->driver->macsec_get_capability) in hapd_macsec_get_capability()
51 return hapd->driver->macsec_get_capability(hapd->drv_priv, cap); in hapd_macsec_get_capability()
57 struct hostapd_data *hapd = priv; in hapd_enable_protect_frames() local
59 if (!hapd->driver->enable_protect_frames) in hapd_enable_protect_frames()
61 return hapd->driver->enable_protect_frames(hapd->drv_priv, enabled); in hapd_enable_protect_frames()
67 struct hostapd_data *hapd = priv; in hapd_enable_encrypt() local
69 if (!hapd->driver->enable_encrypt) in hapd_enable_encrypt()
71 return hapd->driver->enable_encrypt(hapd->drv_priv, enabled); in hapd_enable_encrypt()
77 struct hostapd_data *hapd = priv; in hapd_set_replay_protect() local
79 if (!hapd->driver->set_replay_protect) in hapd_set_replay_protect()
81 return hapd->driver->set_replay_protect(hapd->drv_priv, enabled, in hapd_set_replay_protect()
88 struct hostapd_data *hapd = priv; in hapd_set_current_cipher_suite() local
90 if (!hapd->driver->set_current_cipher_suite) in hapd_set_current_cipher_suite()
92 return hapd->driver->set_current_cipher_suite(hapd->drv_priv, cs); in hapd_set_current_cipher_suite()
98 struct hostapd_data *hapd = priv; in hapd_enable_controlled_port() local
100 if (!hapd->driver->enable_controlled_port) in hapd_enable_controlled_port()
102 return hapd->driver->enable_controlled_port(hapd->drv_priv, enabled); in hapd_enable_controlled_port()
108 struct hostapd_data *hapd = priv; in hapd_get_receive_lowest_pn() local
110 if (!hapd->driver->get_receive_lowest_pn) in hapd_get_receive_lowest_pn()
112 return hapd->driver->get_receive_lowest_pn(hapd->drv_priv, sa); in hapd_get_receive_lowest_pn()
118 struct hostapd_data *hapd = priv; in hapd_get_transmit_next_pn() local
120 if (!hapd->driver->get_transmit_next_pn) in hapd_get_transmit_next_pn()
122 return hapd->driver->get_transmit_next_pn(hapd->drv_priv, sa); in hapd_get_transmit_next_pn()
128 struct hostapd_data *hapd = priv; in hapd_set_transmit_next_pn() local
130 if (!hapd->driver->set_transmit_next_pn) in hapd_set_transmit_next_pn()
132 return hapd->driver->set_transmit_next_pn(hapd->drv_priv, sa); in hapd_set_transmit_next_pn()
153 struct hostapd_data *hapd = priv; in hapd_create_receive_sc() local
155 if (!hapd->driver->create_receive_sc) in hapd_create_receive_sc()
157 return hapd->driver->create_receive_sc(hapd->drv_priv, sc, in hapd_create_receive_sc()
164 struct hostapd_data *hapd = priv; in hapd_delete_receive_sc() local
166 if (!hapd->driver->delete_receive_sc) in hapd_delete_receive_sc()
168 return hapd->driver->delete_receive_sc(hapd->drv_priv, sc); in hapd_delete_receive_sc()
174 struct hostapd_data *hapd = priv; in hapd_create_receive_sa() local
176 if (!hapd->driver->create_receive_sa) in hapd_create_receive_sa()
178 return hapd->driver->create_receive_sa(hapd->drv_priv, sa); in hapd_create_receive_sa()
184 struct hostapd_data *hapd = priv; in hapd_delete_receive_sa() local
186 if (!hapd->driver->delete_receive_sa) in hapd_delete_receive_sa()
188 return hapd->driver->delete_receive_sa(hapd->drv_priv, sa); in hapd_delete_receive_sa()
194 struct hostapd_data *hapd = priv; in hapd_enable_receive_sa() local
196 if (!hapd->driver->enable_receive_sa) in hapd_enable_receive_sa()
198 return hapd->driver->enable_receive_sa(hapd->drv_priv, sa); in hapd_enable_receive_sa()
204 struct hostapd_data *hapd = priv; in hapd_disable_receive_sa() local
206 if (!hapd->driver->disable_receive_sa) in hapd_disable_receive_sa()
208 return hapd->driver->disable_receive_sa(hapd->drv_priv, sa); in hapd_disable_receive_sa()
216 struct hostapd_data *hapd = priv; in hapd_create_transmit_sc() local
218 if (!hapd->driver->create_transmit_sc) in hapd_create_transmit_sc()
220 return hapd->driver->create_transmit_sc(hapd->drv_priv, sc, in hapd_create_transmit_sc()
227 struct hostapd_data *hapd = priv; in hapd_delete_transmit_sc() local
229 if (!hapd->driver->delete_transmit_sc) in hapd_delete_transmit_sc()
231 return hapd->driver->delete_transmit_sc(hapd->drv_priv, sc); in hapd_delete_transmit_sc()
237 struct hostapd_data *hapd = priv; in hapd_create_transmit_sa() local
239 if (!hapd->driver->create_transmit_sa) in hapd_create_transmit_sa()
241 return hapd->driver->create_transmit_sa(hapd->drv_priv, sa); in hapd_create_transmit_sa()
247 struct hostapd_data *hapd = priv; in hapd_delete_transmit_sa() local
249 if (!hapd->driver->delete_transmit_sa) in hapd_delete_transmit_sa()
251 return hapd->driver->delete_transmit_sa(hapd->drv_priv, sa); in hapd_delete_transmit_sa()
257 struct hostapd_data *hapd = priv; in hapd_enable_transmit_sa() local
259 if (!hapd->driver->enable_transmit_sa) in hapd_enable_transmit_sa()
261 return hapd->driver->enable_transmit_sa(hapd->drv_priv, sa); in hapd_enable_transmit_sa()
267 struct hostapd_data *hapd = priv; in hapd_disable_transmit_sa() local
269 if (!hapd->driver->disable_transmit_sa) in hapd_disable_transmit_sa()
271 return hapd->driver->disable_transmit_sa(hapd->drv_priv, sa); in hapd_disable_transmit_sa()
275 int ieee802_1x_alloc_kay_sm_hapd(struct hostapd_data *hapd, in ieee802_1x_alloc_kay_sm_hapd() argument
282 ieee802_1x_dealloc_kay_sm_hapd(hapd); in ieee802_1x_alloc_kay_sm_hapd()
284 if (!hapd->conf || hapd->conf->macsec_policy == 0) in ieee802_1x_alloc_kay_sm_hapd()
287 if (hapd->conf->macsec_policy == 1) { in ieee802_1x_alloc_kay_sm_hapd()
288 if (hapd->conf->macsec_integ_only == 1) in ieee802_1x_alloc_kay_sm_hapd()
296 wpa_printf(MSG_DEBUG, "%s: if_name=%s", __func__, hapd->conf->iface); in ieee802_1x_alloc_kay_sm_hapd()
301 kay_ctx->ctx = hapd; in ieee802_1x_alloc_kay_sm_hapd()
328 hapd->conf->macsec_replay_protect, in ieee802_1x_alloc_kay_sm_hapd()
329 hapd->conf->macsec_replay_window, in ieee802_1x_alloc_kay_sm_hapd()
330 hapd->conf->macsec_offload, in ieee802_1x_alloc_kay_sm_hapd()
331 hapd->conf->macsec_port, in ieee802_1x_alloc_kay_sm_hapd()
332 hapd->conf->mka_priority, in ieee802_1x_alloc_kay_sm_hapd()
333 hapd->conf->macsec_csindex, in ieee802_1x_alloc_kay_sm_hapd()
334 hapd->conf->iface, in ieee802_1x_alloc_kay_sm_hapd()
335 hapd->own_addr); in ieee802_1x_alloc_kay_sm_hapd()
340 hapd->kay = res; in ieee802_1x_alloc_kay_sm_hapd()
346 void ieee802_1x_dealloc_kay_sm_hapd(struct hostapd_data *hapd) in ieee802_1x_dealloc_kay_sm_hapd() argument
348 if (!hapd->kay) in ieee802_1x_dealloc_kay_sm_hapd()
351 ieee802_1x_kay_deinit(hapd->kay); in ieee802_1x_dealloc_kay_sm_hapd()
352 hapd->kay = NULL; in ieee802_1x_dealloc_kay_sm_hapd()
356 static int ieee802_1x_auth_get_msk(struct hostapd_data *hapd, in ieee802_1x_auth_get_msk() argument
384 void * ieee802_1x_notify_create_actor_hapd(struct hostapd_data *hapd, in ieee802_1x_notify_create_actor_hapd() argument
394 if (!hapd->kay || hapd->kay->policy == DO_NOT_SECURE) in ieee802_1x_notify_create_actor_hapd()
408 if (ieee802_1x_auth_get_msk(hapd, sta, msk->key, &msk->len)) { in ieee802_1x_notify_create_actor_hapd()
420 wpa_hexdump(MSG_DEBUG, "own_addr", hapd->own_addr, ETH_ALEN); in ieee802_1x_notify_create_actor_hapd()
425 if (ieee802_1x_cak_aes_cmac(msk->key, msk->len, hapd->own_addr, in ieee802_1x_notify_create_actor_hapd()
434 if (ieee802_1x_ckn_aes_cmac(msk->key, msk->len, hapd->own_addr, in ieee802_1x_notify_create_actor_hapd()
441 res = ieee802_1x_kay_create_mka(hapd->kay, ckn, cak, 0, EAP_EXCHANGE, in ieee802_1x_notify_create_actor_hapd()
453 void * ieee802_1x_create_preshared_mka_hapd(struct hostapd_data *hapd, in ieee802_1x_create_preshared_mka_hapd() argument
460 if ((hapd->conf->mka_psk_set & MKA_PSK_SET) != MKA_PSK_SET) in ieee802_1x_create_preshared_mka_hapd()
471 if (ieee802_1x_alloc_kay_sm_hapd(hapd, sta) < 0 || !hapd->kay) in ieee802_1x_create_preshared_mka_hapd()
474 if (hapd->kay->policy == DO_NOT_SECURE) in ieee802_1x_create_preshared_mka_hapd()
477 cak->len = hapd->conf->mka_cak_len; in ieee802_1x_create_preshared_mka_hapd()
478 os_memcpy(cak->key, hapd->conf->mka_cak, cak->len); in ieee802_1x_create_preshared_mka_hapd()
480 ckn->len = hapd->conf->mka_ckn_len;; in ieee802_1x_create_preshared_mka_hapd()
481 os_memcpy(ckn->name, hapd->conf->mka_ckn, ckn->len); in ieee802_1x_create_preshared_mka_hapd()
483 res = ieee802_1x_kay_create_mka(hapd->kay, ckn, cak, 0, PSK, true); in ieee802_1x_create_preshared_mka_hapd()
489 ieee802_1x_dealloc_kay_sm_hapd(hapd); in ieee802_1x_create_preshared_mka_hapd()