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

Commit d860a3f7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/29861874']...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/29861874'] into security-aosp-udc-release.

Change-Id: Icbe27f40de59c90a5c5ba60371980a0ec043f31c
parents 043d5b99 6ad3d749
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -721,6 +721,17 @@ void smp_proc_rand(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
    return;
  }

  if (!((p_cb->loc_auth_req & SMP_SC_SUPPORT_BIT) &&
        (p_cb->peer_auth_req & SMP_SC_SUPPORT_BIT)) &&
      !(p_cb->flags & SMP_PAIR_FLAGS_CMD_CONFIRM_SENT)) {
    // in legacy pairing, the peer should send its rand after
    // we send our confirm
    tSMP_INT_DATA smp_int_data{};
    smp_int_data.status = SMP_INVALID_PARAMETERS;
    smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data);
    return;
  }

  /* save the SRand for comparison */
  STREAM_TO_ARRAY(p_cb->rrand.data(), p, OCTET16_LEN);
}