Merge pull request #1472 from merlokk/coverity

Coverity
This commit is contained in:
Oleg Moiseenko 2021-08-21 16:23:49 +03:00 committed by GitHub
commit 5deabb4d3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -5067,7 +5067,7 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
if (trkeylen > 0) {
uint8_t prevReaderID[CRYPTO_AES_BLOCK_SIZE] = {0};
DesfireDecodePrevReaderID(&dctx, trkey, transactionCounter, resp, prevReaderID);
PrintAndLogEx(INFO, "Prev reader id: %s", resplen, sprint_hex(prevReaderID, CRYPTO_AES_BLOCK_SIZE));
PrintAndLogEx(INFO, "Prev reader id: %s", sprint_hex(prevReaderID, CRYPTO_AES_BLOCK_SIZE));
}
readeridpushed = true;

View file

@ -689,7 +689,7 @@ void DesfireGenTransSessionKeyLRP(uint8_t *key, uint32_t trCntr, uint8_t *uid, b
void DesfireDecodePrevReaderID(DesfireContext *ctx, uint8_t *key, uint32_t trCntr, uint8_t *encPrevReaderID, uint8_t *prevReaderID) {
uint8_t sessionkey[16] = {0};
uint8_t uid[7] = {0};
uint8_t uid[12] = {0};
memcpy(uid, ctx->uid, MAX(ctx->uidlen, 7));
if (ctx->secureChannel == DACEV2) {