diff -urpN cur/src/wpapsk_fmt.c jumbo-bleeding/src/wpapsk_fmt.c --- cur/src/wpapsk_fmt.c 2013-01-27 16:58:54.593750000 -0600 +++ jumbo-bleeding/src/wpapsk_fmt.c 2013-01-29 21:59:38.500000000 -0600 @@ -62,6 +62,9 @@ static struct fmt_tests tests[] = { {NULL} }; +static int new_keys = 1; +static char last_ssid[36]; + #ifdef MMX_COEF // Ok, now we have our MMX/SSE2/intr buffer. // this version works properly for MMX, SSE2 (.S) and SSE2 intrinsic. @@ -370,14 +373,21 @@ static MAYBE_INLINE void wpapsk_sse(int static void crypt_all(int count) { + if (new_keys || strcmp(last_ssid, hccap.essid)) #ifndef MMX_COEF wpapsk_cpu(count, inbuffer, outbuffer, ¤tsalt); #else wpapsk_sse(count, inbuffer, outbuffer, ¤tsalt); #endif + new_keys = 0; + strcpy(last_ssid, hccap.essid); wpapsk_postprocess(count); } +void clear_keys(void) { + new_keys = 1; +} + struct fmt_main fmt_wpapsk = { { FORMAT_LABEL, @@ -413,7 +423,7 @@ struct fmt_main fmt_wpapsk = { set_salt, set_key, get_key, - fmt_default_clear_keys, + clear_keys, crypt_all, { get_hash_0,