expose crypto module to VM

This commit is contained in:
zefie
2022-10-09 22:07:37 -04:00
parent e544e821c3
commit d1dbbcf82f
3 changed files with 3 additions and 4 deletions

View File

@@ -1,7 +1,4 @@
var minisrv_service_file = true;
const crypto = require('crypto')
var viewer = 2 // debug override
var viewers = {

View File

@@ -11,7 +11,7 @@ var challenge = request_headers.request.split('?')[1];
if (request_headers.request.split('?')[1].substring(0, 3) != "ct=") {
console.log(" *** Logging into Messenger via MSNP3")
data = require('crypto').createHash('md5').update(request_headers.request.split('?')[1] + password).digest("hex");
data = crypto.createHash('md5').update(request_headers.request.split('?')[1] + password).digest("hex");
} else {
console.log(" *** Logging into Messenger via MSNP8")
request_is_async = true; // Make us async

View File

@@ -7,6 +7,7 @@ const zlib = require('zlib');
const http = require('http');
const https = require('https');
const net = require('net');
const crypto = require('crypto')
const CryptoJS = require('crypto-js');
const { crc16 } = require('easy-crc');
const process = require('process');
@@ -127,6 +128,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
"WTVFlashrom": WTVFlashrom,
"strftime": require('strftime'),
"CryptoJS": CryptoJS,
"crypto": crypto,
"fs": fs,
"path": path,