mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
add plain apdu encode
This commit is contained in:
parent
f3bdd52cf1
commit
e0d1656ea1
1 changed files with 13 additions and 1 deletions
|
@ -262,6 +262,7 @@ static bool TestAPDU(void) {
|
|||
uint8_t dstdata[32] = {0};
|
||||
//size_t dstdatalen = 0;
|
||||
|
||||
// MACED APDU
|
||||
srcAPDU.CLA = 0x00;
|
||||
srcAPDU.INS = 0x55;
|
||||
srcAPDU.P1 = 0x11;
|
||||
|
@ -281,8 +282,19 @@ static bool TestAPDU(void) {
|
|||
|
||||
|
||||
|
||||
// Plain APDU
|
||||
CipurseCChannelSetSecurityLevels(&ctx, CPSPlain, CPSPlain);
|
||||
CipurseCAPDUReqEncode(&ctx, &srcAPDU, &dstAPDU, dstdata, true, 0x55);
|
||||
uint8_t test2[] = {0x01, 0x11, 0x22, 0x33, 0x44, 0x00, 0x55};
|
||||
res = res && ((srcAPDU.CLA | 0x04) == dstAPDU.CLA);
|
||||
res = res && (srcAPDU.INS == dstAPDU.INS);
|
||||
res = res && (srcAPDU.P1 == dstAPDU.P1);
|
||||
res = res && (srcAPDU.P2 == dstAPDU.P2);
|
||||
res = res && (dstAPDU.Lc == sizeof(test2));
|
||||
res = res && (memcmp(dstdata, test2, sizeof(test2)) == 0);
|
||||
|
||||
|
||||
// Encrypted APDU
|
||||
//CipurseCChannelSetSecurityLevels(&ctx, CPSEncrypted, CPSEncrypted);
|
||||
|
||||
|
||||
if (res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue