aboutsummaryrefslogtreecommitdiff
path: root/include/dissect.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 01:15:26 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 10:13:05 +0200
commit59ae52487d142fb2b13407419351255c667faa14 (patch)
tree06a256eb98a2602cb23097bc09fe66b67a73e917 /include/dissect.h
parentbe0d677aa2e7eb87a309dc3927c0917380892641 (diff)
downloadlibnitrokey-59ae52487d142fb2b13407419351255c667faa14.tar.gz
libnitrokey-59ae52487d142fb2b13407419351255c667faa14.tar.bz2
Do not log volatile data
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/dissect.h')
-rw-r--r--include/dissect.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/dissect.h b/include/dissect.h
index 8992c56..69a5129 100644
--- a/include/dissect.h
+++ b/include/dissect.h
@@ -20,8 +20,10 @@ class QueryDissector : semantics::non_constructible {
static std::string dissect(const HIDPacket &pod) {
std::stringstream out;
+#ifdef LOG_VOLATILE_DATA
out << "Raw HID packet:" << std::endl;
out << ::nitrokey::misc::hexdump((const char *)(&pod), sizeof pod);
+#endif
out << "Contents:" << std::endl;
out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id))
@@ -83,8 +85,10 @@ class ResponseDissector : semantics::non_constructible {
// FIXME use values from firmware (possibly generate separate
// header automatically)
+#ifdef LOG_VOLATILE_DATA
out << "Raw HID packet:" << std::endl;
out << ::nitrokey::misc::hexdump((const char *)(&pod), sizeof pod);
+#endif
out << "Device status:\t" << pod.device_status + 0 << " "
<< status_translate_device(pod.device_status) << std::endl;