Added per-domain ignoreagenthashcheck.

Ylian Saint-Hilaire committed Jun 29, 2020 at 15:14 UTC 8070c920488d713f791595c5e96eb2b841451f20
1 file changed +2 -2
meshagent.js
+2 -2
@@ -387,7 +387,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
387 if ((msg.length != 98) || ((obj.receivedCommands & 1) != 0)) return;
388 obj.receivedCommands += 1; // Agent can't send the same command twice on the same connection ever. Block DOS attack path.
389
390 - if (args.ignoreagenthashcheck === true) {
390 + if ((args.ignoreagenthashcheck === true) || (domain.ignoreagenthashcheck === true)) {
391 // Send the agent web hash back to the agent
392 // Send 384 bits SHA384 hash of TLS cert + 384 bits nonce
393 obj.sendBinary(common.ShortToStr(1) + msg.substring(2, 50) + obj.nonce); // Command 1, hash + nonce. Use the web hash given by the agent.
@@ -1037,7 +1037,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1037
1038 // Verify the agent signature
1039 function processAgentSignature(msg) {
1040 - if (args.ignoreagenthashcheck !== true) {
1040 + if ((args.ignoreagenthashcheck !== true) && (domain.ignoreagenthashcheck !== true)) {
1041 var verified = false;
1042
1043 if (msg.length != 384) {