Fixed a ClickOnce exception

Ylian Saint-Hilaire committed Oct 15, 2018 at 17:51 UTC 700218c6bd3a053ae8d8238e5f89e5e05ee6c7c8
10 files changed +30 -22
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.2.2-g",
3 + "version": "0.2.2-i",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.application renamed
+4 -4
@@ -1,20 +1,20 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3 - <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.17" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
3 + <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.18" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
4 <description asmv2:publisher="Meshcentral.com" asmv2:product="MeshCentral Mini-Router" asmv2:supportUrl="https://meshcentral.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
5 <deployment install="false" mapFileExtensions="true" trustURLParameters="true" />
6 <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
7 <framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
8 </compatibleFrameworks>
9 <dependency>
10 - <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_17\MeshMiniRouter.exe.manifest" size="4712">
11 - <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.17" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
10 + <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_18\MeshMiniRouter.exe.manifest" size="4712">
11 + <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.18" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
12 <hash>
13 <dsig:Transforms>
14 <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15 </dsig:Transforms>
16 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17 - <dsig:DigestValue>nyBHr6mVUVhjU6l4Bmrfa0juzDDrPD6BiiYzVMhKKVA=</dsig:DigestValue>
17 + <dsig:DigestValue>MRs3i+wWL3/q3ug0vDLnjcM9sWnwJ7cH8RmaFbWEqBs=</dsig:DigestValue>
18 </hash>
19 </dependentAssembly>
20 </dependency>
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.config.deploy renamed
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.deploy renamed
Binary files a/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_17/MeshMiniRouter.exe.deploy and b/public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.deploy differ
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.exe.manifest renamed
+4 -4
@@ -1,10 +1,10 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3 - <asmv1:assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.17" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
3 + <asmv1:assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.18" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
4 <description asmv2:iconFile="MeshMiniRouter.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
5 <application />
6 <entryPoint>
7 - <assemblyIdentity name="MeshMiniRouter" version="1.0.6862.31040" language="neutral" processorArchitecture="msil" />
7 + <assemblyIdentity name="MeshMiniRouter" version="1.0.6862.32063" language="neutral" processorArchitecture="msil" />
8 <commandLine file="MeshMiniRouter.exe" parameters="" />
9 </entryPoint>
10 <trustInfo>
@@ -44,13 +44,13 @@
44 </dependency>
45 <dependency>
46 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MeshMiniRouter.exe" size="186368">
47 - <assemblyIdentity name="MeshMiniRouter" version="1.0.6862.31040" language="neutral" processorArchitecture="msil" />
47 + <assemblyIdentity name="MeshMiniRouter" version="1.0.6862.32063" language="neutral" processorArchitecture="msil" />
48 <hash>
49 <dsig:Transforms>
50 <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
51 </dsig:Transforms>
52 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
53 - <dsig:DigestValue>H+qrBKAsVVx/APIHP2Tq2cK3/FUh4SIShsjM6eo0fUw=</dsig:DigestValue>
53 + <dsig:DigestValue>9CBRw9I6oJzioNiqBO2hWNS8fPrKJs8WKO4N99KM6NY=</dsig:DigestValue>
54 </hash>
55 </dependentAssembly>
56 </dependency>
public/clickonce/minirouter/Application Files/MeshMiniRouter_2_0_0_18/MeshMiniRouter.ico.deploy renamed
public/clickonce/minirouter/MeshMiniRouter.application
+4 -4
@@ -1,20 +1,20 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
3 - <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.17" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
3 + <assemblyIdentity name="MeshMiniRouter.application" version="2.0.0.18" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
4 <description asmv2:publisher="Meshcentral.com" asmv2:product="MeshCentral Mini-Router" asmv2:supportUrl="https://meshcentral.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
5 <deployment install="false" mapFileExtensions="true" trustURLParameters="true" />
6 <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
7 <framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
8 </compatibleFrameworks>
9 <dependency>
10 - <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_17\MeshMiniRouter.exe.manifest" size="4712">
11 - <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.17" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
10 + <dependentAssembly dependencyType="install" codebase="Application Files\MeshMiniRouter_2_0_0_18\MeshMiniRouter.exe.manifest" size="4712">
11 + <assemblyIdentity name="MeshMiniRouter.exe" version="2.0.0.18" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
12 <hash>
13 <dsig:Transforms>
14 <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15 </dsig:Transforms>
16 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17 - <dsig:DigestValue>nyBHr6mVUVhjU6l4Bmrfa0juzDDrPD6BiiYzVMhKKVA=</dsig:DigestValue>
17 + <dsig:DigestValue>MRs3i+wWL3/q3ug0vDLnjcM9sWnwJ7cH8RmaFbWEqBs=</dsig:DigestValue>
18 </hash>
19 </dependentAssembly>
20 </dependency>
public/clickonce/minirouter/publish.htm
+1 -1
@@ -59,7 +59,7 @@ FONT.key {font-weight: bold; color: darkgreen}
59 <TR><TD ALIGN="LEFT"><TABLE CELLPADDING="2" CELLSPACING="0" BORDER="0" WIDTH="540"><TR><TD WIDTH="496">
60
61 <!-- Begin AppInfo -->
62 -<TABLE><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Name:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>MeshCentral Mini-Router</TD></TR><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Version:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>2.0.0.17</TD></TR><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Publisher:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>Meshcentral.com</TD></TR><tr><td colspan="3">&nbsp;</td></tr></TABLE>
62 +<TABLE><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Name:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>MeshCentral Mini-Router</TD></TR><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Version:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>2.0.0.18</TD></TR><TR><TD COLSPAN="3">&nbsp;</TD></TR><TR><TD><B>Publisher:</B></TD><TD WIDTH="5"><SPACER TYPE="block" WIDTH="10" /></TD><TD>Meshcentral.com</TD></TR><tr><td colspan="3">&nbsp;</td></tr></TABLE>
63 <!-- End AppInfo -->
64
65
views/default.handlebars
+2 -1
@@ -1271,7 +1271,8 @@
1271 case 'getcookie': {
1272 if (message.tag == 'clickonce') {
1273 var basicPort = "{{{serverRedirPort}}}"==""?"{{{serverPublicPort}}}":"{{{serverRedirPort}}}";
1274 - var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol + "&HOL=1";
1274 + //var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol + "&HOL=1";
1275 + var rdpurl = "http://" + window.location.hostname + ":" + basicPort + "/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F" + window.location.hostname + "%2Fmeshrelay.ashx%3Fauth=" + message.cookie + "&CH={{{webcerthash}}}&AP=" + message.protocol;
1276 window.open(rdpurl, '_blank');
1277 }
1278 break;
webserver.js
+14 -7
@@ -1792,10 +1792,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1792 obj.app.post(url + 'uploadmeshcorefile.ashx', handleUploadMeshCoreFile);
1793 obj.app.get(url + 'userfiles/*', handleDownloadUserFiles);
1794 obj.app.ws(url + 'echo.ashx', handleEchoWebSocket);
1795 - obj.app.ws(url + 'meshrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, function (ws1, req1, domain, user, cookie) { obj.meshRelayHandler.CreateMeshRelay(obj, ws1, req1, domain, user, cookie); }); });
1795 + obj.app.ws(url + 'meshrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, true, function (ws1, req1, domain, user, cookie) { obj.meshRelayHandler.CreateMeshRelay(obj, ws1, req1, domain, user, cookie); }); });
1796 obj.app.get(url + 'webrelay.ashx', function (req, res) { res.send('Websocket connection expected'); });
1797 - obj.app.ws(url + 'webrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, handleRelayWebSocket); });
1798 - obj.app.ws(url + 'control.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, function (ws1, req1, domain, user, cookie) { obj.meshUserHandler.CreateMeshUser(obj, obj.db, ws1, req1, obj.args, domain); }); });
1797 + obj.app.ws(url + 'webrelay.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, false, handleRelayWebSocket); });
1798 + obj.app.ws(url + 'control.ashx', function (ws, req) { PerformWSSessionAuth(ws, req, false, function (ws1, req1, domain, user, cookie) { obj.meshUserHandler.CreateMeshUser(obj, obj.db, ws1, req1, obj.args, domain); }); });
1799
1800 // Server picture
1801 obj.app.get(url + 'serverpic.ashx', function (req, res) {
@@ -1829,7 +1829,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1829 }
1830
1831 // Authenticates a session and forwards
1832 - function PerformWSSessionAuth(ws, req, func) {
1832 + function PerformWSSessionAuth(ws, req, noAuthOk, func) {
1833 try {
1834 // Check IP filtering and domain
1835 var domain = checkUserIpAddress(ws, req);
@@ -1870,9 +1870,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1870 func(ws, req, domain, req.session.userid);
1871 return;
1872 }
1873 - // If not authenticated, close the websocket connection
1874 - Debug(1, 'ERR: Websocket no auth');
1875 - try { ws.send(JSON.stringify({ action: 'close', cause: 'noauth' })); ws.close(); } catch (e) { }
1873 +
1874 + if (noAuthOk != true) {
1875 + // If not authenticated, close the websocket connection
1876 + Debug(1, 'ERR: Websocket no auth');
1877 + try { ws.send(JSON.stringify({ action: 'close', cause: 'noauth' })); ws.close(); } catch (e) { }
1878 + } else {
1879 + // Continue this session without user authentication,
1880 + // this is expected if the agent is connecting for a tunnel.
1881 + func(ws, req, domain, null);
1882 + }
1883 } catch (e) { console.log(e); }
1884 }
1885