Skip to content

Commit

Permalink
[crypto-rustcrypto]: remove unused custom feature (#161)
Browse files Browse the repository at this point in the history
The `custom` feature from `getrandom` is not actually used in normal
builds — infact, `getrandom` itself is never used directly.

However, the feature can be used by a binary on an embedded platform
to register a custom random number generator. The final binary should
enable the `custom` feature to do this, see the
`register_custem_genrandom!` macro for more details:

  https://docs.rs/getrandom/latest/getrandom/macro.register_custom_getrandom.html

We emulate this in the CI build by enabling the feature on the command
line.

Co-authored-by: mulmarta <103590845+mulmarta@users.noreply.github.com>
  • Loading branch information
mgeisler and mulmarta authored Sep 19, 2024
1 parent b3f2ed4 commit cb5b9e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/no_std_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Build MLS Embedded Full RFC Compliance
run: cargo +nightly build --package mls-rs --lib --no-default-features --features rfc_compliant --target thumbv6m-none-eabi
- name: Build rust crypto embedded
run: cargo +nightly build --package mls-rs-crypto-rustcrypto --no-default-features --target thumbv6m-none-eabi
run: cargo +nightly build --package mls-rs-crypto-rustcrypto --no-default-features --features "getrandom/custom" --target thumbv6m-none-eabi
2 changes: 1 addition & 1 deletion mls-rs-crypto-rustcrypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ thiserror = { version = "1.0.40", optional = true }
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }

# Random
getrandom = { version = "0.2", default-features = false, features = ["custom"] }
getrandom = { version = "0.2", default-features = false, optional = true }
rand_core = { version = "0.6", default-features = false, features = ["alloc"] }

# AEAD
Expand Down

0 comments on commit cb5b9e9

Please sign in to comment.