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

Wrong disconnected reason due to encryption with incorrect LTK

Hi

I'm using the nRF52832 with the SoftDevice S132 V6.0.0 in the central role and would like to encrypt a link with a stored LTK.

The encryption with the function sd_ble_gap_encrypt() with the correct LTK works fine. But when I start the encryption procedure with a peripheral that has an incorrect LTK, I would have expected that the BLE_GAP_EVT_DISCONNECTED event with the reason 0x3D (MIC failure) occurs, as it is described in this MSC.

Instead, I get the BLE_GAP_EVT_DISCONNECTED event with the reason 0x08 (Connection Timeout) after the supervision timeout expired. Am I doing something wrong or is this a bug in the SoftDevice?

EDIT:

I have a further question. Is that correct that the parameters lesc, auth and ltk_len in the ble_gap_enc_info_t struct are not needed/respected by the function sd_ble_gap_encrypt?

Many thanks in advance for your help.

Best regards

Parents Reply
  • Hi Kenneth

    Unfortunately, I don't know the disconnect reason of the peripheral, because this device is not under my control. Here is a snippet from the sniffer:

    I assume that the packet with the error is the LL_START_ENC_RSP from the peripheral that couldn't be decrypted.

    I tried it also with the S132 V6.1 but the effect was the same.

    Best regards

Children
Related