anthonykirby / lora-packet

LoRa radio packet decoder
MIT License
261 stars 83 forks source link

Online decoder using wrong Session Key #36

Closed ludionisio closed 4 years ago

ludionisio commented 4 years ago

I noticed that the online decoder is not using the right key for MIC comparison.

If a given packet uses FPort > 0, then the key being used for MIC calculation is the NetSessionKey instead of the AppSessionKey

anthonykirby commented 4 years ago

I noticed that the online decoder is not using the right key for MIC comparison.

This project is a node.js library: are you reporting a bug an online decoder (if so, which? :shrug: ) or a bug in this library?

ludionisio commented 4 years ago

I did not try using the node.js library directly, I meant the online decoder at:

https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/

which uses the library.

It may be a bug on the library itself, but I just tested the one accessible from the link above. Since the library is probably correct, I thougth it was just a GUI problem passing the given arguments to the library.

If you are not the maintainer of the given website. I am sorry

ludionisio commented 4 years ago

I am looking at the Lorawan Specification 1.0.3 item 4.3.3 MAC Frame Payload Encryption (FRMPayload), I believe I misread it. I thought MIC was dependent on FPort when actually just the content of the FRMPayload.