Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352252
b: refs/heads/master
c: 3f706b7
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jan 23, 2013
1 parent 6922928 commit e4b109c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54ad6d8a5afe1a6d162d8d229a3d8fc48b254d24
refs/heads/master: 3f706b7205456c90cdc91e21eab36e2fcf4a8bce
9 changes: 8 additions & 1 deletion trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,13 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
return err;
}

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

static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
void *cp_data, u16 len)
{
Expand All @@ -2724,7 +2731,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
for (i = 0; i < key_count; i++) {
struct mgmt_ltk_info *key = &cp->keys[i];

if (key->master != 0x00 && key->master != 0x01)
if (!ltk_is_valid(key))
return cmd_status(sk, hdev->id,
MGMT_OP_LOAD_LONG_TERM_KEYS,
MGMT_STATUS_INVALID_PARAMS);
Expand Down

0 comments on commit e4b109c

Please sign in to comment.