From 51d0fbb73eb42325fb2a0832810fd9e1d4339743 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 29 Jan 2020 12:25:33 +0100 Subject: Update nitrokey dependency to 0.6.0 nitrokey 0.6.0 introduced the SerialNumber struct (instead of representing serial numbers as strings). We no longer have to manually format the serial number as SerialNumber implements Display. Import subrepo nitrokey/:nitrokey at 2a8ce725407f32db5ad61c37475719737c9b5c9c --- nitrocli/CHANGELOG.md | 2 +- nitrocli/Cargo.lock | 4 ++-- nitrocli/Cargo.toml | 2 +- nitrocli/src/commands.rs | 6 +++--- nitrocli/src/pinentry.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'nitrocli') diff --git a/nitrocli/CHANGELOG.md b/nitrocli/CHANGELOG.md index 02812e0..0204e6d 100644 --- a/nitrocli/CHANGELOG.md +++ b/nitrocli/CHANGELOG.md @@ -6,7 +6,7 @@ Unreleased - Replaced `argparse` with `structopt` - Removed the `argparse` dependency - Made the --verbose and --model options global -- Bumped `nitrokey` dependency to `0.5.1` +- Bumped `nitrokey` dependency to `0.6.0` 0.3.1 diff --git a/nitrocli/Cargo.lock b/nitrocli/Cargo.lock index 5f9eacf..550da4a 100644 --- a/nitrocli/Cargo.lock +++ b/nitrocli/Cargo.lock @@ -68,7 +68,7 @@ version = "0.3.1" dependencies = [ "base32 0.4.0", "libc 0.2.66", - "nitrokey 0.5.1", + "nitrokey 0.6.0", "nitrokey-test 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "nitrokey-test-state 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -77,7 +77,7 @@ dependencies = [ [[package]] name = "nitrokey" -version = "0.5.1" +version = "0.6.0" dependencies = [ "lazy_static 1.4.0", "libc 0.2.66", diff --git a/nitrocli/Cargo.toml b/nitrocli/Cargo.toml index b69a2bb..d1d7ae2 100644 --- a/nitrocli/Cargo.toml +++ b/nitrocli/Cargo.toml @@ -49,7 +49,7 @@ version = "0.4.0" version = "0.2" [dependencies.nitrokey] -version = "0.5.1" +version = "0.6" [dependencies.structopt] version = "0.3.7" diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs index e361509..08dad04 100644 --- a/nitrocli/src/commands.rs +++ b/nitrocli/src/commands.rs @@ -343,7 +343,7 @@ fn print_status( ctx, r#"Status: model: {model} - serial number: 0x{id} + serial number: {id} firmware version: {fwv} user retry count: {urc} admin retry count: {arc}"#, @@ -393,7 +393,7 @@ pub fn list(ctx: &mut args::ExecCtx<'_>, no_connect: bool) -> Result<()> { .map(|m| m.to_string()) .unwrap_or_else(|| "unknown".into()); let serial_number = match device_info.serial_number { - Some(serial_number) => format!("0x{}", serial_number), + Some(serial_number) => serial_number.to_string(), None => { // Storage devices do not have the serial number present in // the device information. We have to connect to them to @@ -402,7 +402,7 @@ pub fn list(ctx: &mut args::ExecCtx<'_>, no_connect: bool) -> Result<()> { "N/A".to_string() } else { let device = manager.connect_path(device_info.path.clone())?; - format!("0x{}", device.get_serial_number()?) + device.get_serial_number()?.to_string() } } }; diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs index fd47657..af2b4dc 100644 --- a/nitrocli/src/pinentry.rs +++ b/nitrocli/src/pinentry.rs @@ -54,7 +54,7 @@ pub trait SecretEntry: fmt::Debug { pub struct PinEntry { pin_type: PinType, model: nitrokey::Model, - serial: String, + serial: nitrokey::SerialNumber, } impl PinEntry { @@ -127,7 +127,7 @@ impl SecretEntry for PinEntry { #[derive(Debug)] pub struct PwdEntry { model: nitrokey::Model, - serial: String, + serial: nitrokey::SerialNumber, } impl PwdEntry { -- cgit v1.2.1