aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
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.
Diffstat (limited to 'src')
-rw-r--r--src/commands.rs6
-rw-r--r--src/pinentry.rs4
2 files changed, 5 insertions, 5 deletions
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 {