chore: update deps

This commit is contained in:
shimun 2023-12-17 13:53:14 +01:00
parent fb60987468
commit 93e8a33c0e
Signed by: shimun
GPG Key ID: E0420647856EA39E
5 changed files with 286 additions and 289 deletions

512
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ ring = "0.13.5"
failure = "0.1.5" failure = "0.1.5"
rpassword = "4.0.1" rpassword = "4.0.1"
structopt = "0.3.2" structopt = "0.3.2"
libcryptsetup-rs = "0.4.2" libcryptsetup-rs = "0.9.1"
serde_json = "1.0.51" serde_json = "1.0.51"
serde_derive = "1.0.116" serde_derive = "1.0.116"
serde = "1.0.116" serde = "1.0.116"
@ -31,7 +31,7 @@ hex = "0.3.2"
ring = "0.13.5" ring = "0.13.5"
failure = "0.1.5" failure = "0.1.5"
rpassword = "4.0.1" rpassword = "4.0.1"
libcryptsetup-rs = "0.4.1" libcryptsetup-rs = "0.9.1"
structopt = "0.3.2" structopt = "0.3.2"
[profile.release] [profile.release]

38
flake.lock generated
View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1639051343, "lastModified": 1698420672,
"narHash": "sha256-62qARP+5Q0GmudcpuQHJP3/yXIgmUVoHR4orD/+FAC4=", "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=",
"owner": "nmattia", "owner": "nmattia",
"repo": "naersk", "repo": "naersk",
"rev": "ebde51ec0eec82dc71eaca03bc24cf8eb44a3d74", "rev": "aeb58d5e8faead8980a807c840232697982d47b9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1638109994, "lastModified": 1701253981,
"narHash": "sha256-OpA37PTiPMIqoRJbufbl5rOLII7HeeGcA0yl7FoyCIE=", "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a284564b7f75ac4db73607db02076e8da9d42c9d", "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -41,13 +41,31 @@
"utils": "utils" "utils": "utils"
} }
}, },
"utils": { "systems": {
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1681028828,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -16,9 +16,9 @@
forPkgs = pkgs: forPkgs = pkgs:
let let
naersk-lib = naersk.lib."${pkgs.system}"; naersk-lib = naersk.lib."${pkgs.system}";
buildInputs = with pkgs; [ cryptsetup ]; buildInputs = with pkgs; [ cryptsetup cryptsetup.dev ];
LIBCLANG_PATH = "${pkgs.clang.cc.lib}/lib";
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
rustPlatform.bindgenHook
pkg-config pkg-config
clang clang
]; ];
@ -26,7 +26,7 @@
rec { rec {
# `nix build` # `nix build`
packages.${pname} = naersk-lib.buildPackage { packages.${pname} = naersk-lib.buildPackage {
inherit pname root buildInputs nativeBuildInputs LIBCLANG_PATH; inherit pname root buildInputs nativeBuildInputs;
}; };
defaultPackage = packages.${pname}; defaultPackage = packages.${pname};
@ -51,7 +51,7 @@
# `nix develop` # `nix develop`
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo rustfmt nixpkgs-fmt ] ++ nativeBuildInputs; nativeBuildInputs = with pkgs; [ rustc cargo rustfmt nixpkgs-fmt ] ++ nativeBuildInputs;
inherit buildInputs LIBCLANG_PATH; inherit buildInputs;
}; };
}; };
forSystem = system: forPkgs nixpkgs.legacyPackages."${system}"; forSystem = system: forPkgs nixpkgs.legacyPackages."${system}";

View File

@ -1,9 +1,8 @@
use crate::error::*; use crate::error::*;
use libcryptsetup_rs::{ use libcryptsetup_rs::consts::flags::CryptActivate;
CryptActivateFlag, CryptActivateFlags, CryptDevice, CryptInit, CryptTokenInfo, use libcryptsetup_rs::consts::vals::{EncryptionFormat, KeyslotInfo};
EncryptionFormat, KeyslotInfo, TokenInput, use libcryptsetup_rs::{CryptDevice, CryptInit, CryptTokenInfo, TokenInput};
};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::path::Path; use std::path::Path;
@ -204,7 +203,7 @@ impl LuksDevice {
None, None,
None, None,
old_secret, old_secret,
CryptActivateFlags::empty(), CryptActivate::empty(),
)?; )?;
// slot should stay the same but better be safe than sorry // slot should stay the same but better be safe than sorry
@ -240,9 +239,9 @@ impl LuksDevice {
dry_run: bool, dry_run: bool,
allow_discard: bool, allow_discard: bool,
) -> Fido2LuksResult<u32> { ) -> Fido2LuksResult<u32> {
let mut flags = CryptActivateFlags::empty(); let mut flags = CryptActivate::empty();
if allow_discard { if allow_discard {
flags = CryptActivateFlags::new(vec![CryptActivateFlag::AllowDiscards]); flags = flags | CryptActivate::ALLOW_DISCARDS;
} }
self.device self.device
.activate_handle() .activate_handle()