Files
Josh Holtrop 54cb1d8d38 Rust wrapper: ensure memory safety for C RNG struct
- store pointer to WC_RNG instead of full struct
- enforce RNG is not dropped before consumer structs

The C library stores a pointer via the set_rng() methods on a few
structs (e.g. RSA). This change holds a reference (or instance) of RNG
within the consumer structs to ensure it is kept alive if set_rng (or
now set_shared_rng) is used.
2026-05-18 12:27:44 -07:00

21 lines
464 B
Makefile

FEATURES := alloc,rand_core,aead,cipher,digest,mac,signature,password-hash,kem
CARGO_FEATURE_FLAGS := --features $(FEATURES)
.PHONY: all
all:
cargo build $(CARGO_FEATURE_FLAGS)
cargo clippy $(CARGO_FEATURE_FLAGS)
cargo doc $(CARGO_FEATURE_FLAGS)
.PHONY: test
test:
cargo test $(CARGO_FEATURE_FLAGS) -- --test-threads=1
.PHONY: testfips
testfips:
cargo test $(CARGO_FEATURE_FLAGS) --lib --bins --tests -- --test-threads=1
.PHONY: clean
clean:
cargo clean