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

How to know the bond has been removed in the peer device?

I am using nRF5_SDK_15.0.0_a53641a.zip to create an application needs paring and bond. Now I got a problem that, if a smartphone removed the bond manually in its phone settings, the device (N52840) seems that  also needs to remove the bond by using delete_bonds() function, otherwise, the phone which already remove the bond will always failed to pair with the same device (N52840). So I want know, is there a way to let the device N52840 know the phone has already removed the bond when next connection. If the way avaliable, I want to insert a removing bond (call delete_bonds()) after the next connection and before the pairing procedure executing. BTW, whether I can  delete the specified bonds by some reference information. For example, by device address, or connection handle? 

Parents
  • Hi,

    It is not possible to tell if someone has deleted the bond on the smart phone or if the peer device is an attacker that is using the same address as the bonded smart phone. However it is possible to allow re-pairing based on the device address, but that imposes a security risk as an attacker can use the same address to bond with your device. Anyway as long as you are aware of that, but still wants to allow re-pairing, I think it should be sufficient to changed this part of the code:

            case PM_EVT_CONN_SEC_CONFIG_REQ:
            {
                // Reject pairing request from an already bonded peer.
                pm_conn_sec_config_t conn_sec_config = {.allow_repairing = false};

Reply
  • Hi,

    It is not possible to tell if someone has deleted the bond on the smart phone or if the peer device is an attacker that is using the same address as the bonded smart phone. However it is possible to allow re-pairing based on the device address, but that imposes a security risk as an attacker can use the same address to bond with your device. Anyway as long as you are aware of that, but still wants to allow re-pairing, I think it should be sufficient to changed this part of the code:

            case PM_EVT_CONN_SEC_CONFIG_REQ:
            {
                // Reject pairing request from an already bonded peer.
                pm_conn_sec_config_t conn_sec_config = {.allow_repairing = false};

Children
No Data
Related