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

Commit 5dc4e97d authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

smp: Reject pairing if the public keys match am: bb38f5c7

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/13522371

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If45c76319ea662f40ce02bc8ef9f8d6e2ce9d291
parents 61c7e561 bb38f5c7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -689,6 +689,16 @@ void smp_process_pairing_public_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  memcpy(pt.x, p_cb->peer_publ_key.x, BT_OCTET32_LEN);
  memcpy(pt.y, p_cb->peer_publ_key.y, BT_OCTET32_LEN);

  if (!memcmp(p_cb->peer_publ_key.x, p_cb->loc_publ_key.x, BT_OCTET32_LEN) &&
      !memcmp(p_cb->peer_publ_key.y, p_cb->loc_publ_key.y, BT_OCTET32_LEN)) {
    android_errorWriteLog(0x534e4554, "174886838");
    LOG_WARN("Remote and local public keys can't match");
    tSMP_INT_DATA smp;
    smp.status = SMP_PAIR_AUTH_FAIL;
    smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp);
    return;
  }

  if (!ECC_ValidatePoint(pt)) {
    android_errorWriteLog(0x534e4554, "72377774");
    tSMP_INT_DATA smp;