aboutsummaryrefslogtreecommitdiff
path: root/nitrocli
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-08-17 14:46:06 +0200
committerDaniel Mueller <deso@posteo.net>2017-08-17 14:46:06 +0200
commit57c002a84bf14f9ca964c541714c1874dfc2ca69 (patch)
tree7a2341d8f31965160a5d4ee2224e68d86cfd9c00 /nitrocli
parent8d4a7d0ec9c3a82c7546482875be80827e2be57a (diff)
downloadnitrocli-57c002a84bf14f9ca964c541714c1874dfc2ca69.tar.gz
nitrocli-57c002a84bf14f9ca964c541714c1874dfc2ca69.tar.bz2
Remove workaround for incorrect CRC reporting
In the past the Nitrokey Storage device reported wrong CRC values for certain commands, e.g., the closing of an encrypted volume. This problem was tracked by issue 32: Nitrokey/nitrokey-storage-firmware#32 Firmware version 0.47 includes a fix for the problem. With this change we remove the workaround for the incorrect CRC from nitrocli. By doing so, we require the Nitrokey Storage to be running firmware 0.47 or higher to be properly usable.
Diffstat (limited to 'nitrocli')
-rw-r--r--nitrocli/README.md10
-rw-r--r--nitrocli/src/nitrokey.rs6
2 files changed, 10 insertions, 6 deletions
diff --git a/nitrocli/README.md b/nitrocli/README.md
index 4e41c80..bcb47df 100644
--- a/nitrocli/README.md
+++ b/nitrocli/README.md
@@ -10,6 +10,14 @@ The following commands are currently supported:
- status: Report status information about the Nitrokey.
- clear: Remove the user PIN from gpg-agent's cache.
+### *Note:*
+----------------------------------------------------------------------
+> **nitrocli** requires the Nitrokey Storage to be running **firmware
+> version 0.47** or higher. Versions before that reported incorrect
+> checksums which will cause the program to indicate data retrieval
+> errors, causing commands to fail.
+----------------------------------------------------------------------
+
Usage
-----
@@ -23,7 +31,7 @@ $ nitrocli open
$ nitrocli status
Status:
SD card ID: 0xdeadbeef
- firmware version: 0.44
+ firmware version: 0.47
firmware: unlocked
storage keys: created
user retry count: 3
diff --git a/nitrocli/src/nitrokey.rs b/nitrocli/src/nitrokey.rs
index 2691c01..f8995eb 100644
--- a/nitrocli/src/nitrokey.rs
+++ b/nitrocli/src/nitrokey.rs
@@ -78,11 +78,7 @@ impl<P> Report<P>
}
pub fn is_valid(&self) -> bool {
- // TODO: Certain commands return a wrong CRC code that does not
- // match the actual report content. For now we defuse the
- // check but that cannot stay.
- // return self.crc == crc(self.data.as_ref());
- return self.crc != 0;
+ return self.crc == crc(self.data.as_ref());
}
}