Skip to content

Derive Zeroize and ZeroizeOnDrop for VLBytes - #1029

Merged
franziskuskiefer merged 6 commits into
RustCrypto:masterfrom
kkohbrok:konrad/zeroize_vlbytes
Apr 27, 2023
Merged

franziskuskiefer merged 6 commits into
RustCrypto:masterfrom
kkohbrok:konrad/zeroize_vlbytes

Conversation

@kkohbrok

Copy link
Copy Markdown
Contributor

In contrast to the generic tls_vec implementations, there is no Secret... variant for VLBytes. Since the overhead is relatively low, this PR blanket-implements ZeriozeOnDrop for VLBytes. In the future, it might be worth exposing a dedicated SecretVLBytes struct.

Comment thread tls_codec/src/quic_vec.rs Outdated
#[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Zeroize, ZeroizeOnDrop)]
pub struct SecretVLBytes(VLBytes);

impl fmt::Debug for SecretVLBytes {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you throw all of the implementation (that makes sense) into a macro so we don't need to duplicate the code?

Comment thread tls_codec/src/quic_vec.rs Resolved
Comment thread tls_codec/Cargo.toml Resolved
@franziskuskiefer
franziskuskiefer marked this pull request as ready for review April 27, 2023 13:00

@franziskuskiefer franziskuskiefer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm but looks like there's an issue with the msrv on ci

@franziskuskiefer
franziskuskiefer merged commit e3a8214 into RustCrypto:master Apr 27, 2023
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.

2 participants