diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index 80167c670cd..de446b58d6f 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -345,7 +345,7 @@ enum bt_security_err { BT_SECURITY_ERR_SUCCESS, /** Authentication failed. */ - BT_SECURITY_ERR_AUTHENTICATION_FAIL, + BT_SECURITY_ERR_AUTH_FAIL, /** PIN or encryption key is missing. */ BT_SECURITY_ERR_PIN_OR_KEY_MISSING, @@ -354,7 +354,7 @@ enum bt_security_err { BT_SECURITY_ERR_OOB_NOT_AVAILABLE, /** The requested security level could not be reached. */ - BT_SECURITY_ERR_AUTHENTICATION_REQUIREMENT, + BT_SECURITY_ERR_AUTH_REQUIREMENT, /** Pairing is not supported */ BT_SECURITY_ERR_PAIR_NOT_SUPPORTED, diff --git a/include/bluetooth/hci.h b/include/bluetooth/hci.h index 0460d42b3c7..25174043d06 100644 --- a/include/bluetooth/hci.h +++ b/include/bluetooth/hci.h @@ -108,7 +108,7 @@ static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr) #define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02 #define BT_HCI_ERR_HW_FAILURE 0x03 #define BT_HCI_ERR_PAGE_TIMEOUT 0x04 -#define BT_HCI_ERR_AUTHENTICATION_FAIL 0x05 +#define BT_HCI_ERR_AUTH_FAIL 0x05 #define BT_HCI_ERR_PIN_OR_KEY_MISSING 0x06 #define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07 #define BT_HCI_ERR_CONN_TIMEOUT 0x08 @@ -141,6 +141,8 @@ static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr) #define BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL 0x3d #define BT_HCI_ERR_CONN_FAIL_TO_ESTAB 0x3e +#define BT_HCI_ERR_AUTHENTICATION_FAIL __DEPRECATED_MACRO BT_HCI_ERR_AUTH_FAIL + /* EIR/AD data type definitions */ #define BT_DATA_FLAGS 0x01 /* AD flags */ #define BT_DATA_UUID16_SOME 0x02 /* 16-bit UUID, more available */ diff --git a/samples/bluetooth/peripheral_sc_only/src/main.c b/samples/bluetooth/peripheral_sc_only/src/main.c index b6a8325ecec..aa7c9fe9e5a 100644 --- a/samples/bluetooth/peripheral_sc_only/src/main.c +++ b/samples/bluetooth/peripheral_sc_only/src/main.c @@ -110,7 +110,7 @@ static void pairing_complete(struct bt_conn *conn, bool bonded) static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) { printk("Pairing Failed (%d). Disconnecting.\n", reason); - bt_conn_disconnect(conn, BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); } static struct bt_conn_auth_cb auth_cb_display = { diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 858372f4373..e9bd13bb844 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2457,7 +2457,7 @@ int bt_conn_auth_cancel(struct bt_conn *conn) return ssp_passkey_neg_reply(conn); case PASSKEY_DISPLAY: return bt_conn_disconnect(conn, - BT_HCI_ERR_AUTHENTICATION_FAIL); + BT_HCI_ERR_AUTH_FAIL); case LEGACY: return pin_code_neg_reply(&conn->br.dst); default: diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 2bfb94274a2..d3cb46680eb 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1685,8 +1685,8 @@ static enum bt_security_err security_err_get(u8_t hci_err) switch (hci_err) { case BT_HCI_ERR_SUCCESS: return BT_SECURITY_ERR_SUCCESS; - case BT_HCI_ERR_AUTHENTICATION_FAIL: - return BT_SECURITY_ERR_AUTHENTICATION_FAIL; + case BT_HCI_ERR_AUTH_FAIL: + return BT_SECURITY_ERR_AUTH_FAIL; case BT_HCI_ERR_PIN_OR_KEY_MISSING: return BT_SECURITY_ERR_PIN_OR_KEY_MISSING; case BT_HCI_ERR_PAIRING_NOT_SUPPORTED: @@ -1906,13 +1906,13 @@ static bool update_sec_level_br(struct bt_conn *conn) if (!br_sufficient_key_size(conn)) { BT_ERR("Encryption key size is not sufficient"); - bt_conn_disconnect(conn, BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); return false; } if (conn->required_sec_level > conn->sec_level) { BT_ERR("Failed to set required security level"); - bt_conn_disconnect(conn, BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); return false; } @@ -2272,7 +2272,7 @@ static void ssp_complete(struct net_buf *buf) bt_conn_ssp_auth_complete(conn, security_err_get(evt->status)); if (evt->status) { - bt_conn_disconnect(conn, BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); } bt_conn_unref(conn); @@ -3066,7 +3066,7 @@ static void update_sec_level(struct bt_conn *conn) if (conn->required_sec_level > conn->sec_level) { BT_ERR("Failed to set required security level"); - bt_conn_disconnect(conn, BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); } } #endif /* CONFIG_BT_SMP */ diff --git a/subsys/bluetooth/host/l2cap_br.c b/subsys/bluetooth/host/l2cap_br.c index 2bd53006eff..5619c7d36fe 100644 --- a/subsys/bluetooth/host/l2cap_br.c +++ b/subsys/bluetooth/host/l2cap_br.c @@ -759,8 +759,7 @@ static void l2cap_br_conn_req(struct bt_l2cap_br *l2cap, u8_t ident, if (result != BT_L2CAP_BR_SUCCESS) { /* Disconnect link when security rules were violated */ if (result == BT_L2CAP_BR_ERR_SEC_BLOCK) { - bt_conn_disconnect(conn, - BT_HCI_ERR_AUTHENTICATION_FAIL); + bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); } return; diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index fdf14f14f25..7744a170635 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -347,12 +347,12 @@ static enum bt_security_err auth_err_get(u8_t smp_err) case BT_SMP_ERR_DHKEY_CHECK_FAILED: case BT_SMP_ERR_NUMERIC_COMP_FAILED: case BT_SMP_ERR_CONFIRM_FAILED: - return BT_SECURITY_ERR_AUTHENTICATION_FAIL; + return BT_SECURITY_ERR_AUTH_FAIL; case BT_SMP_ERR_OOB_NOT_AVAIL: return BT_SECURITY_ERR_OOB_NOT_AVAILABLE; case BT_SMP_ERR_AUTH_REQUIREMENTS: case BT_SMP_ERR_ENC_KEY_SIZE: - return BT_SECURITY_ERR_AUTHENTICATION_REQUIREMENT; + return BT_SECURITY_ERR_AUTH_REQUIREMENT; case BT_SMP_ERR_PAIRING_NOTSUPP: case BT_SMP_ERR_CMD_NOTSUPP: return BT_SECURITY_ERR_PAIR_NOT_SUPPORTED;