-
Notifications
You must be signed in to change notification settings - Fork 81
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
OpenSSL::ASN1 der translation inconsistent #119
Comments
ping |
hey! sorry for the inconvenience. its a long-term (known) issue. JOSSL does not handle ASN.1 the same and there are edge cases where it simply might need internal refactoring - with lots of 💛. unfortunately, as this is a infrastructure piece, its rare to find contributions accomplishing such a big task. sorry for the inconvenience. if you can please look at it in detail if it relates to any of the already reported ASN.1 issues. |
didn't know that. Do you have such long-term issues/incompatibilities with stock MRI described somewhere, like jruby?
The ASN.1 issues I found relate to decoding, not encoding. My script shows you 2 different outputs for encoding an ASN.1 element, depending of which ruby you use: int = OpenSSL::ASN1::Integer.new(1)
data = OpenSSL::ASN1::ASN1Data.new([int], 1, :CONTEXT_SPECIFIC)
der = data.to_der
puts der.unpack("H*").first
# MRI: "a103020101", which is right
# JRuby: "810101" one could start by creating a test for this specific case and then slowly take care of things. I don't know much about setting a development environment for jruby-openssl, so I don't know of how much help could I be. I just thought that ASN.1 support would be more mature, as TLS certificates are encoded in this stone-age encoding protocol (I guess I like it as much you do). |
Just for context, I use this for a client SNMP library (which encodes packets in ASN.1). We're mostly using MRI, for now. |
this part should be resolved (>= 0.15.0) with 46e5f87 |
#to_der
doesn't seem to be inconsistent encoding context-specific ASN1 data. This is a gist which hopefully demonstrate the issue:Here is the output against jruby 9.1.6.0 (latest stable as of now):
which shows that the original asn can't be encoded and decoded into the same structure.
Here's the output with MRI 2.1:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: