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

verification: add RFC822Name #10487

Merged
merged 4 commits into from
Feb 26, 2024
Merged

verification: add RFC822Name #10487

merged 4 commits into from
Feb 26, 2024

Conversation

woodruffw
Copy link
Contributor

@woodruffw woodruffw commented Feb 26, 2024

This is a backing piece for #10345. Once merged, I'll do a follow up PR for RFC822Constraint for the Name Constraint side.

Flagging one thing: this implementation doesn't currently bother with the "quoted" form of mailbox names. These are treated as invalid addresses for the time being, and I've added a testcase as a backstop for that behavior so that it doesn't change unexpectedly.

(I can try with the quoted form, but it'll probably make a PR a decent bit bigger and may just be worth a crate that gets it right. They're also uncommon and the relevant RFCs advise against using them for compatibility reasons.)

Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
use asn1::IA5String;

// RFC 2822 3.2.4
static ATEXT_CHARS: &str = "!#$%&'*+-/=?^_`{|}~";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might make more sense/be more efficient as &[u8] instead.

Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
@alex alex enabled auto-merge (squash) February 26, 2024 22:34
@alex alex merged commit bcaf375 into pyca:main Feb 26, 2024
56 checks passed
@woodruffw woodruffw deleted the ww/rfc822name branch February 26, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants