forked from emsec/ChameleonMini
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugging ISO authenticate command (0x1a)
- Loading branch information
Showing
8 changed files
with
223 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Software/DESFireLibNFCTesting/Source/TestAuthenticateISO.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* TestAuthenticateAES128.c */ | ||
|
||
#include "LibNFCUtils.h" | ||
#include "LibNFCWrapper.h" | ||
#include "DesfireUtils.h" | ||
#include "CryptoUtils.h" | ||
|
||
/* | ||
* See Notes: https://stackoverflow.com/questions/52520044/desfire-ev1-communication-how-to-assign-iv | ||
*/ | ||
|
||
int main(int argc, char **argv) { | ||
|
||
if(!Test3DESEncyptionRoutines()) { | ||
return EXIT_FAILURE; | ||
} | ||
|
||
nfc_context *nfcCtxt; | ||
nfc_device *nfcPnd = GetNFCDeviceDriver(&nfcCtxt); | ||
if(nfcPnd == NULL) { | ||
return EXIT_FAILURE; | ||
} | ||
|
||
// Select AID application 0x000000: | ||
if(SelectApplication(nfcPnd, MASTER_APPLICATION_AID, APPLICATION_AID_LENGTH)) { | ||
return EXIT_FAILURE; | ||
} | ||
|
||
// Start AES authentication (default key, blank setting of all zeros): | ||
if(Authenticate(nfcPnd, DESFIRE_CRYPTO_AUTHTYPE_ISODES, | ||
MASTER_KEY_INDEX, ZERO_KEY)) { | ||
return EXIT_FAILURE; | ||
} | ||
|
||
FreeNFCDeviceDriver(&nfcCtxt, &nfcPnd); | ||
return EXIT_SUCCESS; | ||
|
||
} | ||
|