Lines Matching full:if
61 if (buf == NULL) in gas_build_req()
88 if (crypto_ec_point_to_bin(e, point, x, y) < 0) { in dpp_debug_print_point()
100 if (curve->hash_len == 32) in dpp_hash_vector()
103 if (curve->hash_len == 48) in dpp_hash_vector()
105 if (curve->hash_len == 64) in dpp_hash_vector()
115 if (hash_len == 32) in dpp_hkdf_expand()
120 if (hash_len == 48) in dpp_hkdf_expand()
124 if (hash_len == 64) in dpp_hkdf_expand()
137 if (hash_len == 32) in dpp_hmac_vector()
141 if (hash_len == 48) in dpp_hmac_vector()
144 if (hash_len == 64) in dpp_hmac_vector()
155 if (hash_len == 32) in dpp_hmac()
158 if (hash_len == 48) in dpp_hmac()
160 if (hash_len == 64) in dpp_hmac()
169 if (crypto_bignum_to_bin(bn, pos, len, 0) < 0) in dpp_bn2bin_pad()
182 if (len <= 0) { in dpp_get_pubkey_point()
189 if (!buf) { in dpp_get_pubkey_point()
196 if (res != len) { in dpp_get_pubkey_point()
204 if (!prefix) { in dpp_get_pubkey_point()
220 if (len & 1) in dpp_set_pubkey_point()
224 if (group) in dpp_set_pubkey_point()
252 if (!msg) in dpp_alloc_msg()
274 if (alen > end - pos) in dpp_get_attr()
276 if (id == req_id) { in dpp_get_attr()
293 if (!prev) in dpp_get_attr_next()
302 if (alen > end - pos) in dpp_get_attr_next()
304 if (id == req_id) { in dpp_get_attr_next()
331 if (alen > end - pos) { in dpp_check_attrs()
336 if (wrapped_data) { in dpp_check_attrs()
341 if (id == DPP_ATTR_WRAPPED_DATA) in dpp_check_attrs()
346 if (end != pos) { in dpp_check_attrs()
359 if (!info) in dpp_bootstrap_info_free()
387 if (val < 0x20 || val > 0x7e || val == 0x3b) in dpp_uri_valid_info()
412 if (*pos2 == '/') { in dpp_parse_uri_chan_list()
416 if (opclass <= 0) in dpp_parse_uri_chan_list()
419 if (channel <= 0) in dpp_parse_uri_chan_list()
427 if (freq < 0) { in dpp_parse_uri_chan_list()
431 } else if (bi->num_freq == DPP_BOOTSTRAP_MAX_FREQ) { in dpp_parse_uri_chan_list()
440 if (*pos == ';' || *pos == '\0') in dpp_parse_uri_chan_list()
442 if (*pos != ',') in dpp_parse_uri_chan_list()
458 if (!mac) in dpp_parse_uri_mac()
461 if (hwaddr_aton2(mac, bi->mac_addr) < 0) { in dpp_parse_uri_mac()
475 if (!info) in dpp_parse_uri_info()
479 if (!end) in dpp_parse_uri_info()
482 if (!bi->info) in dpp_parse_uri_info()
487 if (!dpp_uri_valid_info(bi->info)) { in dpp_parse_uri_info()
499 if (!group_id) in dpp_get_curve_group_id()
503 if (group_id == dpp_curves[i].ike_group) in dpp_get_curve_group_id()
520 if (!end) in dpp_parse_uri_pk()
524 if (!data) { in dpp_parse_uri_pk()
532 if (sha256_vector(1, (const u8 **) &data, &data_len, in dpp_parse_uri_pk()
562 if (!pkey) { in dpp_parse_uri_pk()
568 if (!crypto_is_ec_key(pkey)) { in dpp_parse_uri_pk()
576 if (!group) { in dpp_parse_uri_pk()
581 if (!bi->curve) { in dpp_parse_uri_pk()
604 if (os_strncmp(pos, "DPP:", 4) != 0) { in dpp_parse_uri()
612 if (!end) in dpp_parse_uri()
615 if (end == pos) { in dpp_parse_uri()
622 if (pos[0] == 'C' && pos[1] == ':' && !chan_list) in dpp_parse_uri()
624 else if (pos[0] == 'M' && pos[1] == ':' && !mac) in dpp_parse_uri()
626 else if (pos[0] == 'I' && pos[1] == ':' && !info) in dpp_parse_uri()
628 else if (pos[0] == 'K' && pos[1] == ':' && !pk) in dpp_parse_uri()
637 if (!pk) { in dpp_parse_uri()
643 if (!bi) in dpp_parse_uri()
646 if (dpp_clone_uri(bi, uri) < 0 || in dpp_parse_uri()
674 if (os_strcmp(name, dpp_curves[i].name) == 0 || in dpp_get_curve_name()
688 if (dpp_curves[i].jwk_crv && in dpp_get_curve_jwk_crv()
704 if (!pkey) { in dpp_set_keypair()
709 if (!group) { in dpp_set_keypair()
714 if (!*curve) { in dpp_set_keypair()
732 if (!der) { in dpp_bootstrap_key_der()
750 if (!der) in dpp_bootstrap_key_hash()
758 if (res < 0) in dpp_bootstrap_key_hash()
778 if (!curve) { in dpp_keygen()
782 if (!bi->curve) { in dpp_keygen()
788 if (privkey) in dpp_keygen()
792 if (!bi->pubkey) in dpp_keygen()
797 if (!der) in dpp_keygen()
805 if (res < 0) { in dpp_keygen()
815 if (!base64) in dpp_keygen()
821 if (!pos) in dpp_keygen()
843 if (dpp_hmac(hash_len, salt, hash_len, Mx, Mx_len, prk) < 0) in dpp_derive_k1()
851 if (res < 0) in dpp_derive_k1()
872 if (res < 0) in dpp_derive_k2()
880 if (res < 0) in dpp_derive_k2()
901 if (!auth->Mx_len || !auth->Nx_len) { in dpp_derive_ke()
919 if (auth->peer_bi && auth->own_bi) { in dpp_derive_ke()
920 if (!auth->Lx_len) { in dpp_derive_ke()
931 if (res < 0) in dpp_derive_ke()
939 if (res < 0) in dpp_derive_ke()
961 if (hash) { in dpp_build_attr_r_bootstrap_key_hash()
973 if (hash) { in dpp_build_attr_i_bootstrap_key_hash()
1001 if (neg_freq > 0) in dpp_auth_build_req()
1004 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_REQ) in dpp_auth_build_req()
1008 if (!msg) in dpp_auth_build_req()
1020 if (pi) { in dpp_auth_build_req()
1027 if (neg_freq > 0) { in dpp_auth_build_req()
1038 if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_AUTH_REQ) { in dpp_auth_build_req()
1048 if (dpp_test == DPP_TEST_NO_I_NONCE_AUTH_REQ) { in dpp_auth_build_req()
1052 if (dpp_test == DPP_TEST_INVALID_I_NONCE_AUTH_REQ) { in dpp_auth_build_req()
1074 if (dpp_test == DPP_TEST_NO_I_CAPAB_AUTH_REQ) { in dpp_auth_build_req()
1088 if (dpp_test == DPP_TEST_ZERO_I_CAPAB) { in dpp_auth_build_req()
1109 if (aes_siv_encrypt(auth->k1, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_req()
1123 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_REQ) { in dpp_auth_build_req()
1164 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_RESP) in dpp_auth_build_resp()
1168 if (!msg) in dpp_auth_build_resp()
1174 if (status != 255) in dpp_auth_build_resp()
1184 if (pr) { in dpp_auth_build_resp()
1193 if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_AUTH_RESP) { in dpp_auth_build_resp()
1202 if (r_nonce) { in dpp_auth_build_resp()
1212 if (i_nonce) { in dpp_auth_build_resp()
1220 if (dpp_test == DPP_TEST_I_NONCE_MISMATCH_AUTH_RESP) { in dpp_auth_build_resp()
1229 if (dpp_test == DPP_TEST_NO_R_CAPAB_AUTH_RESP) { in dpp_auth_build_resp()
1244 if (dpp_test == DPP_TEST_ZERO_R_CAPAB) { in dpp_auth_build_resp()
1247 } else if (dpp_test == DPP_TEST_INCOMPATIBLE_R_CAPAB_AUTH_RESP) { in dpp_auth_build_resp()
1250 if ((auth->i_capab & DPP_CAPAB_ROLE_MASK) == in dpp_auth_build_resp()
1260 if (wrapped_r_auth) { in dpp_auth_build_resp()
1282 if (aes_siv_encrypt(siv_key, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_resp()
1296 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_RESP) { in dpp_auth_build_resp()
1316 if (!own_modes || !num_modes) in dpp_channel_ok_init()
1321 if ((unsigned int) own_modes[m].channels[c].freq != in dpp_channel_ok_init()
1325 if (!(flag & (HOSTAPD_CHAN_DISABLED | in dpp_channel_ok_init()
1343 if (freqs[--num] == freq) in freq_included()
1356 if (freqs[i] == freq) in freq_to_start()
1359 if (i == 0 || i >= num) in freq_to_start()
1375 if (freq_included(auth->freq, auth->num_freq, freq)) in dpp_channel_intersect()
1377 if (dpp_channel_ok_init(own_modes, num_modes, freq)) in dpp_channel_intersect()
1380 if (!auth->num_freq) { in dpp_channel_intersect()
1399 if (!own_modes || !num_modes) { in dpp_channel_local_list()
1411 if (flag & (HOSTAPD_CHAN_DISABLED | in dpp_channel_local_list()
1415 if (freq_included(auth->freq, auth->num_freq, freq)) in dpp_channel_local_list()
1418 if (auth->num_freq == DPP_BOOTSTRAP_MAX_FREQ) { in dpp_channel_local_list()
1442 if (auth->peer_bi->num_freq > 0) in dpp_prepare_channel_list()
1446 if (res < 0) in dpp_prepare_channel_list()
1462 if (os_snprintf_error(end - pos, res)) in dpp_prepare_channel_list()
1480 if (auth->own_bi) in dpp_autogen_bootstrap_key()
1484 if (!bi) in dpp_autogen_bootstrap_key()
1488 if (!pk) in dpp_autogen_bootstrap_key()
1494 if (!bi->uri) in dpp_autogen_bootstrap_key()
1531 if (!auth) in dpp_auth_init()
1542 if (dpp_autogen_bootstrap_key(auth) < 0 || in dpp_auth_init()
1547 if (dpp_nonce_override_len > 0) { in dpp_auth_init()
1553 if (random_get_bytes(auth->i_nonce, nonce_len)) { in dpp_auth_init()
1561 if (random_get_bytes(auth->i_nonce, nonce_len)) { in dpp_auth_init()
1569 if (dpp_protocol_key_override_len) { in dpp_auth_init()
1583 if (!auth->own_protocol_key) in dpp_auth_init()
1587 if (!pi) in dpp_auth_init()
1591 if (dpp_ecdh(auth->own_protocol_key, auth->peer_bi->pubkey, in dpp_auth_init()
1600 if (dpp_derive_k1(auth->Mx, auth->secret_len, auth->k1, in dpp_auth_init()
1608 if (dpp_test == DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_REQ) { in dpp_auth_init()
1611 } else if (dpp_test == DPP_TEST_INVALID_R_BOOTSTRAP_KEY_HASH_AUTH_REQ) { in dpp_auth_init()
1617 } else if (dpp_test == DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_REQ) { in dpp_auth_init()
1620 } else if (dpp_test == DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_REQ) { in dpp_auth_init()
1626 } else if (dpp_test == DPP_TEST_NO_I_PROTO_KEY_AUTH_REQ) { in dpp_auth_init()
1630 } else if (dpp_test == DPP_TEST_INVALID_I_PROTO_KEY_AUTH_REQ) { in dpp_auth_init()
1634 if (!pi || dpp_test_gen_invalid_key(pi, auth->curve) < 0) in dpp_auth_init()
1641 if (!auth->req_msg) in dpp_auth_init()
1666 if (random_get_bytes(auth->e_nonce, nonce_len)) { in dpp_build_conf_req_attr()
1679 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_CONF_REQ) in dpp_build_conf_req_attr()
1683 if (!clear || !msg) in dpp_build_conf_req_attr()
1687 if (dpp_test == DPP_TEST_NO_E_NONCE_CONF_REQ) { in dpp_build_conf_req_attr()
1691 if (dpp_test == DPP_TEST_INVALID_E_NONCE_CONF_REQ) { in dpp_build_conf_req_attr()
1698 if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_CONF_REQ) { in dpp_build_conf_req_attr()
1711 if (dpp_test == DPP_TEST_NO_CONFIG_ATTR_OBJ_CONF_REQ) { in dpp_build_conf_req_attr()
1732 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_build_conf_req_attr()
1740 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_CONF_REQ) { in dpp_build_conf_req_attr()
1787 if (!conf_req) { in dpp_build_conf_req()
1794 if (!buf) { in dpp_build_conf_req()
1819 if (dpp_test == DPP_TEST_INVALID_CONFIG_ATTR_OBJ_CONF_REQ) { in dpp_build_conf_req_helper()
1831 if (mud_url && mud_url[0]) in dpp_build_conf_req_helper()
1834 if (!json) in dpp_build_conf_req_helper()
1838 if (json_add_string_escape(json, "name", dpp_name, name_len) < 0) { in dpp_build_conf_req_helper()
1846 if (mud_url && mud_url[0]) { in dpp_build_conf_req_helper()
1850 if (opclasses) { in dpp_build_conf_req_helper()
1898 if (auth->initiator) { in dpp_gen_r_auth()
1901 if (auth->own_bi) in dpp_gen_r_auth()
1909 if (auth->peer_bi) in dpp_gen_r_auth()
1915 if (!pix || !prx || !brx) in dpp_gen_r_auth()
1934 if (bix) { in dpp_gen_r_auth()
1952 if (res == 0) in dpp_gen_r_auth()
1976 if (auth->initiator) { in dpp_gen_i_auth()
1979 if (auth->own_bi) in dpp_gen_i_auth()
1983 if (!auth->peer_bi) in dpp_gen_i_auth()
1989 if (auth->peer_bi) in dpp_gen_i_auth()
1993 if (!auth->own_bi) in dpp_gen_i_auth()
1997 if (!pix || !prx || !brx) in dpp_gen_i_auth()
2020 if (bix) { in dpp_gen_i_auth()
2034 if (res == 0) in dpp_gen_i_auth()
2060 if (!sum || !q || !lx) in dpp_auth_derive_l_responder()
2068 if (!bR_bn || !pR_bn) in dpp_auth_derive_l_responder()
2071 if ((crypto_get_order(group, q) != 0) || in dpp_auth_derive_l_responder()
2076 if (!l || (crypto_ec_point_mul((struct crypto_ec *)group, BI_point, sum, l) != 0) || in dpp_auth_derive_l_responder()
2082 if (dpp_bn2bin_pad(lx, auth->Lx, auth->secret_len) < 0) in dpp_auth_derive_l_responder()
2108 if (!lx) in dpp_auth_derive_l_initiator()
2115 if (!group || !bI_bn) in dpp_auth_derive_l_initiator()
2119 if (!sum || !l || in dpp_auth_derive_l_initiator()
2128 if (dpp_bn2bin_pad(lx, auth->Lx, auth->secret_len) < 0) in dpp_auth_derive_l_initiator()
2159 if (!auth->own_bi) in dpp_auth_build_resp_ok()
2163 if (dpp_nonce_override_len > 0) { in dpp_auth_build_resp_ok()
2169 if (random_get_bytes(auth->r_nonce, nonce_len)) { in dpp_auth_build_resp_ok()
2177 if (random_get_bytes(auth->r_nonce, nonce_len)) { in dpp_auth_build_resp_ok()
2186 if (dpp_protocol_key_override_len) { in dpp_auth_build_resp_ok()
2200 if (!auth->own_protocol_key) in dpp_auth_build_resp_ok()
2204 if (!pr) in dpp_auth_build_resp_ok()
2208 if (dpp_ecdh(auth->own_protocol_key, auth->peer_protocol_key, in dpp_auth_build_resp_ok()
2216 if (dpp_derive_k2(auth->Nx, auth->secret_len, auth->k2, in dpp_auth_build_resp_ok()
2220 if (auth->own_bi && auth->peer_bi) { in dpp_auth_build_resp_ok()
2222 if (dpp_auth_derive_l_responder(auth) < 0) in dpp_auth_build_resp_ok()
2226 if (dpp_derive_ke(auth, auth->ke, auth->curve->hash_len) < 0) in dpp_auth_build_resp_ok()
2232 if (dpp_gen_r_auth(auth, r_auth + 4) < 0) in dpp_auth_build_resp_ok()
2235 if (dpp_test == DPP_TEST_R_AUTH_MISMATCH_AUTH_RESP) { in dpp_auth_build_resp_ok()
2240 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_auth_build_resp_ok()
2250 if (auth->peer_bi) in dpp_auth_build_resp_ok()
2259 if (dpp_test == DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_RESP) { in dpp_auth_build_resp_ok()
2262 } else if (dpp_test == in dpp_auth_build_resp_ok()
2269 } else if (dpp_test == DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_RESP) { in dpp_auth_build_resp_ok()
2272 } else if (dpp_test == in dpp_auth_build_resp_ok()
2276 if (i_pubkey_hash) in dpp_auth_build_resp_ok()
2282 } else if (dpp_test == DPP_TEST_NO_R_PROTO_KEY_AUTH_RESP) { in dpp_auth_build_resp_ok()
2286 } else if (dpp_test == DPP_TEST_INVALID_R_PROTO_KEY_AUTH_RESP) { in dpp_auth_build_resp_ok()
2290 if (!pr || dpp_test_gen_invalid_key(pr, auth->curve) < 0) in dpp_auth_build_resp_ok()
2292 } else if (dpp_test == DPP_TEST_NO_R_AUTH_AUTH_RESP) { in dpp_auth_build_resp_ok()
2296 } else if (dpp_test == DPP_TEST_NO_STATUS_AUTH_RESP) { in dpp_auth_build_resp_ok()
2299 } else if (dpp_test == DPP_TEST_INVALID_STATUS_AUTH_RESP) { in dpp_auth_build_resp_ok()
2302 } else if (dpp_test == DPP_TEST_NO_R_NONCE_AUTH_RESP) { in dpp_auth_build_resp_ok()
2305 } else if (dpp_test == DPP_TEST_NO_I_NONCE_AUTH_RESP) { in dpp_auth_build_resp_ok()
2316 if (!msg) in dpp_auth_build_resp_ok()
2336 if (!auth->own_bi) in dpp_auth_build_resp_status()
2341 if (auth->peer_bi) in dpp_auth_build_resp_status()
2349 if (dpp_test == DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_RESP) { in dpp_auth_build_resp_status()
2352 } else if (dpp_test == in dpp_auth_build_resp_status()
2359 } else if (dpp_test == DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_RESP) { in dpp_auth_build_resp_status()
2362 } else if (dpp_test == in dpp_auth_build_resp_status()
2366 if (i_pubkey_hash) in dpp_auth_build_resp_status()
2372 } else if (dpp_test == DPP_TEST_NO_STATUS_AUTH_RESP) { in dpp_auth_build_resp_status()
2375 } else if (dpp_test == DPP_TEST_NO_I_NONCE_AUTH_RESP) { in dpp_auth_build_resp_status()
2384 if (!msg) in dpp_auth_build_resp_status()
2418 if (dpp_test == DPP_TEST_STOP_AT_AUTH_REQ) { in dpp_auth_req_rx()
2427 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_auth_req_rx()
2437 if (!auth) in dpp_auth_req_rx()
2447 #if 0 in dpp_auth_req_rx()
2450 if (channel) { in dpp_auth_req_rx()
2453 if (channel_len < 2) { in dpp_auth_req_rx()
2462 if (neg_freq < 0) { in dpp_auth_req_rx()
2468 if (auth->curr_freq != (unsigned int) neg_freq) { in dpp_auth_req_rx()
2481 if (!i_proto) { in dpp_auth_req_rx()
2491 if (!pi) { in dpp_auth_req_rx()
2497 if (dpp_ecdh(own_bi->pubkey, pi, auth->Mx, &secret_len) < 0) in dpp_auth_req_rx()
2505 if (dpp_derive_k1(auth->Mx, auth->secret_len, auth->k1, in dpp_auth_req_rx()
2519 if (!unwrapped) in dpp_auth_req_rx()
2521 if (aes_siv_decrypt(auth->k1, auth->curve->hash_len, in dpp_auth_req_rx()
2530 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_auth_req_rx()
2537 if (!i_nonce || i_nonce_len != auth->curve->nonce_len) { in dpp_auth_req_rx()
2547 if (!i_capab || i_capab_len < 1) { in dpp_auth_req_rx()
2559 if (!(dpp_allowed_roles & DPP_CAPAB_CONFIGURATOR)) { in dpp_auth_req_rx()
2568 if (!(dpp_allowed_roles & DPP_CAPAB_ENROLLEE)) { in dpp_auth_req_rx()
2577 if (dpp_allowed_roles & DPP_CAPAB_ENROLLEE) { in dpp_auth_req_rx()
2580 } else if (dpp_allowed_roles & DPP_CAPAB_CONFIGURATOR) { in dpp_auth_req_rx()
2596 if (qr_mutual && !peer_bi && own_bi->type == DPP_BOOTSTRAP_QR_CODE) { in dpp_auth_req_rx()
2601 if (dpp_auth_build_resp_status(auth, in dpp_auth_req_rx()
2607 if (i_bootstrap && i_bootstrap_len == SHA256_MAC_LEN) { in dpp_auth_req_rx()
2621 if (dpp_auth_build_resp_ok(auth) < 0) in dpp_auth_req_rx()
2629 if (dpp_allowed_roles & DPP_CAPAB_CONFIGURATOR) in dpp_auth_req_rx()
2635 if (dpp_auth_build_resp_status(auth, DPP_STATUS_NOT_COMPATIBLE) < 0) in dpp_auth_req_rx()
2651 if (!auth || !auth->response_pending || in dpp_notify_new_qr_code()
2661 if (dpp_auth_build_resp_ok(auth) < 0) in dpp_notify_new_qr_code()
2694 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_CONF) in dpp_auth_build_conf()
2698 if (!msg) in dpp_auth_build_conf()
2704 if (auth->own_bi) in dpp_auth_build_conf()
2710 if (dpp_test == DPP_TEST_NO_STATUS_AUTH_CONF) { in dpp_auth_build_conf()
2713 } else if (dpp_test == DPP_TEST_INVALID_STATUS_AUTH_CONF) { in dpp_auth_build_conf()
2724 if (dpp_test == DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_CONF) { in dpp_auth_build_conf()
2727 } else if (dpp_test == in dpp_auth_build_conf()
2734 } else if (dpp_test == DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_CONF) { in dpp_auth_build_conf()
2737 } else if (dpp_test == in dpp_auth_build_conf()
2741 if (i_pubkey_hash) in dpp_auth_build_conf()
2757 if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_AUTH_CONF) in dpp_auth_build_conf()
2759 if (dpp_test == DPP_TEST_NO_I_AUTH_AUTH_CONF) in dpp_auth_build_conf()
2775 if (status == DPP_STATUS_OK) { in dpp_auth_build_conf()
2782 if (dpp_test == DPP_TEST_NO_I_AUTH_AUTH_CONF) in dpp_auth_build_conf()
2790 if (dpp_gen_i_auth(auth, i_auth + 4) < 0) in dpp_auth_build_conf()
2794 if (dpp_test == DPP_TEST_I_AUTH_MISMATCH_AUTH_CONF) { in dpp_auth_build_conf()
2800 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_auth_build_conf()
2816 if (aes_siv_encrypt(auth->k2, auth->curve->hash_len, in dpp_auth_build_conf()
2825 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_AUTH_CONF) { in dpp_auth_build_conf()
2835 if (status == DPP_STATUS_OK) in dpp_auth_build_conf()
2859 if (status == DPP_STATUS_NOT_COMPATIBLE) { in dpp_auth_resp_rx_status()
2862 } else if (status == DPP_STATUS_RESPONSE_PENDING) { in dpp_auth_resp_rx_status()
2883 if (!unwrapped) in dpp_auth_resp_rx_status()
2885 if (aes_siv_decrypt(auth->k1, auth->curve->hash_len, in dpp_auth_resp_rx_status()
2894 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_auth_resp_rx_status()
2901 if (!i_nonce || i_nonce_len != auth->curve->nonce_len) { in dpp_auth_resp_rx_status()
2906 if (os_memcmp(auth->i_nonce, i_nonce, i_nonce_len) != 0) { in dpp_auth_resp_rx_status()
2914 if (!r_capab || r_capab_len < 1) { in dpp_auth_resp_rx_status()
2920 if (status == DPP_STATUS_NOT_COMPATIBLE) { in dpp_auth_resp_rx_status()
2923 } else if (status == DPP_STATUS_RESPONSE_PENDING) { in dpp_auth_resp_rx_status()
2926 if ((auth->configurator && role != DPP_CAPAB_ENROLLEE) || in dpp_auth_resp_rx_status()
2963 if (dpp_test == DPP_TEST_STOP_AT_AUTH_RESP) { in dpp_auth_resp_rx()
2970 if (!auth->initiator || !auth->peer_bi) { in dpp_auth_resp_rx()
2979 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_auth_resp_rx()
2992 if (!r_bootstrap || r_bootstrap_len != SHA256_MAC_LEN) { in dpp_auth_resp_rx()
2999 if (os_memcmp(r_bootstrap, auth->peer_bi->pubkey_hash, in dpp_auth_resp_rx()
3012 if (i_bootstrap) { in dpp_auth_resp_rx()
3013 if (i_bootstrap_len != SHA256_MAC_LEN) { in dpp_auth_resp_rx()
3021 if (!auth->own_bi || in dpp_auth_resp_rx()
3028 } else if (auth->own_bi && auth->own_bi->type == DPP_BOOTSTRAP_PKEX) { in dpp_auth_resp_rx()
3039 if (!status || status_len < 1) { in dpp_auth_resp_rx()
3046 if (status[0] != DPP_STATUS_OK) { in dpp_auth_resp_rx()
3053 if (!i_bootstrap && auth->own_bi) { in dpp_auth_resp_rx()
3064 if (!r_proto) { in dpp_auth_resp_rx()
3074 if (!pr) { in dpp_auth_resp_rx()
3080 if (dpp_ecdh(auth->own_protocol_key, pr, auth->Nx, &secret_len) < 0) { in dpp_auth_resp_rx()
3092 if (dpp_derive_k2(auth->Nx, auth->secret_len, auth->k2, in dpp_auth_resp_rx()
3106 if (!unwrapped) in dpp_auth_resp_rx()
3108 if (aes_siv_decrypt(auth->k2, auth->curve->hash_len, in dpp_auth_resp_rx()
3117 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_auth_resp_rx()
3124 if (!r_nonce || r_nonce_len != auth->curve->nonce_len) { in dpp_auth_resp_rx()
3133 if (!i_nonce || i_nonce_len != auth->curve->nonce_len) { in dpp_auth_resp_rx()
3138 if (os_memcmp(auth->i_nonce, i_nonce, i_nonce_len) != 0) { in dpp_auth_resp_rx()
3143 if (auth->own_bi) { in dpp_auth_resp_rx()
3145 if (dpp_auth_derive_l_initiator(auth) < 0) in dpp_auth_resp_rx()
3152 if (!r_capab || r_capab_len < 1) { in dpp_auth_resp_rx()
3159 if ((auth->allowed_roles == in dpp_auth_resp_rx()
3167 } else if ((auth->configurator && role != DPP_CAPAB_ENROLLEE) || in dpp_auth_resp_rx()
3173 if (role != DPP_CAPAB_ENROLLEE && in dpp_auth_resp_rx()
3183 if (!wrapped2 || wrapped2_len < AES_BLOCK_SIZE) { in dpp_auth_resp_rx()
3192 if (dpp_derive_ke(auth, auth->ke, auth->curve->hash_len) < 0) in dpp_auth_resp_rx()
3197 if (!unwrapped2) in dpp_auth_resp_rx()
3199 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_auth_resp_rx()
3208 if (dpp_check_attrs(unwrapped2, unwrapped2_len) < 0) { in dpp_auth_resp_rx()
3216 if (!r_auth || r_auth_len != auth->curve->hash_len) { in dpp_auth_resp_rx()
3224 if (dpp_gen_r_auth(auth, r_auth2) < 0) in dpp_auth_resp_rx()
3228 if (os_memcmp(r_auth, r_auth2, r_auth_len) != 0) { in dpp_auth_resp_rx()
3240 if (dpp_test == DPP_TEST_AUTH_RESP_IN_PLACE_OF_CONF) { in dpp_auth_resp_rx()
3243 if (dpp_auth_build_resp_ok(auth) < 0) in dpp_auth_resp_rx()
3286 if (!unwrapped) { in dpp_auth_conf_rx_failure()
3290 if (aes_siv_decrypt(auth->k2, auth->curve->hash_len, in dpp_auth_conf_rx_failure()
3299 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_auth_conf_rx_failure()
3306 if (!r_nonce || r_nonce_len != auth->curve->nonce_len) { in dpp_auth_conf_rx_failure()
3310 if (os_memcmp(r_nonce, auth->r_nonce, r_nonce_len) != 0) { in dpp_auth_conf_rx_failure()
3319 if (status == DPP_STATUS_NOT_COMPATIBLE) in dpp_auth_conf_rx_failure()
3321 else if (status == DPP_STATUS_AUTH_FAILURE) in dpp_auth_conf_rx_failure()
3343 if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) { in dpp_auth_conf_rx()
3350 if (auth->initiator || !auth->own_bi) { in dpp_auth_conf_rx()
3359 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_auth_conf_rx()
3372 if (!r_bootstrap || r_bootstrap_len != SHA256_MAC_LEN) { in dpp_auth_conf_rx()
3379 if (os_memcmp(r_bootstrap, auth->own_bi->pubkey_hash, in dpp_auth_conf_rx()
3392 if (i_bootstrap) { in dpp_auth_conf_rx()
3393 if (i_bootstrap_len != SHA256_MAC_LEN) { in dpp_auth_conf_rx()
3401 if (!auth->peer_bi || in dpp_auth_conf_rx()
3408 } else if (auth->peer_bi) { in dpp_auth_conf_rx()
3418 if (!status || status_len < 1) { in dpp_auth_conf_rx()
3424 if (status[0] == DPP_STATUS_NOT_COMPATIBLE || in dpp_auth_conf_rx()
3430 if (status[0] != DPP_STATUS_OK) { in dpp_auth_conf_rx()
3445 if (!unwrapped) in dpp_auth_conf_rx()
3447 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_auth_conf_rx()
3456 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_auth_conf_rx()
3463 if (!i_auth || i_auth_len != auth->curve->hash_len) { in dpp_auth_conf_rx()
3471 if (dpp_gen_i_auth(auth, i_auth2) < 0) in dpp_auth_conf_rx()
3475 if (os_memcmp(i_auth, i_auth2, i_auth_len) != 0) { in dpp_auth_conf_rx()
3502 if (!conf) in dpp_configuration_alloc()
3506 if (end) in dpp_configuration_alloc()
3511 if (bin_str_eq(type, len, "psk")) in dpp_configuration_alloc()
3513 else if (bin_str_eq(type, len, "sae")) in dpp_configuration_alloc()
3515 else if (bin_str_eq(type, len, "psk-sae") || in dpp_configuration_alloc()
3518 else if (bin_str_eq(type, len, "sae-dpp") || in dpp_configuration_alloc()
3521 else if (bin_str_eq(type, len, "psk-sae-dpp") || in dpp_configuration_alloc()
3524 else if (bin_str_eq(type, len, "dpp")) in dpp_configuration_alloc()
3572 if (conf->ssid_len == 0) in dpp_configuration_valid()
3574 if (dpp_akm_psk(conf->akm) && !conf->passphrase && !conf->psk_set) in dpp_configuration_valid()
3576 if (dpp_akm_sae(conf->akm) && !conf->passphrase) in dpp_configuration_valid()
3584 if (!conf) in dpp_configuration_free()
3600 if (pos) { in dpp_configuration_parse_helper()
3602 if (!conf_sta) in dpp_configuration_parse_helper()
3609 if (pos) { in dpp_configuration_parse_helper()
3611 if (!conf_ap) in dpp_configuration_parse_helper()
3617 if (!conf) in dpp_configuration_parse_helper()
3621 if (pos) { in dpp_configuration_parse_helper()
3626 if (conf->ssid_len > sizeof(conf->ssid) || in dpp_configuration_parse_helper()
3640 if (pos) { in dpp_configuration_parse_helper()
3641 if (conf_ap) { in dpp_configuration_parse_helper()
3650 if (pos) { in dpp_configuration_parse_helper()
3657 if (pass_len > 63 || pass_len < 8) in dpp_configuration_parse_helper()
3660 if (!conf->passphrase || in dpp_configuration_parse_helper()
3666 if (pos) { in dpp_configuration_parse_helper()
3668 if (hexstr2bin(pos, conf->psk, PMK_LEN) < 0) in dpp_configuration_parse_helper()
3674 if (pos) { in dpp_configuration_parse_helper()
3681 if (!conf->group_id) in dpp_configuration_parse_helper()
3688 if (pos) { in dpp_configuration_parse_helper()
3693 if (val <= 0) in dpp_configuration_parse_helper()
3698 if (!dpp_configuration_valid(conf)) in dpp_configuration_parse_helper()
3701 if (idx == 0) { in dpp_configuration_parse_helper()
3704 } else if (idx == 1) { in dpp_configuration_parse_helper()
3728 if (!pos) in dpp_configuration_parse()
3733 if (!tmp) in dpp_configuration_parse()
3739 if (res) in dpp_configuration_parse()
3742 if (res) in dpp_configuration_parse()
3759 if (!dpp) in dpp_configurator_get_id()
3764 if (conf->id == id) in dpp_configurator_get_id()
3777 if (!cmd) in dpp_set_configurator()
3783 if (pos) { in dpp_set_configurator()
3786 if (!auth->conf) { in dpp_set_configurator()
3794 if (pos) { in dpp_set_configurator()
3800 if (pos) { in dpp_set_configurator()
3805 if (dpp_configuration_parse(auth, cmd) < 0) { in dpp_set_configurator()
3818 if (!auth) in dpp_auth_deinit()
3853 if (auth->discovery_override) in dpp_build_conf_start()
3858 if (!buf) in dpp_build_conf_start()
3864 if (auth->discovery_override) { in dpp_build_conf_start()
3874 if (((!conf->ssid_charset || auth->peer_version < 2) && in dpp_build_conf_start()
3883 if (conf->ssid_charset > 0) { in dpp_build_conf_start()
3902 if (!pub) in dpp_build_jwk()
3911 if (json_add_base64url(buf, "x", pos, curve->prime_len) < 0) in dpp_build_jwk()
3915 if (json_add_base64url(buf, "y", pos, curve->prime_len) < 0) in dpp_build_jwk()
3917 if (kid) { in dpp_build_jwk()
3932 if (conf->passphrase && os_strlen(conf->passphrase) < 64) { in dpp_build_legacy_cred_params()
3935 } else if (conf->psk_set) { in dpp_build_legacy_cred_params()
3970 if (hash_len != SHA256_MAC_LEN) in dpp_get_config_obj_hash()
4004 if (!auth->conf) { in dpp_build_conf_obj_dpp()
4011 if (dpp_akm_ver2(akm) && auth->peer_version < 2) { in dpp_build_conf_obj_dpp()
4018 if (auth->groups_override) in dpp_build_conf_obj_dpp()
4022 if (conf->group_id) in dpp_build_conf_obj_dpp()
4027 if (!dppcon) in dpp_build_conf_obj_dpp()
4030 if (auth->groups_override) { in dpp_build_conf_obj_dpp()
4032 if (auth->groups_override) { in dpp_build_conf_obj_dpp()
4056 if (dpp_build_jwk(dppcon, "netAccessKey", auth->peer_protocol_key, NULL, in dpp_build_conf_obj_dpp()
4061 if (conf->netaccesskey_expiry) { in dpp_build_conf_obj_dpp()
4065 if (os_gmtime(conf->netaccesskey_expiry, &tm) < 0) { in dpp_build_conf_obj_dpp()
4082 if (!jws_prot_hdr) in dpp_build_conf_obj_dpp()
4097 if (!signed1 || !signed2) in dpp_build_conf_obj_dpp()
4101 if (!hash) { in dpp_build_conf_obj_dpp()
4104 if (dpp_get_config_obj_hash(signed1, signed1_len, signed2, signed1_len, hash, curve->hash_len) < 0) in dpp_build_conf_obj_dpp()
4109 if (crypto_ecdsa_get_sign(hash, r, s, auth->conf->csign, curve->hash_len) < 0) in dpp_build_conf_obj_dpp()
4113 if (dpp_bn2bin_pad(r, signature, curve->prime_len) < 0 || in dpp_build_conf_obj_dpp()
4121 if (!signed3) in dpp_build_conf_obj_dpp()
4128 if (incl_legacy) in dpp_build_conf_obj_dpp()
4131 if (!buf) in dpp_build_conf_obj_dpp()
4134 if (auth->akm_use_selector && dpp_akm_ver2(akm)) in dpp_build_conf_obj_dpp()
4141 if (incl_legacy) { in dpp_build_conf_obj_dpp()
4153 if (dpp_build_jwk(buf, "csign", auth->conf->csign, auth->conf->kid, in dpp_build_conf_obj_dpp()
4166 if (signed1) in dpp_build_conf_obj_dpp()
4168 if (signed2) in dpp_build_conf_obj_dpp()
4170 if (signed3) in dpp_build_conf_obj_dpp()
4172 if (hash) in dpp_build_conf_obj_dpp()
4174 if (signature) in dpp_build_conf_obj_dpp()
4195 if (!buf) in dpp_build_conf_obj_legacy()
4198 if (auth->akm_use_selector && dpp_akm_ver2(conf->akm)) in dpp_build_conf_obj_legacy()
4223 if (auth->config_obj_override) { in dpp_build_conf_obj()
4224 if (idx != 0) in dpp_build_conf_obj()
4232 if (idx == 0) { in dpp_build_conf_obj()
4233 if (netrole == DPP_NETROLE_STA) in dpp_build_conf_obj()
4235 else if (netrole == DPP_NETROLE_AP) in dpp_build_conf_obj()
4237 } else if (idx == 1) { in dpp_build_conf_obj()
4238 if (netrole == DPP_NETROLE_STA) in dpp_build_conf_obj()
4240 else if (netrole == DPP_NETROLE_AP) in dpp_build_conf_obj()
4243 if (!conf) { in dpp_build_conf_obj()
4244 if (idx == 0) in dpp_build_conf_obj()
4251 if (dpp_akm_dpp(conf->akm)) in dpp_build_conf_obj()
4270 if (conf) { in dpp_build_conf_resp()
4280 if (conf) in dpp_build_conf_resp()
4282 if (conf2) in dpp_build_conf_resp()
4284 if (auth->peer_version >= 2 && auth->send_conn_status && in dpp_build_conf_resp()
4290 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_CONF_RESP) in dpp_build_conf_resp()
4294 if (!clear || !msg) in dpp_build_conf_resp()
4298 if (dpp_test == DPP_TEST_NO_E_NONCE_CONF_RESP) { in dpp_build_conf_resp()
4302 if (dpp_test == DPP_TEST_E_NONCE_MISMATCH_CONF_RESP) { in dpp_build_conf_resp()
4310 if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_CONF_RESP) { in dpp_build_conf_resp()
4323 if (dpp_test == DPP_TEST_NO_CONFIG_OBJ_CONF_RESP) { in dpp_build_conf_resp()
4329 if (conf) { in dpp_build_conf_resp()
4334 if (auth->peer_version >= 2 && conf2) { in dpp_build_conf_resp()
4338 } else if (conf2) { in dpp_build_conf_resp()
4343 if (auth->peer_version >= 2 && auth->send_conn_status && in dpp_build_conf_resp()
4352 if (dpp_test == DPP_TEST_NO_STATUS_CONF_RESP) { in dpp_build_conf_resp()
4356 if (dpp_test == DPP_TEST_INVALID_STATUS_CONF_RESP) { in dpp_build_conf_resp()
4378 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_build_conf_resp()
4386 if (dpp_test == DPP_TEST_AFTER_WRAPPED_DATA_CONF_RESP) { in dpp_build_conf_resp()
4421 if (dpp_test == DPP_TEST_STOP_AT_CONF_REQ) { in dpp_conf_req_rx()
4428 if (dpp_check_attrs(attr_start, attr_len) < 0) { in dpp_conf_req_rx()
4435 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_conf_req_rx()
4445 if (!unwrapped) in dpp_conf_req_rx()
4447 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_conf_req_rx()
4456 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_conf_req_rx()
4464 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) { in dpp_conf_req_rx()
4475 if (!config_attr) { in dpp_conf_req_rx()
4484 if (!root) { in dpp_conf_req_rx()
4490 if (!token || token->type != JSON_STRING) { in dpp_conf_req_rx()
4497 if (!token || token->type != JSON_STRING) { in dpp_conf_req_rx()
4502 if (os_strcmp(token->string, "infra") != 0) { in dpp_conf_req_rx()
4510 if (!token || token->type != JSON_STRING) { in dpp_conf_req_rx()
4515 if (os_strcmp(token->string, "sta") == 0) { in dpp_conf_req_rx()
4517 } else if (os_strcmp(token->string, "ap") == 0) { in dpp_conf_req_rx()
4519 } else if (os_strcmp(token->string, "configurator") == 0) { in dpp_conf_req_rx()
4529 if (token && token->type == JSON_STRING) in dpp_conf_req_rx()
4533 if (token && token->type == JSON_ARRAY) { in dpp_conf_req_rx()
4537 if (token->type != JSON_NUMBER) in dpp_conf_req_rx()
4564 if (!root) { in dpp_parse_jws_prot_hdr()
4570 if (root->type != JSON_OBJECT) { in dpp_parse_jws_prot_hdr()
4577 if (!token || token->type != JSON_STRING) { in dpp_parse_jws_prot_hdr()
4583 if (os_strcmp(token->string, "dppCon") != 0) { in dpp_parse_jws_prot_hdr()
4591 if (!token || token->type != JSON_STRING) { in dpp_parse_jws_prot_hdr()
4597 if (os_strcmp(token->string, curve->jws_alg) != 0) { in dpp_parse_jws_prot_hdr()
4605 if (!kid) { in dpp_parse_jws_prot_hdr()
4628 if (pass && pass->type == JSON_STRING) { in dpp_parse_cred_legacy()
4633 if (len < 8 || len > 63) in dpp_parse_cred_legacy()
4637 } else if (psk_hex && psk_hex->type == JSON_STRING) { in dpp_parse_cred_legacy()
4638 if (dpp_akm_sae(conf->akm) && !dpp_akm_psk(conf->akm)) { in dpp_parse_cred_legacy()
4643 if (os_strlen(psk_hex->string) != PMK_LEN * 2 || in dpp_parse_cred_legacy()
4656 if (dpp_akm_sae(conf->akm) && !conf->passphrase[0]) { in dpp_parse_cred_legacy()
4676 if (!token || token->type != JSON_STRING) { in dpp_parse_jwk()
4680 if (os_strcmp(token->string, "EC") != 0) { in dpp_parse_jwk()
4687 if (!token || token->type != JSON_STRING) { in dpp_parse_jwk()
4692 if (!curve) { in dpp_parse_jwk()
4699 if (!x) { in dpp_parse_jwk()
4704 if (wpabuf_len(x) != curve->prime_len) { in dpp_parse_jwk()
4713 if (!y) { in dpp_parse_jwk()
4718 if (wpabuf_len(y) != curve->prime_len) { in dpp_parse_jwk()
4727 if (!group) { in dpp_parse_jwk()
4760 if (os_strlen(timestamp) < 19) { in dpp_key_expired()
4765 if (sscanf(timestamp, "%04u-%02u-%02uT%02u:%02u:%02u", in dpp_key_expired()
4772 if (os_mktime(year, month, day, hour, min, sec, &utime) < 0) { in dpp_key_expired()
4779 if (*pos == 'Z' || *pos == '\0') { in dpp_key_expired()
4781 } else if (*pos == '-' || *pos == '+') { in dpp_key_expired()
4786 if (items < 1) { in dpp_key_expired()
4792 if (*pos == '-') in dpp_key_expired()
4794 if (*pos == '+') in dpp_key_expired()
4796 if (items > 1) { in dpp_key_expired()
4797 if (*pos == '-') in dpp_key_expired()
4799 if (*pos == '+') in dpp_key_expired()
4808 if (expiry) in dpp_key_expired()
4811 if (os_get_time(&now) < 0) { in dpp_key_expired()
4817 if (now.sec > utime) { in dpp_key_expired()
4839 if (!root) { in dpp_parse_connector()
4845 if (!groups || groups->type != JSON_ARRAY) { in dpp_parse_connector()
4853 if (!id || id->type != JSON_STRING) { in dpp_parse_connector()
4859 if (!role || role->type != JSON_STRING) { in dpp_parse_connector()
4870 if (!rules) { in dpp_parse_connector()
4877 if (!token || token->type != JSON_STRING) { in dpp_parse_connector()
4882 if (dpp_key_expired(token->string, in dpp_parse_connector()
4891 if (!netkey || netkey->type != JSON_OBJECT) { in dpp_parse_connector()
4897 if (!key) in dpp_parse_connector()
4901 if (crypto_key_compare(key, auth->own_protocol_key) != 1) { in dpp_parse_connector()
4905 if (auth->ignore_netaccesskey_mismatch) { in dpp_parse_connector()
4931 if (wpabuf_len(r_hash) != SHA256_MAC_LEN) in dpp_check_pubkey_match()
4934 if (!uncomp) in dpp_check_pubkey_match()
4942 if (res < 0) in dpp_check_pubkey_match()
4944 if (os_memcmp(hash, wpabuf_head(r_hash), SHA256_MAC_LEN) != 0) { in dpp_check_pubkey_match()
4961 if (der_len <= 0) in dpp_copy_csign()
4974 if (crypto_ec_get_priv_key_der(auth->own_protocol_key, &der, &der_len) < 0) in dpp_copy_netaccesskey()
5001 if (!group) in dpp_process_signed_connector()
5005 if (!curve) in dpp_process_signed_connector()
5012 if (!end) { in dpp_process_signed_connector()
5018 if (!prot_hdr) { in dpp_process_signed_connector()
5028 if (!kid) { in dpp_process_signed_connector()
5032 if (wpabuf_len(kid) != SHA256_MAC_LEN) { in dpp_process_signed_connector()
5042 if (!end) { in dpp_process_signed_connector()
5050 if (!info->payload) { in dpp_process_signed_connector()
5061 if (!signature) { in dpp_process_signed_connector()
5070 if (dpp_check_pubkey_match(csign_pub, kid) < 0) { in dpp_process_signed_connector()
5075 if (signature_len & 0x01) { in dpp_process_signed_connector()
5088 if (!crypto_edcsa_sign_verify((unsigned char *)signed_start, r, s, in dpp_process_signed_connector()
5117 if (dpp_akm_psk(conf->akm) || dpp_akm_sae(conf->akm)) { in dpp_parse_cred_dpp()
5120 if (dpp_parse_cred_legacy(conf, cred) < 0) in dpp_parse_cred_dpp()
5127 if (!csign || csign->type != JSON_OBJECT) { in dpp_parse_cred_dpp()
5133 if (!csign_pub) { in dpp_parse_cred_dpp()
5140 if (!token || token->type != JSON_STRING) { in dpp_parse_cred_dpp()
5148 if (os_strchr(signed_connector, '"') || in dpp_parse_cred_dpp()
5155 if (dpp_process_signed_connector(&info, csign_pub, in dpp_parse_cred_dpp()
5159 if (dpp_parse_connector(auth, conf, in dpp_parse_cred_dpp()
5226 if (os_strcmp(akm, "psk") == 0) in dpp_akm_from_str()
5228 if (os_strcmp(akm, "sae") == 0) in dpp_akm_from_str()
5230 if (os_strcmp(akm, "psk+sae") == 0) in dpp_akm_from_str()
5232 if (os_strcmp(akm, "dpp") == 0) in dpp_akm_from_str()
5234 if (os_strcmp(akm, "dpp+sae") == 0) in dpp_akm_from_str()
5236 if (os_strcmp(akm, "dpp+psk+sae") == 0) in dpp_akm_from_str()
5241 if (os_strlen(pos) < 8) in dpp_akm_from_str()
5243 if (os_strncasecmp(pos, "506F9A02", 8) == 0) in dpp_akm_from_str()
5245 else if (os_strncasecmp(pos, "000FAC02", 8) == 0) in dpp_akm_from_str()
5247 else if (os_strncasecmp(pos, "000FAC06", 8) == 0) in dpp_akm_from_str()
5249 else if (os_strncasecmp(pos, "000FAC08", 8) == 0) in dpp_akm_from_str()
5252 if (*pos != '+') in dpp_akm_from_str()
5257 if (dpp && psk && sae) in dpp_akm_from_str()
5259 if (dpp && sae) in dpp_akm_from_str()
5261 if (dpp) in dpp_akm_from_str()
5263 if (psk && sae) in dpp_akm_from_str()
5265 if (sae) in dpp_akm_from_str()
5267 if (psk) in dpp_akm_from_str()
5283 if (!root) in dpp_parse_conf_obj()
5285 if (root->type != JSON_OBJECT) { in dpp_parse_conf_obj()
5291 if (!token || token->type != JSON_STRING) { in dpp_parse_conf_obj()
5295 if (os_strcmp(token->string, "infra") != 0) { in dpp_parse_conf_obj()
5303 if (!discovery || discovery->type != JSON_OBJECT) { in dpp_parse_conf_obj()
5309 if (ssid64) { in dpp_parse_conf_obj()
5312 if (wpabuf_len(ssid64) > SSID_MAX_LEN) { in dpp_parse_conf_obj()
5318 if (!token || token->type != JSON_STRING) { in dpp_parse_conf_obj()
5325 if (os_strlen(token->string) > SSID_MAX_LEN) { in dpp_parse_conf_obj()
5332 if (auth->num_conf_obj == DPP_MAX_CONF_OBJ) { in dpp_parse_conf_obj()
5340 if (ssid64) { in dpp_parse_conf_obj()
5349 if (token && token->type == JSON_NUMBER) { in dpp_parse_conf_obj()
5356 if (!cred || cred->type != JSON_OBJECT) { in dpp_parse_conf_obj()
5362 if (!token || token->type != JSON_STRING) { in dpp_parse_conf_obj()
5368 if (dpp_akm_legacy(conf->akm)) { in dpp_parse_conf_obj()
5369 if (dpp_parse_cred_legacy(conf, cred) < 0) in dpp_parse_conf_obj()
5371 } else if (dpp_akm_dpp(conf->akm)) { in dpp_parse_conf_obj()
5372 if (dpp_parse_cred_dpp(auth, conf, cred) < 0) in dpp_parse_conf_obj()
5403 if (dpp_check_attrs(resp, resp_len) < 0) { in dpp_conf_resp_rx()
5411 if (!wrapped_data || wrapped_data_len < AES_BLOCK_SIZE) { in dpp_conf_resp_rx()
5421 if (!unwrapped) in dpp_conf_resp_rx()
5428 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_conf_resp_rx()
5437 if (dpp_check_attrs(unwrapped, unwrapped_len) < 0) { in dpp_conf_resp_rx()
5445 if (!e_nonce || e_nonce_len != auth->curve->nonce_len) { in dpp_conf_resp_rx()
5451 if (os_memcmp(e_nonce, auth->e_nonce, e_nonce_len) != 0) { in dpp_conf_resp_rx()
5458 if (!status || status_len < 1) { in dpp_conf_resp_rx()
5465 if (status[0] != DPP_STATUS_OK) { in dpp_conf_resp_rx()
5472 if (!conf_obj) { in dpp_conf_resp_rx()
5480 if (dpp_parse_conf_obj(auth, conf_obj, conf_obj_len) < 0) in dpp_conf_resp_rx()
5496 if (!conf) in dpp_configurator_free()
5510 if (!conf->csign) in dpp_configurator_get_key()
5515 if (keylen > 0) in dpp_configurator_get_key()
5535 if (!conf) in dpp_keygen_configurator()
5538 if (!curve) { in dpp_keygen_configurator()
5542 if (!conf->curve) { in dpp_keygen_configurator()
5549 if (privkey) in dpp_keygen_configurator()
5554 if (!conf->csign) in dpp_keygen_configurator()
5559 if (!csign_pub) { in dpp_keygen_configurator()
5567 if (sha256_vector(1, addr, len, kid_hash) < 0) { in dpp_keygen_configurator()
5574 if (!conf->kid) in dpp_keygen_configurator()
5592 if (!auth->conf) { in dpp_configurator_own_config()
5597 if (!curve) { in dpp_configurator_own_config()
5601 if (!auth->curve) { in dpp_configurator_own_config()
5612 if (!auth->own_protocol_key) in dpp_configurator_own_config()
5619 if (!conf_obj) { in dpp_configurator_own_config()
5646 if (!groups || groups->type != JSON_ARRAY) in dpp_connector_compatible_group()
5653 if (!id || id->type != JSON_STRING) in dpp_connector_compatible_group()
5657 if (!role || role->type != JSON_STRING) in dpp_connector_compatible_group()
5660 if (os_strcmp(id->string, "*") != 0 && in dpp_connector_compatible_group()
5665 if (dpp_compatible_netrole(role->string, net_role)) in dpp_connector_compatible_group()
5678 if (!groups || groups->type != JSON_ARRAY) { in dpp_connector_match_groups()
5687 if (!id || id->type != JSON_STRING) { in dpp_connector_match_groups()
5694 if (!role || role->type != JSON_STRING) { in dpp_connector_match_groups()
5702 if (dpp_connector_compatible_group(own_root, id->string, in dpp_connector_match_groups()
5724 if (dpp_hmac(hash_len, salt, hash_len, Nx, Nx_len, prk) < 0) in dpp_derive_pmk()
5732 if (res < 0) in dpp_derive_pmk()
5753 if (!nkx || !pkx) in dpp_derive_pmkid()
5759 if (len[0] != len[1]) in dpp_derive_pmkid()
5761 if (os_memcmp(addr[0], addr[1], len[0]) > 0) { in dpp_derive_pmkid()
5768 if (res < 0) in dpp_derive_pmkid()
5806 if (expiry) in dpp_peer_intro()
5811 if (!csign) { in dpp_peer_intro()
5819 if (!own_key) { in dpp_peer_intro()
5825 if (!pos) { in dpp_peer_intro()
5831 if (!end) { in dpp_peer_intro()
5836 if (!own_conn) { in dpp_peer_intro()
5843 if (!own_root) { in dpp_peer_intro()
5851 if (!signed_connector) in dpp_peer_intro()
5857 if (res != DPP_STATUS_OK) { in dpp_peer_intro()
5863 if (!root) { in dpp_peer_intro()
5869 if (!dpp_connector_match_groups(own_root, root)) { in dpp_peer_intro()
5877 if (!token || token->type != JSON_STRING) { in dpp_peer_intro()
5882 if (dpp_key_expired(token->string, expiry)) { in dpp_peer_intro()
5891 if (!netkey || netkey->type != JSON_OBJECT) { in dpp_peer_intro()
5898 if (!peer_key) { in dpp_peer_intro()
5904 if (own_curve != curve) { in dpp_peer_intro()
5913 if (dpp_ecdh(own_key, peer_key, Nx, &Nx_len) < 0) in dpp_peer_intro()
5920 if (dpp_derive_pmk(Nx, Nx_len, intro->pmk, curve->hash_len) < 0) { in dpp_peer_intro()
5927 if (dpp_derive_pmkid(curve, own_key, peer_key, intro->pmkid) < 0) { in dpp_peer_intro()
5934 if (ret != DPP_STATUS_OK) in dpp_peer_intro()
5963 if (!tmp) in dpp_corrupt_connector_signature()
5968 if (!pos) in dpp_corrupt_connector_signature()
5972 if (!pos) in dpp_corrupt_connector_signature()
5979 if (!signature || signature_len == 0) in dpp_corrupt_connector_signature()
5987 if (!signed3) in dpp_corrupt_connector_signature()
6011 if (bi->id > max_id) in dpp_next_id()
6022 if (!dpp) in dpp_bootstrap_del()
6027 if (id && bi->id != id) in dpp_bootstrap_del()
6034 if (id == 0) in dpp_bootstrap_del()
6045 if (!dpp) in dpp_add_qr_code()
6049 if (!bi) in dpp_add_qr_code()
6064 if (!dpp) in dpp_add_nfc_uri()
6068 if (!bi) in dpp_add_nfc_uri()
6089 if (!bi) in dpp_bootstrap_gen()
6092 if (os_strstr(cmd, "type=qrcode")) in dpp_bootstrap_gen()
6094 else if (os_strstr(cmd, "type=pkex")) in dpp_bootstrap_gen()
6096 else if (os_strstr(cmd, "type=nfc-uri")) in dpp_bootstrap_gen()
6107 if (key) { in dpp_bootstrap_gen()
6110 if (!privkey || in dpp_bootstrap_gen()
6117 if (!pk) in dpp_bootstrap_gen()
6121 if (chan) { in dpp_bootstrap_gen()
6122 if (dpp_parse_uri_chan_list(bi, chan) < 0) in dpp_bootstrap_gen()
6126 if (mac) { in dpp_bootstrap_gen()
6127 if (dpp_parse_uri_mac(bi, mac) < 0) in dpp_bootstrap_gen()
6131 if (info) { in dpp_bootstrap_gen()
6132 if (dpp_parse_uri_info(bi, info) < 0) in dpp_bootstrap_gen()
6138 if (!bi->uri) in dpp_bootstrap_gen()
6168 if (!dpp) in dpp_bootstrap_get_id()
6172 if (bi->id == id) in dpp_bootstrap_get_id()
6183 if (os_strcmp(id, "*") == 0) { in dpp_bootstrap_remove()
6187 if (id_val == 0) in dpp_bootstrap_remove()
6199 if (!bi) in dpp_bootstrap_get_uri()
6211 if (!bi) in dpp_get_bootstrap_info()
6239 if (!dpp) in dpp_bootstrap_find_pair()
6243 if (!*own_bi && bi->own && in dpp_bootstrap_find_pair()
6251 if (!*peer_bi && !bi->own && in dpp_bootstrap_find_pair()
6259 if (*own_bi && *peer_bi) in dpp_bootstrap_find_pair()
6273 if (conf->id > max_id) in dpp_next_configurator_id()
6292 if (key) { in dpp_configurator_add()
6295 if (!privkey || in dpp_configurator_add()
6301 if (!conf) in dpp_configurator_add()
6322 if (!dpp) in dpp_configurator_del()
6327 if (id && conf->id != id) in dpp_configurator_del()
6334 if (id == 0) in dpp_configurator_del()
6344 if (os_strcmp(id, "*") == 0) { in dpp_configurator_remove()
6348 if (id_val == 0) in dpp_configurator_remove()
6362 if (!conf) in dpp_configurator_get_key_id()
6373 if (!dpp) in dpp_global_init()
6386 if (!dpp) in dpp_global_clear()