diff options
-rw-r--r-- | nitrocli/Cargo.toml | 3 | ||||
-rw-r--r-- | nitrocli/src/main.rs | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/nitrocli/Cargo.toml b/nitrocli/Cargo.toml index 8d1519a..895043b 100644 --- a/nitrocli/Cargo.toml +++ b/nitrocli/Cargo.toml @@ -32,10 +32,9 @@ description = """ A command line tool for interacting with the Nitrokey Storage device. """ -[dependencies.libnitrokey] +[dependencies.nitrokey] version = "0.2.1" path = "../nitrokey" -package = "nitrokey" [replace] diff --git a/nitrocli/src/main.rs b/nitrocli/src/main.rs index 5ec68a2..8a8405a 100644 --- a/nitrocli/src/main.rs +++ b/nitrocli/src/main.rs @@ -74,7 +74,7 @@ mod pinentry; use std::process; use std::result; -use libnitrokey; +use nitrokey; use crate::error::Error; @@ -84,19 +84,19 @@ const PIN_TYPE: pinentry::PinType = pinentry::PinType::User; /// Create an `error::Error` with an error message of the format `msg: err`. -fn get_error(msg: &str, err: &libnitrokey::CommandError) -> Error { +fn get_error(msg: &str, err: &nitrokey::CommandError) -> Error { Error::Error(format!("{}: {:?}", msg, err)) } /// Connect to a Nitrokey Storage device and return it. -fn get_storage_device() -> Result<libnitrokey::Storage> { - libnitrokey::Storage::connect() +fn get_storage_device() -> Result<nitrokey::Storage> { + nitrokey::Storage::connect() .or_else(|_| Err(Error::Error("Nitrokey device not found".to_string()))) } /// Return a string representation of the given volume status. -fn get_volume_status(status: &libnitrokey::VolumeStatus) -> &'static str { +fn get_volume_status(status: &nitrokey::VolumeStatus) -> &'static str { if status.active { if status.read_only { "read-only" @@ -110,7 +110,7 @@ fn get_volume_status(status: &libnitrokey::VolumeStatus) -> &'static str { /// Pretty print the response of a status command. -fn print_status(status: &libnitrokey::StorageStatus) { +fn print_status(status: &nitrokey::StorageStatus) { println!("Status:"); // We omit displaying information about the smartcard here as this // program really is only about the SD card portion of the device. @@ -164,7 +164,7 @@ fn open() -> Result<()> { match device.enable_encrypted_volume(&passphrase) { Ok(()) => return Ok(()), Err(err) => match err { - libnitrokey::CommandError::WrongPassword => { + nitrokey::CommandError::WrongPassword => { pinentry::clear_passphrase(PIN_TYPE)?; retry -= 1; |