From 872cdfbc9c933fb117c7b9363d0202db05ce34f8 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Sun, 17 Jan 2021 21:57:32 -0800 Subject: [PATCH] Updated recovery self-update to skip authentication check if agent doesn't expose control channel cert, and server did not supply credentials. --- agents/recoverycore.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agents/recoverycore.js b/agents/recoverycore.js index 08aaf7e8..a6605080 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -245,6 +245,8 @@ function agentUpdate_Start(updateurl, updateoptions) // Check that the certificate is the one expected by the server, fail if not. if (checkServerIdentity.servertlshash == null) { + if (require('MeshAgent').ServerInfo == null || require('MeshAgent').ServerInfo.ControlChannelCertificate == null) { return; } + sendConsoleText('Self Update failed, because the url cannot be verified', sessionid); sendAgentMessage('Self Update failed, because the url cannot be verified', 3); throw new Error('BadCert');