summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/device_proto.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/device_proto.h b/include/device_proto.h
index b557384..c126acd 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -352,12 +352,6 @@ namespace nitrokey {
clear_packet(outp);
- if (!resp.isCRCcorrect())
- LOGD(std::string("Accepting response from device with invalid CRC. ")
- + "Command ID: " + std::to_string(resp.command_id) + " " +
- commandid_to_string(static_cast<CommandID>(resp.command_id))
- );
-
if (status <= 0) {
dev->m_counters.receiving_error++;
@@ -398,6 +392,14 @@ namespace nitrokey {
dev->m_counters.successful_storage_commands++;
}
+ if (!resp.isCRCcorrect())
+ LOG(std::string("Accepting response from device with invalid CRC. ")
+ + "Command ID: " + std::to_string(resp.command_id) + " " +
+ commandid_to_string(static_cast<CommandID>(resp.command_id)) + " "
+ + "Reported and calculated: " + std::to_string(resp.crc) + "!=" + std::to_string(resp.calculate_CRC()),
+ Loglevel::WARNING
+ );
+
// See: DeviceResponse
return resp;
}