diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index e0c3e4436..0c5e7c7ab 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2656,7 +2656,7 @@ void SetTag15693Uid(const uint8_t *uid) { switch_off(); } -static void init_password_15693_Slix(uint8_t *buffer, uint8_t *pwd, const uint8_t *rnd) { +static void init_password_15693_Slix(uint8_t *buffer, const uint8_t *pwd, const uint8_t *rnd) { memcpy(buffer, pwd, 4); if (rnd) { buffer[0] ^= rnd[0]; @@ -2684,7 +2684,7 @@ static bool get_rnd_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t return true; } -static uint32_t disable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pass_id, uint8_t *password) { +static uint32_t disable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pass_id, const uint8_t *password) { uint8_t rnd[2]; if (get_rnd_15693_Slix(start_time, eof_time, rnd) == false) { @@ -2706,7 +2706,7 @@ static uint32_t disable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_ti return PM3_SUCCESS; } -static uint32_t set_pass_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pass_id, uint8_t *password, uint8_t *uid) { +static uint32_t set_pass_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pass_id, const uint8_t *password, uint8_t *uid) { uint8_t rnd[2]; @@ -2733,7 +2733,7 @@ static uint32_t set_pass_15693_Slix(uint32_t start_time, uint32_t *eof_time, uin return PM3_SUCCESS; } -static uint32_t set_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *password) { +static uint32_t set_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, const uint8_t *password) { uint8_t rnd[2]; if (get_rnd_15693_Slix(start_time, eof_time, rnd) == false) { return PM3_ETIMEOUT; @@ -2754,7 +2754,7 @@ static uint32_t set_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, return PM3_SUCCESS; } -static uint32_t disable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *password, bool usepwd) { +static uint32_t disable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, const uint8_t *password, bool usepwd) { uint8_t uid[8]; get_uid_slix(start_time, eof_time, uid); @@ -2788,7 +2788,7 @@ static uint32_t disable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, } -static uint32_t enable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *password, bool usepwd) { +static uint32_t enable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, const uint8_t *password, bool usepwd) { uint8_t uid[8]; get_uid_slix(start_time, eof_time, uid); @@ -2820,7 +2820,7 @@ static uint32_t enable_eas_15693_Slix(uint32_t start_time, uint32_t *eof_time, u return PM3_SUCCESS; } -static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pwd_id, uint8_t *password, uint8_t *uid) { +static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t pwd_id, const uint8_t *password, uint8_t *uid) { uint8_t new_pwd_cmd[] = { (ISO15_REQ_DATARATE_HIGH | ISO15_REQ_ADDRESS), ISO15693_WRITE_PASSWORD, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, pwd_id, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; @@ -2841,7 +2841,7 @@ static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_tim return PM3_SUCCESS; } -static uint32_t pass_protect_EASAFI_15693_Slix(uint32_t start_time, uint32_t *eof_time, bool set_option_flag, uint8_t *password) { +static uint32_t pass_protect_EASAFI_15693_Slix(uint32_t start_time, uint32_t *eof_time, bool set_option_flag, const uint8_t *password) { uint8_t flags; @@ -2880,7 +2880,7 @@ static uint32_t pass_protect_EASAFI_15693_Slix(uint32_t start_time, uint32_t *eo return PM3_SUCCESS; } -static uint32_t write_afi_15693(uint32_t start_time, uint32_t *eof_time, uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi) { +static uint32_t write_afi_15693(uint32_t start_time, uint32_t *eof_time, const uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi) { if (!use_uid) { int res_getuid = get_uid_slix(start_time, eof_time, uid); @@ -2917,7 +2917,7 @@ static uint32_t write_afi_15693(uint32_t start_time, uint32_t *eof_time, uint8_t } /* -static uint32_t enable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, uint8_t pass_id, uint8_t *password) { +static uint32_t enable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, uint8_t pass_id, const uint8_t *password) { uint8_t rnd[2]; if (get_rnd_15693_Slix(start_time, eof_time, rnd) == false) { return PM3_ETIMEOUT; @@ -2938,7 +2938,7 @@ static uint32_t enable_privacy_15693_Slix(uint32_t start_time, uint32_t *eof_tim return PM3_SUCCESS; } -static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, uint8_t pass_id, uint8_t *password) { +static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, uint8_t pass_id, const uint8_t *password) { uint8_t rnd[2]; if (get_rnd_15693_Slix(start_time, eof_time, rnd) == false) { return PM3_ETIMEOUT; @@ -2961,7 +2961,7 @@ static uint32_t write_password_15693_Slix(uint32_t start_time, uint32_t *eof_tim return PM3_SUCCESS; } -static uint32_t destroy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, uint8_t *password) { +static uint32_t destroy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint8_t *uid, const uint8_t *password) { uint8_t rnd[2]; if (get_rnd_15693_Slix(start_time, eof_time, rnd) == false) { @@ -2985,7 +2985,7 @@ static uint32_t destroy_15693_Slix(uint32_t start_time, uint32_t *eof_time, uint */ -void WritePasswordSlixIso15693(uint8_t *old_password, uint8_t *new_password, uint8_t pwd_id) { +void WritePasswordSlixIso15693(const uint8_t *old_password, const uint8_t *new_password, uint8_t pwd_id) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3010,7 +3010,7 @@ void WritePasswordSlixIso15693(uint8_t *old_password, uint8_t *new_password, uin } -void DisablePrivacySlixIso15693(uint8_t *password) { +void DisablePrivacySlixIso15693(const uint8_t *password) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3025,7 +3025,7 @@ void DisablePrivacySlixIso15693(uint8_t *password) { switch_off(); } -void EnablePrivacySlixIso15693(uint8_t *password) { +void EnablePrivacySlixIso15693(const uint8_t *password) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3041,7 +3041,7 @@ void EnablePrivacySlixIso15693(uint8_t *password) { } -void DisableEAS_AFISlixIso15693(uint8_t *password, bool usepwd) { +void DisableEAS_AFISlixIso15693(const uint8_t *password, bool usepwd) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3059,7 +3059,7 @@ void DisableEAS_AFISlixIso15693(uint8_t *password, bool usepwd) { switch_off(); } -void EnableEAS_AFISlixIso15693(uint8_t *password, bool usepwd) { +void EnableEAS_AFISlixIso15693(const uint8_t *password, bool usepwd) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3074,7 +3074,7 @@ void EnableEAS_AFISlixIso15693(uint8_t *password, bool usepwd) { switch_off(); } -void PassProtextEASSlixIso15693(uint8_t *password) { +void PassProtextEASSlixIso15693(const uint8_t *password) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3083,7 +3083,7 @@ void PassProtextEASSlixIso15693(uint8_t *password) { reply_ng(CMD_HF_ISO15693_SLIX_PASS_PROTECT_EAS, res, NULL, 0); switch_off(); } -void PassProtectAFISlixIso15693(uint8_t *password) { +void PassProtectAFISlixIso15693(const uint8_t *password) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); @@ -3093,7 +3093,7 @@ void PassProtectAFISlixIso15693(uint8_t *password) { switch_off(); } -void WriteAFIIso15693(uint8_t *password, bool use_pwd, uint8_t *uid, bool use_uid, uint8_t afi) { +void WriteAFIIso15693(const uint8_t *password, bool use_pwd, uint8_t *uid, bool use_uid, uint8_t afi) { LED_D_ON(); Iso15693InitReader(); StartCountSspClk(); diff --git a/armsrc/iso15693.h b/armsrc/iso15693.h index 4644adea9..8a9e2fe82 100644 --- a/armsrc/iso15693.h +++ b/armsrc/iso15693.h @@ -60,12 +60,12 @@ int SendDataTagEOF(uint8_t *recv, uint16_t max_recv_len, uint32_t start_time, ui void SetTag15693Uid(const uint8_t *uid); -void WritePasswordSlixIso15693(uint8_t *old_password, uint8_t *new_password, uint8_t pwd_id); -void DisablePrivacySlixIso15693(uint8_t *password); -void EnablePrivacySlixIso15693(uint8_t *password); -void DisableEAS_AFISlixIso15693(uint8_t *password, bool usepwd); -void EnableEAS_AFISlixIso15693(uint8_t *password, bool usepwd); -void PassProtextEASSlixIso15693(uint8_t *password); -void PassProtectAFISlixIso15693(uint8_t *password); -void WriteAFIIso15693(uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi); +void WritePasswordSlixIso15693(const uint8_t *old_password, const uint8_t *new_password, uint8_t pwd_id); +void DisablePrivacySlixIso15693(const uint8_t *password); +void EnablePrivacySlixIso15693(const uint8_t *password); +void DisableEAS_AFISlixIso15693(const uint8_t *password, bool usepwd); +void EnableEAS_AFISlixIso15693(const uint8_t *password, bool usepwd); +void PassProtextEASSlixIso15693(const uint8_t *password); +void PassProtectAFISlixIso15693(const uint8_t *password); +void WriteAFIIso15693(const uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi); #endif