Skip to content
Snippets Groups Projects
Commit 184d3cf6 authored by rswindell's avatar rswindell
Browse files

Added length field to hash_t (if lengths don't match, matching hashes are

just a false positive and ignored).
Added reserved (padding) for future hash types (e.g. SHA1) or other fields.
Note: Existing *.hash files must be deleted and recreated with fixsmb to be
useful (sorry).
parent 3da77c86
No related branches found
No related tags found
No related merge requests found
...@@ -494,11 +494,13 @@ typedef struct _PACK { ...@@ -494,11 +494,13 @@ typedef struct _PACK {
ulong number; /* Message number */ ulong number; /* Message number */
ulong time; /* Local time of fingerprinting */ ulong time; /* Local time of fingerprinting */
ulong length; /* Length (in bytes) of source */
uchar source; /* SMB_HASH_SOURCE* (in low 5-bits) */ uchar source; /* SMB_HASH_SOURCE* (in low 5-bits) */
uchar flags; /* indications of valid hashes and pre-processing */ uchar flags; /* indications of valid hashes and pre-processing */
ushort crc16; /* CRC-16 of source */ ushort crc16; /* CRC-16 of source */
ulong crc32; /* CRC-32 of source */ ulong crc32; /* CRC-32 of source */
uchar md5[MD5_DIGEST_SIZE]; /* MD5 digest of source */ uchar md5[MD5_DIGEST_SIZE]; /* MD5 digest of source */
uchar reserved[28]; /* sizeof(hash_t) = 64 */
} hash_t; } hash_t;
......
...@@ -78,6 +78,8 @@ int SMBCALL smb_findhash(smb_t* smb, hash_t** compare, hash_t* found_hash, ...@@ -78,6 +78,8 @@ int SMBCALL smb_findhash(smb_t* smb, hash_t** compare, hash_t* found_hash,
if(compare[c]->source!=hash.source) if(compare[c]->source!=hash.source)
continue; /* wrong source */ continue; /* wrong source */
if(compare[c]->length!=hash.length)
continue; /* wrong source length */
if(compare[c]->flags&SMB_HASH_MARKED) if(compare[c]->flags&SMB_HASH_MARKED)
continue; /* already marked */ continue; /* already marked */
if((compare[c]->flags&SMB_HASH_PROC_MASK)!=(hash.flags&SMB_HASH_PROC_MASK)) if((compare[c]->flags&SMB_HASH_PROC_MASK)!=(hash.flags&SMB_HASH_PROC_MASK))
...@@ -180,6 +182,7 @@ hash_t* SMBCALL smb_hash(ulong msgnum, ulong t, unsigned source, unsigned flags ...@@ -180,6 +182,7 @@ hash_t* SMBCALL smb_hash(ulong msgnum, ulong t, unsigned source, unsigned flags
hash->number=msgnum; hash->number=msgnum;
hash->time=t; hash->time=t;
hash->length=length;
hash->source=source; hash->source=source;
hash->flags=flags; hash->flags=flags;
if(flags&SMB_HASH_CRC16) if(flags&SMB_HASH_CRC16)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment