-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APER encoding failed on a 32-bit machine #175
Comments
INTEGER APER encode/decode functions seem to be operating internally with |
Yes. If you search through the issues, you'll find a discussion about changing internal representation of various integer types to INTEGER or something similarly large, to avoid this implicit restriction. So far, nobody (including myself) stepped forward with an actual PR. I personally don't have either time or skills to do that, plus there's a question of what library to "outsource" processing of multi-precision integers to... |
Proposed solution with PR #176. Tested on a 32-bit machine, armv7l. |
@v0-e thank you for the fix! |
I don't think this issue has been properly resolved yet. The test program I created earlier passes, but there are more unresolved cases. If you
I upgraded my test program as below because it works fine when amf_ue_ngap_id is 0xffffffff, but not when 0xffffffffff1 and 0xf7ed938500000001.
Please let me know if you have any other questions. Thanks a lot! |
Oh, I was wrong, the maximum value for amf_ue_ngap_id was 2^40-1. I tested it again and it's working fine. I apologize for the inconvinence. |
Hey @acetcom, The exact reason why the encoding was failing was because I suspect there will be more instances in asn1c in which the encoding/decoding methods misinterpret the signedness of (large) integer values. |
I think it's because the asn1c library is not used correctly for the type of large integers. If it happens again in Open5GS, I'll share it with you and we'll try to fix it together. Thank you very much for the wonderful work you have done. |
APER encoding fails when using the asn_uint642INTEGER function on a 32-bit machine as shown below.
This was first reported by the open5gs community in issues 2934 and I've been experimenting with it and it's failing the same.
I've added some test code to the asn1c branch of open5gs that you can easily experiment with. You can reproduce it by doing the following.
This run is failing at line 290 of the tests/unit/ngap-message-test.c code.
Of course, it works fine on 64-bit computers.
And the asn1c branch of open5gs used the commit below from mouse07410/asn1c.
Please let me know if you have any other questions.
Thanks a lot!
Sukchan
The text was updated successfully, but these errors were encountered: