diff options
| author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-05-13 15:54:00 +0200 | 
|---|---|---|
| committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-05-13 15:54:00 +0200 | 
| commit | 06c0deb7935a9390a67bc02d6c323e64c785a026 (patch) | |
| tree | c8343c0e1d504b2ae7d1ff5a727084f78a015f7e /include/device_proto.h | |
| parent | be0d677aa2e7eb87a309dc3927c0917380892641 (diff) | |
| parent | 3b5f40a19ca6c6fde55fcdab4ff0a9f91a46a051 (diff) | |
| download | libnitrokey-06c0deb7935a9390a67bc02d6c323e64c785a026.tar.gz libnitrokey-06c0deb7935a9390a67bc02d6c323e64c785a026.tar.bz2  | |
Merge branch 'do_not_log_volatile_data'
Diffstat (limited to 'include/device_proto.h')
| -rw-r--r-- | include/device_proto.h | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/include/device_proto.h b/include/device_proto.h index 964c2d9..b557384 100644 --- a/include/device_proto.h +++ b/include/device_proto.h @@ -236,6 +236,7 @@ namespace nitrokey {                outp.payload = payload;                outp.update_CRC(); +              LOG("-------------------", Loglevel::DEBUG);                LOG("Outgoing HID packet:", Loglevel::DEBUG);                LOG(static_cast<std::string>(outp), Loglevel::DEBUG); @@ -334,7 +335,7 @@ namespace nitrokey {                    LOG(                        "Device is not ready or received packet's last CRC is not equal to sent CRC packet, retrying...", -                      Loglevel::DEBUG); +                      Loglevel::DEBUG_L2);                    LOG("Invalid incoming HID packet:", Loglevel::DEBUG_L2);                    LOG(static_cast<std::string>(resp), Loglevel::DEBUG_L2);                    dev->m_counters.total_retries++; @@ -351,6 +352,13 @@ 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++;                  throw DeviceReceivingFailure( //FIXME replace with CriticalErrorException @@ -361,7 +369,7 @@ namespace nitrokey {                LOG("Incoming HID packet:", Loglevel::DEBUG);                LOG(static_cast<std::string>(resp), Loglevel::DEBUG);                LOG(std::string("receiving_retry_counter count: ") + std::to_string(receiving_retry_counter), -                              Loglevel::DEBUG); +                              Loglevel::DEBUG_L2);                if (resp.device_status == static_cast<uint8_t>(stick10::device_status::busy) &&                    static_cast<stick20::device_status>(resp.storage_status.device_status)  | 
