diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/bluetooth/hci_core.c | 14 | ||||
| -rw-r--r-- | net/bluetooth/hci_event.c | 17 | ||||
| -rw-r--r-- | net/bluetooth/mgmt.c | 23 |
3 files changed, 23 insertions, 31 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 90ea0b7670d2..bbefb4eea36e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
| @@ -3469,7 +3469,7 @@ void hci_remote_oob_data_clear(struct hci_dev *hdev) | |||
| 3469 | } | 3469 | } |
| 3470 | 3470 | ||
| 3471 | int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | 3471 | int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 3472 | u8 *hash, u8 *randomizer) | 3472 | u8 *hash, u8 *rand) |
| 3473 | { | 3473 | { |
| 3474 | struct oob_data *data; | 3474 | struct oob_data *data; |
| 3475 | 3475 | ||
| @@ -3484,10 +3484,10 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
| 3484 | } | 3484 | } |
| 3485 | 3485 | ||
| 3486 | memcpy(data->hash192, hash, sizeof(data->hash192)); | 3486 | memcpy(data->hash192, hash, sizeof(data->hash192)); |
| 3487 | memcpy(data->randomizer192, randomizer, sizeof(data->randomizer192)); | 3487 | memcpy(data->rand192, rand, sizeof(data->rand192)); |
| 3488 | 3488 | ||
| 3489 | memset(data->hash256, 0, sizeof(data->hash256)); | 3489 | memset(data->hash256, 0, sizeof(data->hash256)); |
| 3490 | memset(data->randomizer256, 0, sizeof(data->randomizer256)); | 3490 | memset(data->rand256, 0, sizeof(data->rand256)); |
| 3491 | 3491 | ||
| 3492 | BT_DBG("%s for %pMR", hdev->name, bdaddr); | 3492 | BT_DBG("%s for %pMR", hdev->name, bdaddr); |
| 3493 | 3493 | ||
| @@ -3495,8 +3495,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
| 3495 | } | 3495 | } |
| 3496 | 3496 | ||
| 3497 | int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | 3497 | int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 3498 | u8 *hash192, u8 *randomizer192, | 3498 | u8 *hash192, u8 *rand192, |
| 3499 | u8 *hash256, u8 *randomizer256) | 3499 | u8 *hash256, u8 *rand256) |
| 3500 | { | 3500 | { |
| 3501 | struct oob_data *data; | 3501 | struct oob_data *data; |
| 3502 | 3502 | ||
| @@ -3511,10 +3511,10 @@ int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
| 3511 | } | 3511 | } |
| 3512 | 3512 | ||
| 3513 | memcpy(data->hash192, hash192, sizeof(data->hash192)); | 3513 | memcpy(data->hash192, hash192, sizeof(data->hash192)); |
| 3514 | memcpy(data->randomizer192, randomizer192, sizeof(data->randomizer192)); | 3514 | memcpy(data->rand192, rand192, sizeof(data->rand192)); |
| 3515 | 3515 | ||
| 3516 | memcpy(data->hash256, hash256, sizeof(data->hash256)); | 3516 | memcpy(data->hash256, hash256, sizeof(data->hash256)); |
| 3517 | memcpy(data->randomizer256, randomizer256, sizeof(data->randomizer256)); | 3517 | memcpy(data->rand256, rand256, sizeof(data->rand256)); |
| 3518 | 3518 | ||
| 3519 | BT_DBG("%s for %pMR", hdev->name, bdaddr); | 3519 | BT_DBG("%s for %pMR", hdev->name, bdaddr); |
| 3520 | 3520 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 09d76547d985..844f7d1ff1cd 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -994,8 +994,8 @@ static void hci_cc_read_local_oob_data(struct hci_dev *hdev, | |||
| 994 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); | 994 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); |
| 995 | 995 | ||
| 996 | hci_dev_lock(hdev); | 996 | hci_dev_lock(hdev); |
| 997 | mgmt_read_local_oob_data_complete(hdev, rp->hash, rp->randomizer, | 997 | mgmt_read_local_oob_data_complete(hdev, rp->hash, rp->rand, NULL, NULL, |
| 998 | NULL, NULL, rp->status); | 998 | rp->status); |
| 999 | hci_dev_unlock(hdev); | 999 | hci_dev_unlock(hdev); |
| 1000 | } | 1000 | } |
| 1001 | 1001 | ||
| @@ -1007,8 +1007,8 @@ static void hci_cc_read_local_oob_ext_data(struct hci_dev *hdev, | |||
| 1007 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); | 1007 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); |
| 1008 | 1008 | ||
| 1009 | hci_dev_lock(hdev); | 1009 | hci_dev_lock(hdev); |
| 1010 | mgmt_read_local_oob_data_complete(hdev, rp->hash192, rp->randomizer192, | 1010 | mgmt_read_local_oob_data_complete(hdev, rp->hash192, rp->rand192, |
| 1011 | rp->hash256, rp->randomizer256, | 1011 | rp->hash256, rp->rand256, |
| 1012 | rp->status); | 1012 | rp->status); |
| 1013 | hci_dev_unlock(hdev); | 1013 | hci_dev_unlock(hdev); |
| 1014 | } | 1014 | } |
| @@ -3996,11 +3996,9 @@ static void hci_remote_oob_data_request_evt(struct hci_dev *hdev, | |||
| 3996 | 3996 | ||
| 3997 | bacpy(&cp.bdaddr, &ev->bdaddr); | 3997 | bacpy(&cp.bdaddr, &ev->bdaddr); |
| 3998 | memcpy(cp.hash192, data->hash192, sizeof(cp.hash192)); | 3998 | memcpy(cp.hash192, data->hash192, sizeof(cp.hash192)); |
| 3999 | memcpy(cp.randomizer192, data->randomizer192, | 3999 | memcpy(cp.rand192, data->rand192, sizeof(cp.rand192)); |
| 4000 | sizeof(cp.randomizer192)); | ||
| 4001 | memcpy(cp.hash256, data->hash256, sizeof(cp.hash256)); | 4000 | memcpy(cp.hash256, data->hash256, sizeof(cp.hash256)); |
| 4002 | memcpy(cp.randomizer256, data->randomizer256, | 4001 | memcpy(cp.rand256, data->rand256, sizeof(cp.rand256)); |
| 4003 | sizeof(cp.randomizer256)); | ||
| 4004 | 4002 | ||
| 4005 | hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_EXT_DATA_REPLY, | 4003 | hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_EXT_DATA_REPLY, |
| 4006 | sizeof(cp), &cp); | 4004 | sizeof(cp), &cp); |
| @@ -4009,8 +4007,7 @@ static void hci_remote_oob_data_request_evt(struct hci_dev *hdev, | |||
| 4009 | 4007 | ||
| 4010 | bacpy(&cp.bdaddr, &ev->bdaddr); | 4008 | bacpy(&cp.bdaddr, &ev->bdaddr); |
| 4011 | memcpy(cp.hash, data->hash192, sizeof(cp.hash)); | 4009 | memcpy(cp.hash, data->hash192, sizeof(cp.hash)); |
| 4012 | memcpy(cp.randomizer, data->randomizer192, | 4010 | memcpy(cp.rand, data->rand192, sizeof(cp.rand)); |
| 4013 | sizeof(cp.randomizer)); | ||
| 4014 | 4011 | ||
| 4015 | hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY, | 4012 | hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY, |
| 4016 | sizeof(cp), &cp); | 4013 | sizeof(cp), &cp); |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 258c9826e78c..cbeef5f62f3b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
| @@ -3598,7 +3598,7 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | |||
| 3598 | } | 3598 | } |
| 3599 | 3599 | ||
| 3600 | err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr, | 3600 | err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr, |
| 3601 | cp->hash, cp->randomizer); | 3601 | cp->hash, cp->rand); |
| 3602 | if (err < 0) | 3602 | if (err < 0) |
| 3603 | status = MGMT_STATUS_FAILED; | 3603 | status = MGMT_STATUS_FAILED; |
| 3604 | else | 3604 | else |
| @@ -3619,10 +3619,8 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | |||
| 3619 | } | 3619 | } |
| 3620 | 3620 | ||
| 3621 | err = hci_add_remote_oob_ext_data(hdev, &cp->addr.bdaddr, | 3621 | err = hci_add_remote_oob_ext_data(hdev, &cp->addr.bdaddr, |
| 3622 | cp->hash192, | 3622 | cp->hash192, cp->rand192, |
| 3623 | cp->randomizer192, | 3623 | cp->hash256, cp->rand256); |
| 3624 | cp->hash256, | ||
| 3625 | cp->randomizer256); | ||
| 3626 | if (err < 0) | 3624 | if (err < 0) |
| 3627 | status = MGMT_STATUS_FAILED; | 3625 | status = MGMT_STATUS_FAILED; |
| 3628 | else | 3626 | else |
| @@ -6771,8 +6769,8 @@ void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status) | |||
| 6771 | } | 6769 | } |
| 6772 | 6770 | ||
| 6773 | void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, | 6771 | void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, |
| 6774 | u8 *randomizer192, u8 *hash256, | 6772 | u8 *rand192, u8 *hash256, u8 *rand256, |
| 6775 | u8 *randomizer256, u8 status) | 6773 | u8 status) |
| 6776 | { | 6774 | { |
| 6777 | struct pending_cmd *cmd; | 6775 | struct pending_cmd *cmd; |
| 6778 | 6776 | ||
| @@ -6787,16 +6785,14 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, | |||
| 6787 | mgmt_status(status)); | 6785 | mgmt_status(status)); |
| 6788 | } else { | 6786 | } else { |
| 6789 | if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags) && | 6787 | if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags) && |
| 6790 | hash256 && randomizer256) { | 6788 | hash256 && rand256) { |
| 6791 | struct mgmt_rp_read_local_oob_ext_data rp; | 6789 | struct mgmt_rp_read_local_oob_ext_data rp; |
| 6792 | 6790 | ||
| 6793 | memcpy(rp.hash192, hash192, sizeof(rp.hash192)); | 6791 | memcpy(rp.hash192, hash192, sizeof(rp.hash192)); |
| 6794 | memcpy(rp.randomizer192, randomizer192, | 6792 | memcpy(rp.rand192, rand192, sizeof(rp.rand192)); |
| 6795 | sizeof(rp.randomizer192)); | ||
| 6796 | 6793 | ||
| 6797 | memcpy(rp.hash256, hash256, sizeof(rp.hash256)); | 6794 | memcpy(rp.hash256, hash256, sizeof(rp.hash256)); |
| 6798 | memcpy(rp.randomizer256, randomizer256, | 6795 | memcpy(rp.rand256, rand256, sizeof(rp.rand256)); |
| 6799 | sizeof(rp.randomizer256)); | ||
| 6800 | 6796 | ||
| 6801 | cmd_complete(cmd->sk, hdev->id, | 6797 | cmd_complete(cmd->sk, hdev->id, |
| 6802 | MGMT_OP_READ_LOCAL_OOB_DATA, 0, | 6798 | MGMT_OP_READ_LOCAL_OOB_DATA, 0, |
| @@ -6805,8 +6801,7 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, | |||
| 6805 | struct mgmt_rp_read_local_oob_data rp; | 6801 | struct mgmt_rp_read_local_oob_data rp; |
| 6806 | 6802 | ||
| 6807 | memcpy(rp.hash, hash192, sizeof(rp.hash)); | 6803 | memcpy(rp.hash, hash192, sizeof(rp.hash)); |
| 6808 | memcpy(rp.randomizer, randomizer192, | 6804 | memcpy(rp.rand, rand192, sizeof(rp.rand)); |
| 6809 | sizeof(rp.randomizer)); | ||
| 6810 | 6805 | ||
| 6811 | cmd_complete(cmd->sk, hdev->id, | 6806 | cmd_complete(cmd->sk, hdev->id, |
| 6812 | MGMT_OP_READ_LOCAL_OOB_DATA, 0, | 6807 | MGMT_OP_READ_LOCAL_OOB_DATA, 0, |
