Skip to content

Commit

Permalink
fixup build after openmls#1548
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Apr 9, 2024
1 parent 639349a commit 1ad514a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,18 @@ jobs:
- name: Build
if: ${{ matrix.arch != 'wasm32-unknown-unknown' }}
run: cargo build $TEST_MODE --verbose --target ${{ matrix.arch }} -p openmls

# Check feature powerset
check:
strategy:
fail-fast: false

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack

- name: Cargo hack
run: cargo hack check --feature-powerset --no-dev-deps --verbose -p openmls
15 changes: 9 additions & 6 deletions openmls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ openmls_basic_credential = { version = "0.2.0", path = "../basic_credential", op
] }
rstest = { version = "^0.16", optional = true }
rstest_reuse = { version = "0.4", optional = true }
wasm-bindgen-test = {version = "0.3.40", optional = true}
getrandom = {version = "0.2.12", optional = true, features = [ "js" ]}
fluvio-wasm-timer = {version = "0.2.5", optional = true}
wasm-bindgen-test = { version = "0.3.40", optional = true }
getrandom = { version = "0.2.12", optional = true, features = ["js"] }
fluvio-wasm-timer = { version = "0.2.5", optional = true }

[features]
default = ["backtrace"]
Expand All @@ -48,14 +48,17 @@ test-utils = [
"dep:wasm-bindgen-test",
"dep:openmls_basic_credential",
]
libcrux-provider = ["dep:openmls_libcrux_crypto",]
libcrux-provider = ["dep:openmls_libcrux_crypto"]
crypto-debug = [] # ☣️ Enable logging of sensitive cryptographic information
content-debug = [] # ☣️ Enable logging of sensitive message content
js = ["dep:getrandom", "dep:fluvio-wasm-timer"] # enable js randomness source for provider
js = [
"dep:getrandom",
"dep:fluvio-wasm-timer",
] # enable js randomness source for provider

[dev-dependencies]
backtrace = "0.3"
criterion = {version = "^0.5", default-features = false} # need to disable default features for wasm
criterion = { version = "^0.5", default-features = false } # need to disable default features for wasm
hex = { version = "0.4", features = ["serde"] }
itertools = "0.10"
lazy_static = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion openmls/src/binary_tree/array_representation/treemath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl TreeNodeIndex {
}

/// Re-exported for testing.
#[cfg(any(feature = "test-utils", test))]
#[cfg(any(feature = "test-utils", feature = "crypto-debug", test))]
pub(crate) fn test_u32(&self) -> u32 {
self.u32()
}
Expand Down
7 changes: 3 additions & 4 deletions openmls/src/ciphersuite/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Debug for Secret {
let mut ds = f.debug_struct("Secret");

#[cfg(feature = "crypto-debug")]
ds.field("value", &self.value);
return ds.field("value", &self.value).finish();
#[cfg(not(feature = "crypto-debug"))]
ds.field("value", &"***").finish()
}
Expand Down Expand Up @@ -156,10 +156,9 @@ impl Secret {
) -> Result<Secret, CryptoError> {
log_crypto!(
trace,
"derive secret from {:x?} with label {} and {:?}",
"derive secret from {:x?} with label {}",
self.value,
label,
self.ciphersuite
label
);
self.kdf_expand_label(crypto, ciphersuite, label, &[], ciphersuite.hash_length())
}
Expand Down
5 changes: 4 additions & 1 deletion openmls/src/schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,10 @@ fn ciphertext_sample(ciphersuite: Ciphersuite, ciphertext: &[u8]) -> &[u8] {
/// A key that can be used to derive an `AeadKey` and an `AeadNonce`.
#[derive(Serialize, Deserialize)]
#[cfg_attr(test, derive(PartialEq))]
#[cfg_attr(any(feature = "test-utils", test), derive(Debug, Clone))]
#[cfg_attr(
any(feature = "test-utils", feature = "crypto-debug", test),
derive(Debug, Clone)
)]
pub(crate) struct SenderDataSecret {
secret: Secret,
}
Expand Down
2 changes: 1 addition & 1 deletion openmls/src/schedule/psk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ impl PskSecret {
&self.secret
}

#[cfg(any(feature = "test-utils", test))]
#[cfg(any(feature = "test-utils", feature = "crypto-debug", test))]
pub(crate) fn as_slice(&self) -> &[u8] {
self.secret.as_slice()
}
Expand Down

0 comments on commit 1ad514a

Please sign in to comment.