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

Commit 26a4a1d7 authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Fail LE secure pairing for secure only peripherals

This change allows the host peripheral which initiates the pairing
to reject the pairing in case the remote does not support
secure LE connections and the host DUT is in secure connections
only mode.

Bug: 22203134
Change-Id: If58f791cb575d6b66c361f58e574b613d5686047
parent 9279b62a
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -549,11 +549,22 @@ void smp_proc_pair_cmd(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
        }
        else /* update local i/r key according to pairing request */
        {
            /* paring started with this side (slave) sending Security Request */
            /* pairing started with this side (slave) sending Security Request */
            p_cb->local_i_key &= p_cb->peer_i_key;
            p_cb->local_r_key &= p_cb->peer_r_key;
            p_cb->selected_association_model = smp_select_association_model(p_cb);

            if (p_cb->secure_connections_only_mode_required &&
                (!(p_cb->le_secure_connections_mode_is_used) ||
               (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS)))
            {
                SMP_TRACE_ERROR("%s pairing failed - slave requires secure connection only mode",
                    __func__);
                reason = SMP_PAIR_AUTH_FAIL;
                smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
                return;
            }

            if (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_OOB)
            {
                if (smp_request_oob_data(p_cb)) return;