-
Notifications
You must be signed in to change notification settings - Fork 11
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
fast_ber::Integer wrong encodding #36
Comments
Hi Pedjaman, I believe this value is correct. Rules from https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf:
As this is two's compliment Nokalva online encoder agrees with this encoding.
|
Hi, I'm not sure which variant of BER is used in Microsoft's remote desktop protocol but they certainly require 65535 to be encoded as 02 02 ff ff. Although I'm not a fan of Microsoft, it sounds quite strange that they are wrong about. I've tried to transform 65535 value to achieve what is expected but had no luck. It seems I'll have to use something else. |
It's definitely not -1? Do you have any ASN.1 specs or other documents I may look at as a reference? |
The best I can provide is Check page 328/430 (raw packet data). At position 0x29 is a sequence Please find attached asn file here describing BER encoding has been used for data in question. |
I assume this is caused by the sign constraint (maxMCSPDUsize INTEGER (0..MAX), which unfortunately this library does not support. |
Ok. I've read somewhere that all integers should be encoded as unsigned in
BER. But I'm not sure where I read that.
Anyways thanks for the clarification. Unfortunately I will have to try
another approach
…On Fri, Apr 23, 2021, 16:08 Samuel-Tyler ***@***.***> wrote:
I assume this is caused by the sign constraint (maxMCSPDUsize INTEGER
(0..MAX), which unfortunately this library does not support.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJKNHZZTEARV7PGDWMYLQTTKF5OZANCNFSM43LDAKKQ>
.
|
Ok, thank you for taking the time to try the library. Maybe some time in the future I will add support for unsigned integers. |
I've tried using fast_ber for my project as it required BER encoding. It is a Microsoft RDP protocol. It seems that integers are encoded badly, as produced results are not as in BER specification and RDP messages are also expecting different results.
Here are some example of integer being encoded badly:
fast_ber::Integer<> i = 255;
result = 02 02 00 ff (wrong)
should be: 02 01 ff
fast_ber::Integer<> i = 65534;
result = 02 03 00 ff fe (wrong)
should be: 02 02 ff fe
fast_ber::Integer<> i = 65535;
result = 02 03 00 ff ff (wrong)
should be: 02 02 ff ff
Please advise
The text was updated successfully, but these errors were encountered: