0

I have a BLE server running, but I would like to limit the connection of remotes devices by asking/requesting for a PIN, passkey, or similar. Is that possible in Low Energy? I do not mean classic bluetooth. I am not really sure if it is possible or how to enable set it. I was unable to find any internet thread on how to enable or play with it (using bluez5).

According to the thread How to change BLE pin programmatically, I see that

There is no password-protecting mechanism in the BLE standard for "login to a device". Is that correct?

I have digging into this a little bit and, as commented, I was not able to find anything for that. But, I was looking into the bluez(5.46) code, and in "tools/btmgmt.c", function "prompt_input", there are PIN and PASSKEY request cases.

Or well, there is an alternative method? Maybe something like OOB pairing exchanging the TK? https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security#ABasicIntroductiontoBLESecurity-PairingMethodsforLESecureConnections(4.2devicesonly)

Isaac
  • 1
  • 1
  • I've seen devices implement their own system after a connection has been made by twisting the normal API. For example, requiring a particular code being written to an attribute before allowing other attributes to be read. If you tried to read the other attributes first you get an error or it's just empty. – Tim Tisdall May 29 '18 at 12:32
  • Thanks Tim. That is something that I have as my backup plan, create a characteristic that is initialized empty and check it until it is provided, and always check if it is valid till provide/access the other ones. But I hope this is covered in an standard way somehow. For instance the bluez code has "BT_ATT_PERM_AUTHEN", so I would guess that setting my characteristic with that flag should require/trigger some kind of authentication when accessing it. – Isaac May 29 '18 at 15:18
  • @Isaac You need to implement an Agent and register it using AgentManager interface "RegisterAgent". So that before any communication begins, bluetoothd will automatically the registered agent API when pairing. AFAIK, there is no difference in pairing process for classic and BLE. I can provide you some examples later today. – Parthiban Jun 20 '18 at 08:35

0 Answers0