Lines Matching refs:params

94 	struct beacon_params *params;  in beacon_cache_match()  local
97 params = data; in beacon_cache_match()
98 beacon = subnet_beacon_get_by_type(sub, params->private); in beacon_cache_match()
100 return !memcmp(beacon->cache, params->auth, sizeof(beacon->cache)); in beacon_cache_match()
523 const struct beacon_params *params) in auth_match() argument
527 if (memcmp(params->net_id, keys->net_id, 8)) { in auth_match()
531 if (bt_mesh_beacon_auth(&keys->beacon, params->flags, keys->net_id, params->iv_index, in auth_match()
536 if (memcmp(params->auth, net_auth, 8)) { in auth_match()
537 LOG_WRN("Invalid auth value. Received auth: %s", bt_hex(params->auth, 8)); in auth_match()
547 struct beacon_params *params = cb_data; in secure_beacon_authenticate() local
550 if (sub->keys[i].valid && auth_match(&sub->keys[i], params)) { in secure_beacon_authenticate()
551 params->new_key = (i > 0); in secure_beacon_authenticate()
555 beacon_info.flags = params->flags; in secure_beacon_authenticate()
556 memcpy(&beacon_info.net_id, params->net_id, 8); in secure_beacon_authenticate()
557 beacon_info.iv_idx = params->iv_index; in secure_beacon_authenticate()
558 memcpy(&beacon_info.auth_val, params->auth, 8); in secure_beacon_authenticate()
576 struct beacon_params *params = cb_data; in priv_beacon_decrypt() local
585 err = bt_mesh_beacon_decrypt(&sub->keys[i].priv_beacon, params->random, in priv_beacon_decrypt()
586 params->data, params->auth, out); in priv_beacon_decrypt()
588 params->new_key = (i > 0); in priv_beacon_decrypt()
589 params->flags = out[0]; in priv_beacon_decrypt()
590 params->iv_index = sys_get_be32(&out[1]); in priv_beacon_decrypt()
595 memcpy(beacon_info.random, params->random, 13); in priv_beacon_decrypt()
596 beacon_info.flags = params->flags; in priv_beacon_decrypt()
597 beacon_info.iv_idx = params->iv_index; in priv_beacon_decrypt()
598 memcpy(&beacon_info.auth_tag, params->auth, 8); in priv_beacon_decrypt()
623 const struct beacon_params *params) in net_beacon_recv() argument
625 bt_mesh_kr_update(sub, BT_MESH_KEY_REFRESH(params->flags), in net_beacon_recv()
626 params->new_key); in net_beacon_recv()
637 sub->net_idx, params->flags, params->iv_index, bt_mesh.iv_index); in net_beacon_recv()
641 BT_MESH_IV_UPDATE(params->flags))) { in net_beacon_recv()
645 bt_mesh_net_iv_update(params->iv_index, in net_beacon_recv()
646 BT_MESH_IV_UPDATE(params->flags)); in net_beacon_recv()
649 static void net_beacon_resolve(struct beacon_params *params, in net_beacon_resolve() argument
656 sub = bt_mesh_subnet_find(beacon_cache_match, (void *)params); in net_beacon_resolve()
658 beacon = subnet_beacon_get_by_type(sub, params->private); in net_beacon_resolve()
661 net_beacon_register(beacon, params->private); in net_beacon_resolve()
665 sub = bt_mesh_subnet_find(matcher, params); in net_beacon_resolve()
671 if (sub->kr_phase == BT_MESH_KR_PHASE_2 && !params->new_key) { in net_beacon_resolve()
676 beacon = subnet_beacon_get_by_type(sub, params->private); in net_beacon_resolve()
678 cache_add(params->auth, beacon); in net_beacon_resolve()
680 net_beacon_recv(sub, params); in net_beacon_resolve()
681 net_beacon_register(beacon, params->private); in net_beacon_resolve()
686 struct beacon_params params; in secure_beacon_recv() local
693 params.private = false; in secure_beacon_recv()
694 params.flags = net_buf_simple_pull_u8(buf); in secure_beacon_recv()
695 params.net_id = net_buf_simple_pull_mem(buf, 8); in secure_beacon_recv()
696 params.iv_index = net_buf_simple_pull_be32(buf); in secure_beacon_recv()
697 params.auth = buf->data; in secure_beacon_recv()
699 net_beacon_resolve(&params, secure_beacon_authenticate); in secure_beacon_recv()
704 struct beacon_params params; in private_beacon_recv() local
711 params.private = true; in private_beacon_recv()
712 params.random = net_buf_simple_pull_mem(buf, 13); in private_beacon_recv()
713 params.data = net_buf_simple_pull_mem(buf, 5); in private_beacon_recv()
714 params.auth = buf->data; in private_beacon_recv()
716 net_beacon_resolve(&params, priv_beacon_decrypt); in private_beacon_recv()