aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-04-08 20:24:27 -0700
committerDaniel Mueller <deso@posteo.net>2017-04-08 20:24:27 -0700
commitc441df2c153c811af19f37bdfdc45a13c36e8f14 (patch)
tree68c441e0cdf97a0154812df7397e87d044f526fb
parentf1fe434d1487fad624b0574955c3af0cfd75e674 (diff)
downloadnitrocli-c441df2c153c811af19f37bdfdc45a13c36e8f14.tar.gz
nitrocli-c441df2c153c811af19f37bdfdc45a13c36e8f14.tar.bz2
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.
-rw-r--r--nitrocli/src/nitrokey.rs6
1 files changed, 5 insertions, 1 deletions
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<P> Report<P>
}
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;
}
}