summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-29 12:25:33 +0100
committerDaniel Mueller <deso@posteo.net>2020-01-29 12:25:33 +0100
commitbab33d84078a0ff2eb3d55ef39ea382b797abc92 (patch)
tree15d42b78c84904de881c5eb72c813aab160116fd
parentb6212b6e1209f30a523f4c405a9e9607bfe7bb16 (diff)
downloadnitrocli-bab33d84078a0ff2eb3d55ef39ea382b797abc92.tar.gz
nitrocli-bab33d84078a0ff2eb3d55ef39ea382b797abc92.tar.bz2
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.
-rw-r--r--CHANGELOG.md2
-rw-r--r--Cargo.lock6
-rw-r--r--Cargo.toml2
-rw-r--r--src/commands.rs6
-rw-r--r--src/pinentry.rs4
5 files changed, 10 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48f0c1b..a0075b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ Unreleased
- Made the `--verbose` and `--model` options global
- Removed vendored dependencies and moved source code into repository
root
-- Bumped `nitrokey` dependency to `0.5.1`
+- Bumped `nitrokey` dependency to `0.6.0`
0.3.1
diff --git a/Cargo.lock b/Cargo.lock
index dac3e54..a43499f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -77,7 +77,7 @@ version = "0.3.1"
dependencies = [
"base32 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
- "nitrokey 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "nitrokey 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"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)",
@@ -86,7 +86,7 @@ dependencies = [
[[package]]
name = "nitrokey"
-version = "0.5.1"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -277,7 +277,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
-"checksum nitrokey 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dcec8a996394226fd4d441bf41a0e9f0cbd2a540ff1dcf16e5d4d813bbea39cb"
+"checksum nitrokey 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1587c61144935958f74fb9111c9a369a23a2e5ad39476bde1750b7b8c0c87ac0"
"checksum nitrokey-sys 3.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71c6052aeb37309317d25c8fec2801f271b96c5a15656f2573d8e78ba4124c49"
"checksum nitrokey-test 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f3da0c2cedaa512f79fbc3ed45143a52c76c5edcca88d0823b967ff11d05fe37"
"checksum nitrokey-test-state 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a59b732ed6d5212424ed31ec9649f05652bcbc38f45f2292b27a6044e7098803"
diff --git a/Cargo.toml b/Cargo.toml
index 68dbeaa..4ad53eb 100644
--- a/Cargo.toml
+++ b/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/src/commands.rs b/src/commands.rs
index e361509..08dad04 100644
--- a/src/commands.rs
+++ b/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/src/pinentry.rs b/src/pinentry.rs
index fd47657..af2b4dc 100644
--- a/src/pinentry.rs
+++ b/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 {