Fixed invalid handling of initialization value for -m 11500

pull/3006/head
Jens Steube 3 years ago
parent c6f88a52ca
commit 5e48f2a552

@ -109,7 +109,7 @@ DECLSPEC u32x round_crc32 (u32x a, const u32x v)
DECLSPEC u32x crc32 (const u32x *w, const u32 pw_len, const u32 iv)
{
u32x a = iv ^ ~0;
u32x a = ~iv;
if (pw_len >= 1) a = round_crc32 (a, w[0] >> 0);
if (pw_len >= 2) a = round_crc32 (a, w[0] >> 8);

@ -107,7 +107,7 @@ DECLSPEC u32x round_crc32 (u32x a, const u32x v)
DECLSPEC u32x crc32 (const u32x *w, const u32 pw_len, const u32 iv)
{
u32x a = iv ^ ~0;
u32x a = ~iv;
if (pw_len >= 1) a = round_crc32 (a, w[0] >> 0);
if (pw_len >= 2) a = round_crc32 (a, w[0] >> 8);

@ -107,7 +107,7 @@ DECLSPEC u32x round_crc32 (u32x a, const u32x v)
DECLSPEC u32x crc32 (const u32x *w, const u32 pw_len, const u32 iv)
{
u32x a = iv ^ ~0;
u32x a = ~iv;
if (pw_len >= 1) a = round_crc32 (a, w[0] >> 0);
if (pw_len >= 2) a = round_crc32 (a, w[0] >> 8);

@ -12,6 +12,7 @@
##
- Fixed division by zero because backend_ctx->hardware_power_all was not re-inserted after refactoring device_param->hardware_power
- Fixed invalid handling of initialization value for -m 11500
- Fixed invalid progress counter initialization in attack-mode 9 when using --skip or --restore
- Fixed out-of-boundary reads in attack-mode 9 that were caused by a missing work item limit in the refactored autotune engine
- Fixed strategy for eliminating hashes with zero length in LM when multiple hashes contain a zero hash

@ -67,7 +67,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *hash_pos = token.buf[0];
digest[0] = hex_to_u32 (hash_pos + 0);
digest[0] = hex_to_u32 (hash_pos);
digest[1] = 0;
digest[2] = 0;
digest[3] = 0;
@ -78,11 +78,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
digest[3] = 0;
const u8 *salt_pos = token.buf[1];
const int salt_len = token.len[1];
const bool parse_rc = generic_salt_decode (hashconfig, salt_pos, salt_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
salt->salt_buf[0] = hex_to_u32 (salt_pos);
salt->salt_buf[1] = 0;
salt->salt_buf[2] = 0;
salt->salt_buf[3] = 0;
if (parse_rc == false) return (PARSER_SALT_LENGTH);
salt->salt_buf[0] = byte_swap_32 (salt->salt_buf[0]);
salt->salt_buf[1] = 0;
salt->salt_buf[2] = 0;
salt->salt_buf[3] = 0;
salt->salt_len = 4;
return (PARSER_OK);
}
@ -91,13 +98,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const u32 *digest = (const u32 *) digest_buf;
char tmp_salt[SALT_MAX * 2];
const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt);
tmp_salt[salt_len] = 0;
const int line_len = snprintf (line_buf, line_size, "%08x%c%s", digest[0], hashconfig->separator, tmp_salt);
const int line_len = snprintf (line_buf, line_size, "%08x%c%08x", digest[0], hashconfig->separator, salt->salt_buf[0]);
return line_len;
}

Loading…
Cancel
Save