@syncfusion/ej2-pdf 23.1.38 → 23.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.38
3
+ * version : 23.1.39
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf@*",
3
- "_id": "@syncfusion/ej2-pdf@23.1.36",
3
+ "_id": "@syncfusion/ej2-pdf@23.1.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-UxecW8YkOzEjWhPgZkAUw8nzEM9h+f7FgHWcrp4hWkhT+4+2nAlGwVuZFBfNQlQnFmP48qIoefBjCzYdKAKOXA==",
5
+ "_integrity": "sha512-FL3hsArLkJBVTcoPCA8xNYz8Ap0RpHpKVVdR2R5qETpw4SoLPbvv78ig0Samph39eQ0s/WFgzqMxmiJZmwY7VQ==",
6
6
  "_location": "/@syncfusion/ej2-pdf",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -21,8 +21,8 @@
21
21
  "/@syncfusion/ej2",
22
22
  "/@syncfusion/ej2-pdfviewer"
23
23
  ],
24
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-23.1.36.tgz",
25
- "_shasum": "c692c77b2b0ef1c720b95c073508daaa6e63a2c2",
24
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-23.1.38.tgz",
25
+ "_shasum": "9adbd287dae5a6e106e9ec477330805f5aa0fb91",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
28
28
  "author": {
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/pdf"
56
56
  },
57
57
  "typings": "index.d.ts",
58
- "version": "23.1.38",
58
+ "version": "23.1.39",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -99,21 +99,21 @@ var _PdfEncryptor = /** @class */ (function () {
99
99
  else {
100
100
  algorithm_1 = new _BasicEncryption();
101
101
  }
102
- var password_1;
102
+ var p = void 0;
103
103
  if (passwordBytes) {
104
- password_1 = passwordBytes.subarray(0, Math.min(127, passwordBytes.length));
104
+ p = passwordBytes.subarray(0, Math.min(127, passwordBytes.length));
105
105
  }
106
106
  else {
107
- password_1 = new Uint8Array([]);
107
+ p = new Uint8Array([]);
108
108
  }
109
- if (algorithm_1._checkUserPassword(password_1, userValidationSalt, userPassword)) {
110
- encryptionKey = this._createEncryptionKey(true, password_1, ownerKeySalt, uBytes, userKeySalt, ownerEncryption, userEncryption, algorithm_1);
109
+ if (algorithm_1._checkUserPassword(p, userValidationSalt, userPassword)) {
110
+ encryptionKey = this._createEncryptionKey(true, p, ownerKeySalt, uBytes, userKeySalt, ownerEncryption, userEncryption, algorithm_1);
111
111
  this._isUserPassword = true;
112
- if (password_1.length && algorithm_1._checkOwnerPassword(password_1, ownerValidationSalt, uBytes, ownerPassword)) {
112
+ if (password.length && algorithm_1._checkOwnerPassword(p, ownerValidationSalt, uBytes, ownerPassword)) {
113
113
  this._hasUserPasswordOnly = true;
114
114
  }
115
115
  }
116
- else if (password_1.length && algorithm_1._checkOwnerPassword(password_1, ownerValidationSalt, uBytes, ownerPassword)) {
116
+ else if (password.length && algorithm_1._checkOwnerPassword(p, ownerValidationSalt, uBytes, ownerPassword)) {
117
117
  encryptionKey = this._createEncryptionKey(false, passwordBytes, ownerKeySalt, uBytes, userKeySalt, ownerEncryption, userEncryption, algorithm_1);
118
118
  this._isUserPassword = false;
119
119
  }
@@ -128,7 +128,6 @@ var _PdfEncryptor = /** @class */ (function () {
128
128
  throw new Error('Cannot open an encrypted document. The password is invalid.');
129
129
  }
130
130
  }
131
- this._encryptionKey = encryptionKey;
132
131
  if (algorithm >= 4) {
133
132
  var cipherDictionary = dictionary.get('CF');
134
133
  if (cipherDictionary) {
@@ -148,6 +147,10 @@ var _PdfEncryptor = /** @class */ (function () {
148
147
  this._string = dictionary.get('StrF') || _PdfName.get('Identity');
149
148
  this._eff = dictionary.get('EFF') || this._stream;
150
149
  }
150
+ if (!encryptionKey && !this._encryptOnlyAttachment) {
151
+ throw new Error('Cannot open an encrypted document. The password is invalid.');
152
+ }
153
+ this._encryptionKey = encryptionKey;
151
154
  }
152
155
  Object.defineProperty(_PdfEncryptor.prototype, "_md5", {
153
156
  get: function () {
@@ -1552,7 +1555,7 @@ var _AdvancedEncryption256Cipher = /** @class */ (function (_super) {
1552
1555
  }
1553
1556
  }
1554
1557
  for (var n = 0; n < 4; ++n) {
1555
- result[Number.parseInt(i.toString(), 10)] = t1 ^= result[j - 32];
1558
+ result[Number.parseInt(j.toString(), 10)] = t1 ^= result[j - 32];
1556
1559
  result[j + 1] = t2 ^= result[j - 31];
1557
1560
  result[j + 2] = t3 ^= result[j - 30];
1558
1561
  result[j + 3] = t4 ^= result[j - 29];