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

The most significant bit in a INTEGER is always 0 #22

Merged
merged 1 commit into from Oct 7, 2017

Conversation

Projects
None yet
2 participants
@sindreij

sindreij commented Oct 7, 2017

When the number is positive.

If a INTEGER is only decoded with 8 bits one octet, and the
msb of that octet is 1, AD reads this as a signed integer,
and will therefore read a negative number.

This fixes that by incrementing the number of octets in a integer
if the msb is 1 and the number is positive.

Fixes #21

(I also fixed a few tests that failed)

The most significant bit in a INTEGER is always 0
When the number is positive.

If a INTEGER is only decoded with 8 bits one octet, and the
msb of that octet is 1, AD reads this as a signed integer,
and will therefore read a negative number.

This fixes that by incrementing the number of octets in a integer
if the msb is 1 and the number is positive.

Fixes #21
@inejge

This comment has been minimized.

Show comment
Hide comment
@inejge

inejge Oct 7, 2017

Owner

Thanks for the PR! ASN.1 code has been left mostly untouched since the fork from the original project, and this kind of practical testing is very helpful in shaking out the bugs. LGTM, so I'm merging it.

Owner

inejge commented Oct 7, 2017

Thanks for the PR! ASN.1 code has been left mostly untouched since the fork from the original project, and this kind of practical testing is very helpful in shaking out the bugs. LGTM, so I'm merging it.

@inejge inejge merged commit 6196d56 into inejge:master Oct 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment