Commit 02130bc3 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил файл Common/Private/editorscommon.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64952 954022d7-b5bf-4e40-9824-e11837661b57
parent beda2957
......@@ -24,6 +24,7 @@
"../../Common/downloaderfiles.js",
"../../Common/commonDefines.js",
"../../Common/editorscommon.js",
"../../Common/Private/editorscommon.js",
"../../Common/Shapes/Serialize.js",
"../../Common/Shapes/SerializeWriter.js",
"../../Common/SerializeCommonWordExcel.js",
......
......@@ -18,6 +18,7 @@
"../../Common/apiCommon.js",
"../../Common/commonDefines.js",
"../../Common/editorscommon.js",
"../../Common/Private/editorscommon.js",
"../../Common/NumFormat.js",
"../../Common/Charts/charts.js",
"../../Common/Charts/DrawingArea.js",
......
......@@ -25,6 +25,7 @@
"../../Common/docscoapi.js",
"../../Common/wordcopypaste.js",
"../../Common/editorscommon.js",
"../../Common/Private/editorscommon.js",
"../../PowerPoint/Drawing/ThemeLoader.js",
"../../Common/Charts/DrawingObjects.js",
"../../Common/SerializeCommonWordExcel.js",
......
......@@ -22,6 +22,7 @@
"../../Common/downloaderfiles.js",
"../../Common/commonDefines.js",
"../../Common/editorscommon.js",
"../../Common/Private/editorscommon.js",
"../../Common/Shapes/Serialize.js",
"../../Common/Shapes/SerializeWriter.js",
"../../Common/SerializeCommonWordExcel.js",
......
"use strict";
var g_sLicenseDefaultUrl = "/license";
var g_sPublicRSAKey = '-----BEGIN CERTIFICATE-----MIIBvTCCASYCCQD55fNzc0WF7TANBgkqhkiG9w0BAQUFADAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwHhcNMTAwNTI4MDIwODUxWhcNMjAwNTI1MDIwODUxWjAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANGEYXtfgDRlWUSDn3haY4NVVQiKI9CzThoua9+DxJuiseyzmBBe7Roh1RPqdvmtOHmEPbJ+kXZYhbozzPRbFGHCJyBfCLzQfVos9/qUQ88u83b0SFA2MGmQWQAlRtLy66EkR4rDRwTj2DzR4EEXgEKpIvo8VBs/3+sHLF3ESgAhAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAEZ6mXFFq3AzfaqWHmCy1ARjlauYAa8ZmUFnLm0emg9dkVBJ63aEqARhtok6bDQDzSJxiLpCEF6G4b/Nv/M/MLyhP+OoOTmETMegAVQMq71choVJyOFE5BtQa6M/lCHEOya5QUfoRF2HF9EjRF44K3OK+u3ivTSj3zwjtpudY5Xo=-----END CERTIFICATE-----';
var g_sAESKey = '7f3d2338390c1e3e154c21005f51010e065b0f1a1e101600202473150c022a11';
function CheckLicense(licenseUrl, callback) {
licenseUrl = licenseUrl ? licenseUrl : g_sLicenseDefaultUrl;
require('jsziputils').getBinaryContent(licenseUrl, function(err, data) {
if (err) {
callback(true, false);
return;
}
try {
var base64TextData = String.fromCharCode.apply(null, new Uint8Array(data));
var decrypted = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse(base64TextData),
salt: ""
}, CryptoJS.enc.Hex.parse(g_sAESKey), {iv: CryptoJS.enc.Hex.parse(g_sAESKey.slice(0, g_sAESKey.length / 2))});
var sJson = decrypted.toString(CryptoJS.enc.Utf8);
var oJson = JSON.parse(sJson);
var hSig = oJson.signature;
delete oJson.signature;
var x509 = new X509();
x509.readCertPEM(g_sPublicRSAKey);
var isValid = x509.subjectPublicKeyRSA.verifyString(JSON.stringify(oJson), hSig);
callback(false, isValid);
} catch(e) {
callback(true, false);
}
});
}
\ No newline at end of file
......@@ -56,7 +56,6 @@ if (typeof String.prototype.repeat !== 'function') {
}
var g_oZipChanges = null;
var g_sLicenseDefaultUrl = "/license";
var g_sDownloadServiceLocalUrl = "/downloadas";
var g_sUploadServiceLocalUrl = "/upload";
var g_sUploadServiceLocalUrlOld = "/uploadold";
......@@ -133,37 +132,8 @@ DocumentUrls.prototype = {
};
var g_oDocumentUrls = new DocumentUrls();
var g_sPublicRSAKey = '-----BEGIN CERTIFICATE-----MIIBvTCCASYCCQD55fNzc0WF7TANBgkqhkiG9w0BAQUFADAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwHhcNMTAwNTI4MDIwODUxWhcNMjAwNTI1MDIwODUxWjAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANGEYXtfgDRlWUSDn3haY4NVVQiKI9CzThoua9+DxJuiseyzmBBe7Roh1RPqdvmtOHmEPbJ+kXZYhbozzPRbFGHCJyBfCLzQfVos9/qUQ88u83b0SFA2MGmQWQAlRtLy66EkR4rDRwTj2DzR4EEXgEKpIvo8VBs/3+sHLF3ESgAhAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAEZ6mXFFq3AzfaqWHmCy1ARjlauYAa8ZmUFnLm0emg9dkVBJ63aEqARhtok6bDQDzSJxiLpCEF6G4b/Nv/M/MLyhP+OoOTmETMegAVQMq71choVJyOFE5BtQa6M/lCHEOya5QUfoRF2HF9EjRF44K3OK+u3ivTSj3zwjtpudY5Xo=-----END CERTIFICATE-----';
var g_sAESKey = '7f3d2338390c1e3e154c21005f51010e065b0f1a1e101600202473150c022a11';
function CheckLicense(licenseUrl, callback) {
licenseUrl = licenseUrl ? licenseUrl : g_sLicenseDefaultUrl;
require('jsziputils').getBinaryContent(licenseUrl, function(err, data) {
if (err) {
callback(true, false);
return;
}
try {
var base64TextData = String.fromCharCode.apply(null, new Uint8Array(data));
var decrypted = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse(base64TextData),
salt: ""
}, CryptoJS.enc.Hex.parse(g_sAESKey), {iv: CryptoJS.enc.Hex.parse(g_sAESKey.slice(0, g_sAESKey.length / 2))});
var sJson = decrypted.toString(CryptoJS.enc.Utf8);
var oJson = JSON.parse(sJson);
var hSig = oJson.signature;
delete oJson.signature;
var x509 = new X509();
x509.readCertPEM(g_sPublicRSAKey);
var isValid = x509.subjectPublicKeyRSA.verifyString(JSON.stringify(oJson), hSig);
callback(false, isValid);
} catch(e) {
callback(true, false);
}
});
callback(false, false);
}
function OpenFileResult () {
......
......@@ -33,6 +33,7 @@
<script type="text/javascript" src="../../Common/commonDefines.js"></script>
<script type="text/javascript" src="../../Common/NumFormat.js"></script>
<script type="text/javascript" src="../../Common/editorscommon.js"></script>
<script type="text/javascript" src="../../Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../Common/apiCommon.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/font_engine.js"></script>
......
......@@ -48,6 +48,7 @@
<script type="text/javascript" src="../Common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../Common/commonDefines.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../Common/apiCommon.js"></script>
<script type="text/javascript" src="../Common/FontsFreeType/font_engine.js"></script>
......
......@@ -38,6 +38,7 @@
<script type="text/javascript" src="../Common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../Common/commonDefines.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../Common/apiCommon.js"></script>
<script type="text/javascript" src="../Common/FontsFreeType/font_engine.js"></script>
......
......@@ -246,6 +246,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/browser.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapi.js"></script>
......
......@@ -210,6 +210,7 @@
</script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/browser.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapi.js"></script>
......
......@@ -30,6 +30,7 @@
<script type="text/javascript" src="../Common/browser.js"></script>
<script type="text/javascript" src="../Common/wordcopypaste.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="menu/main_menu.js"></script>
<script type="text/javascript" src="menu/Statusbar.js"></script>
......@@ -47,12 +48,6 @@
<script type="text/javascript" src="../Word/Drawing/GlobalLoaders.js"></script>
<script type="text/javascript" src="../Common/apiCommon.js"></script>
<script type="text/javascript" src="../Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../Common/docscoapi.js"></script>
<script type="text/javascript" src="../Common/wordcopypaste.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../PowerPoint/Drawing/ThemeLoader.js"></script>
<script type="text/javascript" src="../Common/Shapes/EditorSettings.js"></script>
......
......@@ -260,6 +260,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Drawing/ThemeLoader.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/EditorSettings.js"></script>
......
......@@ -23,6 +23,7 @@
<script type="text/javascript" src="../Common/CommonDefines.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../Excel/apiDefines.js"></script>
......
......@@ -28,6 +28,7 @@
<!-- application -->
<script type="text/javascript" src="../Common/browser.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../Common/docscoapi.js"></script>
......
......@@ -243,6 +243,7 @@
<!-- -->
<script type="text/javascript" src="../../../../OfficeWeb/Common/browser.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapi.js"></script>
......
......@@ -71,10 +71,10 @@
<!-- SDK -->
<script type="text/javascript" src="../../../sdk/Common/AllFonts.js"></script>
<!--<script type="text/javascript" src="../../../sdk/Word/sdk-all.js"></script>-->
<script type="text/javascript" src="../../../../OfficeWeb/Common/browser.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapi.js"></script>
......
......@@ -26,7 +26,8 @@
<script type="text/javascript" src="../../OfficeWeb/Common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/CommonDefines.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/NumFormat.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/editorscommon.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/Private/editorscommon.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/apiCommon.js"></script>
......
......@@ -36,6 +36,7 @@
<script type="text/javascript" src="../Common/CommonDefines.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/Private/editorscommon.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../Excel/apiDefines.js"></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment