Skip to content

Commit

Permalink
Bluetooth: Check for valid key->authenticated value for LTKs
Browse files Browse the repository at this point in the history
This patch adds necessary checks for the two allowed values of the
authenticated parameter of each Long Term Key, i.e. 0x00 and 0x01. If
any other value is encountered the valid response is to return invalid
params to user space.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jan 23, 2013
1 parent 3f706b7 commit 44b20d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,8 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,

static bool ltk_is_valid(struct mgmt_ltk_info *key)
{
if (key->authenticated != 0x00 && key->authenticated != 0x01)
return false;
if (key->master != 0x00 && key->master != 0x01)
return false;
return true;
Expand Down

0 comments on commit 44b20d3

Please sign in to comment.