chg: 'hf iclass chk' - adjustments to output

This commit is contained in:
iceman1001 2017-12-13 10:40:20 +01:00
commit c50c0e49d6

View file

@ -800,7 +800,7 @@ static bool select_and_auth(uint8_t *KEY, uint8_t *MAC, uint8_t *div_key, bool u
else
HFiClassCalcDivKey(CSN, KEY, div_key, elite);
PrintAndLog("Authing with %s: %02x%02x%02x%02x%02x%02x%02x%02x", rawkey ? "raw key" : "diversified key", div_key[0],div_key[1],div_key[2],div_key[3],div_key[4],div_key[5],div_key[6],div_key[7]);
if (verbose) PrintAndLog("Authing with %s: %s", rawkey ? "raw key" : "diversified key", sprint_hex(div_key, 8) );
doMAC(CCNR, div_key, MAC);
UsbCommand resp;
@ -809,12 +809,12 @@ static bool select_and_auth(uint8_t *KEY, uint8_t *MAC, uint8_t *div_key, bool u
clearCommandBuffer();
SendCommand(&d);
if (!WaitForResponseTimeout(CMD_ACK,&resp,4500)) {
PrintAndLog("Auth Command execute timeout");
if (verbose) PrintAndLog("Auth Command execute timeout");
return false;
}
uint8_t isOK = resp.arg[0] & 0xff;
if (!isOK) {
PrintAndLog("Authentication error");
if (verbose) PrintAndLog("Authentication error");
return false;
}
return true;
@ -1895,6 +1895,8 @@ int CmdHFiClassCheckKeys(const char *Cmd) {
break;
}
memcpy(key, keyBlock + 8 * c , 8);
// debit key. try twice
if ( !found_debit ) {
for (int foo = 0; foo < 2; foo++) {