Security improvements.

This commit is contained in:
Ylian Saint-Hilaire
2020-09-22 14:25:22 -07:00
parent fcf7e3eaaf
commit c65098c6fa
7 changed files with 40 additions and 48 deletions

View File

@@ -17,12 +17,6 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, parent,
obj.noncecounter = 1;
obj.authcounter = 0;
obj.Address = '/wsman';
obj.challengeParams = null;
obj.noncecounter = 1;
obj.authcounter = 0;
obj.cnonce = Math.random().toString(36).substring(7); // Generate a random client nonce
obj.net = require('net');
obj.tls = require('tls');
obj.crypto = require('crypto');
@@ -32,6 +26,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, parent,
obj.kerberosDone = 0;
obj.amtVersion = null;
obj.Address = '/wsman';
obj.challengeParams = null;
obj.noncecounter = 1;
obj.authcounter = 0;
obj.cnonce = obj.crypto.randomBytes(16).toString('hex'); // Generate a random client nonce
obj.host = host;
obj.port = port;
obj.user = user;