Replace Math.random with crypto.getBytes for session tokens

This commit is contained in:
Nick O'Leary
2020-09-11 14:09:54 +01:00
parent baffe4861c
commit 70b6674f44
3 changed files with 6 additions and 20 deletions

View File

@@ -18,9 +18,10 @@ var net = require("net");
var fs = require("fs-extra");
var path = require("path");
var os = require("os");
const crypto = require("crypto");
function getListenPath() {
var seed = (0x100000+Math.random()*0x999999).toString(16);
var seed = crypto.randomBytes(8).toString('hex');
var fn = 'node-red-git-askpass-'+seed+'-sock';
var listenPath;
if (process.platform === 'win32') {