Bluetooth: Add handling for security level 0

So far bt_security_t has completely missed out on security level 0,
i.e. its actual values have been one lower than in the core
specification.

To properly introduce for the new level (which is only applicable for
BR/EDR) add proper tracking for each channel and server, and make the
channels inherit their required level from the respective server.

Change-Id: I9a2384d883017125c2c117880aa6e0ade30520e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-11-01 11:05:35 +02:00
commit 9dc033cb84
4 changed files with 40 additions and 4 deletions

View file

@ -241,6 +241,8 @@ struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer,
/** Security level. */
typedef enum __packed {
/** Only for BR/EDR special cases, like SDP */
BT_SECURITY_ZERO,
/** No encryption and no authentication. */
BT_SECURITY_LOW,
/** Encryption and no authentication (no MITM). */