Skip to content

Commit

Permalink
Merge pull request #3490 from mulkieran/version-3.6.1
Browse files Browse the repository at this point in the history
Version 3.6.1
  • Loading branch information
mulkieran committed Oct 31, 2023
2 parents a15210e + db3a791 commit 6aa3b29
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
14 changes: 14 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
stratisd 3.6.1
==============
Recommended Rust toolchain version: 1.73.0
Recommended development platform for Python development: Fedora 38

- Cherry-picked commits:
* Regression test for CryptHandle unlocking with both keyring and Clevis
* Fix bug where Clevis and keyring implementations are enabled together
* Run "cargo update --package=rustix --precise=0.37.25"

- Set up patch branch:
https://github.com/stratis-storage/stratisd/pull/3487


stratisd 3.6.0
==============
Recommended Rust toolchain version: 1.73.0
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stratisd"
version = "3.6.0"
version = "3.6.1"
authors = ["Stratis Developers <stratis-devel@lists.fedorahosted.org>"]
edition = "2021"
rust-version = "1.71.1" # LOWEST SUPPORTED RUST TOOLCHAIN
Expand Down
10 changes: 9 additions & 1 deletion src/engine/strat_engine/backstore/crypt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,17 @@ mod tests {
.token_handle()
.json_get(CLEVIS_LUKS_TOKEN_ID)
.unwrap();
handle.deactivate().unwrap();
}

fn unlock_clevis(paths: &[&Path]) {
let path = paths.get(0).copied().expect("Expected exactly one path");
CryptHandle::setup(path, Some(UnlockMethod::Clevis))
.unwrap()
.unwrap();
}

crypt::insert_and_cleanup_key(paths, both_initialize);
crypt::insert_and_remove_key(paths, both_initialize, unlock_clevis);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/backstore/crypt/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ pub fn activate(
unlock_method: UnlockMethod,
name: &DmName,
) -> StratisResult<()> {
if let Some(kd) = key_desc {
if let (Some(kd), UnlockMethod::Keyring) = (key_desc, unlock_method) {
let key_description_missing = keys::search_key_persistent(kd)
.map_err(|_| {
StratisError::Msg(format!(
Expand Down
23 changes: 23 additions & 0 deletions src/engine/strat_engine/tests/crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ where
}
}

/// Takes physical device paths from loopback or real tests and passes
/// them through to a compatible test definition. This harness runs two test
/// methods, one with a key description set and one after the key description
/// used in the previous test has been unset. This can be helpful for testing cases
/// where a key description is missing but Clevis is enabled.
pub fn insert_and_remove_key<F1, F2>(physical_paths: &[&Path], test_pre: F1, test_post: F2)
where
F1: FnOnce(&[&Path], &KeyDescription) + UnwindSafe,
F2: FnOnce(&[&Path]),
{
let key_description = set_up_key("test-description-for-stratisd");

let result = catch_unwind(|| test_pre(physical_paths, &key_description));

StratKeyActions.unset(&key_description).unwrap();

if let Err(e) = result {
resume_unwind(e)
}

test_post(physical_paths)
}

/// Takes physical device paths from loopback or real tests and passes
/// them through to a compatible test definition. This method
/// will also enrich the context passed to the test with two different key
Expand Down

0 comments on commit 6aa3b29

Please sign in to comment.