diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-01-20 07:27:17 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-01-22 22:57:04 -0500 |
commit | 44b20d33962a73ca14b934540e9168e0da1b49ab (patch) | |
tree | ad495d9369bc9616a247a16059bb2537895a49b0 /net/bluetooth | |
parent | 3f706b7205456c90cdc91e21eab36e2fcf4a8bce (diff) |
Bluetooth: Check for valid key->authenticated value for LTKs
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index cd758994b02f..bc04c444c98e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -2703,6 +2703,8 @@ done: | |||
2703 | 2703 | ||
2704 | static bool ltk_is_valid(struct mgmt_ltk_info *key) | 2704 | static bool ltk_is_valid(struct mgmt_ltk_info *key) |
2705 | { | 2705 | { |
2706 | if (key->authenticated != 0x00 && key->authenticated != 0x01) | ||
2707 | return false; | ||
2706 | if (key->master != 0x00 && key->master != 0x01) | 2708 | if (key->master != 0x00 && key->master != 0x01) |
2707 | return false; | 2709 | return false; |
2708 | return true; | 2710 | return true; |