Lora-net/LoRaMac-node

FRMPayload < 10 bytes not de-encrypted on AWS

Closed this issue · 1 comments

dlippy commented

We are noticing on AWS IOT that if we send a FRMPayload less than 10 bytes it doesn't decrypt it (odd that it isn't 16 maybe).

LoRaWAN Spec indicates:
Encryption and decryption of the payload is done by truncating
(pld | pad16) xor S
to the first len(pld) octets

PayloadEncrypt doesn't pad but the above truncation looks like it should yield same results anyway without padding. I am wondering though if this could be an issue with the MIC value which gets computed from message (I assume it's supposed to be before truncating)?

The provided description is not clear enough about the observed issue.

What clues lead you to such conclusion?
What do you mean by "PayloadEncrypt doesn't pad"?

Could you provide an example of:

  • inputs (full uplink frame, keys, counters)
  • expected output
  • real output

Maybe you can try using https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/ to validate your assumptions.

The LoRaWAN stack provided by this project is supposed to work as expected concerning the cryptographic operations.
This is further enforced by the fact that the LoRa Alliance certification process checks such behaviors in addition this project is used with many different Network Server providers with success.

In the future it would be nice if you could post this kind of questions on the project Discussions tab. It is a better place to engage discussions and then we can agree if it is an issue or not.
If you don't mind I move this issue to the Discussions tab.