diff options
author | Robin Krahl <me@robin-krahl.de> | 2018-12-12 15:59:30 +0000 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2018-12-17 07:52:14 -0800 |
commit | 5116ac035a5ea5994ffadb8a497531fd1f3f4f3b (patch) | |
tree | 63c5eb96c22fbda314e83aa8e587ec393003172e | |
parent | 44f6100b36eecf79c1e8484a048ea49cad6e488d (diff) | |
download | nitrocli-5116ac035a5ea5994ffadb8a497531fd1f3f4f3b.tar.gz nitrocli-5116ac035a5ea5994ffadb8a497531fd1f3f4f3b.tar.bz2 |
Rename libnitrokey to nitrokey
Currently, the nitrokey crate is renamed to libnitrokey in Cargo.toml as
there used to exist a nitrokey module in this crate. As this module
does no longer exist and is not likely to return, this patch removes the
customized name for the nitrokey crate.
-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; |