mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
add error check in the crypto stream
This commit is contained in:
parent
8b9271fc7d
commit
aa880239a1
1 changed files with 5 additions and 0 deletions
|
@ -506,6 +506,11 @@ void CipurseCAPDURespDecode(CipurseContext *ctx, uint8_t *srcdata, size_t srcdat
|
|||
CipurseCChannelDecrypt(ctx, srcdata, srcdatalen, buf, &buflen);
|
||||
//PrintAndLogEx(INFO, "data plain[%d]: %s", buflen, sprint_hex(buf, buflen));
|
||||
|
||||
if (buflen == 0) {
|
||||
PrintAndLogEx(ERR, "APDU can't decode crypto stream");
|
||||
break;
|
||||
}
|
||||
|
||||
micdatalen = buflen - 2 - CIPURSE_MIC_LENGTH;
|
||||
memcpy(micdata, buf, buflen);
|
||||
memcpy(&micdata[micdatalen], &buf[buflen - 2], 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue