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

Commit 1d4ab1fd authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "BLE: Don't set SC bit in AuthReq for Legacy Device" am: 978a810e

parents e74b33a3 978a810e
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -189,6 +189,27 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
                remote_lmp_version);
          }

          if (!p_cb->secure_connections_only_mode_required &&
              (!(p_cb->loc_auth_req & SMP_SC_SUPPORT_BIT) ||
               (remote_lmp_version &&
                remote_lmp_version < HCI_PROTO_VERSION_4_2) ||
               interop_match_addr(INTEROP_DISABLE_LE_SECURE_CONNECTIONS,
                                  (const RawAddress*)&p_cb->pairing_bda))) {
            LOG_DEBUG(
                "Setting SC, H7 and LinkKey bits to false to support "
                "legacy device with lmp version: %d",
                remote_lmp_version);
            p_cb->loc_auth_req &= ~SMP_SC_SUPPORT_BIT;
            p_cb->loc_auth_req &= ~SMP_KP_SUPPORT_BIT;
            p_cb->local_i_key &= ~SMP_SEC_KEY_TYPE_LK;
            p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
          }

          if (remote_lmp_version &&
              remote_lmp_version < HCI_PROTO_VERSION_5_0) {
            p_cb->loc_auth_req &= ~SMP_H7_SUPPORT_BIT;
          }

          LOG_DEBUG(
              "Remote request IO capabilities postcondition auth_req: 0x%02x,"
              " local_i_key: 0x%02x, local_r_key: 0x%02x",