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

How to correctly discriminate the level of ble connection security analyzing bonding infos

To the kind attention of Nordic support team,

Our product should be able to establish encrypted ble connections using passkey (the strongest security level in ble) and other connections using the lowest security level instead. We would like to use peer manager routines to retrieve every bonding infos that is present in nRF52x device memory, and just analyzing bonding infos, be able to understand if those bonding infos are related to a certain type of connection or the other one (as mentioned before).

Could you please help us understanding what is the relevant infos to give a look at, so to discriminate the type of connection?

Thank you for your attention,

Best regards

  • After creating a bond you can read out the bond info using pm_peer_data_bonding_load(current_peer_id, p_data). You should be able to check the p_data->peer_ltk.enc_info.auth bit if the bond have been authenticated or not (e.g. just works bonding vs. passkey bonding). E.g. something in principle like this:

    pm_peer_data_bonding_t * p_data;
    pm_peer_id_t current_peer_id = pm_next_peer_id_get(PM_PEER_ID_INVALID);
    
    while (current_peer_id != PM_PEER_ID_INVALID)
    {
       pm_peer_data_bonding_load(current_peer_id, p_data);
    
       if(p_data->peer_ltk.enc_info.auth == true)
       {
           // bond authenticated with passkey
       }
    
       current_peer_id = pm_next_peer_id_get(current_peer_id);
    }

  • Thank you very much for your kindness Kenneth. Very helpful.

Related