Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to check if bonded public MAC is valid

Hello.

I would like to use any of bonded {IRK, LTK, ediv, rand}info to validate public MAC[6], to be sure that it's valid. Seems that such validation functions are only within softdevice.

My application uses internal flash as data storage and mcu is periodically waked up from systemOff, so there is always a possibilty of messing last page which coresponds to bond info, overwriting, so it would be nice to validate MAC on each wakeup. I already had occasions when last flash page (bonding info page) had corrupted data.

Now i can only compare ediv which is stored on multiple location to check a match, which isn't very safe.

Parents
  • Hi,

    I do not understand the background for this question. Wy do you expect flash corruption? The Peer manager library in the SDK which handles bonding use the FSD library for storing data in flash, and this is written to ensure that it can handle resets at any time.

    Also, what do you mean by validate the MAC? Do you want to validate that the MAC of a peer is derived from the IRK you have stored (i.e. resolve the address)? Or do you have another goal?

    You are right that the SDK does not have any implementation for tis. It is handled by the SoftDevice (but the application is responsible for keeping the bonding information and providing it to the SoftDevice). Unfortunately, I cannot share any code from the SoftDevice implementation. This is standard operations though, so you can refer to the Bluetooth specification to see the details.

  • Understood, thank you. The flash corruption sometimes happen due to third party internal flash database implementation.

Reply Children
No Data
Related