Commit b541260
committed
Bluetooth: hci_event: Fix using memcmp when comparing keys
memcmp is not consider safe to use with cryptographic secrets:
'Do not use memcmp() to compare security critical data, such as
cryptographic secrets, because the required CPU time depends on the
number of equal bytes.'
While usage of memcmp for ZERO_KEY may not be considered a security
critical data, it can lead to more usage of memcmp with pairing keys
which could introduce more security problems.
Fixes: 455c2ff ("Bluetooth: Fix BR/EDR out-of-band pairing with only initiator data")
Fixes: 33155c4 ("Bluetooth: hci_event: Ignore NULL link key")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>1 parent c7f5946 commit b541260
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
4754 | 4756 | | |
4755 | 4757 | | |
4756 | 4758 | | |
4757 | | - | |
| 4759 | + | |
4758 | 4760 | | |
4759 | 4761 | | |
4760 | 4762 | | |
| |||
5294 | 5296 | | |
5295 | 5297 | | |
5296 | 5298 | | |
5297 | | - | |
5298 | | - | |
| 5299 | + | |
| 5300 | + | |
5299 | 5301 | | |
5300 | 5302 | | |
5301 | 5303 | | |
| |||
5305 | 5307 | | |
5306 | 5308 | | |
5307 | 5309 | | |
5308 | | - | |
5309 | | - | |
| 5310 | + | |
| 5311 | + | |
5310 | 5312 | | |
5311 | 5313 | | |
5312 | 5314 | | |
| |||
0 commit comments