Lines Matching refs:key

2835 		struct mgmt_link_key_info *key = &cp->keys[i];
2838 if (key->type > 0x08)
2858 struct mgmt_link_key_info *key = &cp->keys[i];
2862 key->val)) {
2863 bt_dev_warn(hdev, "Skipping blocked link key for %pMR",
2864 &key->addr.bdaddr);
2871 if (key->type == HCI_LK_DEBUG_COMBINATION)
2874 hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val,
2875 key->type, key->pin_len, NULL);
4245 * the remote public key validation is supported.
4248 * indicate support for public key validation as well.
4251 flags |= 0x01; /* Remote public key validation (BR/EDR) */
4253 flags |= 0x02; /* Remote public key validation (LE) */
4256 * encryption key size is enforced.
4259 flags |= 0x04; /* Encryption key size enforcement (BR/EDR) */
4261 flags |= 0x08; /* Encryption key size enforcement (LE) */
4267 * also max encryption key size information is provided.
4486 /* The zero key uuid is special. Multiple exp features are set through it. */
7058 struct mgmt_irk_info *key = &cp->irks[i];
7060 if (!irk_is_valid(key))
7100 static bool ltk_is_valid(struct mgmt_ltk_info *key)
7102 if (key->initiator != 0x00 && key->initiator != 0x01)
7105 switch (key->addr.type) {
7111 if ((key->addr.bdaddr.b[5] & 0xc0) != 0xc0)
7153 struct mgmt_ltk_info *key = &cp->keys[i];
7155 if (!ltk_is_valid(key))
7166 struct mgmt_ltk_info *key = &cp->keys[i];
7168 u8 addr_type = le_addr_type(key->addr.type);
7172 key->val)) {
7174 &key->addr.bdaddr);
7178 switch (key->type) {
7181 type = key->initiator ? SMP_LTK : SMP_LTK_RESPONDER;
7185 type = key->initiator ? SMP_LTK : SMP_LTK_RESPONDER;
7204 if (key->addr.type == BDADDR_BREDR)
7207 hci_add_ltk(hdev, &key->addr.bdaddr,
7209 key->val, key->enc_size, key->ediv, key->rand);
8238 * pairing happens before the identity resolving key is
9447 void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
9455 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
9456 ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
9457 ev.key.type = key->type;
9458 memcpy(ev.key.val, key->val, HCI_LINK_KEY_SIZE);
9459 ev.key.pin_len = key->pin_len;
9483 void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent)
9490 * without providing an identity resolving key don't require
9495 * make sure the long term key is stored. If the remote
9500 if (key->bdaddr_type == ADDR_LE_DEV_RANDOM &&
9501 (key->bdaddr.b[5] & 0xc0) != 0xc0)
9506 bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
9507 ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type);
9508 ev.key.type = mgmt_ltk_type(key);
9509 ev.key.enc_size = key->enc_size;
9510 ev.key.ediv = key->ediv;
9511 ev.key.rand = key->rand;
9513 if (key->type == SMP_LTK)
9514 ev.key.initiator = 1;
9517 * encryption key size, and set the rest of the value to zeroes.
9519 memcpy(ev.key.val, key->val, key->enc_size);
9520 memset(ev.key.val + key->enc_size, 0,
9521 sizeof(ev.key.val) - key->enc_size);
9550 * without providing an identity resolving key don't require
9555 * make sure the signature resolving key is stored. So allow
9564 bacpy(&ev.key.addr.bdaddr, &csrk->bdaddr);
9565 ev.key.addr.type = link_to_bdaddr(csrk->link_type, csrk->bdaddr_type);
9566 ev.key.type = csrk->type;
9567 memcpy(ev.key.val, csrk->val, sizeof(csrk->val));