if (skb->len < sizeof(*rp))
return SMP_UNSPECIFIED;
+ /* Ignore this PDU if it wasn't requested */
+ if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY))
+ return 0;
+
skb_pull(skb, sizeof(*rp));
memcpy(smp->tk, rp->ltk, sizeof(smp->tk));
if (skb->len < sizeof(*rp))
return SMP_UNSPECIFIED;
+ /* Ignore this PDU if it wasn't requested */
+ if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY))
+ return 0;
+
skb_pull(skb, sizeof(*rp));
hci_dev_lock(hdev);
if (skb->len < sizeof(*info))
return SMP_UNSPECIFIED;
+ /* Ignore this PDU if it wasn't requested */
+ if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
+ return 0;
+
skb_pull(skb, sizeof(*info));
memcpy(smp->irk, info->irk, 16);
if (skb->len < sizeof(*info))
return SMP_UNSPECIFIED;
+ /* Ignore this PDU if it wasn't requested */
+ if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
+ return 0;
+
skb_pull(skb, sizeof(*info));
bacpy(&smp->id_addr, &info->bdaddr);