-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add basic support for Subject Alternative Name OtherName #209
Conversation
OpenSSL seems to allow general ASN.1 for OtherName while here we restrict ourselves to a bunch of string types. Should we instead just take binary encoded ASN.1 plus a custom specified oid? |
This is the same tradeoff that is made for I don’t feel strongly about that, and will make the required changes if we think exposing an arbitrary ASN.1 struct is the best solution. |
I haven't reviewed the branch yet but in general I think we should address #181 before making the problem worse by introducing more types that carry tagged string types that don't enforce that the content matches the type's limitations. |
96f5a18
to
1b75025
Compare
1b75025
to
bff7da9
Compare
I've rebased on the latest commits to be able to use the new string types (#214). What I propose in this MR is the same tradeoff that the one we are making for
Technically,
Most of the time the issuer value will just be a string, so that makes sense we make variants for that, it will cover most of the user's use cases. That's exactly what I propose for For my use cases (p2p), we need an UTF-8 string. For smart cards, this the same thing (extracted from Microsoft doc):
Note that this OID is also used even for non-Windows OS, see this tutorial from Red Hat.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me.
5d0fadf
to
7e413dc
Compare
Just leaving a note that I haven't forgotten about this PR. I will aim to review it this week. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had a few comments but nothing that I think will be a blocker.
7e413dc
to
ab3d3d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :-)
Add basic support for
OtherName
in the Subject Alternative Name extension.OtherName
is used by smart card certificates and also, for instance, to identify nodes in a peer-to-peer network.OtherName
is defined like this in the RFC 5280§4.2.1.6:Which is really close to
AttributeTypeAndValue
that we already support (RFC 5280§4.1.2.4)So I took the same approach while implementing it.
I don't try to map the OID with a specific ASN.1 object, as users could define their own.
This is the same approach as OpenSSL where users provide the OID, the format and its content.