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

nRF8001 Auth passkey generation

How does the nRF8001 chip generate the passkey in the DisplayKeyEvent? Is it possible to set this passkey from the App Controller?

As I understand it, the SetKey command only responds to the KeyRequestEvent as a means of verifying the passkey provided by the peer device. However, I want to set a static passkey instead of returning a seemingly random one in the DisplayKeyEvent, which the peer device has to enter via keyboard when bonding.

Parents
  • Hello Tom,

    The nRF8001 uses its internal Random Number Generator to generate a random number to be used for the passkey. This is required as per the Bluetooth specification for the passkey. See Bluetooth specification version 4.0 , Part H (Security Manager Specification) Section 2.3.5.3 .

    The only possibility to use a fixed PIN and comply to Bluetooth specifications would be to set both endpoints (master and slave) to use "Keyboard Only" in their IO capability. This will allow you to state "Type the 'fixed PIN' that you see printed on Device A on the keyboard of device B". I.e When the KeyRequestEvent arrives, use the SetKey command to put the fixed PIN. The fixed PIN can then be typed out on the peer device to complete the bonding.

    This however is possibly Only when you control both ends of the link i.e You control the master device and the slave device, so you are able to set the IO capability of both master and slave.

    In addition, a fixed pin as the passkey provides no additional protection over using JustWorks. So JustWorks would be the preferred method in this usecase over a passkey.

    Thanks David

Reply
  • Hello Tom,

    The nRF8001 uses its internal Random Number Generator to generate a random number to be used for the passkey. This is required as per the Bluetooth specification for the passkey. See Bluetooth specification version 4.0 , Part H (Security Manager Specification) Section 2.3.5.3 .

    The only possibility to use a fixed PIN and comply to Bluetooth specifications would be to set both endpoints (master and slave) to use "Keyboard Only" in their IO capability. This will allow you to state "Type the 'fixed PIN' that you see printed on Device A on the keyboard of device B". I.e When the KeyRequestEvent arrives, use the SetKey command to put the fixed PIN. The fixed PIN can then be typed out on the peer device to complete the bonding.

    This however is possibly Only when you control both ends of the link i.e You control the master device and the slave device, so you are able to set the IO capability of both master and slave.

    In addition, a fixed pin as the passkey provides no additional protection over using JustWorks. So JustWorks would be the preferred method in this usecase over a passkey.

    Thanks David

Children
Related