Skip to content
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

Invalid encoding and decoding of OIDs #26

Closed
zaczkows opened this issue Aug 11, 2021 · 2 comments · Fixed by #29
Closed

Invalid encoding and decoding of OIDs #26

zaczkows opened this issue Aug 11, 2021 · 2 comments · Fixed by #29
Labels
kind/bug Something isn't working

Comments

@zaczkows
Copy link
Contributor

Hello,
This crate is amazing and speeds up my small ASN.1 encoding project enormously :-)

However, I found a bug when encoding OIDs, having values bigger than 127. E.g. when taking following example ID from MS website encoding using rasn gives back:

  • wrong [2b, 6, 1, 4, 1, b7, 2,15,14] (this actually decodes to 1.3.6.1.4.1.7042.21.20, look here)
  • instead of correct [2b, 6, 1, 4, 1, b7, 2, 15, 14]

Another example is from stackoverflow and 1.2.840.113549.1.1.5 (sha1WithRsaEncryption):

  • current (incorrect) encoding: [2a, c8, 6, 8d, f7, 6, 1, 1, 5] (lapo.it)
  • correct encoding: [2a, 86, 48, 86, f7, d, 1, 1, 5] (lapo.it)

BR, Piotr

@zaczkows
Copy link
Contributor Author

I'm working on the fix here

@XAMPPRocky
Copy link
Collaborator

Thank you for your issue! Feel to open a PR when you're ready 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants