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

Add RFC5280 DistinguishedName behavior #77

Closed

Conversation

nick-mobilecoin
Copy link
Collaborator

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.

Motivation

@meowblecoinbot meowblecoinbot requested a review from a team May 5, 2023 04:19
@github-actions github-actions bot added the size/XL Extra-Large PRs label May 5, 2023
@github-actions github-actions bot added the rust Pull requests that update rust code label May 5, 2023
@github-actions
Copy link

github-actions bot commented May 5, 2023

❌ Unreviewed dependencies found

Crate Version Reviews (N/2) LoC Left-Pad Index Geiger Flags

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

❗ No coverage uploaded for pull request base (nick/pkits-4.2@9751c54). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head cd4e247 differs from pull request most recent head c01b562. Consider uploading reports for the commit c01b562 to get more accurate results

@@                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

@nick-mobilecoin nick-mobilecoin force-pushed the nick/rfc5280-distinguished-name branch from d530838 to 118565d Compare May 5, 2023 04:24
@@ -0,0 +1,391 @@
// Copyright (c) 2023 The MobileCoin Foundation

//! X509 distinguished name as defined in sections
Copy link
Collaborator Author

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.

Comment on lines +20 to +23
.chars()
.filter_map(rfc_4518_filter_map)
.nfkc()
.collect::<String>();
Copy link
Collaborator Author

@nick-mobilecoin nick-mobilecoin May 5, 2023

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

@nick-mobilecoin nick-mobilecoin force-pushed the nick/rfc5280-distinguished-name branch from 118565d to cd4e247 Compare May 5, 2023 04:47
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.
@nick-mobilecoin nick-mobilecoin force-pushed the nick/rfc5280-distinguished-name branch from cd4e247 to c01b562 Compare May 5, 2023 14:33
@nick-mobilecoin nick-mobilecoin changed the title Add RFC5380 DistinguishedName behavior Add RFC5280 DistinguishedName behavior May 5, 2023
@nick-mobilecoin
Copy link
Collaborator Author

punting on implementing x509 chain parsing logic.

@nick-mobilecoin nick-mobilecoin deleted the nick/rfc5280-distinguished-name branch October 3, 2023 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Pull requests that update rust code size/XL Extra-Large PRs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant