Different BLE pairing behaviors on iPhone 6 and iPhone 7


Li, Jun R
 

Hi everyone,

 

I’m trying to test the secured pairing with a NRF51 device by using an iPhone 6 and 7, and noticed different behaviors on different phones:

iPhone 7: secured pairing is always successful.

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

 

iPhone 6: paring always fails with the following errors:

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8

 

 

It seems most logs are almost same except that an error occurred (in red color) when pairing is initiated by iPhone 6. I’m using the “BT_SECURITY_MEDIUM” level for security setting.

 

Can anyone point me to what makes the difference between iPhone 6 and iPhone 7? Both phones are running on the same software version: 11.4.

 

More logs can be referred below. Thank you!

 

Regards,

Jun

 

 

Pairing results with iPhone 7:

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 69:2e:88:bc:dd:7f (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6dbcecdc91beea980b22d3987165e432

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x06 len 17

[bt] [DBG] smp_encrypt_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x07 len 11

[bt] [DBG] smp_master_ident: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x08 len 17

[bt] [DBG] smp_ident_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x09 len 8

[bt] [DBG] smp_ident_addr_info: (0x20001908) identity 40:4d:7f:a6:0f:7e (public)

Identity resolved 69:2e:88:bc:dd:7f (random) -> 40:4d:7f:a6:0f:7e (public)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x0

 

 

Paring results with iPhone 6

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 6c:82:85:45:2a:97 (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 4ae51a076090285b947bfbb98819933b

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8


Carles Cufi
 

Hi there,

 

Have you tried erasing the bond from iOS settings? I find that sometimes bonding fails if the device is already bonded, for whatever reason.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of Li, Jun R
Sent: 14 June 2018 17:23
To: devel@...
Subject: [Zephyr-devel] Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Hi everyone,

 

I’m trying to test the secured pairing with a NRF51 device by using an iPhone 6 and 7, and noticed different behaviors on different phones:

iPhone 7: secured pairing is always successful.

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

 

iPhone 6: paring always fails with the following errors:

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8

 

 

It seems most logs are almost same except that an error occurred (in red color) when pairing is initiated by iPhone 6. I’m using the “BT_SECURITY_MEDIUM” level for security setting.

 

Can anyone point me to what makes the difference between iPhone 6 and iPhone 7? Both phones are running on the same software version: 11.4.

 

More logs can be referred below. Thank you!

 

Regards,

Jun

 

 

Pairing results with iPhone 7:

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 69:2e:88:bc:dd:7f (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6dbcecdc91beea980b22d3987165e432

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x06 len 17

[bt] [DBG] smp_encrypt_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x07 len 11

[bt] [DBG] smp_master_ident: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x08 len 17

[bt] [DBG] smp_ident_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x09 len 8

[bt] [DBG] smp_ident_addr_info: (0x20001908) identity 40:4d:7f:a6:0f:7e (public)

Identity resolved 69:2e:88:bc:dd:7f (random) -> 40:4d:7f:a6:0f:7e (public)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x0

 

 

Paring results with iPhone 6

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 6c:82:85:45:2a:97 (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 4ae51a076090285b947bfbb98819933b

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8


Li, Jun R
 

Yes, every time when I did the tests, I let iPhone “forget the device”, which I suppose to erase the bond info, right?

 

Regards,

Jun

 

 

From: "Cufi, Carles" <Carles.Cufi@...>
Date: Thursday, June 14, 2018 at 08:29
To: Jun Li <jun.r.li@...>, "devel@..." <devel@...>
Subject: RE: Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Hi there,

 

Have you tried erasing the bond from iOS settings? I find that sometimes bonding fails if the device is already bonded, for whatever reason.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of Li, Jun R
Sent: 14 June 2018 17:23
To: devel@...
Subject: [Zephyr-devel] Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Hi everyone,

 

I’m trying to test the secured pairing with a NRF51 device by using an iPhone 6 and 7, and noticed different behaviors on different phones:

iPhone 7: secured pairing is always successful.

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

 

iPhone 6: paring always fails with the following errors:

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8

 

 

It seems most logs are almost same except that an error occurred (in red color) when pairing is initiated by iPhone 6. I’m using the “BT_SECURITY_MEDIUM” level for security setting.

 

Can anyone point me to what makes the difference between iPhone 6 and iPhone 7? Both phones are running on the same software version: 11.4.

 

More logs can be referred below. Thank you!

 

Regards,

Jun

 

 

Pairing results with iPhone 7:

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 69:2e:88:bc:dd:7f (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6dbcecdc91beea980b22d3987165e432

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x06 len 17

[bt] [DBG] smp_encrypt_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x07 len 11

[bt] [DBG] smp_master_ident: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x08 len 17

[bt] [DBG] smp_ident_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x09 len 8

[bt] [DBG] smp_ident_addr_info: (0x20001908) identity 40:4d:7f:a6:0f:7e (public)

Identity resolved 69:2e:88:bc:dd:7f (random) -> 40:4d:7f:a6:0f:7e (public)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x0

 

 

Paring results with iPhone 6

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 6c:82:85:45:2a:97 (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 4ae51a076090285b947bfbb98819933b

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8


Carles Cufi
 

Yes, that is exactly it.

In that case I am not sure about the issue. Perhaps Johan can bring some light into it.

 

Carles

 

From: "Li, Jun R" <jun.r.li@...>
Date: Thursday, 14 June 2018 at 17:32
To: "Cufi, Carles" <Carles.Cufi@...>, "devel@..." <devel@...>
Subject: Re: Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Yes, every time when I did the tests, I let iPhone “forget the device”, which I suppose to erase the bond info, right?

 

Regards,

Jun

 

 

From: "Cufi, Carles" <Carles.Cufi@...>
Date: Thursday, June 14, 2018 at 08:29
To: Jun Li <jun.r.li@...>, "devel@..." <devel@...>
Subject: RE: Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Hi there,

 

Have you tried erasing the bond from iOS settings? I find that sometimes bonding fails if the device is already bonded, for whatever reason.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of Li, Jun R
Sent: 14 June 2018 17:23
To: devel@...
Subject: [Zephyr-devel] Different BLE pairing behaviors on iPhone 6 and iPhone 7

 

Hi everyone,

 

I’m trying to test the secured pairing with a NRF51 device by using an iPhone 6 and 7, and noticed different behaviors on different phones:

iPhone 7: secured pairing is always successful.

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

 

iPhone 6: paring always fails with the following errors:

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8

 

 

It seems most logs are almost same except that an error occurred (in red color) when pairing is initiated by iPhone 6. I’m using the “BT_SECURITY_MEDIUM” level for security setting.

 

Can anyone point me to what makes the difference between iPhone 6 and iPhone 7? Both phones are running on the same software version: 11.4.

 

More logs can be referred below. Thank you!

 

Regards,

Jun

 

 

Pairing results with iPhone 7:

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 69:2e:88:bc:dd:7f (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r cd01fcf3ecfda76163f273083a8ae3ea

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6dbcecdc91beea980b22d3987165e432

[bt] [DBG] smp_c1: (0x20001908) ia 69:2e:88:bc:dd:7f (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce7fddbc882e6900000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 2d4b2a7aa0172202b7ae895f0e7e89eb cfm 2d4b2a7aa0172202b7ae895f0e7e89eb

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 23b40cb4113ebf87a79eee3322c405a0

[bt] [DBG] bt_smp_encrypt_change: (0x20001908) chan 0x2000093c conn 0x20000684 handle 0 encrypt 0x01 hci status 0x00

Security changed: 69:2e:88:bc:dd:7f (random) level 3

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x06 len 17

[bt] [DBG] smp_encrypt_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x07 len 11

[bt] [DBG] smp_master_ident: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x08 len 17

[bt] [DBG] smp_ident_info: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x09 len 8

[bt] [DBG] smp_ident_addr_info: (0x20001908) identity 40:4d:7f:a6:0f:7e (public)

Identity resolved 69:2e:88:bc:dd:7f (random) -> 40:4d:7f:a6:0f:7e (public)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x0

 

 

Paring results with iPhone 6

[bt] [DBG] bt_smp_accept: (0x20001908) conn 0x20000684 handle 0

[bt] [DBG] bt_smp_connected: (0x20001908) chan 0x2000093c cid 0x0006

Connected

[bt] [DBG] bt_smp_send_security_req: (0x20001908)

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x01 len 7

[bt] [DBG] smp_pairing_req: (0x20001908)

[bt] [DBG] smp_init: (0x20001908) prnd 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] legacy_pairing_req: (0x20001908)

Passkey for 6c:82:85:45:2a:97 (random): 043945

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x03 len 17

[bt] [DBG] smp_pairing_confirm: (0x20001908)

[bt] [DBG] legacy_pairing_confirm: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 6ec402b8025b75b991b7ae84ff139f5a

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] bt_smp_recv: (0x20001908) Received SMP code 0x04 len 17

[bt] [DBG] smp_pairing_random: (0x20001908)

[bt] [DBG] legacy_pairing_random: (0x20001908)

[bt] [DBG] smp_c1: (0x20001908) k a9ab0000000000000000000000000000 r 4ae51a076090285b947bfbb98819933b

[bt] [DBG] smp_c1: (0x20001908) ia 6c:82:85:45:2a:97 (random) ra ce:e4:6d:15:ac:0f (random)

[bt] [DBG] smp_c1: (0x20001908) preq 01040005100303 pres 02000005100301

[bt] [DBG] smp_c1: (0x20001908) p1 01010104000510030302000005100301

[bt] [DBG] smp_c1: (0x20001908) p2 0fac156de4ce972a4585826c00000000

[bt] [DBG] legacy_pairing_random: (0x20001908) pcnf 66ff28447187fdc8964f3aa4024912fe cfm 66ff28447187fdc8964f3aa4024912fe

[bt] [DBG] legacy_pairing_random: (0x20001908) generated STK 60c3fed7191023bf5b38969ac8a383f5

[bt] [ERR] bt_smp_update_keys: Unable to get keys for 6c:82:85:45:2a:97 (random)

[bt] [DBG] smp_pairing_complete: (0x20001908) status 0x8