P1sec / pycrate

A Python library to ease the development of encoders and decoders for various protocols and file formats; contains ASN.1 and CSN.1 compilers.
GNU Lesser General Public License v2.1
381 stars 132 forks source link

Value for BEARER, an input para to function FGIA/FGEA should be update. #116

Closed eric-guanwy closed 3 years ago

eric-guanwy commented 3 years ago
Hi guys, first of all highly appriciate for your great work.
I just found that there's an incorrect value for BEARER which as an input parameter for the function **FGIA( )** and **FGEA( )** in TS24501_FGMM.py from folder pycrate_mobile.  
According to 3GPP TS33.501, **BEARER**, one of input parameters to integrity and confidentiality algorithm, shall be equal to the NAS connection identifier, and the value of the unique NAS connection identifier **shall be set to "0x01" for 3GPP access** and set to "0x02" for non-3GPP access. 
So the bearer here should be set to 1 rather than 0. 
But in the code the bearer always be 0, which actually not conformance to the specification. 

image image

Hope these will be helpful.
Thanks again.
eric-guanwy commented 3 years ago

The value of the unique NAS connection identifier updated to "0x01" for 3GPP access and "0x02" for non-3GPP access since R15.2.0(TS33501-f20), and before this it was “0” for 3GPP access and “1” for non-3GPP access, according to TS33.501 change history.

p1-bmu commented 3 years ago

Thanks for the feedback. I just pushed commit https://github.com/P1sec/pycrate/commit/53ed6fe8172d87059391dbb601f8cef2ca8d7d1a that fixes this.