Skip to content

Commit fecf5cb

Browse files
committed
More progress towards PM3 compatible auth II
1 parent b873261 commit fecf5cb

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Firmware/Chameleon-Mini/Application/DESFire/DESFireInstructions.c

+6-12
Original file line numberDiff line numberDiff line change
@@ -1754,16 +1754,9 @@ uint16_t DesfireCmdAuthenticate3KTDEA1(uint8_t *Buffer, uint16_t ByteCount) {
17541754
/* Update state */
17551755
Key = SessionKey;
17561756
DesfireCommandState.KeyId = KeyId;
1757-
if (!AuthenticatedWithPICCMasterKey) {
1758-
keySize = GetDefaultCryptoMethodKeySize(CRYPTO_TYPE_DES);
1759-
DesfireCommandState.CryptoMethodType = CRYPTO_TYPE_DES;
1760-
DesfireCommandState.ActiveCommMode = GetCryptoMethodCommSettings(CRYPTO_TYPE_DES);
1761-
1762-
} else {
1763-
keySize = GetDefaultCryptoMethodKeySize(CRYPTO_TYPE_3K3DES);
1764-
DesfireCommandState.CryptoMethodType = CRYPTO_TYPE_3K3DES;
1765-
DesfireCommandState.ActiveCommMode = GetCryptoMethodCommSettings(CRYPTO_TYPE_3K3DES);
1766-
}
1757+
keySize = GetDefaultCryptoMethodKeySize(CRYPTO_TYPE_3K3DES);
1758+
DesfireCommandState.CryptoMethodType = CRYPTO_TYPE_3K3DES;
1759+
DesfireCommandState.ActiveCommMode = GetCryptoMethodCommSettings(CRYPTO_TYPE_3K3DES);
17671760
CryptoChallengeResponseBytesSize = keySize;
17681761

17691762
/* Fetch the key */
@@ -1865,8 +1858,9 @@ uint16_t DesfireCmdAuthenticate3KTDEA2(uint8_t *Buffer, uint16_t ByteCount) {
18651858
(KeyId == DESFIRE_MASTER_KEY_ID);
18661859

18671860
/* Return the status on success */
1868-
Buffer[0] = STATUS_OPERATION_OK;
1869-
return DESFIRE_STATUS_RESPONSE_SIZE + CryptoChallengeResponseBytesSize;
1861+
Buffer[0] = (SW_NO_ERROR >> 8) & 0x00ff;
1862+
Buffer[1] = SW_NO_ERROR & 0x00ff;
1863+
return 2 * DESFIRE_STATUS_RESPONSE_SIZE;
18701864

18711865
}
18721866

0 commit comments

Comments
 (0)