mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Add SHA1 and SHA256 hashing BIFs. (addresses #542)
Also refactor all internal MD5 stuff to use OpenSSL's.
This commit is contained in:
parent
8766a2e2fc
commit
79afc834ce
19 changed files with 461 additions and 531 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "MIME.h"
|
||||
#include "Event.h"
|
||||
#include "Reporter.h"
|
||||
#include "digest.h"
|
||||
|
||||
// Here are a few things to do:
|
||||
//
|
||||
|
@ -1008,7 +1009,7 @@ void MIME_Mail::Done()
|
|||
if ( compute_content_hash && mime_content_hash )
|
||||
{
|
||||
u_char* digest = new u_char[16];
|
||||
md5_finish(&md5_hash, digest);
|
||||
md5_final(&md5_hash, digest);
|
||||
|
||||
val_list* vl = new val_list;
|
||||
vl->append(analyzer->BuildConnVal());
|
||||
|
@ -1096,7 +1097,7 @@ void MIME_Mail::SubmitData(int len, const char* buf)
|
|||
if ( compute_content_hash )
|
||||
{
|
||||
content_hash_length += len;
|
||||
md5_append(&md5_hash, (const u_char*) buf, len);
|
||||
md5_update(&md5_hash, (const u_char*) buf, len);
|
||||
}
|
||||
|
||||
if ( mime_entity_data || mime_all_data )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue