mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-05 23:52:27 +08:00
fix out-of-bound
This commit is contained in:
parent
4073b88ed7
commit
9d355a9b4e
1 changed files with 2 additions and 3 deletions
|
@ -263,7 +263,6 @@ static int nxp_15693_print_signature(uint8_t *uid, uint8_t *signature) {
|
|||
*/
|
||||
|
||||
uint8_t i;
|
||||
int res;
|
||||
bool is_valid = false;
|
||||
for (i = 0; i < ARRAYLEN(nxp_15693_public_keys); i++) {
|
||||
|
||||
|
@ -271,14 +270,14 @@ static int nxp_15693_print_signature(uint8_t *uid, uint8_t *signature) {
|
|||
uint8_t key[PUBLIC_ECDA_KEYLEN];
|
||||
param_gethex_to_eol(nxp_15693_public_keys[i].value, 0, key, PUBLIC_ECDA_KEYLEN, &dl);
|
||||
|
||||
res = ecdsa_signature_r_s_verify(MBEDTLS_ECP_DP_SECP128R1, key, uid, 8, signature, 32, false);
|
||||
int res = ecdsa_signature_r_s_verify(MBEDTLS_ECP_DP_SECP128R1, key, uid, 8, signature, 32, false);
|
||||
is_valid = (res == 0);
|
||||
if (is_valid)
|
||||
break;
|
||||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
if (is_valid == false) {
|
||||
if (is_valid == false || i == ARRAYLEN(nxp_15693_public_keys)) {
|
||||
PrintAndLogEx(SUCCESS, "Signature verification " _RED_("failed"));
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue