Bluetooth: Rename BT_SECURITY_ZERO to BT_SECURITY_NONE

Even though this is level 0, NONE as a symbolic description is more in
line with the other level names.

Change-Id: Ic9d7c38b928d8744d47e759fae804bbbc08c89bf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-11-01 15:16:19 +02:00
commit 3eb04280ed
3 changed files with 6 additions and 6 deletions

View file

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

View file

@ -1359,7 +1359,7 @@ int bt_l2cap_chan_connect(struct bt_conn *conn, struct bt_l2cap_chan *chan,
if (chan->required_sec_level > BT_SECURITY_FIPS) { if (chan->required_sec_level > BT_SECURITY_FIPS) {
return -EINVAL; return -EINVAL;
} else if (chan->required_sec_level == BT_SECURITY_ZERO) { } else if (chan->required_sec_level == BT_SECURITY_NONE) {
chan->required_sec_level = BT_SECURITY_LOW; chan->required_sec_level = BT_SECURITY_LOW;
} }

View file

@ -708,7 +708,7 @@ l2cap_br_conn_security(struct bt_l2cap_chan *chan, const uint16_t psm)
int check; int check;
/* For SDP PSM there's no need to change existing security on link */ /* For SDP PSM there's no need to change existing security on link */
if (chan->required_sec_level == BT_SECURITY_ZERO) { if (chan->required_sec_level == BT_SECURITY_NONE) {
return L2CAP_CONN_SECURITY_PASSED; return L2CAP_CONN_SECURITY_PASSED;
} }
@ -839,7 +839,7 @@ static void l2cap_br_conn_req(struct bt_l2cap_br *l2cap, uint8_t ident,
* Report security violation for non SDP channel without encryption when * Report security violation for non SDP channel without encryption when
* remote supports SSP. * remote supports SSP.
*/ */
if (server->sec_level != BT_SECURITY_ZERO && if (server->sec_level != BT_SECURITY_NONE &&
BT_FEAT_HOST_SSP(conn->br.features) && !conn->encrypt) { BT_FEAT_HOST_SSP(conn->br.features) && !conn->encrypt) {
result = BT_L2CAP_BR_ERR_SEC_BLOCK; result = BT_L2CAP_BR_ERR_SEC_BLOCK;
goto done; goto done;
@ -977,7 +977,7 @@ int bt_l2cap_br_server_register(struct bt_l2cap_server *server)
if (server->sec_level > BT_SECURITY_FIPS) { if (server->sec_level > BT_SECURITY_FIPS) {
return -EINVAL; return -EINVAL;
} else if (server->sec_level == BT_SECURITY_ZERO && } else if (server->sec_level == BT_SECURITY_NONE &&
server->psm != L2CAP_BR_PSM_SDP) { server->psm != L2CAP_BR_PSM_SDP) {
server->sec_level = BT_SECURITY_LOW; server->sec_level = BT_SECURITY_LOW;
} }
@ -1372,7 +1372,7 @@ int bt_l2cap_br_chan_connect(struct bt_conn *conn, struct bt_l2cap_chan *chan,
if (chan->required_sec_level > BT_SECURITY_FIPS) { if (chan->required_sec_level > BT_SECURITY_FIPS) {
return -EINVAL; return -EINVAL;
} else if (chan->required_sec_level == BT_SECURITY_ZERO && } else if (chan->required_sec_level == BT_SECURITY_NONE &&
psm != L2CAP_BR_PSM_SDP) { psm != L2CAP_BR_PSM_SDP) {
chan->required_sec_level = BT_SECURITY_LOW; chan->required_sec_level = BT_SECURITY_LOW;
} }