-
Notifications
You must be signed in to change notification settings - Fork 497
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
compiling to wasm fails due to clear_on_drop without no_cc ? #281
Comments
@warner re: Barring any unforeseen circumstances, the next release of |
Cool, thanks, that sounds like the best solution. I'll wait for that update. |
As cargo features are additive then it might help if you add clear_on_drop as your own dependency with the no_cc feature. I suppose clear_on_drop might be violating feature additivity by using no_cc this way, but hey yet another problem with clear_on_drop. |
Oh, thank you! That at least gets me a quick workaround I can use to move forward with testing. |
@warner The issue with |
`zeroize` is WASM-friendly as it has no dependencies on C compilers. Instead uses Rust's own volatile write semantics and compiler fences to ensure zeroization is not elided by the compiler.
`zeroize` is WASM-friendly as it has no dependencies on C compilers. Instead uses Rust's own volatile write semantics and compiler fences to ensure zeroization is not elided by the compiler.
`zeroize` is WASM-friendly as it has no dependencies on C compilers. Instead uses Rust's own volatile write semantics and compiler fences to ensure zeroization is not elided by the compiler.
`zeroize` is WASM-friendly as it has no dependencies on C compilers. Instead uses Rust's own volatile write semantics and compiler fences to ensure zeroization is not elided by the compiler.
`zeroize` is WASM-friendly as it has no dependencies on C compilers. Instead uses Rust's own volatile write semantics and compiler fences to ensure zeroization is not elided by the compiler.
Switch from `clear_on_drop` to `zeroize` (fixes #281)
I'm experimenting with using magic-wormhole.rs in a browser context, for which I'm compiling it to WASM (https://github.com/warner/magic-wormhole.rs/issues/2). This is my first attempt at doing anything with WASM, so please tell me if I'm missing something obvious, but I'm seeing the
wasm-pack build
fail becauseclear_on_drop
is trying to compile a C file, and I guess that doesn't work when the target is WASM. The dependency chain ismagic-wormhole
->spake2
->curve25519-dalek
->clear_on_drop
.It looks like
clear_on_drop
has a feature (no_cc
) that would disable the C compilation, which might allow this to work. But there's no way formagic-wormhole
to askcurve25519-dalek
to askclear_on_drop
to use that feature.So I think what I'm asking for is some
curve25519-dalek
feature that would then modify itsclear_on_drop
dependency's features to avoid this C compile. Then I could add a similar feature tospake2
that affects its dependency uponcurve25519-dalek
, and then again withmagic-wormhole
affecting its dependency uponspake2
to pass the request along.Does that make sense? It sounds like a lot of work spread over many crates, and I have to imagine that every "feature" added to a Cargo.toml is a long-lived maintenance burden, so I don't really want to make a high-cost feature request for a fringe use case. And clear-on-drop is obviously the right thing to be doing, I don't want to see it become harder to achieve that security property. Is there a better way that people deal with this cross-crate feature handling?
For magic-wormhole's own clear-the-old-secrets purposes, I'm considering the
zeroize
crate, which I think is pure-Rust. But I don't really know what the tradeoffs are; I have to imagineclear_on_drop
is more reliable or more thorough when it can use lower-level tools.The text was updated successfully, but these errors were encountered: