|
|
@@ -5191,6 +5191,22 @@ static tBTM_STATUS btm_sec_execute_procedure (tBTM_SEC_DEV_REC *p_dev_rec)
|
|
|
return (BTM_CMD_STARTED);
|
|
|
}
|
|
|
|
|
|
+#if (CLASSIC_BT_INCLUDED == TRUE)
|
|
|
+ tACL_CONN *p_acl_cb = btm_handle_to_acl(p_dev_rec->hci_handle);
|
|
|
+ /*
|
|
|
+ * To prevent a remote device from doing a Bluetooth Impersonation Attack, a suggested fix by SIG is:
|
|
|
+ *
|
|
|
+ * "Hosts performing legacy (non-mutual) authentication must ensure a remote device is authenticated
|
|
|
+ * prior to proceeding with encryption establishment, regardless of role."
|
|
|
+ *
|
|
|
+ * As an implementation, we enforce mutual authentication when devices use Legacy Authentication.
|
|
|
+ */
|
|
|
+ if ((p_acl_cb != NULL) && (BTM_BothEndsSupportSecureConnections(p_acl_cb->remote_addr) == 0) &&
|
|
|
+ ((p_acl_cb->legacy_auth_state & BTM_ACL_LEGACY_AUTH_SELF) == 0)) {
|
|
|
+ p_dev_rec->sec_flags &= ~BTM_SEC_AUTHENTICATED;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
/* If connection is not authenticated and authentication is required */
|
|
|
/* start authentication and return PENDING to the caller */
|
|
|
if ((((!(p_dev_rec->sec_flags & BTM_SEC_AUTHENTICATED))
|