From c441df2c153c811af19f37bdfdc45a13c36e8f14 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 8 Apr 2017 20:24:27 -0700 Subject: Do not check CRC The nitrokey embeds a wrong CRC code into the response for certain commands. When closing the encrypted volume, for example, the CRC code never matches the actual report data. This problem is tracked by issue 32: https://github.com/Nitrokey/nitrokey-storage-firmware/issues/32 To work around this problem for now we unfortunately have to ignore the result of the CRC check. This change adjusts the code to do that. --- nitrocli/src/nitrokey.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nitrocli') diff --git a/nitrocli/src/nitrokey.rs b/nitrocli/src/nitrokey.rs index 87283c0..d5e21be 100644 --- a/nitrocli/src/nitrokey.rs +++ b/nitrocli/src/nitrokey.rs @@ -73,7 +73,11 @@ impl

Report

} pub fn is_valid(&self) -> bool { - return self.crc == crc(self.data.as_ref()); + // 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; } } -- cgit v1.2.1