mirror of
https://github.com/hashcat/hashcat
synced 2025-02-14 15:24:28 +01:00
Merge pull request #3374 from philsmd/26200_hash_encoding
improved hash sanity checks for -m 26200 = OpenEdge
This commit is contained in:
commit
854707a6a5
@ -109,6 +109,26 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
|||||||
const u8 *hash_pos = (u8 *) token.buf[0];
|
const u8 *hash_pos = (u8 *) token.buf[0];
|
||||||
const u32 hash_len = token.len[0];
|
const u32 hash_len = token.len[0];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check encoding:
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (u32 i = 0; i < hash_len; i++)
|
||||||
|
{
|
||||||
|
// chars used (alphabet):
|
||||||
|
// ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
|
|
||||||
|
const u8 c = hash_pos[i];
|
||||||
|
|
||||||
|
if ( c < 'A') return (PARSER_HASH_ENCODING);
|
||||||
|
if (c > 'Z' && c < 'a') return (PARSER_HASH_ENCODING);
|
||||||
|
if (c > 'z' ) return (PARSER_HASH_ENCODING);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* digest:
|
||||||
|
*/
|
||||||
|
|
||||||
memcpy ((u8 *) digest, hash_pos, hash_len);
|
memcpy ((u8 *) digest, hash_pos, hash_len);
|
||||||
|
|
||||||
return (PARSER_OK);
|
return (PARSER_OK);
|
||||||
|
Loading…
Reference in New Issue
Block a user