From 57c002a84bf14f9ca964c541714c1874dfc2ca69 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Thu, 17 Aug 2017 14:46:06 +0200 Subject: 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. --- nitrocli/README.md | 10 +++++++++- nitrocli/src/nitrokey.rs | 6 +----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'nitrocli') 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

Report

} 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()); } } -- cgit v1.2.1