Compare commits

..

3 Commits
0.2.5 ... luks2

Author SHA1 Message Date
f6de4a033e more detailed messages 2020-03-27 18:28:33 +01:00
f5880346b9 switch to libcryptsetup-rs 2020-03-27 18:09:38 +01:00
6089b254b4 switch to libcryptsetup-rs for luks2 support 2020-03-22 17:39:44 +01:00
4 changed files with 9 additions and 8 deletions

8
Cargo.lock generated
View File

@@ -158,7 +158,7 @@ dependencies = [
[[package]]
name = "ctap_hmac"
version = "0.2.2"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -214,9 +214,9 @@ dependencies = [
[[package]]
name = "fido2luks"
version = "0.2.5"
version = "0.2.4"
dependencies = [
"ctap_hmac 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ctap_hmac 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libcryptsetup-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -854,7 +854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
"checksum ctap_hmac 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0fbb287d2cf549cc10030bd3c1884b13dab6691174e2c6c8badde97110a98b1c"
"checksum ctap_hmac 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d57004228e303ed0d161f081020240d969ce18b623c3f4503645e1a06b42ae7"
"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
"checksum failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b"

View File

@@ -1,6 +1,6 @@
[package]
name = "fido2luks"
version = "0.2.5"
version = "0.2.4"
authors = ["shimunn <shimun@shimun.net>"]
edition = "2018"
@@ -14,7 +14,7 @@ categories = ["command-line-utilities"]
license-file = "LICENSE"
[dependencies]
ctap_hmac = "0.2.2"
ctap_hmac = "0.2.1"
hex = "0.3.2"

View File

@@ -46,10 +46,10 @@ pub fn add_key<P: AsRef<Path>>(
pub fn remove_keyslots<P: AsRef<Path>>(path: P, exclude: &[u32]) -> Fido2LuksResult<u32> {
let mut device = load_device_handle(path)?;
let mut slot = 0;
let mut handle;
let mut destroyed = 0;
//TODO: detect how many keyslots there are instead of trying within a given range
for slot in 0..1024 {
loop {
handle = device.keyslot_handle(Some(slot));
match handle.status()? {
KeyslotInfo::Inactive => continue,
@@ -63,6 +63,7 @@ pub fn remove_keyslots<P: AsRef<Path>>(path: P, exclude: &[u32]) -> Fido2LuksRes
KeyslotInfo::ActiveLast => break,
_ => (),
}
slot += 1;
}
Ok(destroyed)
}

0
src/setup.rs Normal file
View File