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: Make zeroize's alloc feature conditional #920

Merged

Conversation

nick-mobilecoin
Copy link
Contributor

Previously zeroize's alloc feature would be enabled if zeroize was enabled in der. Now zeroize's alloc feature is only enabled if this der's alloc feature is enabled.


We were hoping to use p256 in a no-alloc environment. Moving p256 from 0.12.0->0.13.0 results in alloc getting pulled in.

It looks like when sec1 went from 0.3.0->0.7.1, sec1/v0.3.0...sec1/v0.7.1#diff-fe7c93733c51ed30397c61754e6d22958291335b1d61470ce78edcdf49a09399R36 its der dependency now uses zeroize. The zeroize dependency in der was calling out alloc.

Looking through der and sec1 it seems that alloc + zerioze is only needed for der's document.rs.

Making this proposed change may be a breaking change as der exposes zeroize, https://github.com/RustCrypto/formats/blob/master/der/src/lib.rs#L394. If someone was using the Vec, String, etc features exposed via der::zeroize and the alloc feature.

Previously `zeroize`'s `alloc` feature would be enabled if `zeroize` was
enabled. Now `zeroize`'s `alloc` feature is only enabled if this crate's
`alloc` feature is enabled.
@tarcieri
Copy link
Member

tarcieri commented Mar 7, 2023

Though technically a breaking change, the fact this entire repo passes with it is a good indication it's unlikely to cause real-world breakages.

I can merge this and yank the previous release so this is the new behavior going forward. It does seem like a good change.

@tarcieri tarcieri merged commit d2f847c into RustCrypto:master Mar 7, 2023
@tarcieri tarcieri mentioned this pull request Mar 7, 2023
@nick-mobilecoin
Copy link
Contributor Author

Thanks so much!!

@nick-mobilecoin nick-mobilecoin deleted the der-zeroize-conditional-alloc branch March 7, 2023 16:46
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