Fixed decodeCookie()

This commit is contained in:
Ylian Saint-Hilaire 2019-12-12 11:03:33 -08:00
parent a98874d672
commit c6f4112f22
11 changed files with 47 additions and 11 deletions

View File

@ -1858,7 +1858,7 @@ function CreateMeshCentralServer(config, args) {
// Decode a cookie back into an object using a key using AES256-GCM or AES128-CBC/HMAC-SHA386. Return null if it's not a valid cookie. (key must be 32 bytes or more) // Decode a cookie back into an object using a key using AES256-GCM or AES128-CBC/HMAC-SHA386. Return null if it's not a valid cookie. (key must be 32 bytes or more)
obj.decodeCookie = function (cookie, key, timeout) { obj.decodeCookie = function (cookie, key, timeout) {
const r = obj.decodeCookieAESGCM(cookie, key, timeout); var r = obj.decodeCookieAESGCM(cookie, key, timeout);
if (r == null) { r = obj.decodeCookieAESSHA(cookie, key, timeout); } if (r == null) { r = obj.decodeCookieAESSHA(cookie, key, timeout); }
if ((r != null) && (typeof r.once == 'string') && (r.once.length > 0)) { if ((r != null) && (typeof r.once == 'string') && (r.once.length > 0)) {
// This cookie must only be used once. // This cookie must only be used once.

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.4.5-r", "version": "0.4.5-s",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",

View File

@ -3570,7 +3570,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -3570,7 +3570,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -3570,7 +3570,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -3570,7 +3570,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -3570,7 +3570,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -4579,7 +4579,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -4579,7 +4579,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -4579,7 +4579,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;

View File

@ -4579,7 +4579,11 @@
p13clearConsoleMsg(); p13clearConsoleMsg();
// Device refresh plugin handler // Device refresh plugin handler
if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); } if (pluginHandler != null) {
pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event);
var lastTab = getstore('_curPluginPage', null);
if (lastTab != null) pluginHandler.callPluginPage(lastTab, Q('p19ph-' + lastTab));
}
} }
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching. setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10; if (!panel) panel = 10;