Hi,
we are building a device based on nrf52832. Everyone with the app installed should be able to connect to some characteristics on the device but we want other characteristics (that changes the device behavior) to be protected. The device have a button that can be used to indicate physical access to it and we want to use that as means to enable access to the protected characteristics. How do we best implement this while not violating any basic ideas behind Bluetooth pairing/bonding?
As it stands now we use BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM for the attribute metadata that require physical access and only BLE_GAP_CONN_SEC_MODE_SET_OPEN for attributes that are publicly available. The button controls if bonding is allowed or not by calling pm_sec_params_set() upon keypress. Static keys are used to automatically setup encryption with MITM authentication. Problem with current setup is that all peers with access to the static key, which is distributed in the app, can do MITM level encryption and access the restricted attributes. It is just that they cannot bond unless button is pressed (have physical access to the unit).
Adding a sticker with a generated PIN to the device, instead of distributing a static PIN with the app, would of course solve the problem (and increase security) but we would rather want users to press a button than including an additional sticker and forcing them to enter a pin.
Many thanks, Olov