Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0dbfb46 authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by Johan Hedberg
Browse files

Bluetooth: Add support for removing LTK's when pairing is removed



Instead of having a separated command for removing SMP keys, we use the
Remove Keys command to remove *all* keys.

Signed-off-by: default avatarVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 346af67b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1089,6 +1089,12 @@ static int remove_keys(struct sock *sk, u16 index, void *data, u16 len)
	bacpy(&rp.bdaddr, &cp->bdaddr);
	rp.status = MGMT_STATUS_FAILED;

	err = hci_remove_ltk(hdev, &cp->bdaddr);
	if (err < 0) {
		err = cmd_status(sk, index, MGMT_OP_REMOVE_KEYS, -err);
		goto unlock;
	}

	err = hci_remove_link_key(hdev, &cp->bdaddr);
	if (err < 0) {
		rp.status = MGMT_STATUS_NOT_PAIRED;