Android-nRF-Mesh-Library: ExtendedInvalidCipherTextException message response after switching from iOS to Android


Describe the bug We have the scenario in which same Mesh Network can be edited on both Android and iOS devices. We managed to successfully restore Mesh Network with import and export built-in procedures, by creating different provisioners for each device and platform. The issue we’re facing is that after iOS can succesfully get the response after sending a Vendor Model Message, Android receives the Exception i reported below in Logs / Screenshots section. Only powering the BT peripheral off and back on seems to fix the issue on the Android side.

To Reproduce Steps to reproduce the behavior:

  1. Create Mesh Network from Android
  2. Provision a Node
  3. Import Mesh Network on iOS
  4. Get a parameter from one vendor model
  5. Switch back to Android
  6. Get a parameter from same vendor model

Expected behavior Successfully read response value

Platform details:

  • Library Version 2.1.1

Logs / Screenshots

no.nordicsemi.android.meshprovisioner.utils.ExtendedInvalidCipherTextException: mac check in CCM failed
    at no.nordicsemi.android.meshprovisioner.transport.BaseMeshMessageHandler.parseMeshPduNotifications(BaseMeshMessageHandler.java:163)
    at no.nordicsemi.android.meshprovisioner.MeshMessageHandler.parseMeshPduNotifications(MeshMessageHandler.java:61)
    at no.nordicsemi.android.meshprovisioner.MeshManagerApi.parseNotifications(MeshManagerApi.java:263)
    at no.nordicsemi.android.meshprovisioner.MeshManagerApi.handleNotifications(MeshManagerApi.java:235)
    at com.vimar.p406.ble.viewmodel.NrfMeshRepository.onDataReceived(NrfMeshRepository.java:540)
    at com.vimar.p406.ble.BleMeshManager$1.lambda$initialize$0$BleMeshManager$1(BleMeshManager.java:145)
    at com.vimar.p406.ble.-$$Lambda$BleMeshManager$1$menHcS3BNZmUA4ruRSpuglMOKeA.onDataReceived(Unknown Source:2)
    at no.nordicsemi.android.ble.ValueChangedCallback.notifyValueChanged(ValueChangedCallback.java:123)
    at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.onCharacteristicChangedSafe(BleManager.java:2884)
    at no.nordicsemi.android.ble.MainThreadBluetoothGattCallback.lambda$onCharacteristicChanged$4$MainThreadBluetoothGattCallback(MainThreadBluetoothGattCallback.java:135)
    at no.nordicsemi.android.ble.-$$Lambda$MainThreadBluetoothGattCallback$7AU42XLOqZKSRIMVuifw3eecBbw.run(Unknown Source:8)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8016)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t know but you requested it anyway. I will discourage using it on doc, but want people to use it correctly.

Hi @antoniovillanova , so I gave this a try and i was unable to reproduce the same issue as you are facing. I can detail the steps I took just like you had mentioned.

  1. Create Mesh Network from Android
  2. Provision a Node
  3. Import Mesh Network on iOS (I did not use the same provisioner as on Android as this is bound to fail because the sequence numbers are not exported for any given provisioner)
  4. Bind key to vendor model using iOS
  5. Control vendor model
  6. Switch back to Android
  7. Go to vendor model pull to refresh to get the newly bound key configuration that was added using iOS
  8. Control the vendor model.

I repeated the process 3 times and it worked 3 out of 3 times. Also I extended the test process by

  1. Unbinding the key on the vendor model from Android
  2. Pulled to refresh on iOS to update the the unbound key setting
  3. Bind again
  4. Control

All messages worked as it should. Have you checked if you are encrypting your message properly on the fw side? If you want me to test against your fw you can create a private ticket on devzone