mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
Bluetooth: Add smp_ltk_sec_level() helper function
There are several places that need to determine the security level that an LTK can provide. This patch adds a convenience function for this to help make the code more readable. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
1afc2a1ab6
commit
a6f7833ca3
3 changed files with 10 additions and 5 deletions
|
@ -125,6 +125,14 @@ enum {
|
|||
SMP_LTK_SLAVE,
|
||||
};
|
||||
|
||||
static inline u8 smp_ltk_sec_level(struct smp_ltk *key)
|
||||
{
|
||||
if (key->authenticated)
|
||||
return BT_SECURITY_HIGH;
|
||||
|
||||
return BT_SECURITY_MEDIUM;
|
||||
}
|
||||
|
||||
/* SMP Commands */
|
||||
bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level);
|
||||
int smp_conn_security(struct hci_conn *hcon, __u8 sec_level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue