-
Notifications
You must be signed in to change notification settings - Fork 4
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 RFC5280 DistinguishedName
behavior
#77
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
❌ Unreviewed dependencies found
|
Codecov Report
@@ Coverage Diff @@
## nick/pkits-4.2 #77 +/- ##
=================================================
Coverage ? 97.96%
=================================================
Files ? 10
Lines ? 2308
Branches ? 0
=================================================
Hits ? 2261
Misses ? 47
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
d530838
to
118565d
Compare
@@ -0,0 +1,391 @@ | |||
// Copyright (c) 2023 The MobileCoin Foundation | |||
|
|||
//! X509 distinguished name as defined in sections |
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.
I'm up for suggestions on what else to bring from the RFC to have on hand. I wanted to avoid too much duplication, but also understand it's nice to have some things closer at hand.
.chars() | ||
.filter_map(rfc_4518_filter_map) | ||
.nfkc() | ||
.collect::<String>(); |
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.
I added a task to #50 for the missing prohibited unicode and bidi code points logic
I'm up for suggestions on how to handle these.
The unassigned table is a big concern, https://datatracker.ietf.org/doc/html/rfc3454#appendix-A.1 nesting that directly seems like it will be noisy and hard to maintain.
It maybe that we do something like, caseless, where we have a txt file with the code points listed, and then generate code build time based on it.
bidi could fall into the same camp, they are listed here for unicode 3.2, https://datatracker.ietf.org/doc/html/rfc3454#appendix-D. I look at something like https://github.com/servo/unicode-bidi, but this will likely use a newer unicode. I would vote for using a newer unicode for bidi detection. It may be that the unassigned code points above catch these newer ones so versions past unicode 3.2 may not be a concern
118565d
to
cd4e247
Compare
RFC5280 section [4.2.1.4](https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.4), calls out specific behavior on how issuer and subject names should be compared. It calls these fields `DistinguishedName`. This change implements most of this behavior with the exception of prohibited unicode code points and ignoring bidi code points.
30cc3af
to
9751c54
Compare
cd4e247
to
c01b562
Compare
DistinguishedName
behaviorDistinguishedName
behavior
punting on implementing x509 chain parsing logic. |
RFC5280 section
4.2.1.4,
calls out specific behavior on how issuer and subject names should be
compared. It calls these fields
DistinguishedName
. This changeimplements most of this behavior with the exception of prohibited
unicode code points and ignoring bidi code points.
Motivation