From c8e1eb11f2ea6cf8d5a2221069518dab021f5a99 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 8 Jul 2018 21:54:22 +0200 Subject: [PATCH] chg: 'sc raw' adjusted output --- client/cmdsmartcard.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 66ac3e528..0697d2451 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -103,11 +103,19 @@ int CmdSmartRaw(const char *Cmd) { PrintAndLogEx(WARNING, "smart card response failed"); return 1; } - PrintAndLogEx(SUCCESS,"isOK %d | %d | resp: %s", - resp.arg[0], - resp.arg[1], - sprint_hex(resp.d.asBytes, resp.arg[1]) - ); + + if ( !resp.arg[0] ) { + PrintAndLogEx(WARNING, "smart card response failed"); + return 1; + } + + uint32_t len = resp.arg[1]; + PrintAndLogEx(INFO, "received %i bytes:", len); + + if (!len) + return 1; + + PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.d.asBytes, len) ); } return 0; }