This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541: How does BLE bonded devices reconnect safely?

Part Number: CC2541

Hi,

I'm working on auto-reconnect feature of two BLE devices. And I'm not sure how to safely do it.

From salve side, I kinda get it: broadcast using and make it only whitelisted device connectable. But question is, if we use RPA(resolvable private address), is it still necessary to make it only connectable by whitelisted devices? I'm having trouble making whitelist work on CC2541, so I'm curious.

From master side, if I scan and see a device, how do I make sure I only connect to it if it's already a device I bonded with earlier? If I see the address is RPA and can be resolved to match a public address in my bonded list, can I say it's safe to connect? Can a device fake or repeat a RPA?

thanks

Malcolm

  • Hi,

    Have you referenced the the GAP Bond Manager Documentation available in TI_BLE_Software_Developers_Guide.pdf? This is in the documents folder of the install location for the BLE Stack.

    The GAPBondMgr profile handles the initiation and managing of security features during a BLE connection.

    When a device connects with a device that has an RPA, the devices will need to pair and bond and share keys. The devices will store these keys in secure flash (SNV) and upon a reconnection, the Host will use these keys to resolve the address of the device into an Identity Address (As noted in BLE Spec 4.0 Volume 3 Section 10.8.2.3 "Resolving Private Address Resolution Procedure" and the devices can connect.

    To be extra clear, the Gap Bond Mgr handles this for you, so you do not need to write your own code to do this. You can leverage the GapBondMgr and the section in the pdf I described above on titled Section 5.3.2 "Using the Gap Bond Manager".

    Devices cannot fake an RPA unless they have your IRK and the same random 24-bit sequence that is used to make the RPA. You can reference BLE Spec 4.0 Volume 3 Section 10.8.2.2 on how a RPA is generated.

  • Thank you Even. The last point you said "Devices cannot fake an RPA unless" yes fake device can't generate them. But what about replay attack? Can a malicious device heard the RPA being broadcast?
  • A device could spoof another devices RPA sure, but RPA is used more for Privacy in the use case where a device would be coming and going. There isn't much a device could do even if it spoofed the RPA of another device because when they connect and try to authenticate with one another, the spoofing device would not have the keys and not be able to bond.