X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/5e14319d2c993ef4530ee2de36ad849abe17ec1c..d1e197e9ec44affdf3ad9ef0ea6a221d0c30aa6d:/client/nonce2key/nonce2key.c diff --git a/client/nonce2key/nonce2key.c b/client/nonce2key/nonce2key.c index 85332900..3d3d1e37 100644 --- a/client/nonce2key/nonce2key.c +++ b/client/nonce2key/nonce2key.c @@ -97,7 +97,6 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui state = lfsr_common_prefix_ex(nr, ks3x); if (!state) { - key_count = 0; PrintAndLog("Failed getting states"); return 1; } @@ -117,7 +116,6 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui // first call to this function. clear all other stuff and set new found states. if (last_keylist == NULL) { - key_count = 0; free(last_keylist); last_keylist = state_s; PrintAndLog("parity is all zero, testing special attack. First call, this attack needs at least two calls. Hold on..."); @@ -147,6 +145,7 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui printf("key_count: %d\n", key_count); if ( key_count == 0 ){ free(state); + state = NULL; return 0; } @@ -169,6 +168,7 @@ out: free(last_keylist); last_keylist = NULL; free(state); + state = NULL; return retval; }