diff --git a/Cargo.lock b/Cargo.lock
index cec174be3a..e0fa574737 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -785,8 +785,7 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "libcryptsetup-rs"
version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99a61d3782d841dca88244f582cfd95d96da9d175fb06616d50a480058647e39"
+source = "git+https://github.com/jbaublitz/libcryptsetup-rs?branch=reencrypt-fixes#7b1e96c9f95d85ee4fc693d3ab58b7e8e2d5a5c2"
dependencies = [
"bitflags 2.4.0",
"either",
@@ -803,8 +802,7 @@ dependencies = [
[[package]]
name = "libcryptsetup-rs-sys"
version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c78b397341cb9aa5ddc8d11118754ed0eab4aeb9cee96ee7cbe83a7d2867b8d2"
+source = "git+https://github.com/jbaublitz/libcryptsetup-rs?branch=reencrypt-fixes#7b1e96c9f95d85ee4fc693d3ab58b7e8e2d5a5c2"
dependencies = [
"bindgen",
"cc",
diff --git a/Cargo.toml b/Cargo.toml
index 973e494e3d..d7e3aa20cc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -145,10 +145,14 @@ optional = true
version = "0.9.3"
features = ["mutex"]
optional = true
+git = "https://github.com/jbaublitz/libcryptsetup-rs"
+branch = "reencrypt-fixes"
[dependencies.libcryptsetup-rs-sys]
version = "0.4.0"
optional = true
+git = "https://github.com/jbaublitz/libcryptsetup-rs"
+branch = "reencrypt-fixes"
[dependencies.libmount]
version = "0.1.9"
diff --git a/src/engine/strat_engine/crypt/handle/v1.rs b/src/engine/strat_engine/crypt/handle/v1.rs
index b31a716223..a667d1d0ff 100644
--- a/src/engine/strat_engine/crypt/handle/v1.rs
+++ b/src/engine/strat_engine/crypt/handle/v1.rs
@@ -31,7 +31,7 @@ use crate::{
engine::MAX_STRATIS_PASS_SIZE,
strat_engine::{
backstore::get_devno_from_path,
- cmd::{clevis_decrypt, clevis_luks_bind, clevis_luks_regen, clevis_luks_unbind},
+ cmd::{clevis_luks_bind, clevis_luks_regen, clevis_luks_unbind},
crypt::{
consts::{
CLEVIS_LUKS_TOKEN_ID, DEFAULT_CRYPT_KEYSLOTS_SIZE, DEFAULT_CRYPT_METADATA_SIZE,
@@ -42,8 +42,8 @@ use crate::{
},
shared::{
acquire_crypt_device, activate, add_keyring_keyslot, check_luks2_token,
- clevis_info_from_metadata, device_from_physical_path, ensure_inactive,
- ensure_wiped, get_keyslot_number, interpret_clevis_config,
+ clevis_decrypt, clevis_info_from_metadata, device_from_physical_path,
+ ensure_inactive, ensure_wiped, get_keyslot_number, interpret_clevis_config,
key_desc_from_metadata, luks2_token_type_is_valid, read_key, wipe_fallback,
},
},
@@ -956,7 +956,7 @@ impl CryptHandle {
/// Add a keyring binding to the underlying LUKS2 volume.
pub fn bind_keyring(&mut self, key_desc: &KeyDescription) -> StratisResult<()> {
let mut device = self.acquire_crypt_device()?;
- let key = Self::clevis_decrypt(&mut device)?.ok_or_else(|| {
+ let key = clevis_decrypt(&mut device)?.ok_or_else(|| {
StratisError::Msg(
"The Clevis token appears to have been wiped outside of \
Stratis; cannot add a keyring key binding without an existing \
@@ -1030,24 +1030,6 @@ impl CryptHandle {
replace_pool_name(&mut device, pool_name)
}
- /// Decrypt a Clevis passphrase and return it securely.
- fn clevis_decrypt(device: &mut CryptDevice) -> StratisResult