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

Encrypted packet decrypted incorrectly (bad MIC)

Helo, I am developing a BLE product, and @ encryption stage, I get thie message on the topic.

I attach my log for further information.

The log entry that gives the message in the topic is: 

2629 23.809161 Master_0x23c8cccf LE 1M LE LL 1 399691 21 Encrypted packet decrypted incorrectly (bad MIC)

Any help on how to sort this out would be appreciated.

Thank you, decrypted incorrectly.pcapng

Victor

  • Yes, agree on the part where the first encrypted packet from the master (LL_START_ENC_REQ) is not decrypted by the sniffer (yes the sniffer cannot decrypt a normal LE secure connection), however the interesting part is that the slave also fails to decrypt that packet, if this was a sniffer issue alone then the sniffer will follow the link but fail to decrypt the packet however the link abruptly stops and the slave radio just stops responding.

    The slave LL should be generating a HCI or equivalent event Connection Terminated/Dicsonnected Due to MIC Failure (0x3D). The behavior for MIC failure is that the RADIO should stop immediately as soon as MIC failure is detected, in this case it stops in the next connection event and does not respond to subsequent master TX which fits the MIC failure case.

    The master LL should get a HCI or Equivalent event Connection Terminated/Disconnection Event due to connection timeout (0x08).

    I have not seen this type of issue earlier, very atypical and rare.

    Can you post the disconnection event codes for the master and slave and that should confirm the issue.

  • Hello, it really seems to be a MIC failure, the returned disconnection reason in the Peripheral application is CO_ERROR_TERMINATED_MIC_FAILURE 0x3D.

    Thank you for the help. The only reason I raised this questioin was to make sure is not a sniffer limitation, and it does not seem to be the case.

    Thank you for the allocated time.

    Regards, 

    Victor

  • Indeed, on the Peripheral (slave) side, I get 0x3D Disconnect reason, and on the central (master) side, the disconnect reason is indeed 0x08.

    However, I don't want to hijack the Nordic support forum for my Dialog problem right now, even though I am not sure what am I doing wrong in my setup and how to proceed.

    Thank you Amanda and David for your time.

  • I must specify that none of the devices has i/o capabilities.

    I am not sure at this point if this limitation is even compatible with LE Secure Connection pairing method...

  • Having no IO capability is fine, which means it will use the JustWorks method. LE secure enables the distribution of the LTK without sharing it over the air (Legacy pairing will share the LTK over the air). the rules for authentication for MITM remain the same for Legacy and LE Secure.

Related