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

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

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

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

Change-Id: I6e0a82ce22f6cf437a61a8a22a8f5591ce8d6c4e
parents de80ed65 2f0cf867
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -686,6 +686,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);
}