-
Notifications
You must be signed in to change notification settings - Fork 12
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 2.999 decoded wrong #9
Comments
Hi! Actually OID 2.49 is invalid to begin with. By the specification first sub-identifier must be in the range of 0..39. This is because the first two values are packed into one integer, due to an optimization dating back over 30 years. For details see http://luca.ntop.org/Teaching/Appunti/asn1.html chapter 5.9, or https://www.oss.com/asn1/resources/books-whitepapers-pubs/larmouth-asn1-book.pdf page 270. Anyway, it's a bug that we're allowing an encoding with such values. I'll add a check and throw an exception where appropriate. |
2.49 is valid. 2.999 is also valid. Even 2.99999999999999999999999999 is valid. Actually, there are a lot of OIDs above 2.39 registered http://www.oid-info.com/get/2.49 The "0..39" limitation applies only to the top arcs 0 and 1, not to 2. As reference, please see ITU Rec. X.690, page 13+ ( https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf ) Here is an utility which you can use to test the DER encoding/decoding https://misc.daniel-marschall.de/asn.1/oid-converter/online.php |
I see you're correct. It seems that for root arc 2 there's no limitation for the first sub id. I'll look into it! |
Hello, I just checked your latest version and found out that your fix bbf871a solves this problem. However, this commit has some problems with "Travis CI"? I don't know what that means. For the sake of completeness, here are my testcases:
and the code for the testcases:
If you want, you can include my testcase in your project, of course. |
That particular test run failed because PHP bumped nightly version to 8.0.0, but phpunit requires 7.x. I removed the nightly test from Travis on a later commit. |
Hello,
I found out that "OIDs greater than 2.39 are not correclty decoded", e.g. "2.999"
Please find attached my small test program.
The text was updated successfully, but these errors were encountered: