Lines Matching defs:key
2374 struct mgmt_link_key_info *key = &cp->keys[i];
2377 if (key->type > 0x08)
2397 struct mgmt_link_key_info *key = &cp->keys[i];
2401 key->val)) {
2402 bt_dev_warn(hdev, "Skipping blocked link key for %pMR",
2403 &key->addr.bdaddr);
2410 if (key->type == HCI_LK_DEBUG_COMBINATION)
2413 hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val,
2414 key->type, key->pin_len, NULL);
3734 * the remote public key validation is supported.
3737 flags |= 0x01; /* Remote public key validation (BR/EDR) */
3739 flags |= 0x02; /* Remote public key validation (LE) */
3742 * encryption key size is enforced.
3745 flags |= 0x04; /* Encryption key size enforcement (BR/EDR) */
3747 flags |= 0x08; /* Encryption key size enforcement (LE) */
3752 * also max encryption key size information is provided.
5908 struct mgmt_irk_info *key = &cp->irks[i];
5910 if (!irk_is_valid(key))
5950 static bool ltk_is_valid(struct mgmt_ltk_info *key)
5952 if (key->initiator != 0x00 && key->initiator != 0x01)
5955 switch (key->addr.type) {
5961 if ((key->addr.bdaddr.b[5] & 0xc0) != 0xc0)
6003 struct mgmt_ltk_info *key = &cp->keys[i];
6005 if (!ltk_is_valid(key))
6016 struct mgmt_ltk_info *key = &cp->keys[i];
6018 u8 addr_type = le_addr_type(key->addr.type);
6022 key->val)) {
6024 &key->addr.bdaddr);
6028 switch (key->type) {
6031 type = key->initiator ? SMP_LTK : SMP_LTK_RESPONDER;
6035 type = key->initiator ? SMP_LTK : SMP_LTK_RESPONDER;
6054 if (key->addr.type == BDADDR_BREDR)
6057 hci_add_ltk(hdev, &key->addr.bdaddr,
6059 key->val, key->enc_size, key->ediv, key->rand);
7139 * pairing happens before the identity resolving key is
8052 void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
8060 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
8061 ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
8062 ev.key.type = key->type;
8063 memcpy(ev.key.val, key->val, HCI_LINK_KEY_SIZE);
8064 ev.key.pin_len = key->pin_len;
8088 void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent)
8095 * without providing an identity resolving key don't require
8100 * make sure the long term key is stored. If the remote
8105 if (key->bdaddr_type == ADDR_LE_DEV_RANDOM &&
8106 (key->bdaddr.b[5] & 0xc0) != 0xc0)
8111 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
8112 ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
8113 ev.key.type = mgmt_ltk_type(key);
8114 ev.key.enc_size = key->enc_size;
8115 ev.key.ediv = key->ediv;
8116 ev.key.rand = key->rand;
8118 if (key->type == SMP_LTK)
8119 ev.key.initiator = 1;
8122 * encryption key size, and set the rest of the value to zeroes.
8124 memcpy(ev.key.val, key->val, key->enc_size);
8125 memset(ev.key.val + key->enc_size, 0,
8126 sizeof(ev.key.val) - key->enc_size);
8155 * without providing an identity resolving key don't require
8160 * make sure the signature resolving key is stored. So allow
8169 bacpy(&ev.key.addr.bdaddr, &csrk->bdaddr);
8170 ev.key.addr.type = link_to_bdaddr(csrk->link_type, csrk->bdaddr_type);
8171 ev.key.type = csrk->type;
8172 memcpy(ev.key.val, csrk->val, sizeof(csrk->val));