aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/nitrokey.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-04-09 19:36:35 -0700
committerDaniel Mueller <deso@posteo.net>2017-04-09 19:36:35 -0700
commitf94d04578f44fc79212550203838f7c78e1ac414 (patch)
tree903bdcdd5edde580a557509ec55acfd1a5edad0f /nitrocli/src/nitrokey.rs
parentc441df2c153c811af19f37bdfdc45a13c36e8f14 (diff)
downloadnitrocli-f94d04578f44fc79212550203838f7c78e1ac414.tar.gz
nitrocli-f94d04578f44fc79212550203838f7c78e1ac414.tar.bz2
Add 'status' command
The nitrokey supports a status command that instructs it to report details about itself. This data includes general useful information such as the current version of the firmware being installed along with more contextual bits such as the number of remaining retries for the user and admin PINs or whether the different volumes (unencrypted, encrypted, hidden) are writable. This change introduces the 'status' command line option that can be used to retrieve this information from the nitrokey and to display it.
Diffstat (limited to 'nitrocli/src/nitrokey.rs')
-rw-r--r--nitrocli/src/nitrokey.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/nitrocli/src/nitrokey.rs b/nitrocli/src/nitrokey.rs
index d5e21be..d1d6c72 100644
--- a/nitrocli/src/nitrokey.rs
+++ b/nitrocli/src/nitrokey.rs
@@ -30,6 +30,11 @@ pub const PID: u16 = 0x4109;
// Magic number identifying a storage response.
pub const MAGIC_NUMBER_STICK20_CONFIG: u16 = 0x3318;
+// Flags indicating whether the respective volume is active or not.
+pub const VOLUME_ACTIVE_UNENCRYPTED: u8 = 0b001;
+pub const VOLUME_ACTIVE_ENCRYPTED: u8 = 0b010;
+pub const VOLUME_ACTIVE_HIDDEN: u8 = 0b100;
+
#[derive(Debug)]
#[derive(PartialEq)]