Lines Matching refs:bi
62 struct dpp_bootstrap_info *bi; in wpas_dpp_next_id() local
65 dl_list_for_each(bi, &wpa_s->dpp_bootstrap, struct dpp_bootstrap_info, in wpas_dpp_next_id()
67 if (bi->id > max_id) in wpas_dpp_next_id()
68 max_id = bi->id; in wpas_dpp_next_id()
82 struct dpp_bootstrap_info *bi; in wpas_dpp_qr_code() local
85 bi = dpp_parse_qr_code(cmd); in wpas_dpp_qr_code()
86 if (!bi) in wpas_dpp_qr_code()
89 bi->id = wpas_dpp_next_id(wpa_s); in wpas_dpp_qr_code()
90 dl_list_add(&wpa_s->dpp_bootstrap, &bi->list); in wpas_dpp_qr_code()
93 dpp_notify_new_qr_code(auth, bi) == 1) { in wpas_dpp_qr_code()
104 return bi->id; in wpas_dpp_qr_code()
141 struct dpp_bootstrap_info *bi; in wpas_dpp_bootstrap_gen() local
143 bi = os_zalloc(sizeof(*bi)); in wpas_dpp_bootstrap_gen()
144 if (!bi) in wpas_dpp_bootstrap_gen()
148 bi->type = DPP_BOOTSTRAP_QR_CODE; in wpas_dpp_bootstrap_gen()
150 bi->type = DPP_BOOTSTRAP_PKEX; in wpas_dpp_bootstrap_gen()
168 pk = dpp_keygen(bi, curve, privkey, privkey_len); in wpas_dpp_bootstrap_gen()
174 if (dpp_parse_uri_chan_list(bi, chan) < 0) in wpas_dpp_bootstrap_gen()
179 if (dpp_parse_uri_mac(bi, mac) < 0) in wpas_dpp_bootstrap_gen()
184 if (dpp_parse_uri_info(bi, info) < 0) in wpas_dpp_bootstrap_gen()
189 bi->uri = os_malloc(len + 1); in wpas_dpp_bootstrap_gen()
190 if (!bi->uri) in wpas_dpp_bootstrap_gen()
192 os_snprintf(bi->uri, len + 1, "DPP:%s%s%s%s%s%s%s%s%sK:%s;;", in wpas_dpp_bootstrap_gen()
197 bi->id = wpas_dpp_next_id(wpa_s); in wpas_dpp_bootstrap_gen()
198 dl_list_add(&wpa_s->dpp_bootstrap, &bi->list); in wpas_dpp_bootstrap_gen()
199 ret = bi->id; in wpas_dpp_bootstrap_gen()
200 bi = NULL; in wpas_dpp_bootstrap_gen()
209 dpp_bootstrap_info_free(bi); in wpas_dpp_bootstrap_gen()
217 struct dpp_bootstrap_info *bi; in dpp_bootstrap_get_id() local
219 dl_list_for_each(bi, &wpa_s->dpp_bootstrap, struct dpp_bootstrap_info, in dpp_bootstrap_get_id()
221 if (bi->id == id) in dpp_bootstrap_get_id()
222 return bi; in dpp_bootstrap_get_id()
230 struct dpp_bootstrap_info *bi, *tmp; in dpp_bootstrap_del() local
233 dl_list_for_each_safe(bi, tmp, &wpa_s->dpp_bootstrap, in dpp_bootstrap_del()
235 if (id && bi->id != id) in dpp_bootstrap_del()
238 dl_list_del(&bi->list); in dpp_bootstrap_del()
239 dpp_bootstrap_info_free(bi); in dpp_bootstrap_del()
267 struct dpp_bootstrap_info *bi; in wpas_dpp_bootstrap_get_uri() local
269 bi = dpp_bootstrap_get_id(wpa_s, id); in wpas_dpp_bootstrap_get_uri()
270 if (!bi) in wpas_dpp_bootstrap_get_uri()
272 return bi->uri; in wpas_dpp_bootstrap_get_uri()
279 struct dpp_bootstrap_info *bi; in wpas_dpp_bootstrap_info() local
281 bi = dpp_bootstrap_get_id(wpa_s, id); in wpas_dpp_bootstrap_info()
282 if (!bi) in wpas_dpp_bootstrap_info()
289 dpp_bootstrap_type_txt(bi->type), in wpas_dpp_bootstrap_info()
290 MAC2STR(bi->mac_addr), in wpas_dpp_bootstrap_info()
291 bi->info ? bi->info : "", in wpas_dpp_bootstrap_info()
292 bi->num_freq, in wpas_dpp_bootstrap_info()
293 bi->curve->name); in wpas_dpp_bootstrap_info()
782 struct dpp_bootstrap_info *bi, *own_bi = NULL, *peer_bi = NULL; in wpas_dpp_rx_auth_req() local
821 dl_list_for_each(bi, &wpa_s->dpp_bootstrap, struct dpp_bootstrap_info, in wpas_dpp_rx_auth_req()
823 if (!own_bi && bi->own && in wpas_dpp_rx_auth_req()
824 os_memcmp(bi->pubkey_hash, r_bootstrap, in wpas_dpp_rx_auth_req()
828 own_bi = bi; in wpas_dpp_rx_auth_req()
831 if (!peer_bi && !bi->own && in wpas_dpp_rx_auth_req()
832 os_memcmp(bi->pubkey_hash, i_bootstrap, in wpas_dpp_rx_auth_req()
836 peer_bi = bi; in wpas_dpp_rx_auth_req()
1450 struct dpp_bootstrap_info *bi; in wpas_dpp_rx_pkex_commit_reveal_req() local
1478 bi = os_zalloc(sizeof(*bi)); in wpas_dpp_rx_pkex_commit_reveal_req()
1479 if (!bi) in wpas_dpp_rx_pkex_commit_reveal_req()
1481 bi->id = wpas_dpp_next_id(wpa_s); in wpas_dpp_rx_pkex_commit_reveal_req()
1482 bi->type = DPP_BOOTSTRAP_PKEX; in wpas_dpp_rx_pkex_commit_reveal_req()
1483 os_memcpy(bi->mac_addr, src, ETH_ALEN); in wpas_dpp_rx_pkex_commit_reveal_req()
1484 bi->num_freq = 1; in wpas_dpp_rx_pkex_commit_reveal_req()
1485 bi->freq[0] = freq; in wpas_dpp_rx_pkex_commit_reveal_req()
1486 bi->curve = pkex->own_bi->curve; in wpas_dpp_rx_pkex_commit_reveal_req()
1487 bi->pubkey = pkex->peer_bootstrap_key; in wpas_dpp_rx_pkex_commit_reveal_req()
1491 if (dpp_bootstrap_key_hash(bi) < 0) { in wpas_dpp_rx_pkex_commit_reveal_req()
1492 dpp_bootstrap_info_free(bi); in wpas_dpp_rx_pkex_commit_reveal_req()
1495 dl_list_add(&wpa_s->dpp_bootstrap, &bi->list); in wpas_dpp_rx_pkex_commit_reveal_req()
1505 struct dpp_bootstrap_info *bi, *own_bi; in wpas_dpp_rx_pkex_commit_reveal_resp() local
1525 bi = os_zalloc(sizeof(*bi)); in wpas_dpp_rx_pkex_commit_reveal_resp()
1526 if (!bi) in wpas_dpp_rx_pkex_commit_reveal_resp()
1528 bi->id = wpas_dpp_next_id(wpa_s); in wpas_dpp_rx_pkex_commit_reveal_resp()
1529 bi->type = DPP_BOOTSTRAP_PKEX; in wpas_dpp_rx_pkex_commit_reveal_resp()
1530 os_memcpy(bi->mac_addr, src, ETH_ALEN); in wpas_dpp_rx_pkex_commit_reveal_resp()
1531 bi->num_freq = 1; in wpas_dpp_rx_pkex_commit_reveal_resp()
1532 bi->freq[0] = freq; in wpas_dpp_rx_pkex_commit_reveal_resp()
1533 bi->curve = own_bi->curve; in wpas_dpp_rx_pkex_commit_reveal_resp()
1534 bi->pubkey = pkex->peer_bootstrap_key; in wpas_dpp_rx_pkex_commit_reveal_resp()
1538 if (dpp_bootstrap_key_hash(bi) < 0) { in wpas_dpp_rx_pkex_commit_reveal_resp()
1539 dpp_bootstrap_info_free(bi); in wpas_dpp_rx_pkex_commit_reveal_resp()
1542 dl_list_add(&wpa_s->dpp_bootstrap, &bi->list); in wpas_dpp_rx_pkex_commit_reveal_resp()
1545 bi->id, in wpas_dpp_rx_pkex_commit_reveal_resp()