Skip to content

Commit

Permalink
Update nitrokey dependency to 0.6.0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robinkrahl authored and d-e-s-o committed Jan 29, 2020
1 parent b6212b6 commit bab33d8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"#,
Expand Down Expand Up @@ -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
Expand All @@ -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()
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/pinentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -127,7 +127,7 @@ impl SecretEntry for PinEntry {
#[derive(Debug)]
pub struct PwdEntry {
model: nitrokey::Model,
serial: String,
serial: nitrokey::SerialNumber,
}

impl PwdEntry {
Expand Down

0 comments on commit bab33d8

Please sign in to comment.