mirror of https://github.com/MISP/MISP
Fixes an issue with the upload of malware samples not generating an md5
hash if the file is too largepull/217/head
parent
8bf54e7c01
commit
b3f6032857
|
@ -297,7 +297,7 @@ class AttributesController extends AppController {
|
|||
$this->request->data['Attribute']['type'] = "malware-sample";
|
||||
// Validate filename
|
||||
if (!preg_match('@^[\w-,\s]+\.[A-Za-z0-9_]{2,4}$@', $filename)) throw new Exception ('Filename not allowed');
|
||||
$this->request->data['Attribute']['value'] = $filename . '|' . $tmpfile->md5(); // TODO gives problems with bigger files
|
||||
$this->request->data['Attribute']['value'] = $filename . '|' . hash_file('md5', $tmpfile->path); // TODO gives problems with bigger files
|
||||
$sha256 = (hash_file('sha256', $tmpfile->path));
|
||||
$sha1 = (hash_file('sha1', $tmpfile->path));
|
||||
$this->request->data['Attribute']['to_ids'] = 1; // LATER let user choose to send this to IDS
|
||||
|
|
Loading…
Reference in New Issue