From 48ec48d2c680b9f40d2b038fda9555bfd024bb97 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 30 Jan 2017 20:31:18 +0100 Subject: Use local hexdumping function for getting serial number Signed-off-by: Szczepan Zalega --- include/stick10_commands.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/stick10_commands.h b/include/stick10_commands.h index b66a9b4..8d37dbd 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -357,8 +357,14 @@ class GetStatus : Command { bool isValid() const { return enable_user_password!=delete_user_password; } std::string get_card_serial_hex() const { - return ::nitrokey::misc::hexdump((const char *)(card_serial), - sizeof card_serial, false, false, false); +// return ::nitrokey::misc::hexdump((const char *)(card_serial), +// sizeof card_serial, false, false, false); + std::stringstream ss; + ss << std::hex << std::setfill('0'); + for (int i = 0; i < sizeof(card_serial); ++i) { + ss << std::setw(2) << static_cast(card_serial[i]); + } + return ss.str(); } std::string dissect() const { -- cgit v1.2.3