From a80c8683c2fdbb49cbb0702406d3ae78cb6da0eb Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Fri, 14 Jun 2024 21:32:43 +0200 Subject: [PATCH] [crypto-rustcrypto]: remove unused `custom` feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/no_std_build.yml | 2 +- mls-rs-crypto-rustcrypto/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/no_std_build.yml b/.github/workflows/no_std_build.yml index 2179ae12..d15afdd0 100644 --- a/.github/workflows/no_std_build.yml +++ b/.github/workflows/no_std_build.yml @@ -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 diff --git a/mls-rs-crypto-rustcrypto/Cargo.toml b/mls-rs-crypto-rustcrypto/Cargo.toml index a3672aa3..f636c53b 100644 --- a/mls-rs-crypto-rustcrypto/Cargo.toml +++ b/mls-rs-crypto-rustcrypto/Cargo.toml @@ -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