This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

what is the meaning of difference of keys list distributed between own device and peer?

In ANCS example (SDK 11.0.0)

I thought keys list distributed should be the same naturally until I see the code below.

ret_code_t   dm_register( dm_application_instance_t    *p_appl_instance,
                          dm_application_param_t const   *p_appl_param )
{
    .
    .
    .

    m_application_table[0].sec_param.kdist_peer.enc  = 0;
    m_application_table[0].sec_param.kdist_peer.id   = 1;
    m_application_table[0].sec_param.kdist_peer.sign = 0;

    m_application_table[0].sec_param.kdist_own.enc   = 1;
    m_application_table[0].sec_param.kdist_own.id    = 1;
    m_application_table[0].sec_param.kdist_own.sign  = 0;
    
    .
    .
    .
}

Is there no problem, although keys distributed are different?

  • Hi Joon,

    No, there is no problem with that. This tells that the peripheral expect that it will be the one who distribute the encryption key (LTK) not the central. It's normal for LE legacy bonding that the peripheral generate the LTK.

  • Thank you. But iPhone always returned 0x0 as IRK. Does it means that peripheral's message can be authetificated, but central's message can't be authetificated??

    And does absence of central's LTK means that data from peripheral to central is encypted but, from peripheral to central is not encypted?

  • usually Iphone do distribute IRK as it uses Random resolvable address. Do you have a sniffer trace showing the otherwise ?

    Absence of central's LTK meaning the central won't generate LTK , but the peripheral should do. And the link (on both direction) are encrypted with this LTK from the next time they connect (the initial connection, they use STK to encrypt instead).

  • I have a sniffer but I confirmed iphone's irk by using prinf function in device manager handler. And rhe result is 0x0.

    And if both peers distribute ltk, what key is used after initial connection?

  • The LTK should be always provided by the slave. The LTK provide by the master can only be used if they switch role in the future. Please see section 2.4.2.3 Vol 3 Part H in Bluetooth Core Spec 5.0.

    IRK = 0 is a little bit strange. I would suggest you to test your phone with one of our example and check if our device manager managed to capture IRK correctly or not (check in the whitelist if we have that IRK provided or not when we advertise after bonding. )

1 2