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

der: Document and SecretDocument types #571

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Apr 2, 2022

Replaces the previous Document trait with types for wrapping serialized ASN.1 DER SEQUENCEs stored on the heap.

The SecretDocument is composed in terms of Document and provides some additional hardening for sensitive data, namely zeroize-on-drop and file permissions hardening when writing to disk.

This commit also removes all of the format-specific *Document types found in the pkcs1, pkcs8, spki, and sec1 crates with the new Document and SecretDocument types.

@tarcieri tarcieri force-pushed the der/document-types branch 4 times, most recently from ce80f42 to 156e8a4 Compare April 2, 2022 17:05
@tarcieri tarcieri force-pushed the der/document-types branch 2 times, most recently from d4da146 to 7e991f5 Compare April 3, 2022 17:53
@tarcieri tarcieri changed the title [WIP] der: Document and SecretDocument types der: Document and SecretDocument types Apr 3, 2022
@tarcieri tarcieri marked this pull request as ready for review April 3, 2022 17:53
@tarcieri
Copy link
Member Author

tarcieri commented Apr 3, 2022

Removing WIP/draft.

The core implementation is effectively done, although could probably use some additional work to reduce repetitiveness. Still, this removes quite a bit of duplicated code from the original implementation.

I'm going to continue adding additional/replacement tests for the format-specific Decode*/Encode* traits.

cc @bstrie @npmccallum

@@ -1,97 +0,0 @@
//! CertificateDocument implementation
Copy link
Member Author

Choose a reason for hiding this comment

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

@carl-wallace FYI, ended up removing this along with all of the format-specific *Document types. Hope the Document type works for your use cases

@tarcieri tarcieri force-pushed the der/document-types branch 3 times, most recently from bf3ca08 to 4ad135f Compare April 4, 2022 23:48
Replaces the previous `Document` trait with types for wrapping
serialized ASN.1 DER SEQUENCEs stored on the heap.

The `SecretDocument` is composed in terms of `Document` and provides
some additional hardening for sensitive data, namely zeroize-on-drop and
file permissions hardening when writing to disk.

This commit also removes all of the format-specific `*Document` types
found in the `pkcs1`, `pkcs8`, `spki`, and `sec1` crates with the new
`Document` and `SecretDocument` types.
@tarcieri tarcieri merged commit 71bb668 into master Apr 5, 2022
@tarcieri tarcieri deleted the der/document-types branch April 5, 2022 12:29
This was referenced May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant