mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-27 01:25:41 +08:00
transactions
This commit is contained in:
parent
5763089f5a
commit
0f5c6005d1
2 changed files with 16 additions and 0 deletions
|
@ -173,6 +173,7 @@ int CIPURSESelectMF(uint8_t *result, size_t max_result_len, size_t *result_len,
|
|||
}
|
||||
|
||||
int CIPURSESelectFileEx(bool activate_field, bool leave_field_on, uint16_t fileid, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw) {
|
||||
CipurseCClearContext(&cipurseContext);
|
||||
uint8_t fileIdBin[] = {fileid >> 8, fileid & 0xff};
|
||||
return CIPURSEExchangeEx(activate_field, leave_field_on, (sAPDU_t) {0x00, 0xa4, 0x00, 0x00, 02, fileIdBin}, true, 0, result, max_result_len, result_len, sw);
|
||||
}
|
||||
|
@ -200,6 +201,18 @@ int CIPURSEUpdateBinary(uint16_t offset, uint8_t *data, uint16_t datalen, uint8_
|
|||
return CIPURSEExchange((sAPDU_t) {0x00, 0xd6, (offset >> 8) & 0x7f, offset & 0xff, datalen, data}, result, max_result_len, result_len, sw);
|
||||
}
|
||||
|
||||
int CIPURSECommitTransaction(uint16_t *sw) {
|
||||
uint8_t result[APDU_RES_LEN] = {0};
|
||||
size_t result_len = 0;
|
||||
return CIPURSEExchange((sAPDU_t) {0x80, 0x7e, 0x00, 0x00, 0, NULL}, result, sizeof(result), &result_len, sw);
|
||||
}
|
||||
|
||||
int CIPURSECancelTransaction(uint16_t *sw) {
|
||||
uint8_t result[APDU_RES_LEN] = {0};
|
||||
size_t result_len = 0;
|
||||
return CIPURSEExchange((sAPDU_t) {0x80, 0x7c, 0x00, 0x00, 0, NULL}, result, sizeof(result), &result_len, sw);
|
||||
}
|
||||
|
||||
bool CIPURSEChannelAuthenticate(uint8_t keyindex, uint8_t *key, bool verbose) {
|
||||
uint8_t buf[APDU_RES_LEN] = {0};
|
||||
size_t len = 0;
|
||||
|
|
|
@ -51,6 +51,9 @@ int CIPURSEReadFileAttributes(uint8_t *result, size_t max_result_len, size_t *re
|
|||
int CIPURSEReadBinary(uint16_t offset, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
|
||||
int CIPURSEUpdateBinary(uint16_t offset, uint8_t *data, uint16_t datalen, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
|
||||
|
||||
int CIPURSECommitTransaction(uint16_t *sw);
|
||||
int CIPURSECancelTransaction(uint16_t *sw);
|
||||
|
||||
bool CIPURSEChannelAuthenticate(uint8_t keyindex, uint8_t *key, bool verbose);
|
||||
void CIPURSECSetActChannelSecurityLevels(CipurseChannelSecurityLevel req, CipurseChannelSecurityLevel resp);
|
||||
|
||||
|
|
Loading…
Reference in a new issue