Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af8651f2 authored by Zhihai Xu's avatar Zhihai Xu
Browse files

Bluetooth: GAP: Remove bonded device info on Authentication fail

Remove bonded device information from the BT-IF layer storage
on authentication failure if already bonded with just works
model.
from QCOM
Change-Id: Ia3c1635c446f39b1dbd4cdd0122c2f70cbbc8dd7
parent d8402708
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -893,6 +893,7 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)

            /* map the auth failure codes, so we can retry pairing if necessary */
            case HCI_ERR_AUTH_FAILURE:
                btif_storage_remove_bonded_device(&bd_addr);
            case HCI_ERR_HOST_REJECT_SECURITY:
            case HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE:
            case HCI_ERR_UNIT_KEY_USED:
+7 −3
Original line number Diff line number Diff line
@@ -803,8 +803,12 @@ bt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr)
    bdstr_t bdstr;
    bd2str(remote_bd_addr, &bdstr);
    BTIF_TRACE_DEBUG1("in bd addr:%s", bdstr);
    int ret = btif_config_remove("Remote", bdstr, "LinkKeyType");
    int ret = 1;
    if(btif_config_exist("Remote", bdstr, "LinkKeyType"))
        ret &= btif_config_remove("Remote", bdstr, "LinkKeyType");
    if(btif_config_exist("Remote", bdstr, "PinLength"))
        ret &= btif_config_remove("Remote", bdstr, "PinLength");
    if(btif_config_exist("Remote", bdstr, "LinkKey"))
        ret &= btif_config_remove("Remote", bdstr, "LinkKey");
    /* write bonded info immediately */
    btif_config_flush();