cesarb / clear_on_drop

Helpers for clearing sensitive data on the stack and heap
Apache License 2.0
54 stars 13 forks source link

no_std support appears to be broken #20

Open isislovecruft opened 5 years ago

isislovecruft commented 5 years ago
∃!isisⒶwintermute:~/code/rust ∴ git clone https://github.com/cesarb/clear_on_drop
Cloning into 'clear_on_drop'...
remote: Enumerating objects: 397, done.
remote: Total 397 (delta 0), reused 0 (delta 0), pack-reused 397
Receiving objects: 100% (397/397), 659.54 KiB | 672.00 KiB/s, done.
Resolving deltas: 100% (225/225), done.
∃!isisⒶwintermute:~/code/rust ∴ cd clear_on_drop/
∃!isisⒶwintermute:(master=)~/code/rust/clear_on_drop ∴ xargo build --no-default-features --target thumbv7em-none-eabi
    Updating crates.io index
   Compiling cc v1.0.35
   Compiling clear_on_drop v0.2.3 (/home/isis/code/rust/clear_on_drop)
error: failed to run custom build command for `clear_on_drop v0.2.3 (/home/isis/code/rust/clear_on_drop)`
process didn't exit successfully: `/home/isis/code/rust/clear_on_drop/target/debug/build/clear_on_drop-ed653599a53b5584/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("thumbv7em-none-eabi")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
CC_thumbv7em-none-eabi = None
CC_thumbv7em_none_eabi = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_thumbv7em-none-eabi = None
CFLAGS_thumbv7em_none_eabi = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("dsp,mclass,v5te,v6,v6k,v6t2,v7")
running: "arm-none-eabi-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-mthumb" "-march=armv7e-m" "-Wall" "-Wextra" "-o" "/home/isis/code/rust/clear_on_drop/target/thumbv7em-none-eabi/debug/build/clear_on_drop-1204178289c534f9/out/src/hide.o" "-c" "src/hide.c"

--- stderr
thread 'main' panicked at '

Internal error occurred: Failed to find tool. Is `arm-none-eabi-gcc` installed?

', /home/isis/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.35/src/lib.rs:2398:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

∃!isisⒶwintermute:(master=)~/code/rust/clear_on_drop ∴ 
fubuloubu commented 5 years ago

@isislovecruft I'm having this issue to, did you have a workaround?

burdges commented 5 years ago

Just use zeroize instead: https://github.com/iqlusioninc/crates/tree/develop/zeroize

If your dependencies do not implement zeroize then you can impl Zeroize yourself by copying and calling this zeroize_hack fn: https://github.com/w3f/schnorrkel/blob/master/src/lib.rs#L225

cesarb commented 5 years ago

According to the error message, the issue is that the C compiler (in this case, arm-none-eabi-gcc) could not be found. That is not something which could be fixed by this crate.