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

Modify pre shared OOB key for Legacy Connection

Hi !

I am working on SDK 15.2 and on a NRF52832.

The others devices I will interact with are on BLE 4, so I can use only Legacy Connection mode for security. 

I would like to use Out of Band mode, with a pre shared key stored on my device. The other device, a BLE Gateway, will have a file with this key stored too. 

First, I would like to know if there are examples to do that. 

Second, i would like to know if it is possible to modify the value of the key and keep its value even if we switch off the device. 

Thanks,

  • Hi Kenneth,

    Are you controlling both sides of the link?

    Indirectly yes, I am programming the peripheral only, but Master side also programms with the mutual understand in order to connect with OOB Legacy Pairing with 128 bit Security key /Preshared Key. 

    E.g. have you updated the project to use preshared keys on both peripheral and central?

    I am programming only the peripheral, therefore I am doing test with the help of nRF52840 Dongle and nRF Connect Desktop (not programms Master)

    Maybe check that SDK v13 example works before you try to update one of the sides to a newer SDK.

    I am working with nRF SDK v17.

    simply it works, when the 128 bit key is Zeros but not pairing when any other number present in key other than Zero..

    thanks and Regards,

    Sreejith

  • I recommend to get the SDKv13 up and running for comparison. 

    Can the problem be related to endianness? e.g. does using AAAAAA..AAA work?

    Kenneth

  • Hi,

    Can the problem be related to endianness? e.g. does using AAAAAA..AAA work?

    I tried with following keys,

    /***ADDED CODE ***/
    static ble_advdata_tk_value_t m_oob_auth_key = {
    .tk = { 0x11, 0x11, 0x11, 0x11,
    0x11, 0x11, 0x11, 0x11,
    0x11, 0x11, 0x11, 0x11,
    0x11, 0x11, 0x11, 0x11}
    };

    Fed key: 11111111111111111111111111111111

    and

    /***ADDED CODE ***/
    static ble_advdata_tk_value_t m_oob_auth_key = {
    .tk = { 0x01, 0x01, 0x01, 0x01,
    0x01, 0x01, 0x01, 0x01,
    0x01, 0x01, 0x01, 0x01,
    0x01, 0x01, 0x01, 0x01}
    };

    fed key: 01010101010101010101010101010101

    also tried here key: 10101010101010101010101010101010

    in all these above given stage it did not paired....That means the only connects when all numbers are Zeroes...if any number other than zero present in the key, then it will not connect....

    Thanks and Regards,

    Sreejith

  • I notice you have a private case open regarding the same issue you experience with OOB. 

    From the private case I can see that 00000...000 means that it is not actually using OOB, but "just works" bonding. This will explain why it seemingly work with 00000...000, but not other keys.

    It might be an issue with nRF Connect for desktop in this case. I expect you will not use nRF Connect for desktop in your final application, so I suggest you use an nRF52 instead as a central device here, or a peer that you know you can inject OOB keys the same way.

    In any case, I suggest you handle your issue in the other private case you have, since this thread you are using here is really resolved.

    Kenneth

Related