summaryrefslogtreecommitdiffstats
path: root/stack/btm/btm_sec.c
diff options
context:
space:
mode:
Diffstat (limited to 'stack/btm/btm_sec.c')
-rw-r--r--stack/btm/btm_sec.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c
index d439cfc34..e35b148b8 100644
--- a/stack/btm/btm_sec.c
+++ b/stack/btm/btm_sec.c
@@ -3803,7 +3803,7 @@ False-positive: evt_data.bd_addr is set at the beginning with: STREAM_TO_BDA
else
{
evt_data.auth_req = (p_dev_rec->p_cur_service->security_flags &
- BTM_SEC_OUT_MITM)? BTM_AUTH_SP_YES : BTM_AUTH_SP_NO;
+ BTM_SEC_OUT_MITM)? BTM_AUTH_SPGB_YES : BTM_AUTH_SPGB_NO;
}
}
}
@@ -4361,8 +4361,23 @@ void btm_sec_auth_complete (UINT16 handle, UINT8 status)
}
if (!p_dev_rec)
- return;
+ {
+ /* check if the handle is BTM_INVALID_HCI_HANDLE */
+ if(handle == BTM_INVALID_HCI_HANDLE)
+ {
+ /* get the device with auth type as BTM_SEC_STATE_AUTHENTICATING */
+ p_dev_rec = btm_find_dev_by_sec_state(BTM_SEC_STATE_AUTHENTICATING);
+ if ( p_dev_rec && (btm_cb.api.p_auth_complete_callback))
+ {
+ (*btm_cb.api.p_auth_complete_callback) (p_dev_rec->bd_addr,
+ p_dev_rec->dev_class,
+ p_dev_rec->sec_bd_name, status);
+ BTM_TRACE_DEBUG("btm_sec_auth_complete: Invalid Handle, send Auth failure");
+ }
+ }
+ return;
+ }
/* keep the old sm4 flag and clear the retry bit in control block */
old_sm4 = p_dev_rec->sm4;
p_dev_rec->sm4 &= ~BTM_SM4_RETRY;