use minversion tlsv1 to fix older amt issues (#6983)
Signed-off-by: si458 <simonsmith5521@gmail.com>
Simon Smith committed
Apr 18, 2025 at 22:22 UTC
95e1796844161a8e96e4e6fd2b42c1ef12312c06
4 files changed
+15
-15
amt/amt-redir-mesh.js
+4
-4
@@ -170,8 +170,8 @@ module.exports.CreateAmtRedirect = function (module, domain, user, webserver, me
170
171
// TLSSocket to encapsulate TLS communication, which then tunneled via SerialTunnel an then wrapped through CIRA APF
172
const TLSSocket = require('tls').TLSSocket;
173
- const tlsoptions = { ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false };
174
- if (obj.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
173
+ const tlsoptions = { minVersion: 'TLSv1', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
174
+ // if (obj.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
175
const tlsock = new TLSSocket(ser, tlsoptions);
176
tlsock.on('error', function (err) { Debug(1, "CIRA TLS Connection Error ", err); });
177
tlsock.on('secureConnect', function () { Debug(2, "CIRA Secure TLS Connection"); ws._socket.resume(); });
@@ -228,8 +228,8 @@ module.exports.CreateAmtRedirect = function (module, domain, user, webserver, me
228
obj.forwardclient.setEncoding('binary');
229
} else {
230
// If TLS is going to be used, setup a TLS socket
231
- var tlsoptions = { ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false };
232
- if (obj.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
231
+ var tlsoptions = { minVersion: 'TLSv1', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
232
+ // if (obj.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
233
obj.forwardclient = obj.tls.connect(port, node.host, tlsoptions, function () {
234
// The TLS connection method is the same as TCP, but located a bit differently.
235
Debug(2, 'TLS Intel AMT transport connected to ' + node.host + ':' + port + '.');
amt/amt-wsman-comm.js
+4
-4
@@ -236,8 +236,8 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
236
if (state == 0) { obj.xxOnSocketClosed(); }
237
if (state == 2) {
238
// TLSSocket to encapsulate TLS communication, which then tunneled via SerialTunnel an then wrapped through CIRA APF
239
- var options = { socket: ser, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false };
240
- if (obj.xtlsMethod == 1) { options.secureProtocol = 'TLSv1_method'; }
239
+ var options = { minVersion: 'TLSv1', socket: ser, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE | obj.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
240
+ // if (obj.xtlsMethod == 1) { options.secureProtocol = 'TLSv1_method'; }
241
if (obj.xtlsoptions) {
242
if (obj.xtlsoptions.ca) { options.ca = obj.xtlsoptions.ca; }
243
if (obj.xtlsoptions.cert) { options.cert = obj.xtlsoptions.cert; }
@@ -274,8 +274,8 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
274
obj.socket.connect(obj.port, obj.host, obj.xxOnSocketConnected);
275
} else {
276
// Direct connect with TLS
277
- var options = { ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE | obj.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
278
- if (obj.xtlsMethod != 0) { options.secureProtocol = 'TLSv1_method'; }
277
+ var options = { minVersion: 'TLSv1', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE | obj.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
278
+ // if (obj.xtlsMethod != 0) { options.secureProtocol = 'TLSv1_method'; }
279
if (obj.xtlsoptions) {
280
if (obj.xtlsoptions.ca) { options.ca = obj.xtlsoptions.ca; }
281
if (obj.xtlsoptions.cert) { options.cert = obj.xtlsoptions.cert; }
amtscanner.js
+2
-2
@@ -387,8 +387,8 @@ module.exports.CreateAmtScanner = function (parent) {
387
} else {
388
// Connect using TLS, we will switch from default TLS to TLS1-only and back if we get a connection error to support older Intel AMT.
389
if (scaninfo.tlsoption == null) { scaninfo.tlsoption = 0; }
390
- const tlsOptions = { rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE };
391
- if (scaninfo.tlsoption == 1) { tlsOptions.secureProtocol = 'TLSv1_method'; }
390
+ const tlsOptions = { minVersion: 'TLSv1', rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION };
391
+ // if (scaninfo.tlsoption == 1) { tlsOptions.secureProtocol = 'TLSv1_method'; }
392
client = obj.tls.connect(port, host, tlsOptions, function () { this.write('GET / HTTP/1.1\r\nhost: ' + host + '\r\n\r\n'); });
393
}
394
client.scaninfo = scaninfo;
webserver.js
+5
-5
@@ -4854,8 +4854,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
4854
if (state == 0) { try { ws.close(); } catch (e) { } }
4855
if (state == 2) {
4856
// TLSSocket to encapsulate TLS communication, which then tunneled via SerialTunnel an then wrapped through CIRA APF
4857
- const tlsoptions = { socket: ser, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false };
4858
- if (req.query.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
4857
+ const tlsoptions = { minVersion: 'TLSv1', socket: ser, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
4858
+ // if (req.query.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
4859
var tlsock = obj.tls.connect(tlsoptions, function () { parent.debug('webrelay', "CIRA Secure TLS Connection"); ws._socket.resume(); });
4860
tlsock.chnl = chnl;
4861
tlsock.setEncoding('binary');
@@ -5025,7 +5025,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5025
setTimeout(function(){ // wait 5 seconds before finishing file for some reason?
5026
obj.meshRelayHandler.recordingEntry(ws.logfile, 3, 0, 'MeshCentralMCREC', function (logfile, ws) {
5027
obj.fs.close(logfile.fd);
5028
- parent.debug('relay', 'Relay1: Finished recording to file: ' + ws.logfile.filename);
5028
+ parent.debug('relay', 'Relay: Finished recording to file: ' + ws.logfile.filename);
5029
// Compute session length
5030
var sessionLength = null;
5031
if (ws.logfile.startTime != null) { sessionLength = Math.round((Date.now() - ws.logfile.startTime) / 1000) - 5; }
@@ -5175,8 +5175,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5175
ws._socket.resume();
5176
} else {
5177
// If TLS is going to be used, setup a TLS socket
5178
- var tlsoptions = { ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
5179
- if (req.query.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
5178
+ var tlsoptions = { minVersion: 'TLSv1', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE | constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, rejectUnauthorized: false };
5179
+ // if (req.query.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
5180
ws.forwardclient = obj.tls.connect(port, node.host, tlsoptions, function () {
5181
// The TLS connection method is the same as TCP, but located a bit differently.
5182
parent.debug('webrelay', user.name + ' - TLS connected to ' + node.host + ':' + port + '.');