5G NAS UE policy protocol TS 24.501_UEPOL UEPolSectionMgmtSubresult uses length in octets instead of number of results
UEPolSectionMgmtSubresult has a length field which it sets to the length in octets of the results plus the length of the plmnId field rather than the number of results.
https://github.com/P1sec/pycrate/blob/1824d90cd4815ccdf4070e76338009aa1a1e8097/pycrate_mobile/TS24501_UEPOL.py#L149
https://github.com/P1sec/pycrate/blob/1824d90cd4815ccdf4070e76338009aa1a1e8097/pycrate_mobile/TS24501_UEPOL.py#L156
From TS 24501 D.6.3
Number of results (octet d) This field contains the binary encoding of number of results included in the UE policy section management subresult.
The 'Len' field should be a Uint8 and set to the number of elements in the sequence of UePolResult.
The field name of 'Len' may also be worth reviewing ;-)
I'm happy to assist with testing.
Thanks.
Thanks for uncovering this bug. A new repository has been setup, including new fixes. This repo will keep being maintained : https://github.com/pycrate-org/pycrate. It includes fixes for this specific 5G NAS module. Moreover, it will ease collaborative support !
If you checkout the last 0.7.1 version, this bug should be solved.