From a0ba14e55dd90f8a087227aac8ce93baf353ef3d Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Tue, 30 Jun 2026 16:27:18 +0800 Subject: [PATCH] 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 --- components/bt/host/bluedroid/stack/btm/btm_sec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/stack/btm/btm_sec.c b/components/bt/host/bluedroid/stack/btm/btm_sec.c index a744bc30322..fcf9261534a 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_sec.c +++ b/components/bt/host/bluedroid/stack/btm/btm_sec.c @@ -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