fix(bt/bluedroid): fixed wrong link key flag cleared on legacy BR/EDR authentication failure

Stale bond trust state cound remain after authenticaion failure, causing
incorrect bond status and link key auto-reply behavior.

Closes SEC-1153
This commit is contained in:
Jin Cheng
2026-06-30 16:27:18 +08:00
parent 6fa5704eda
commit a0ba14e55d

View File

@@ -4490,7 +4490,7 @@ void btm_sec_connected (UINT8 *bda, UINT16 handle, UINT8 status, UINT8 enc_mode)
(status == HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE) ||
(status == HCI_ERR_REPEATED_ATTEMPTS)))) {
p_dev_rec->security_required &= ~BTM_SEC_OUT_AUTHENTICATE;
p_dev_rec->sec_flags &= ~ (BTM_SEC_LE_LINK_KEY_KNOWN << bit_shift);
p_dev_rec->sec_flags &= ~((BTM_SEC_LINK_KEY_KNOWN | BTM_SEC_LINK_KEY_AUTHED) << bit_shift);
#ifdef BRCM_NOT_4_BTE