diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index 67e47c0d4..9c6c343aa 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -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; }