Skip to content
Snippets Groups Projects
Commit 88553583 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Apply audit tool security update

parent 1f90b36d
No related branches found
No related tags found
No related merge requests found
{
"name": "decentraleyes-audit",
"version": "1.3.0",
"version": "1.4.0",
"author": "Thomas Rientjes",
"license": "MPL-2.0",
"description": "Library audit tool for Decentraleyes.",
......
......@@ -137,7 +137,7 @@ function _hashFileContents(fileContents) {
var hash;
hash = crypto.createHash('md5');
hash = crypto.createHash('sha512');
hash.setEncoding('hex');
hash.write(fileContents);
......@@ -148,20 +148,19 @@ function _hashFileContents(fileContents) {
function _compareResources(localResourceContents, remoteResourceContents, URL) {
var hadSourceMappingURL = sourceMappingURL.existsIn(remoteResourceContents);
remoteResourceContents = sourceMappingURL.removeFrom(remoteResourceContents);
var hasSourceMappingURL = sourceMappingURL.existsIn(remoteResourceContents);
var sourceMappingNotice = '[ ] REMOTE RESOURCE HAD SOURCE MAPPING URL';
if (hadSourceMappingURL) {
if (hasSourceMappingURL) {
remoteResourceContents = sourceMappingURL.removeFrom(remoteResourceContents);
sourceMappingNotice = '[X] REMOTE RESOURCE HAD SOURCE MAPPING URL';
}
var localResourceHash = _hashFileContents(localResourceContents);
var remoteResourceHash = _hashFileContents(remoteResourceContents);
console.log(localResourceHash);
console.log(remoteResourceHash);
console.log('RESOURCE HASH (SHA512): ' + localResourceHash);
console.log('RESOURCE HASH (SHA512): ' + remoteResourceHash);
var fileHashesMatch = (localResourceHash === remoteResourceHash);
......@@ -172,9 +171,8 @@ function _compareResources(localResourceContents, remoteResourceContents, URL) {
}
console.log();
console.log(sourceMappingNotice);
console.log('[X] LOCAL AND REMOTE RESOURCE HASHES MATCH');
console.log(sourceMappingNotice);
}
function _showCompletedMessage() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment