Bluetooth: Fix OOB data present value for SMP pairing
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 31 Jan 2015 08:15:52 +0000 (00:15 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 31 Jan 2015 20:26:14 +0000 (21:26 +0100)
Before setting the OOB data present flag with SMP pairing, check the
newly introduced present tracking that actual OOB data values have
been provided. The existence of remote OOB data structure does not
actually mean that the correct data values are available.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/smp.c

index 37d9180bfe1c559902279da1ae4ba08422e2d50a..c09a821f381d0b648b45ca5c722d89161775f638 100644 (file)
@@ -620,7 +620,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn,
 
                oob_data = hci_find_remote_oob_data(hdev, &hcon->dst,
                                                    bdaddr_type);
-               if (oob_data) {
+               if (oob_data && oob_data->present) {
                        set_bit(SMP_FLAG_OOB, &smp->flags);
                        oob_flag = SMP_OOB_PRESENT;
                        memcpy(smp->rr, oob_data->rand256, 16);