Bluetooth: SMP: Fix invalid return from smp_pairing_master
With this patch, Identity Information and Identity Address Information are properly received. There was a bug when returning too early from smp_pairing_master function and not setting BT_SMP_CMD_IDENT_INFO bit in allowed_cmds. bt: bt_smp_recv (0x0010f054): Received SMP code 0x06 len 17 bt: smp_pairing_encrypt (0x0010f054): bt: bt_smp_recv (0x0010f054): Received SMP code 0x07 len 11 bt: smp_pairing_master (0x0010f054): bt: bt_smp_recv (0x0010f054): Received SMP code 0x08 len 17 bt: bt_smp_recv: Unexpected SMP code 0x08 bt: bt_smp_recv (0x0010f054): Received SMP code 0x09 len 8 bt: bt_smp_recv: Unexpected SMP code 0x09 The return should be after distributing LTK, EDIV and Rand if IdKey was not set. bt: bt_smp_recv (0x0010effc): Received SMP code 0x06 len 17 bt: smp_pairing_encrypt (0x0010effc): bt: bt_smp_recv (0x0010effc): Received SMP code 0x07 len 11 bt: smp_pairing_master (0x0010effc): bt: bt_smp_recv (0x0010effc): Received SMP code 0x08 len 17 bt: smp_ident_info (0x0010effc): bt: bt_smp_recv (0x0010effc): Received SMP code 0x09 len 8 bt: smp_ident_addr_info (0x0010effc): bt: smp_ident_addr_info (0x0010effc): identity 88:63:DF:88:0E:83 (public) bt: bt_smp_disconnected (0x0010effc): conn 0x0010badc handle 64 Change-Id: Ic98cf6fd6ad2f7e41c6cd506d39fc9a9571a491f Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This commit is contained in:
parent
410a8a8165
commit
fcda155262
@ -753,9 +753,9 @@ static uint8_t smp_master_ident(struct bt_conn *conn, struct bt_buf *buf)
|
||||
smp->remote_dist &= ~BT_SMP_DIST_ENC_KEY;
|
||||
if (!smp->remote_dist) {
|
||||
bt_smp_distribute_keys(conn);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (smp->remote_dist & BT_SMP_DIST_ID_KEY) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user