aboutsummaryrefslogtreecommitdiff
path: root/include/command.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 14:20:40 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 14:20:40 +0200
commit1634bddb91323753546e6fe475d70d41dd79faee (patch)
treefc6c5cc9cd1f99674f433fe99124ecc362bbcc12 /include/command.h
parentb307e84b5d67419a9fbec6e222ff51d2f917d928 (diff)
downloadlibnitrokey-1634bddb91323753546e6fe475d70d41dd79faee.tar.gz
libnitrokey-1634bddb91323753546e6fe475d70d41dd79faee.tar.bz2
Log temporary password as hexdump instead of string representation
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/command.h')
-rw-r--r--include/command.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/command.h b/include/command.h
index bf3cb4e..3f711c0 100644
--- a/include/command.h
+++ b/include/command.h
@@ -6,10 +6,12 @@
#define print_to_ss(x) ( ss << " " << (#x) <<":\t" << (x) << std::endl );
#ifdef LOG_VOLATILE_DATA
-#define print_to_ss_volatile(x) ( ss << " " << (#x) <<":\t" << (x) << std::endl );
+#define print_to_ss_volatile(x) print_to_ss(x);
#else
#define print_to_ss_volatile(x) ( ss << " " << (#x) <<":\t" << "***********" << std::endl );
#endif
+#define hexdump_to_ss(x) (ss << #x":\n"\
+ << ::nitrokey::misc::hexdump((const char *) (&x), sizeof x, false));
namespace nitrokey {
namespace proto {