-
Notifications
You must be signed in to change notification settings - Fork 3
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
OID Decoding/Encoding is wrong #8
Comments
Hi @danielmarschall, thanks for reporting this issue. Indeed, looking at the x.690 spec, I am not handling that properly. They also include an example of how it should be encoded as well. I will work on it this week. |
I think this should be resolved with b854cf1. I have tagged a new version with the fixes. |
I thought of yet another case where I could potentially not be handling the encoding of the second OID component properly now when it reaches near the |
Considering this resolved. If you still notice issues please feel free to re-open it or let me know. Thanks again for reporting this. |
Hello,
I noticed that the
BerEncoder::decodeOid()
andBerEncoder::encodeOid()
functions are not correctly implemented.The formula "modulo 40" is only correct for the root OIDs 0 and 1. For 2, the procedure becomes more complex.
More information at: https://misc.daniel-marschall.de/asn.1/oid_facts.html
Example:
Your program is not able to handle th OID 2.999
Here is a tool that you can use to test if your implementation is correct:
https://misc.daniel-marschall.de/asn.1/oid-converter/online.php
The text was updated successfully, but these errors were encountered: