@it-enterprise/digital-signature 1.5.5 → 1.5.6
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.
- package/dist/euscp.worker.js +758 -300
- package/dist/it-digital-signature.mjs +298 -301
- package/dist/it-digital-signature.mjs.map +1 -1
- package/dist/it-digital-signature.umd.js +1 -1
- package/dist/it-digital-signature.umd.js.map +1 -1
- package/euscp/euscp.js +7 -7
- package/package.json +2 -2
- package/src/DigitalSignature.js +4 -2
- package/src/Models.js +1 -1
package/dist/euscp.worker.js
CHANGED
|
@@ -837,14 +837,16 @@ if (typeof window === 'undefined') {
|
|
|
837
837
|
m = 0;
|
|
838
838
|
if (l === n.Type.BITSTRING && (i(t, r, 1), m = t.getByte(), r--), 0 === m) try {
|
|
839
839
|
o = t.length();
|
|
840
|
-
var C =
|
|
840
|
+
var C = {
|
|
841
841
|
strict: !0,
|
|
842
|
-
decodeBitStrings: !
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
842
|
+
decodeBitStrings: !1,
|
|
843
|
+
maxDepth: s.maxDepth
|
|
844
|
+
},
|
|
845
|
+
E = e(t, r, a + 1, C),
|
|
846
|
+
S = o - t.length();
|
|
847
|
+
r -= S, l == n.Type.BITSTRING && S++;
|
|
848
|
+
var T = E.tagClass;
|
|
849
|
+
S !== h || T !== n.Class.UNIVERSAL && T !== n.Class.CONTEXT_SPECIFIC || (p = [E]);
|
|
848
850
|
} catch (e) {}
|
|
849
851
|
void 0 === p && (t.read = g, r = v);
|
|
850
852
|
}
|
|
@@ -855,10 +857,10 @@ if (typeof window === 'undefined') {
|
|
|
855
857
|
}
|
|
856
858
|
if (l === n.Type.BMPSTRING) for (p = ""; h > 0; h -= 2) i(t, r, 2), p += String.fromCharCode(t.getInt16()), r -= 2;else p = t.getBytes(h), r -= h;
|
|
857
859
|
}
|
|
858
|
-
var
|
|
860
|
+
var I = void 0 === f ? null : {
|
|
859
861
|
bitStringContents: f
|
|
860
862
|
};
|
|
861
|
-
return n.create(u, l, y, p,
|
|
863
|
+
return n.create(u, l, y, p, I);
|
|
862
864
|
}(e, e.length(), 0, t);
|
|
863
865
|
if (t.parseAllBytes && 0 !== e.length()) {
|
|
864
866
|
var o = new Error("Unparsed DER bytes remain after ASN.1 parsing.");
|
|
@@ -890,24 +892,24 @@ if (typeof window === 'undefined') {
|
|
|
890
892
|
n,
|
|
891
893
|
i,
|
|
892
894
|
s = e.split("."),
|
|
893
|
-
o = a.util.createBuffer()
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
895
|
+
o = a.util.createBuffer(),
|
|
896
|
+
c = parseInt(s[0], 10),
|
|
897
|
+
u = parseInt(s[1], 10);
|
|
898
|
+
if (!(c >= 0 && c <= 2 && u >= 0) || c < 2 && u > 39) throw new Error("Invalid OID; the first two arcs are out of range.");
|
|
899
|
+
for (var l = 1; l < s.length; ++l) {
|
|
900
|
+
if (t = !0, r = [], (n = 1 === l ? 40 * c + u : parseInt(s[l], 10)) > 4294967295) throw new Error("OID value too large; max is 32-bits.");
|
|
897
901
|
do {
|
|
898
902
|
i = 127 & n, n >>>= 7, t || (i |= 128), r.push(i), t = !1;
|
|
899
903
|
} while (n > 0);
|
|
900
|
-
for (var
|
|
904
|
+
for (var p = r.length - 1; p >= 0; --p) o.putByte(r[p]);
|
|
901
905
|
}
|
|
902
906
|
return o;
|
|
903
907
|
}, n.derToOid = function (e) {
|
|
904
|
-
var t;
|
|
908
|
+
var t, r;
|
|
905
909
|
"string" == typeof e && (e = a.util.createBuffer(e));
|
|
906
|
-
var
|
|
907
|
-
t = Math.floor(r / 40) + "." + r % 40;
|
|
908
|
-
for (var n = 0; e.length() > 0;) {
|
|
910
|
+
for (var n = 0, i = !0; e.length() > 0;) {
|
|
909
911
|
if (n > 70368744177663) throw new Error("OID value too large; max is 53-bits.");
|
|
910
|
-
n *= 128, 128 & (r = e.getByte()) ? n += 127 & r : (
|
|
912
|
+
n *= 128, 128 & (r = e.getByte()) ? n += 127 & r : (n += r, i ? (t = n < 80 ? Math.floor(n / 40) + "." + n % 40 : "2." + (n - 80), i = !1) : t += "." + n, n = 0);
|
|
911
913
|
}
|
|
912
914
|
return t;
|
|
913
915
|
}, n.utcTimeToDate = function (e) {
|
|
@@ -1286,6 +1288,10 @@ if (typeof window === 'undefined') {
|
|
|
1286
1288
|
function s(e) {
|
|
1287
1289
|
return e.replace(/^\s+/, "");
|
|
1288
1290
|
}
|
|
1291
|
+
function o(e) {
|
|
1292
|
+
for (var t = e.length; t > 0 && /\s/.test(e.charAt(t - 1));) --t;
|
|
1293
|
+
return e.substring(0, t);
|
|
1294
|
+
}
|
|
1289
1295
|
n.encode = function (e, t) {
|
|
1290
1296
|
t = t || {};
|
|
1291
1297
|
var r,
|
|
@@ -1302,51 +1308,124 @@ if (typeof window === 'undefined') {
|
|
|
1302
1308
|
}, e.dekInfo.parameters && r.values.push(e.dekInfo.parameters), n += i(r)), e.headers) for (var s = 0; s < e.headers.length; ++s) n += i(e.headers[s]);
|
|
1303
1309
|
return e.procType && (n += "\r\n"), n += a.util.encode64(e.body, t.maxline || 64) + "\r\n", n += "-----END " + e.type + "-----\r\n";
|
|
1304
1310
|
}, n.decode = function (e) {
|
|
1305
|
-
for (var t, r = [], n =
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1311
|
+
for (var t, r = [], n = function (e) {
|
|
1312
|
+
var t = /[:A-Za-z0-9+\/=\s]/,
|
|
1313
|
+
r = /[^:A-Za-z0-9+\/=\s]/g,
|
|
1314
|
+
a = /[^\x21-\x7e\s]/g,
|
|
1315
|
+
n = /[A-Z0-9- ]/;
|
|
1316
|
+
function i(t, r) {
|
|
1317
|
+
t.lastIndex = r;
|
|
1318
|
+
var a = t.exec(e);
|
|
1319
|
+
return a ? a.index : e.length;
|
|
1320
|
+
}
|
|
1321
|
+
function s(t) {
|
|
1322
|
+
for (var r = t; r < e.length && n.test(e.charAt(r)); ++r) if (r > t && "-----" === e.substr(r, 5)) return e.substring(t, r);
|
|
1323
|
+
return null;
|
|
1324
|
+
}
|
|
1325
|
+
function o(t) {
|
|
1326
|
+
return "\r" === e.charAt(t) && ++t, "\n" !== e.charAt(t) ? -1 : ("\r" === e.charAt(++t) && ++t, "\n" === e.charAt(t) ? t + 1 : -1);
|
|
1327
|
+
}
|
|
1328
|
+
function c(e, t) {
|
|
1329
|
+
for (var r = e; r < t; ++r) {
|
|
1330
|
+
var a = o(r);
|
|
1331
|
+
if (-1 !== a && a < t) return r;
|
|
1332
|
+
}
|
|
1333
|
+
return -1;
|
|
1334
|
+
}
|
|
1335
|
+
for (var u = {}, l = e.indexOf("-----END "); -1 !== l; l = e.indexOf("-----END ", l + 1)) {
|
|
1336
|
+
for (var p = s(l + 9), f = l; f > 0 && t.test(e.charAt(f - 1));) --f;
|
|
1337
|
+
var h = c(f, l);
|
|
1338
|
+
if (null !== p && -1 !== h) {
|
|
1339
|
+
var d = "$" + p;
|
|
1340
|
+
(u[d] = u[d] || []).push({
|
|
1341
|
+
end: l,
|
|
1342
|
+
blank: h
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
var y = 0,
|
|
1347
|
+
g = -1;
|
|
1348
|
+
return {
|
|
1349
|
+
next: function () {
|
|
1350
|
+
for (var t; -1 !== (t = e.indexOf("-----BEGIN ", y));) {
|
|
1351
|
+
y = t + 1;
|
|
1352
|
+
var n = s(t + 11);
|
|
1353
|
+
if (null !== n) {
|
|
1354
|
+
var l = t + 16 + n.length,
|
|
1355
|
+
p = i(r, l),
|
|
1356
|
+
f = "-----END " === e.substr(p, 9) && s(p + 9) === n;
|
|
1357
|
+
l > g && (g = i(a, l));
|
|
1358
|
+
var h = null,
|
|
1359
|
+
d = u["$" + n];
|
|
1360
|
+
if (d) {
|
|
1361
|
+
for (var v = 0, m = d.length; v < m;) {
|
|
1362
|
+
var C = v + m >> 1;
|
|
1363
|
+
d[C].end > p ? m = C : v = C + 1;
|
|
1364
|
+
}
|
|
1365
|
+
h = d[v] || null;
|
|
1366
|
+
}
|
|
1367
|
+
var E = [];
|
|
1368
|
+
"\r" === e.charAt(l) ? ("\n" === e.charAt(l + 1) && E.push(l + 2), E.push(l + 1)) : "\n" === e.charAt(l) && E.push(l + 1), E.push(l);
|
|
1369
|
+
for (var S = 0; S < E.length; ++S) {
|
|
1370
|
+
var T = E[S],
|
|
1371
|
+
I = f ? c(T + 1, p) : -1,
|
|
1372
|
+
A = p;
|
|
1373
|
+
if (-1 === I && h && (I = h.blank, A = h.end), -1 !== I && I <= g) {
|
|
1374
|
+
var b = o(I);
|
|
1375
|
+
return y = A + 14 + n.length, [e.substring(t, y), n, e.substring(T, b), e.substring(b, A)];
|
|
1376
|
+
}
|
|
1377
|
+
if (f && T < p) return y = p + 14 + n.length, [e.substring(t, y), n, void 0, e.substring(T, p)];
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
return null;
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
}(e = String(e)), i = /(?:^|[^\x21-\x7e])([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/, c = /\r?\n/; t = n.next();) {
|
|
1385
|
+
var u = t[1];
|
|
1386
|
+
"NEW CERTIFICATE REQUEST" === u && (u = "CERTIFICATE REQUEST");
|
|
1387
|
+
var l = {
|
|
1388
|
+
type: u,
|
|
1310
1389
|
procType: null,
|
|
1311
1390
|
contentDomain: null,
|
|
1312
1391
|
dekInfo: null,
|
|
1313
1392
|
headers: [],
|
|
1314
1393
|
body: a.util.decode64(t[3])
|
|
1315
1394
|
};
|
|
1316
|
-
if (r.push(
|
|
1317
|
-
for (var
|
|
1318
|
-
for (var
|
|
1319
|
-
var
|
|
1320
|
-
if (!/\s/.test(
|
|
1321
|
-
|
|
1395
|
+
if (r.push(l), t[2]) {
|
|
1396
|
+
for (var p = t[2].split(c), f = 0; t && f < p.length;) {
|
|
1397
|
+
for (var h = o(p[f]), d = f + 1; d < p.length; ++d) {
|
|
1398
|
+
var y = p[d];
|
|
1399
|
+
if (!/\s/.test(y[0])) break;
|
|
1400
|
+
h += y, f = d;
|
|
1322
1401
|
}
|
|
1323
|
-
if (t =
|
|
1324
|
-
for (var
|
|
1402
|
+
if (t = h.match(i)) {
|
|
1403
|
+
for (var g = {
|
|
1325
1404
|
name: t[1],
|
|
1326
1405
|
values: []
|
|
1327
|
-
},
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1330
|
-
if (
|
|
1331
|
-
if (0 ===
|
|
1332
|
-
|
|
1333
|
-
algorithm:
|
|
1334
|
-
parameters:
|
|
1406
|
+
}, v = t[2].split(","), m = 0; m < v.length; ++m) g.values.push(s(v[m]));
|
|
1407
|
+
if (l.procType) {
|
|
1408
|
+
if (l.contentDomain || "Content-Domain" !== g.name) {
|
|
1409
|
+
if (l.dekInfo || "DEK-Info" !== g.name) l.headers.push(g);else {
|
|
1410
|
+
if (0 === g.values.length) throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');
|
|
1411
|
+
l.dekInfo = {
|
|
1412
|
+
algorithm: v[0],
|
|
1413
|
+
parameters: v[1] || null
|
|
1335
1414
|
};
|
|
1336
1415
|
}
|
|
1337
|
-
} else
|
|
1416
|
+
} else l.contentDomain = v[0] || "";
|
|
1338
1417
|
} else {
|
|
1339
|
-
if ("Proc-Type" !==
|
|
1340
|
-
if (2 !==
|
|
1341
|
-
|
|
1342
|
-
version:
|
|
1343
|
-
type:
|
|
1418
|
+
if ("Proc-Type" !== g.name) throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');
|
|
1419
|
+
if (2 !== g.values.length) throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');
|
|
1420
|
+
l.procType = {
|
|
1421
|
+
version: v[0],
|
|
1422
|
+
type: v[1]
|
|
1344
1423
|
};
|
|
1345
1424
|
}
|
|
1346
1425
|
}
|
|
1347
|
-
++
|
|
1426
|
+
++f;
|
|
1348
1427
|
}
|
|
1349
|
-
if ("ENCRYPTED" ===
|
|
1428
|
+
if ("ENCRYPTED" === l.procType && !l.dekInfo) throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');
|
|
1350
1429
|
}
|
|
1351
1430
|
}
|
|
1352
1431
|
if (0 === r.length) throw new Error("Invalid PEM formatted message.");
|
|
@@ -1521,8 +1600,8 @@ if (typeof window === 'undefined') {
|
|
|
1521
1600
|
for (var I = 0; I < m.length; ++I) {
|
|
1522
1601
|
m[I] ? (S = S << 2 | S >>> 26, T = T << 2 | T >>> 26) : (S = S << 1 | S >>> 27, T = T << 1 | T >>> 27);
|
|
1523
1602
|
var A = r[(S &= -15) >>> 28] | a[S >>> 24 & 15] | n[S >>> 20 & 15] | i[S >>> 16 & 15] | s[S >>> 12 & 15] | o[S >>> 8 & 15] | c[S >>> 4 & 15],
|
|
1524
|
-
|
|
1525
|
-
t = 65535 & (
|
|
1603
|
+
b = u[(T &= -15) >>> 28] | l[T >>> 24 & 15] | p[T >>> 20 & 15] | f[T >>> 16 & 15] | h[T >>> 12 & 15] | d[T >>> 8 & 15] | y[T >>> 4 & 15];
|
|
1604
|
+
t = 65535 & (b >>> 16 ^ A), v[C++] = A ^ t, v[C++] = b ^ t << 16;
|
|
1526
1605
|
}
|
|
1527
1606
|
}
|
|
1528
1607
|
return v;
|
|
@@ -1749,7 +1828,11 @@ if (typeof window === 'undefined') {
|
|
|
1749
1828
|
capture: "digest"
|
|
1750
1829
|
}]
|
|
1751
1830
|
},
|
|
1752
|
-
y = function (e) {
|
|
1831
|
+
y = function (e, t, r) {
|
|
1832
|
+
var a = [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(e).getBytes())];
|
|
1833
|
+
return r && a.push(s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")), s.toDer(s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, a), s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, t)])).getBytes();
|
|
1834
|
+
},
|
|
1835
|
+
g = function (e) {
|
|
1753
1836
|
var t;
|
|
1754
1837
|
if (!(e.algorithm in c.oids)) {
|
|
1755
1838
|
var r = new Error("Unknown message digest algorithm.");
|
|
@@ -1763,7 +1846,7 @@ if (typeof window === 'undefined') {
|
|
|
1763
1846
|
var o = s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, e.digest().getBytes());
|
|
1764
1847
|
return n.value.push(i), n.value.push(o), s.toDer(n).getBytes();
|
|
1765
1848
|
},
|
|
1766
|
-
|
|
1849
|
+
v = function (e, t, r) {
|
|
1767
1850
|
if (r) return e.modPow(t.e, t.n);
|
|
1768
1851
|
if (!t.p || !t.q) return e.modPow(t.d, t.n);
|
|
1769
1852
|
var i;
|
|
@@ -1775,7 +1858,7 @@ if (typeof window === 'undefined') {
|
|
|
1775
1858
|
var c = s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);
|
|
1776
1859
|
return c = c.multiply(i.modInverse(t.n)).mod(t.n);
|
|
1777
1860
|
};
|
|
1778
|
-
function
|
|
1861
|
+
function m(e, t, r) {
|
|
1779
1862
|
var n = a.util.createBuffer(),
|
|
1780
1863
|
i = Math.ceil(t.n.bitLength() / 8);
|
|
1781
1864
|
if (e.length > i - 11) {
|
|
@@ -1796,7 +1879,7 @@ if (typeof window === 'undefined') {
|
|
|
1796
1879
|
}
|
|
1797
1880
|
return n.putByte(0), n.putBytes(e), n;
|
|
1798
1881
|
}
|
|
1799
|
-
function
|
|
1882
|
+
function C(e, t, r, n, i) {
|
|
1800
1883
|
var s = Math.ceil(t.n.bitLength() / 8),
|
|
1801
1884
|
o = a.util.createBuffer(e),
|
|
1802
1885
|
c = o.getByte(),
|
|
@@ -1828,7 +1911,7 @@ if (typeof window === 'undefined') {
|
|
|
1828
1911
|
if (0 !== o.getByte() || l !== s - 3 - o.length()) throw new Error("Encryption block is invalid.");
|
|
1829
1912
|
return o.getBytes();
|
|
1830
1913
|
}
|
|
1831
|
-
function
|
|
1914
|
+
function E(e, t, r) {
|
|
1832
1915
|
"function" == typeof t && (r = t, t = {});
|
|
1833
1916
|
var i = {
|
|
1834
1917
|
algorithm: {
|
|
@@ -1866,22 +1949,22 @@ if (typeof window === 'undefined') {
|
|
|
1866
1949
|
}
|
|
1867
1950
|
"prng" in t && (i.prng = t.prng), s();
|
|
1868
1951
|
}
|
|
1869
|
-
function
|
|
1952
|
+
function S(e) {
|
|
1870
1953
|
var t = e.toString(16);
|
|
1871
1954
|
t[0] >= "8" && (t = "00" + t);
|
|
1872
1955
|
var r = a.util.hexToBytes(t);
|
|
1873
1956
|
return r.length > 1 && (0 === r.charCodeAt(0) && 0 == (128 & r.charCodeAt(1)) || 255 === r.charCodeAt(0) && 128 == (128 & r.charCodeAt(1))) ? r.substr(1) : r;
|
|
1874
1957
|
}
|
|
1875
|
-
function
|
|
1958
|
+
function T(e) {
|
|
1876
1959
|
return e <= 100 ? 27 : e <= 150 ? 18 : e <= 200 ? 15 : e <= 250 ? 12 : e <= 300 ? 9 : e <= 350 ? 8 : e <= 400 ? 7 : e <= 500 ? 6 : e <= 600 ? 5 : e <= 800 ? 4 : e <= 1250 ? 3 : 2;
|
|
1877
1960
|
}
|
|
1878
|
-
function
|
|
1961
|
+
function I(e) {
|
|
1879
1962
|
return a.util.isNodejs && "function" == typeof i[e];
|
|
1880
1963
|
}
|
|
1881
|
-
function
|
|
1964
|
+
function A(e) {
|
|
1882
1965
|
return void 0 !== o.globalScope && "object" == typeof o.globalScope.crypto && "object" == typeof o.globalScope.crypto.subtle && "function" == typeof o.globalScope.crypto.subtle[e];
|
|
1883
1966
|
}
|
|
1884
|
-
function
|
|
1967
|
+
function b(e) {
|
|
1885
1968
|
return void 0 !== o.globalScope && "object" == typeof o.globalScope.msCrypto && "object" == typeof o.globalScope.msCrypto.subtle && "function" == typeof o.globalScope.msCrypto.subtle[e];
|
|
1886
1969
|
}
|
|
1887
1970
|
function B(e) {
|
|
@@ -1892,8 +1975,8 @@ if (typeof window === 'undefined') {
|
|
|
1892
1975
|
var i,
|
|
1893
1976
|
s = r,
|
|
1894
1977
|
o = Math.ceil(t.n.bitLength() / 8);
|
|
1895
|
-
!1 !== r && !0 !== r ? (s = 2 === r, i =
|
|
1896
|
-
for (var c = new n(i.toHex(), 16), u =
|
|
1978
|
+
!1 !== r && !0 !== r ? (s = 2 === r, i = m(e, t, r)) : (i = a.util.createBuffer()).putBytes(e);
|
|
1979
|
+
for (var c = new n(i.toHex(), 16), u = v(c, t, s).toString(16), l = a.util.createBuffer(), p = o - Math.ceil(u.length / 2); p > 0;) l.putByte(0), --p;
|
|
1897
1980
|
return l.putBytes(a.util.hexToBytes(u)), l.getBytes();
|
|
1898
1981
|
}, c.rsa.decrypt = function (e, t, r, i) {
|
|
1899
1982
|
var s = Math.ceil(t.n.bitLength() / 8);
|
|
@@ -1903,8 +1986,8 @@ if (typeof window === 'undefined') {
|
|
|
1903
1986
|
}
|
|
1904
1987
|
var c = new n(a.util.createBuffer(e).toHex(), 16);
|
|
1905
1988
|
if (c.compareTo(t.n) >= 0) throw new Error("Encrypted message is invalid.");
|
|
1906
|
-
for (var u =
|
|
1907
|
-
return l.putBytes(a.util.hexToBytes(u)), !1 !== i ?
|
|
1989
|
+
for (var u = v(c, t, r).toString(16), l = a.util.createBuffer(), p = s - Math.ceil(u.length / 2); p > 0;) l.putByte(0), --p;
|
|
1990
|
+
return l.putBytes(a.util.hexToBytes(u)), !1 !== i ? C(l.getBytes(), t, r) : l.getBytes();
|
|
1908
1991
|
}, c.rsa.createKeyPairGenerationState = function (e, t, r) {
|
|
1909
1992
|
"string" == typeof e && (e = parseInt(e, 10)), e = e || 2048;
|
|
1910
1993
|
var i,
|
|
@@ -1941,7 +2024,7 @@ if (typeof window === 'undefined') {
|
|
|
1941
2024
|
if (0 === e.state) {
|
|
1942
2025
|
var p = null === e.p ? e.pBits : e.qBits,
|
|
1943
2026
|
f = p - 1;
|
|
1944
|
-
0 === e.pqState ? (e.num = new n(p, e.rng), e.num.testBit(f) || e.num.bitwiseTo(n.ONE.shiftLeft(f), s, e.num), e.num.dAddOffset(31 - e.num.mod(r).byteValue(), 0), i = 0, ++e.pqState) : 1 === e.pqState ? e.num.bitLength() > p ? e.pqState = 0 : e.num.isProbablePrime(
|
|
2027
|
+
0 === e.pqState ? (e.num = new n(p, e.rng), e.num.testBit(f) || e.num.bitwiseTo(n.ONE.shiftLeft(f), s, e.num), e.num.dAddOffset(31 - e.num.mod(r).byteValue(), 0), i = 0, ++e.pqState) : 1 === e.pqState ? e.num.bitLength() > p ? e.pqState = 0 : e.num.isProbablePrime(T(e.num.bitLength())) ? ++e.pqState : e.num.dAddOffset(u[i++ % 8], 0) : 2 === e.pqState ? e.pqState = 0 === e.num.subtract(n.ONE).gcd(e.e).compareTo(n.ONE) ? 3 : 0 : 3 === e.pqState && (e.pqState = 0, null === e.p ? e.p = e.num : e.q = e.num, null !== e.p && null !== e.q && ++e.state, e.num = null);
|
|
1945
2028
|
} else if (1 === e.state) e.p.compareTo(e.q) < 0 && (e.num = e.p, e.p = e.q, e.q = e.num), ++e.state;else if (2 === e.state) e.p1 = e.p.subtract(n.ONE), e.q1 = e.q.subtract(n.ONE), e.phi = e.p1.multiply(e.q1), ++e.state;else if (3 === e.state) 0 === e.phi.gcd(e.e).compareTo(n.ONE) ? ++e.state : (e.p = null, e.q = null, e.state = 0);else if (4 === e.state) e.n = e.p.multiply(e.q), e.n.bitLength() === e.bits ? ++e.state : (e.q = null, e.state = 0);else if (5 === e.state) {
|
|
1946
2029
|
var h = e.e.modInverse(e.phi);
|
|
1947
2030
|
e.keys = {
|
|
@@ -1954,7 +2037,7 @@ if (typeof window === 'undefined') {
|
|
|
1954
2037
|
return null !== e.keys;
|
|
1955
2038
|
}, c.rsa.generateKeyPair = function (e, t, r, n) {
|
|
1956
2039
|
if (1 === arguments.length ? "object" == typeof e ? (r = e, e = void 0) : "function" == typeof e && (n = e, e = void 0) : 2 === arguments.length ? "number" == typeof e ? "function" == typeof t ? (n = t, t = void 0) : "number" != typeof t && (r = t, t = void 0) : (r = e, n = t, e = void 0, t = void 0) : 3 === arguments.length && ("number" == typeof t ? "function" == typeof r && (n = r, r = void 0) : (n = r, r = t, t = void 0)), r = r || {}, void 0 === e && (e = r.bits || 2048), void 0 === t && (t = r.e || 65537), !a.options.usePureJavaScript && !r.prng && e >= 256 && e <= 16384 && (65537 === t || 3 === t)) if (n) {
|
|
1957
|
-
if (
|
|
2040
|
+
if (I("generateKeyPair")) return i.generateKeyPair("rsa", {
|
|
1958
2041
|
modulusLength: e,
|
|
1959
2042
|
publicExponent: t,
|
|
1960
2043
|
publicKeyEncoding: {
|
|
@@ -1972,7 +2055,7 @@ if (typeof window === 'undefined') {
|
|
|
1972
2055
|
publicKey: c.publicKeyFromPem(t)
|
|
1973
2056
|
});
|
|
1974
2057
|
});
|
|
1975
|
-
if (
|
|
2058
|
+
if (A("generateKey") && A("exportKey")) return o.globalScope.crypto.subtle.generateKey({
|
|
1976
2059
|
name: "RSASSA-PKCS1-v1_5",
|
|
1977
2060
|
modulusLength: e,
|
|
1978
2061
|
publicExponent: B(t),
|
|
@@ -1992,7 +2075,7 @@ if (typeof window === 'undefined') {
|
|
|
1992
2075
|
});
|
|
1993
2076
|
}
|
|
1994
2077
|
});
|
|
1995
|
-
if (
|
|
2078
|
+
if (b("generateKey") && b("exportKey")) {
|
|
1996
2079
|
var u = o.globalScope.msCrypto.subtle.generateKey({
|
|
1997
2080
|
name: "RSASSA-PKCS1-v1_5",
|
|
1998
2081
|
modulusLength: e,
|
|
@@ -2018,7 +2101,7 @@ if (typeof window === 'undefined') {
|
|
|
2018
2101
|
n(e);
|
|
2019
2102
|
});
|
|
2020
2103
|
}
|
|
2021
|
-
} else if (
|
|
2104
|
+
} else if (I("generateKeyPairSync")) {
|
|
2022
2105
|
var l = i.generateKeyPairSync("rsa", {
|
|
2023
2106
|
modulusLength: e,
|
|
2024
2107
|
publicExponent: t,
|
|
@@ -2038,7 +2121,7 @@ if (typeof window === 'undefined') {
|
|
|
2038
2121
|
}
|
|
2039
2122
|
var p = c.rsa.createKeyPairGenerationState(e, t, r);
|
|
2040
2123
|
if (!n) return c.rsa.stepKeyPairGenerationState(p, 0), p.keys;
|
|
2041
|
-
|
|
2124
|
+
E(p, r, n);
|
|
2042
2125
|
}, c.setRsaPublicKey = c.rsa.setPublicKey = function (e, t) {
|
|
2043
2126
|
var r = {
|
|
2044
2127
|
n: e,
|
|
@@ -2046,7 +2129,7 @@ if (typeof window === 'undefined') {
|
|
|
2046
2129
|
encrypt: function (e, t, n) {
|
|
2047
2130
|
if ("string" == typeof t ? t = t.toUpperCase() : void 0 === t && (t = "RSAES-PKCS1-V1_5"), "RSAES-PKCS1-V1_5" === t) t = {
|
|
2048
2131
|
encode: function (e, t, r) {
|
|
2049
|
-
return
|
|
2132
|
+
return m(e, t, 2).getBytes();
|
|
2050
2133
|
}
|
|
2051
2134
|
};else if ("RSA-OAEP" === t || "RSAES-OAEP" === t) t = {
|
|
2052
2135
|
encode: function (e, t) {
|
|
@@ -2066,7 +2149,7 @@ if (typeof window === 'undefined') {
|
|
|
2066
2149
|
_skipPaddingChecks: !1
|
|
2067
2150
|
}), "_parseAllDigestBytes" in i || (i._parseAllDigestBytes = !0), "_skipPaddingChecks" in i || (i._skipPaddingChecks = !1), "RSASSA-PKCS1-V1_5" === n ? n = {
|
|
2068
2151
|
verify: function (e, t) {
|
|
2069
|
-
t =
|
|
2152
|
+
t = C(t, r, !0, void 0, i);
|
|
2070
2153
|
var n = s.fromDer(t, {
|
|
2071
2154
|
parseAllBytes: i._parseAllDigestBytes
|
|
2072
2155
|
}),
|
|
@@ -2077,11 +2160,14 @@ if (typeof window === 'undefined') {
|
|
|
2077
2160
|
l = s.derToOid(o.algorithmIdentifier);
|
|
2078
2161
|
if (l !== a.oids.md2 && l !== a.oids.md5 && l !== a.oids.sha1 && l !== a.oids.sha224 && l !== a.oids.sha256 && l !== a.oids.sha384 && l !== a.oids.sha512 && l !== a.oids["sha512-224"] && l !== a.oids["sha512-256"]) throw (u = new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid = l, u;
|
|
2079
2162
|
if ((l === a.oids.md2 || l === a.oids.md5) && !("parameters" in o)) throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");
|
|
2163
|
+
var p = y(l, o.digest, !0),
|
|
2164
|
+
f = y(l, o.digest, !1);
|
|
2165
|
+
if (t.substring(0, p.length) !== p && t.substring(0, f.length) !== f) throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");
|
|
2080
2166
|
return e === o.digest;
|
|
2081
2167
|
}
|
|
2082
2168
|
} : "NONE" !== n && "NULL" !== n && null !== n || (n = {
|
|
2083
2169
|
verify: function (e, t) {
|
|
2084
|
-
return e === (t =
|
|
2170
|
+
return e === (t = C(t, r, !0, void 0, i));
|
|
2085
2171
|
}
|
|
2086
2172
|
});
|
|
2087
2173
|
var o = c.rsa.decrypt(t, r, !0, !1);
|
|
@@ -2103,7 +2189,7 @@ if (typeof window === 'undefined') {
|
|
|
2103
2189
|
"string" == typeof t ? t = t.toUpperCase() : void 0 === t && (t = "RSAES-PKCS1-V1_5");
|
|
2104
2190
|
var n = c.rsa.decrypt(e, l, !1, !1);
|
|
2105
2191
|
if ("RSAES-PKCS1-V1_5" === t) t = {
|
|
2106
|
-
decode:
|
|
2192
|
+
decode: C
|
|
2107
2193
|
};else if ("RSA-OAEP" === t || "RSAES-OAEP" === t) t = {
|
|
2108
2194
|
decode: function (e, t) {
|
|
2109
2195
|
return a.pkcs1.decode_rsa_oaep(t, e, r);
|
|
@@ -2121,7 +2207,7 @@ if (typeof window === 'undefined') {
|
|
|
2121
2207
|
sign: function (e, t) {
|
|
2122
2208
|
var r = !1;
|
|
2123
2209
|
"string" == typeof t && (t = t.toUpperCase()), void 0 === t || "RSASSA-PKCS1-V1_5" === t ? (t = {
|
|
2124
|
-
encode:
|
|
2210
|
+
encode: g
|
|
2125
2211
|
}, r = 1) : "NONE" !== t && "NULL" !== t && null !== t || (t = {
|
|
2126
2212
|
encode: function () {
|
|
2127
2213
|
return e;
|
|
@@ -2151,7 +2237,7 @@ if (typeof window === 'undefined') {
|
|
|
2151
2237
|
}
|
|
2152
2238
|
return t = a.util.createBuffer(y.privateKeyModulus).toHex(), r = a.util.createBuffer(y.privateKeyPublicExponent).toHex(), i = a.util.createBuffer(y.privateKeyPrivateExponent).toHex(), o = a.util.createBuffer(y.privateKeyPrime1).toHex(), u = a.util.createBuffer(y.privateKeyPrime2).toHex(), f = a.util.createBuffer(y.privateKeyExponent1).toHex(), h = a.util.createBuffer(y.privateKeyExponent2).toHex(), d = a.util.createBuffer(y.privateKeyCoefficient).toHex(), c.setRsaPrivateKey(new n(t, 16), new n(r, 16), new n(i, 16), new n(o, 16), new n(u, 16), new n(f, 16), new n(h, 16), new n(d, 16));
|
|
2153
2239
|
}, c.privateKeyToAsn1 = c.privateKeyToRSAPrivateKey = function (e) {
|
|
2154
|
-
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(0).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1,
|
|
2240
|
+
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(0).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.n)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.e)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.d)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.p)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.q)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.dP)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.dQ)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.qInv))]);
|
|
2155
2241
|
}, c.publicKeyFromAsn1 = function (e) {
|
|
2156
2242
|
var t = {},
|
|
2157
2243
|
r = [];
|
|
@@ -2168,7 +2254,7 @@ if (typeof window === 'undefined') {
|
|
|
2168
2254
|
}, c.publicKeyToAsn1 = c.publicKeyToSubjectPublicKeyInfo = function (e) {
|
|
2169
2255
|
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(c.oids.rsaEncryption).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")]), s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, [c.publicKeyToRSAPublicKey(e)])]);
|
|
2170
2256
|
}, c.publicKeyToRSAPublicKey = function (e) {
|
|
2171
|
-
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1,
|
|
2257
|
+
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.n)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, S(e.e))]);
|
|
2172
2258
|
};
|
|
2173
2259
|
}, function (e, t, r) {
|
|
2174
2260
|
var a,
|
|
@@ -2258,7 +2344,7 @@ if (typeof window === 'undefined') {
|
|
|
2258
2344
|
function A(e) {
|
|
2259
2345
|
return e;
|
|
2260
2346
|
}
|
|
2261
|
-
function
|
|
2347
|
+
function b(e) {
|
|
2262
2348
|
this.r2 = s(), this.q3 = s(), i.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
|
|
2263
2349
|
}
|
|
2264
2350
|
y.prototype.convert = function (e) {
|
|
@@ -2448,23 +2534,23 @@ if (typeof window === 'undefined') {
|
|
|
2448
2534
|
e.multiplyTo(t, r);
|
|
2449
2535
|
}, I.prototype.sqrTo = function (e, t) {
|
|
2450
2536
|
e.squareTo(t);
|
|
2451
|
-
},
|
|
2537
|
+
}, b.prototype.convert = function (e) {
|
|
2452
2538
|
if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
|
|
2453
2539
|
if (e.compareTo(this.m) < 0) return e;
|
|
2454
2540
|
var t = s();
|
|
2455
2541
|
return e.copyTo(t), this.reduce(t), t;
|
|
2456
|
-
},
|
|
2542
|
+
}, b.prototype.revert = function (e) {
|
|
2457
2543
|
return e;
|
|
2458
|
-
},
|
|
2544
|
+
}, b.prototype.reduce = function (e) {
|
|
2459
2545
|
for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) e.dAddOffset(1, this.m.t + 1);
|
|
2460
2546
|
for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) e.subTo(this.m, e);
|
|
2461
|
-
},
|
|
2547
|
+
}, b.prototype.mulTo = function (e, t, r) {
|
|
2462
2548
|
e.multiplyTo(t, r), this.reduce(r);
|
|
2463
|
-
},
|
|
2549
|
+
}, b.prototype.sqrTo = function (e, t) {
|
|
2464
2550
|
e.squareTo(t), this.reduce(t);
|
|
2465
2551
|
};
|
|
2466
|
-
var
|
|
2467
|
-
N = (1 << 26) /
|
|
2552
|
+
var B = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
|
|
2553
|
+
N = (1 << 26) / B[B.length - 1];
|
|
2468
2554
|
i.prototype.chunkSize = function (e) {
|
|
2469
2555
|
return Math.floor(Math.LN2 * this.DB / Math.log(e));
|
|
2470
2556
|
}, i.prototype.toRadix = function (e) {
|
|
@@ -2657,7 +2743,7 @@ if (typeof window === 'undefined') {
|
|
|
2657
2743
|
n = e.bitLength(),
|
|
2658
2744
|
i = h(1);
|
|
2659
2745
|
if (n <= 0) return i;
|
|
2660
|
-
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new y(t) : t.isEven() ? new
|
|
2746
|
+
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new y(t) : t.isEven() ? new b(t) : new g(t);
|
|
2661
2747
|
var o = new Array(),
|
|
2662
2748
|
c = 3,
|
|
2663
2749
|
u = r - 1,
|
|
@@ -2681,7 +2767,7 @@ if (typeof window === 'undefined') {
|
|
|
2681
2767
|
}
|
|
2682
2768
|
return a.revert(i);
|
|
2683
2769
|
}, i.prototype.modInverse = function (e) {
|
|
2684
|
-
if (0
|
|
2770
|
+
if (this.signum() <= 0 || e.signum() <= 0) return i.ZERO;
|
|
2685
2771
|
var t = e.isEven();
|
|
2686
2772
|
if (this.isEven() && t || 0 == e.signum()) return i.ZERO;
|
|
2687
2773
|
for (var r = e.clone(), a = this.clone(), n = h(1), s = h(0), o = h(0), c = h(1); 0 != r.signum();) {
|
|
@@ -2707,14 +2793,14 @@ if (typeof window === 'undefined') {
|
|
|
2707
2793
|
}, i.prototype.isProbablePrime = function (e) {
|
|
2708
2794
|
var t,
|
|
2709
2795
|
r = this.abs();
|
|
2710
|
-
if (1 == r.t && r.data[0] <=
|
|
2711
|
-
for (t = 0; t <
|
|
2796
|
+
if (1 == r.t && r.data[0] <= B[B.length - 1]) {
|
|
2797
|
+
for (t = 0; t < B.length; ++t) if (r.data[0] == B[t]) return !0;
|
|
2712
2798
|
return !1;
|
|
2713
2799
|
}
|
|
2714
2800
|
if (r.isEven()) return !1;
|
|
2715
|
-
for (t = 1; t <
|
|
2716
|
-
for (var a =
|
|
2717
|
-
for (a = r.modInt(a); t < n;) if (a %
|
|
2801
|
+
for (t = 1; t < B.length;) {
|
|
2802
|
+
for (var a = B[t], n = t + 1; n < B.length && a < N;) a *= B[n++];
|
|
2803
|
+
for (a = r.modInt(a); t < n;) if (a % B[t++] == 0) return !1;
|
|
2718
2804
|
}
|
|
2719
2805
|
return r.millerRabin(e);
|
|
2720
2806
|
}, i.prototype.square = function () {
|
|
@@ -3268,21 +3354,58 @@ if (typeof window === 'undefined') {
|
|
|
3268
3354
|
},
|
|
3269
3355
|
g = function (e) {
|
|
3270
3356
|
var t,
|
|
3271
|
-
r = e.certificate
|
|
3357
|
+
r = e.certificate,
|
|
3358
|
+
n = e.publicKey || r.publicKey;
|
|
3272
3359
|
switch (r.signatureOid) {
|
|
3273
3360
|
case s.sha1WithRSAEncryption:
|
|
3274
3361
|
case s.sha1WithRSASignature:
|
|
3275
3362
|
break;
|
|
3276
3363
|
case s["RSASSA-PSS"]:
|
|
3277
|
-
var
|
|
3278
|
-
if (void 0 === (
|
|
3279
|
-
if (void 0 === (
|
|
3280
|
-
if (
|
|
3281
|
-
t = a.pss.create(a.md[
|
|
3364
|
+
var i, o, c;
|
|
3365
|
+
if (void 0 === (i = s[r.signatureParameters.mgf.hash.algorithmOid]) || void 0 === a.md[i]) throw (c = new Error("Unsupported MGF hash function.")).oid = r.signatureParameters.mgf.hash.algorithmOid, c.name = i, c;
|
|
3366
|
+
if (void 0 === (o = s[r.signatureParameters.mgf.algorithmOid]) || void 0 === a.mgf[o]) throw (c = new Error("Unsupported MGF function.")).oid = r.signatureParameters.mgf.algorithmOid, c.name = o, c;
|
|
3367
|
+
if (o = a.mgf[o].create(a.md[i].create()), void 0 === (i = s[r.signatureParameters.hash.algorithmOid]) || void 0 === a.md[i]) throw (c = new Error("Unsupported RSASSA-PSS hash function.")).oid = r.signatureParameters.hash.algorithmOid, c.name = i, c;
|
|
3368
|
+
t = a.pss.create(a.md[i].create(), o, r.signatureParameters.saltLength);
|
|
3282
3369
|
}
|
|
3283
|
-
return
|
|
3370
|
+
return n.verify(e.md.digest().getBytes(), e.signature, t);
|
|
3284
3371
|
};
|
|
3285
3372
|
function v(e) {
|
|
3373
|
+
var t = {
|
|
3374
|
+
permittedSubtrees: [],
|
|
3375
|
+
excludedSubtrees: [],
|
|
3376
|
+
unsupportedSubtreeRange: !1
|
|
3377
|
+
};
|
|
3378
|
+
if (e.tagClass !== n.Class.UNIVERSAL || e.type !== n.Type.SEQUENCE || !a.util.isArray(e.value)) throw new Error("Invalid nameConstraints extension.");
|
|
3379
|
+
for (var r = 0; r < e.value.length; ++r) {
|
|
3380
|
+
var s,
|
|
3381
|
+
o = e.value[r];
|
|
3382
|
+
if (o.tagClass === n.Class.CONTEXT_SPECIFIC && 0 === o.type) s = t.permittedSubtrees;else {
|
|
3383
|
+
if (o.tagClass !== n.Class.CONTEXT_SPECIFIC || 1 !== o.type) throw new Error("Invalid nameConstraints extension.");
|
|
3384
|
+
s = t.excludedSubtrees;
|
|
3385
|
+
}
|
|
3386
|
+
if (!a.util.isArray(o.value)) throw new Error("Invalid nameConstraints extension.");
|
|
3387
|
+
for (var c = 0; c < o.value.length; ++c) {
|
|
3388
|
+
var u = o.value[c];
|
|
3389
|
+
if (u.type !== n.Type.SEQUENCE || !a.util.isArray(u.value) || 0 === u.value.length || u.value[0].tagClass !== n.Class.CONTEXT_SPECIFIC) throw new Error("Invalid nameConstraints extension.");
|
|
3390
|
+
var l = u.value[0],
|
|
3391
|
+
p = {
|
|
3392
|
+
type: l.type,
|
|
3393
|
+
value: l.value
|
|
3394
|
+
};
|
|
3395
|
+
4 === l.type && a.util.isArray(l.value) && 1 === l.value.length && l.value[0].type === n.Type.SEQUENCE && a.util.isArray(l.value[0].value) && (p.attributes = i.RDNAttributesAsArray(l.value[0]));
|
|
3396
|
+
for (var f = 1; f < u.value.length; ++f) {
|
|
3397
|
+
var h = u.value[f];
|
|
3398
|
+
if (h.tagClass === n.Class.CONTEXT_SPECIFIC && 0 === h.type) p.minimum = n.derToInteger(h.value), 0 !== p.minimum && (t.unsupportedSubtreeRange = !0);else {
|
|
3399
|
+
if (h.tagClass !== n.Class.CONTEXT_SPECIFIC || 1 !== h.type) throw new Error("Invalid nameConstraints extension.");
|
|
3400
|
+
p.maximum = n.derToInteger(h.value), t.unsupportedSubtreeRange = !0;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
s.push(p);
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
return t;
|
|
3407
|
+
}
|
|
3408
|
+
function m(e) {
|
|
3286
3409
|
for (var t, r, i = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, []), s = e.attributes, o = 0; o < s.length; ++o) {
|
|
3287
3410
|
var c = (t = s[o]).value,
|
|
3288
3411
|
u = n.Type.PRINTABLESTRING;
|
|
@@ -3290,7 +3413,7 @@ if (typeof window === 'undefined') {
|
|
|
3290
3413
|
}
|
|
3291
3414
|
return i;
|
|
3292
3415
|
}
|
|
3293
|
-
function
|
|
3416
|
+
function C(e) {
|
|
3294
3417
|
for (var t, r = 0; r < e.length; ++r) {
|
|
3295
3418
|
if (void 0 === (t = e[r]).name && (t.type && t.type in i.oids ? t.name = i.oids[t.type] : t.shortName && t.shortName in o && (t.name = i.oids[o[t.shortName]])), void 0 === t.type) {
|
|
3296
3419
|
if (!t.name || !(t.name in i.oids)) throw (c = new Error("Attribute type not specified.")).attribute = t, c;
|
|
@@ -3298,13 +3421,13 @@ if (typeof window === 'undefined') {
|
|
|
3298
3421
|
}
|
|
3299
3422
|
if (void 0 === t.shortName && t.name && t.name in o && (t.shortName = o[t.name]), t.type === s.extensionRequest && (t.valueConstructed = !0, t.valueTagClass = n.Type.SEQUENCE, !t.value && t.extensions)) {
|
|
3300
3423
|
t.value = [];
|
|
3301
|
-
for (var a = 0; a < t.extensions.length; ++a) t.value.push(i.certificateExtensionToAsn1(
|
|
3424
|
+
for (var a = 0; a < t.extensions.length; ++a) t.value.push(i.certificateExtensionToAsn1(E(t.extensions[a])));
|
|
3302
3425
|
}
|
|
3303
3426
|
var c;
|
|
3304
3427
|
if (void 0 === t.value) throw (c = new Error("Attribute value not specified.")).attribute = t, c;
|
|
3305
3428
|
}
|
|
3306
3429
|
}
|
|
3307
|
-
function
|
|
3430
|
+
function E(e, t) {
|
|
3308
3431
|
if (t = t || {}, void 0 === e.name && e.id && e.id in i.oids && (e.name = i.oids[e.id]), void 0 === e.id) {
|
|
3309
3432
|
if (!e.name || !(e.name in i.oids)) throw (S = new Error("Extension ID not specified.")).extension = e, S;
|
|
3310
3433
|
e.id = i.oids[e.name];
|
|
@@ -3329,11 +3452,11 @@ if (typeof window === 'undefined') {
|
|
|
3329
3452
|
} else if ("subjectAltName" === e.name || "issuerAltName" === e.name) {
|
|
3330
3453
|
e.value = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, []);
|
|
3331
3454
|
for (var f = 0; f < e.altNames.length; ++f) {
|
|
3332
|
-
u = (
|
|
3333
|
-
if (7 ===
|
|
3334
|
-
if (null === (u = a.util.bytesFromIP(
|
|
3335
|
-
} else 8 ===
|
|
3336
|
-
e.value.value.push(n.create(n.Class.CONTEXT_SPECIFIC,
|
|
3455
|
+
u = (v = e.altNames[f]).value;
|
|
3456
|
+
if (7 === v.type && v.ip) {
|
|
3457
|
+
if (null === (u = a.util.bytesFromIP(v.ip))) throw (S = new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension = e, S;
|
|
3458
|
+
} else 8 === v.type && (u = v.oid ? n.oidToDer(n.oidToDer(v.oid)) : n.oidToDer(u));
|
|
3459
|
+
e.value.value.push(n.create(n.Class.CONTEXT_SPECIFIC, v.type, !1, u));
|
|
3337
3460
|
}
|
|
3338
3461
|
} else if ("nsComment" === e.name && t.cert) {
|
|
3339
3462
|
if (!/^[\x00-\x7F]*$/.test(e.comment) || e.comment.length < 1 || e.comment.length > 128) throw new Error('Invalid "nsComment" content.');
|
|
@@ -3349,7 +3472,7 @@ if (typeof window === 'undefined') {
|
|
|
3349
3472
|
l.push(n.create(n.Class.CONTEXT_SPECIFIC, 0, !1, d));
|
|
3350
3473
|
}
|
|
3351
3474
|
if (e.authorityCertIssuer) {
|
|
3352
|
-
var y = [n.create(n.Class.CONTEXT_SPECIFIC, 4, !0, [
|
|
3475
|
+
var y = [n.create(n.Class.CONTEXT_SPECIFIC, 4, !0, [m(!0 === e.authorityCertIssuer ? t.cert.issuer : e.authorityCertIssuer)])];
|
|
3353
3476
|
l.push(n.create(n.Class.CONTEXT_SPECIFIC, 1, !0, y));
|
|
3354
3477
|
}
|
|
3355
3478
|
if (e.serialNumber) {
|
|
@@ -3359,15 +3482,15 @@ if (typeof window === 'undefined') {
|
|
|
3359
3482
|
} else if ("cRLDistributionPoints" === e.name) {
|
|
3360
3483
|
e.value = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, []);
|
|
3361
3484
|
l = e.value.value;
|
|
3362
|
-
var
|
|
3485
|
+
var v,
|
|
3363
3486
|
C = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, []),
|
|
3364
3487
|
E = n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, []);
|
|
3365
3488
|
for (f = 0; f < e.altNames.length; ++f) {
|
|
3366
|
-
u = (
|
|
3367
|
-
if (7 ===
|
|
3368
|
-
if (null === (u = a.util.bytesFromIP(
|
|
3369
|
-
} else 8 ===
|
|
3370
|
-
E.value.push(n.create(n.Class.CONTEXT_SPECIFIC,
|
|
3489
|
+
u = (v = e.altNames[f]).value;
|
|
3490
|
+
if (7 === v.type && v.ip) {
|
|
3491
|
+
if (null === (u = a.util.bytesFromIP(v.ip))) throw (S = new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension = e, S;
|
|
3492
|
+
} else 8 === v.type && (u = v.oid ? n.oidToDer(n.oidToDer(v.oid)) : n.oidToDer(u));
|
|
3493
|
+
E.value.push(n.create(n.Class.CONTEXT_SPECIFIC, v.type, !1, u));
|
|
3371
3494
|
}
|
|
3372
3495
|
C.value.push(n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [E])), l.push(C);
|
|
3373
3496
|
}
|
|
@@ -3375,7 +3498,7 @@ if (typeof window === 'undefined') {
|
|
|
3375
3498
|
if (void 0 === e.value) throw (S = new Error("Extension value not specified.")).extension = e, S;
|
|
3376
3499
|
return e;
|
|
3377
3500
|
}
|
|
3378
|
-
function
|
|
3501
|
+
function S(e, t) {
|
|
3379
3502
|
switch (e) {
|
|
3380
3503
|
case s["RSASSA-PSS"]:
|
|
3381
3504
|
var r = [];
|
|
@@ -3384,7 +3507,7 @@ if (typeof window === 'undefined') {
|
|
|
3384
3507
|
return n.create(n.Class.UNIVERSAL, n.Type.NULL, !1, "");
|
|
3385
3508
|
}
|
|
3386
3509
|
}
|
|
3387
|
-
function
|
|
3510
|
+
function T(e) {
|
|
3388
3511
|
var t = n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, []);
|
|
3389
3512
|
if (0 === e.attributes.length) return t;
|
|
3390
3513
|
for (var r = e.attributes, i = 0; i < r.length; ++i) {
|
|
@@ -3491,17 +3614,17 @@ if (typeof window === 'undefined') {
|
|
|
3491
3614
|
return e.siginfo.algorithmOid = null, e.validity = {}, e.validity.notBefore = new Date(), e.validity.notAfter = new Date(), e.issuer = {}, e.issuer.getField = function (t) {
|
|
3492
3615
|
return h(e.issuer, t);
|
|
3493
3616
|
}, e.issuer.addField = function (t) {
|
|
3494
|
-
|
|
3617
|
+
C([t]), e.issuer.attributes.push(t);
|
|
3495
3618
|
}, e.issuer.attributes = [], e.issuer.hash = null, e.subject = {}, e.subject.getField = function (t) {
|
|
3496
3619
|
return h(e.subject, t);
|
|
3497
3620
|
}, e.subject.addField = function (t) {
|
|
3498
|
-
|
|
3621
|
+
C([t]), e.subject.attributes.push(t);
|
|
3499
3622
|
}, e.subject.attributes = [], e.subject.hash = null, e.extensions = [], e.publicKey = null, e.md = null, e.setSubject = function (t, r) {
|
|
3500
|
-
|
|
3623
|
+
C(t), e.subject.attributes = t, delete e.subject.uniqueId, r && (e.subject.uniqueId = r), e.subject.hash = null;
|
|
3501
3624
|
}, e.setIssuer = function (t, r) {
|
|
3502
|
-
|
|
3625
|
+
C(t), e.issuer.attributes = t, delete e.issuer.uniqueId, r && (e.issuer.uniqueId = r), e.issuer.hash = null;
|
|
3503
3626
|
}, e.setExtensions = function (t) {
|
|
3504
|
-
for (var r = 0; r < t.length; ++r)
|
|
3627
|
+
for (var r = 0; r < t.length; ++r) E(t[r], {
|
|
3505
3628
|
cert: e
|
|
3506
3629
|
});
|
|
3507
3630
|
e.extensions = t;
|
|
@@ -3540,7 +3663,8 @@ if (typeof window === 'undefined') {
|
|
|
3540
3663
|
c.update(l.getBytes());
|
|
3541
3664
|
}
|
|
3542
3665
|
return null !== c && (r = g({
|
|
3543
|
-
certificate:
|
|
3666
|
+
certificate: t,
|
|
3667
|
+
publicKey: e.publicKey,
|
|
3544
3668
|
md: c,
|
|
3545
3669
|
signature: t.signature
|
|
3546
3670
|
})), r;
|
|
@@ -3598,15 +3722,15 @@ if (typeof window === 'undefined') {
|
|
|
3598
3722
|
g.update(v.getBytes()), c.issuer.getField = function (e) {
|
|
3599
3723
|
return h(c.issuer, e);
|
|
3600
3724
|
}, c.issuer.addField = function (e) {
|
|
3601
|
-
|
|
3725
|
+
C([e]), c.issuer.attributes.push(e);
|
|
3602
3726
|
}, c.issuer.attributes = i.RDNAttributesAsArray(r.certIssuer), r.certIssuerUniqueId && (c.issuer.uniqueId = r.certIssuerUniqueId), c.issuer.hash = g.digest().toHex();
|
|
3603
|
-
var
|
|
3727
|
+
var m = a.md.sha1.create(),
|
|
3604
3728
|
E = n.toDer(r.certSubject);
|
|
3605
|
-
return
|
|
3729
|
+
return m.update(E.getBytes()), c.subject.getField = function (e) {
|
|
3606
3730
|
return h(c.subject, e);
|
|
3607
3731
|
}, c.subject.addField = function (e) {
|
|
3608
|
-
|
|
3609
|
-
}, c.subject.attributes = i.RDNAttributesAsArray(r.certSubject), r.certSubjectUniqueId && (c.subject.uniqueId = r.certSubjectUniqueId), c.subject.hash =
|
|
3732
|
+
C([e]), c.subject.attributes.push(e);
|
|
3733
|
+
}, c.subject.attributes = i.RDNAttributesAsArray(r.certSubject), r.certSubjectUniqueId && (c.subject.uniqueId = r.certSubjectUniqueId), c.subject.hash = m.digest().toHex(), r.certExtensions ? c.extensions = i.certificateExtensionsFromAsn1(r.certExtensions) : c.extensions = [], c.publicKey = i.publicKeyFromAsn1(r.subjectPublicKeyInfo), c;
|
|
3610
3734
|
}, i.certificateExtensionsFromAsn1 = function (e) {
|
|
3611
3735
|
for (var t = [], r = 0; r < e.value.length; ++r) for (var a = e.value[r], n = 0; n < a.value.length; ++n) t.push(i.certificateExtensionFromAsn1(a.value[n]));
|
|
3612
3736
|
return t;
|
|
@@ -3647,7 +3771,10 @@ if (typeof window === 'undefined') {
|
|
|
3647
3771
|
h.oid = n.derToOid(p.value);
|
|
3648
3772
|
}
|
|
3649
3773
|
}
|
|
3650
|
-
} else if ("
|
|
3774
|
+
} else if ("nameConstraints" === t.name && "2.5.29.30" === t.id) try {
|
|
3775
|
+
var d = v(n.fromDer(t.value));
|
|
3776
|
+
t.permittedSubtrees = d.permittedSubtrees, t.excludedSubtrees = d.excludedSubtrees, t.unsupportedSubtreeRange = d.unsupportedSubtreeRange;
|
|
3777
|
+
} catch (e) {} else if ("subjectKeyIdentifier" === t.name) {
|
|
3651
3778
|
c = n.fromDer(t.value);
|
|
3652
3779
|
t.subjectKeyIdentifier = a.util.bytesToHex(c.value);
|
|
3653
3780
|
}
|
|
@@ -3673,11 +3800,11 @@ if (typeof window === 'undefined') {
|
|
|
3673
3800
|
return c.subject.getField = function (e) {
|
|
3674
3801
|
return h(c.subject, e);
|
|
3675
3802
|
}, c.subject.addField = function (e) {
|
|
3676
|
-
|
|
3803
|
+
C([e]), c.subject.attributes.push(e);
|
|
3677
3804
|
}, c.subject.attributes = i.RDNAttributesAsArray(r.certificationRequestInfoSubject, l), c.subject.hash = l.digest().toHex(), c.publicKey = i.publicKeyFromAsn1(r.subjectPublicKeyInfo), c.getAttribute = function (e) {
|
|
3678
3805
|
return h(c, e);
|
|
3679
3806
|
}, c.addAttribute = function (e) {
|
|
3680
|
-
|
|
3807
|
+
C([e]), c.attributes.push(e);
|
|
3681
3808
|
}, c.attributes = i.CRIAttributesAsArray(r.certificationRequestInfoAttributes || []), c;
|
|
3682
3809
|
}, i.createCertificationRequest = function () {
|
|
3683
3810
|
var e = {
|
|
@@ -3689,15 +3816,15 @@ if (typeof window === 'undefined') {
|
|
|
3689
3816
|
return e.siginfo.algorithmOid = null, e.subject = {}, e.subject.getField = function (t) {
|
|
3690
3817
|
return h(e.subject, t);
|
|
3691
3818
|
}, e.subject.addField = function (t) {
|
|
3692
|
-
|
|
3819
|
+
C([t]), e.subject.attributes.push(t);
|
|
3693
3820
|
}, e.subject.attributes = [], e.subject.hash = null, e.publicKey = null, e.attributes = [], e.getAttribute = function (t) {
|
|
3694
3821
|
return h(e, t);
|
|
3695
3822
|
}, e.addAttribute = function (t) {
|
|
3696
|
-
|
|
3823
|
+
C([t]), e.attributes.push(t);
|
|
3697
3824
|
}, e.md = null, e.setSubject = function (t) {
|
|
3698
|
-
|
|
3825
|
+
C(t), e.subject.attributes = t, e.subject.hash = null;
|
|
3699
3826
|
}, e.setAttributes = function (t) {
|
|
3700
|
-
|
|
3827
|
+
C(t), e.attributes = t;
|
|
3701
3828
|
}, e.sign = function (t, r) {
|
|
3702
3829
|
e.md = r || a.md.sha1.create();
|
|
3703
3830
|
var o = s[e.md.algorithm + "WithRSAEncryption"];
|
|
@@ -3727,23 +3854,23 @@ if (typeof window === 'undefined') {
|
|
|
3727
3854
|
})), t;
|
|
3728
3855
|
}, e;
|
|
3729
3856
|
};
|
|
3730
|
-
var
|
|
3731
|
-
|
|
3732
|
-
function
|
|
3733
|
-
return e >=
|
|
3857
|
+
var I = new Date("1950-01-01T00:00:00Z"),
|
|
3858
|
+
A = new Date("2050-01-01T00:00:00Z");
|
|
3859
|
+
function b(e) {
|
|
3860
|
+
return e >= I && e < A ? n.create(n.Class.UNIVERSAL, n.Type.UTCTIME, !1, n.dateToUtcTime(e)) : n.create(n.Class.UNIVERSAL, n.Type.GENERALIZEDTIME, !1, n.dateToGeneralizedTime(e));
|
|
3734
3861
|
}
|
|
3735
3862
|
i.getTBSCertificate = function (e) {
|
|
3736
|
-
var t =
|
|
3737
|
-
r =
|
|
3738
|
-
s = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(e.version).getBytes())]), n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, a.util.hexToBytes(e.serialNumber)), n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.siginfo.algorithmOid).getBytes()),
|
|
3863
|
+
var t = b(e.validity.notBefore),
|
|
3864
|
+
r = b(e.validity.notAfter),
|
|
3865
|
+
s = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(e.version).getBytes())]), n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, a.util.hexToBytes(e.serialNumber)), n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.siginfo.algorithmOid).getBytes()), S(e.siginfo.algorithmOid, e.siginfo.parameters)]), m(e.issuer), n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [t, r]), m(e.subject), i.publicKeyToAsn1(e.publicKey)]);
|
|
3739
3866
|
return e.issuer.uniqueId && s.value.push(n.create(n.Class.CONTEXT_SPECIFIC, 1, !0, [n.create(n.Class.UNIVERSAL, n.Type.BITSTRING, !1, String.fromCharCode(0) + e.issuer.uniqueId)])), e.subject.uniqueId && s.value.push(n.create(n.Class.CONTEXT_SPECIFIC, 2, !0, [n.create(n.Class.UNIVERSAL, n.Type.BITSTRING, !1, String.fromCharCode(0) + e.subject.uniqueId)])), e.extensions.length > 0 && s.value.push(i.certificateExtensionsToAsn1(e.extensions)), s;
|
|
3740
3867
|
}, i.getCertificationRequestInfo = function (e) {
|
|
3741
|
-
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(e.version).getBytes()),
|
|
3868
|
+
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(e.version).getBytes()), m(e.subject), i.publicKeyToAsn1(e.publicKey), T(e)]);
|
|
3742
3869
|
}, i.distinguishedNameToAsn1 = function (e) {
|
|
3743
|
-
return
|
|
3870
|
+
return m(e);
|
|
3744
3871
|
}, i.certificateToAsn1 = function (e) {
|
|
3745
3872
|
var t = e.tbsCertificate || i.getTBSCertificate(e);
|
|
3746
|
-
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [t, n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.signatureOid).getBytes()),
|
|
3873
|
+
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [t, n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.signatureOid).getBytes()), S(e.signatureOid, e.signatureParameters)]), n.create(n.Class.UNIVERSAL, n.Type.BITSTRING, !1, String.fromCharCode(0) + e.signature)]);
|
|
3747
3874
|
}, i.certificateExtensionsToAsn1 = function (e) {
|
|
3748
3875
|
var t = n.create(n.Class.CONTEXT_SPECIFIC, 3, !0, []),
|
|
3749
3876
|
r = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, []);
|
|
@@ -3757,7 +3884,7 @@ if (typeof window === 'undefined') {
|
|
|
3757
3884
|
return "string" != typeof e.value && (r = n.toDer(r).getBytes()), t.value.push(n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, r)), t;
|
|
3758
3885
|
}, i.certificationRequestToAsn1 = function (e) {
|
|
3759
3886
|
var t = e.certificationRequestInfo || i.getCertificationRequestInfo(e);
|
|
3760
|
-
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [t, n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.signatureOid).getBytes()),
|
|
3887
|
+
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [t, n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(e.signatureOid).getBytes()), S(e.signatureOid, e.signatureParameters)]), n.create(n.Class.UNIVERSAL, n.Type.BITSTRING, !1, String.fromCharCode(0) + e.signature)]);
|
|
3761
3888
|
}, i.createCaStore = function (e) {
|
|
3762
3889
|
var t = {
|
|
3763
3890
|
certs: {}
|
|
@@ -3768,7 +3895,7 @@ if (typeof window === 'undefined') {
|
|
|
3768
3895
|
function s(e) {
|
|
3769
3896
|
if (!e.hash) {
|
|
3770
3897
|
var t = a.md.sha1.create();
|
|
3771
|
-
e.attributes = i.RDNAttributesAsArray(
|
|
3898
|
+
e.attributes = i.RDNAttributesAsArray(m(e), t), e.hash = t.digest().toHex();
|
|
3772
3899
|
}
|
|
3773
3900
|
}
|
|
3774
3901
|
if (t.getIssuer = function (e) {
|
|
@@ -3815,83 +3942,364 @@ if (typeof window === 'undefined') {
|
|
|
3815
3942
|
certificate_expired: "forge.pki.CertificateExpired",
|
|
3816
3943
|
certificate_unknown: "forge.pki.CertificateUnknown",
|
|
3817
3944
|
unknown_ca: "forge.pki.UnknownCertificateAuthority"
|
|
3818
|
-
}
|
|
3945
|
+
};
|
|
3946
|
+
var B = {
|
|
3947
|
+
0: "otherName",
|
|
3948
|
+
1: "rfc822Name",
|
|
3949
|
+
2: "dNSName",
|
|
3950
|
+
3: "x400Address",
|
|
3951
|
+
4: "directoryName",
|
|
3952
|
+
5: "ediPartyName",
|
|
3953
|
+
6: "uniformResourceIdentifier",
|
|
3954
|
+
7: "iPAddress",
|
|
3955
|
+
8: "registeredID"
|
|
3956
|
+
};
|
|
3957
|
+
function N(e) {
|
|
3958
|
+
for (var t = [], r = 0; r < e.extensions.length; ++r) {
|
|
3959
|
+
var a = e.extensions[r];
|
|
3960
|
+
if ("2.5.29.30" === a.id) {
|
|
3961
|
+
var i;
|
|
3962
|
+
try {
|
|
3963
|
+
var s = a.value;
|
|
3964
|
+
"string" == typeof s && (s = n.fromDer(s)), i = v(s);
|
|
3965
|
+
} catch (e) {
|
|
3966
|
+
t.push({
|
|
3967
|
+
invalid: !0
|
|
3968
|
+
});
|
|
3969
|
+
continue;
|
|
3970
|
+
}
|
|
3971
|
+
t.push({
|
|
3972
|
+
permitted: w(i.permittedSubtrees),
|
|
3973
|
+
excluded: w(i.excludedSubtrees)
|
|
3974
|
+
});
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
return t;
|
|
3978
|
+
}
|
|
3979
|
+
function w(e) {
|
|
3980
|
+
for (var t = [], r = 0; r < e.length; ++r) {
|
|
3981
|
+
var a = e[r],
|
|
3982
|
+
n = {
|
|
3983
|
+
type: a.type,
|
|
3984
|
+
supported: R(a)
|
|
3985
|
+
};
|
|
3986
|
+
if (n.supported) switch (n.type) {
|
|
3987
|
+
case 1:
|
|
3988
|
+
var i = a.value.lastIndexOf("@");
|
|
3989
|
+
n.local = -1 === i ? null : a.value.substr(0, i), n.host = a.value.substr(i + 1).toLowerCase();
|
|
3990
|
+
break;
|
|
3991
|
+
case 2:
|
|
3992
|
+
case 6:
|
|
3993
|
+
n.host = a.value.toLowerCase();
|
|
3994
|
+
break;
|
|
3995
|
+
case 4:
|
|
3996
|
+
n.attributes = _(a.attributes);
|
|
3997
|
+
break;
|
|
3998
|
+
case 7:
|
|
3999
|
+
n.value = a.value;
|
|
4000
|
+
}
|
|
4001
|
+
t.push(n);
|
|
4002
|
+
}
|
|
4003
|
+
return t;
|
|
4004
|
+
}
|
|
4005
|
+
function R(e) {
|
|
4006
|
+
if (e.minimum && 0 !== e.minimum || "maximum" in e) return !1;
|
|
4007
|
+
switch (e.type) {
|
|
4008
|
+
case 1:
|
|
4009
|
+
case 2:
|
|
4010
|
+
case 6:
|
|
4011
|
+
return "string" == typeof e.value;
|
|
4012
|
+
case 4:
|
|
4013
|
+
return a.util.isArray(e.attributes);
|
|
4014
|
+
case 7:
|
|
4015
|
+
return "string" == typeof e.value && (8 === e.value.length || 32 === e.value.length);
|
|
4016
|
+
}
|
|
4017
|
+
return !1;
|
|
4018
|
+
}
|
|
4019
|
+
function _(e) {
|
|
4020
|
+
for (var t = [], r = 0; r < e.length; ++r) {
|
|
4021
|
+
var a = e[r].value;
|
|
4022
|
+
"string" == typeof a && (" " === (a = a.replace(/[ \t\n\v\f\r]+/g, " ")).charAt(0) && (a = a.substr(1)), " " === a.charAt(a.length - 1) && (a = a.substr(0, a.length - 1)), a = a.replace(/[A-Z]+/g, function (e) {
|
|
4023
|
+
return e.toLowerCase();
|
|
4024
|
+
})), t.push({
|
|
4025
|
+
type: e[r].type,
|
|
4026
|
+
value: a
|
|
4027
|
+
});
|
|
4028
|
+
}
|
|
4029
|
+
return t;
|
|
4030
|
+
}
|
|
4031
|
+
function k(e) {
|
|
4032
|
+
if ("string" != typeof e) return !1;
|
|
4033
|
+
for (var t = !1, r = 0; r < e.length; ++r) {
|
|
4034
|
+
var a = e.charAt(r);
|
|
4035
|
+
if (!/[a-zA-Z0-9_]/.test(a)) {
|
|
4036
|
+
if (r > 0 && r < e.length - 1) {
|
|
4037
|
+
if ("-" === a) continue;
|
|
4038
|
+
var n = e.charAt(r + 1);
|
|
4039
|
+
if ("." === a && "." !== n && "-" !== n && "-" !== e.charAt(r - 1)) {
|
|
4040
|
+
t = !0;
|
|
4041
|
+
continue;
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
return !1;
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
return t;
|
|
4048
|
+
}
|
|
4049
|
+
function L(e, t, r) {
|
|
4050
|
+
var n = {
|
|
4051
|
+
type: t,
|
|
4052
|
+
value: r
|
|
4053
|
+
},
|
|
4054
|
+
i = !1;
|
|
4055
|
+
switch (e.types[t] = !0, t) {
|
|
4056
|
+
case 1:
|
|
4057
|
+
if (i = "string" == typeof r && -1 !== r.lastIndexOf("@")) {
|
|
4058
|
+
var s = r.lastIndexOf("@");
|
|
4059
|
+
n.local = r.substr(0, s), n.host = r.substr(s + 1).toLowerCase();
|
|
4060
|
+
}
|
|
4061
|
+
break;
|
|
4062
|
+
case 2:
|
|
4063
|
+
(i = "string" == typeof r) && (n.host = r.toLowerCase());
|
|
4064
|
+
break;
|
|
4065
|
+
case 4:
|
|
4066
|
+
(i = a.util.isArray(r)) && (n.attributes = _(r));
|
|
4067
|
+
break;
|
|
4068
|
+
case 6:
|
|
4069
|
+
var o = "string" == typeof r && /^[a-zA-Z][a-zA-Z0-9+.\-]*:\/\/([^\/?#]*)/.exec(r);
|
|
4070
|
+
if (o) {
|
|
4071
|
+
var c = o[1].substr(o[1].lastIndexOf("@") + 1);
|
|
4072
|
+
if ("[" === c.charAt(0)) n.host = null;else {
|
|
4073
|
+
var u = c.indexOf(":");
|
|
4074
|
+
-1 !== u && (c = c.substr(0, u)), n.host = c.toLowerCase();
|
|
4075
|
+
}
|
|
4076
|
+
i = c.length > 0;
|
|
4077
|
+
}
|
|
4078
|
+
break;
|
|
4079
|
+
case 7:
|
|
4080
|
+
i = "string" == typeof r && (4 === r.length || 16 === r.length);
|
|
4081
|
+
}
|
|
4082
|
+
i ? e.names.push(n) : e.unsupported[t] = !0;
|
|
4083
|
+
}
|
|
4084
|
+
function U(e, t) {
|
|
4085
|
+
return 0 === t.length || ("." === t.charAt(0) ? e.length > t.length && e.substr(e.length - t.length) === t : e === t);
|
|
4086
|
+
}
|
|
4087
|
+
function D(e, t) {
|
|
4088
|
+
var r,
|
|
4089
|
+
a = e.host,
|
|
4090
|
+
n = t.host;
|
|
4091
|
+
switch (e.type) {
|
|
4092
|
+
case 1:
|
|
4093
|
+
return null !== t.local ? ("" === t.local || e.local === t.local) && a === n : U(a, n);
|
|
4094
|
+
case 2:
|
|
4095
|
+
return 0 === n.length || ("." === n.charAt(0) ? a.length > n.length && a.substr(a.length - n.length) === n : a === n || a.length > n.length && a.substr(a.length - n.length - 1) === "." + n);
|
|
4096
|
+
case 6:
|
|
4097
|
+
return null !== a && U(a, n);
|
|
4098
|
+
case 4:
|
|
4099
|
+
var i = t.attributes,
|
|
4100
|
+
s = e.attributes;
|
|
4101
|
+
if (i.length > s.length) return !1;
|
|
4102
|
+
for (r = 0; r < i.length; ++r) if (i[r].type !== s[r].type || i[r].value !== s[r].value) return !1;
|
|
4103
|
+
return !0;
|
|
4104
|
+
case 7:
|
|
4105
|
+
if (a = e.value, (n = t.value).length !== 2 * a.length) return !1;
|
|
4106
|
+
for (r = 0; r < a.length; ++r) {
|
|
4107
|
+
var o = n.charCodeAt(a.length + r);
|
|
4108
|
+
if ((a.charCodeAt(r) & o) != (n.charCodeAt(r) & o)) return !1;
|
|
4109
|
+
}
|
|
4110
|
+
return !0;
|
|
4111
|
+
}
|
|
4112
|
+
return !1;
|
|
4113
|
+
}
|
|
4114
|
+
function P(e) {
|
|
4115
|
+
if (4 === e.type) {
|
|
4116
|
+
for (var t = [], r = 0; r < e.value.length; ++r) {
|
|
4117
|
+
var n = e.value[r];
|
|
4118
|
+
t.push((n.shortName || n.name || n.type) + "=" + n.value);
|
|
4119
|
+
}
|
|
4120
|
+
return t.join(", ");
|
|
4121
|
+
}
|
|
4122
|
+
return 7 === e.type ? a.util.bytesToIP(e.value) : e.value;
|
|
4123
|
+
}
|
|
4124
|
+
function V(e, t, r, o, c) {
|
|
4125
|
+
if (0 === r) return null;
|
|
4126
|
+
var u,
|
|
4127
|
+
l,
|
|
4128
|
+
p,
|
|
4129
|
+
f,
|
|
4130
|
+
h,
|
|
4131
|
+
d,
|
|
4132
|
+
y = function (e, t) {
|
|
4133
|
+
var r,
|
|
4134
|
+
o = {
|
|
4135
|
+
names: [],
|
|
4136
|
+
unsupported: {},
|
|
4137
|
+
types: {}
|
|
4138
|
+
},
|
|
4139
|
+
c = e.subject.attributes;
|
|
4140
|
+
for (c.length > 0 && L(o, 4, c), r = 0; r < c.length; ++r) c[r].type === s.emailAddress && L(o, 1, c[r].value);
|
|
4141
|
+
var u = !1;
|
|
4142
|
+
for (r = 0; r < e.extensions.length; ++r) {
|
|
4143
|
+
var l = e.extensions[r];
|
|
4144
|
+
if ("2.5.29.17" === l.id) for (var p = l.altNames || [], f = 0; f < p.length; ++f) {
|
|
4145
|
+
var h = p[f],
|
|
4146
|
+
d = h.value;
|
|
4147
|
+
switch (2 === h.type && (u = !0), h.type) {
|
|
4148
|
+
case 4:
|
|
4149
|
+
d = null, a.util.isArray(h.value) && 1 === h.value.length && h.value[0].type === n.Type.SEQUENCE && a.util.isArray(h.value[0].value) && (d = i.RDNAttributesAsArray(h.value[0]));
|
|
4150
|
+
break;
|
|
4151
|
+
case 7:
|
|
4152
|
+
h.ip && (d = a.util.bytesFromIP(h.ip));
|
|
4153
|
+
}
|
|
4154
|
+
L(o, h.type, d);
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
if (t && !u) for (r = 0; r < c.length; ++r) c[r].type === s.commonName && k(c[r].value) && L(o, 2, c[r].value);
|
|
4158
|
+
return o;
|
|
4159
|
+
}(e, o),
|
|
4160
|
+
g = y.names;
|
|
4161
|
+
for (u = 0; u < r && c.checks <= 1 << 20; ++u) f = t[u], c.checks += (g.length + 1) * (f.invalid ? 1 : f.permitted.length + f.excluded.length + 1);
|
|
4162
|
+
if (c.checks > 1 << 20) return {
|
|
4163
|
+
message: "Certificate name constraints require too many checks.",
|
|
4164
|
+
error: i.certificateError.unsupported_certificate
|
|
4165
|
+
};
|
|
4166
|
+
for (u = 0; u < r; ++u) {
|
|
4167
|
+
if ((f = t[u]).invalid) return {
|
|
4168
|
+
message: "Certificate name constraint could not be parsed.",
|
|
4169
|
+
error: i.certificateError.unsupported_certificate
|
|
4170
|
+
};
|
|
4171
|
+
var v = f.permitted.concat(f.excluded);
|
|
4172
|
+
for (l = 0; l < v.length; ++l) if ((h = v[l]).type in y.unsupported || !h.supported && h.type in y.types) return {
|
|
4173
|
+
message: "Certificate name constraint of type " + (d = B[h.type] || String(h.type)) + " is not supported.",
|
|
4174
|
+
error: i.certificateError.unsupported_certificate,
|
|
4175
|
+
nameType: d
|
|
4176
|
+
};
|
|
4177
|
+
}
|
|
4178
|
+
for (p = 0; p < g.length; ++p) {
|
|
4179
|
+
var m = g[p];
|
|
4180
|
+
for (u = 0; u < r; ++u) {
|
|
4181
|
+
f = t[u];
|
|
4182
|
+
var C = !1,
|
|
4183
|
+
E = !1;
|
|
4184
|
+
for (l = 0; !E && l < f.permitted.length; ++l) (h = f.permitted[l]).type === m.type && (C = !0, E = D(m, h));
|
|
4185
|
+
if (C && !E) return {
|
|
4186
|
+
message: "Certificate subject name is not permitted by a name constraint.",
|
|
4187
|
+
error: i.certificateError.bad_certificate,
|
|
4188
|
+
nameValue: P(m),
|
|
4189
|
+
nameType: B[m.type]
|
|
4190
|
+
};
|
|
4191
|
+
for (l = 0; l < f.excluded.length; ++l) if ((h = f.excluded[l]).type === m.type && D(m, h)) return {
|
|
4192
|
+
message: "Certificate subject name is excluded by a name constraint.",
|
|
4193
|
+
error: i.certificateError.bad_certificate,
|
|
4194
|
+
nameValue: P(m),
|
|
4195
|
+
nameType: B[m.type]
|
|
4196
|
+
};
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
return null;
|
|
4200
|
+
}
|
|
4201
|
+
i.verifyCertificateChain = function (e, t, r) {
|
|
3819
4202
|
"function" == typeof r && (r = {
|
|
3820
4203
|
verify: r
|
|
3821
4204
|
}), r = r || {};
|
|
3822
4205
|
var n = (t = t.slice(0)).slice(0),
|
|
3823
4206
|
s = r.validityCheckDate;
|
|
3824
4207
|
void 0 === s && (s = new Date());
|
|
3825
|
-
var o =
|
|
3826
|
-
c =
|
|
3827
|
-
u =
|
|
4208
|
+
var o = [],
|
|
4209
|
+
c = [],
|
|
4210
|
+
u = {
|
|
4211
|
+
checks: 0
|
|
4212
|
+
},
|
|
4213
|
+
l = n[n.length - 1];
|
|
4214
|
+
if (l && !l.isIssuer(l)) {
|
|
4215
|
+
var p = e.getIssuer(l);
|
|
4216
|
+
p = p ? a.util.isArray(p) ? p.slice() : [p] : [];
|
|
4217
|
+
for (var f = 0; f < p.length; ++f) {
|
|
4218
|
+
var h = N(p[f]);
|
|
4219
|
+
if (h.length > 0) {
|
|
4220
|
+
var d = !1;
|
|
4221
|
+
try {
|
|
4222
|
+
d = p[f].verify(l);
|
|
4223
|
+
} catch (e) {}
|
|
4224
|
+
for (var y = 0; d && y < h.length; ++y) o.push(h[y]);
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
for (var g = n.length - 1; g >= 0; --g) {
|
|
4229
|
+
c[g] = o.length;
|
|
4230
|
+
for (var v = g > 0 ? N(n[g]) : [], m = 0; m < v.length; ++m) o.push(v[m]);
|
|
4231
|
+
}
|
|
4232
|
+
var C = !0,
|
|
4233
|
+
E = null,
|
|
4234
|
+
S = 0;
|
|
3828
4235
|
do {
|
|
3829
|
-
var
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
if (s && (s <
|
|
4236
|
+
var T = t.shift(),
|
|
4237
|
+
I = null,
|
|
4238
|
+
A = !1;
|
|
4239
|
+
if (s && (s < T.validity.notBefore || s > T.validity.notAfter) && (E = {
|
|
3833
4240
|
message: "Certificate is not valid yet or has expired.",
|
|
3834
4241
|
error: i.certificateError.certificate_expired,
|
|
3835
|
-
notBefore:
|
|
3836
|
-
notAfter:
|
|
4242
|
+
notBefore: T.validity.notBefore,
|
|
4243
|
+
notAfter: T.validity.notAfter,
|
|
3837
4244
|
now: s
|
|
3838
|
-
}), null ===
|
|
3839
|
-
if (null === (
|
|
3840
|
-
var
|
|
3841
|
-
|
|
3842
|
-
for (var d = !1; !d && h.length > 0;) {
|
|
3843
|
-
p = h.shift();
|
|
4245
|
+
}), null === E) {
|
|
4246
|
+
if (null === (I = t[0] || e.getIssuer(T)) && T.isIssuer(T) && (A = !0, I = T), I) {
|
|
4247
|
+
for (var b = a.util.isArray(I) ? I.slice() : [I], B = !1; !B && b.length > 0;) {
|
|
4248
|
+
I = b.shift();
|
|
3844
4249
|
try {
|
|
3845
|
-
|
|
4250
|
+
B = I.verify(T);
|
|
3846
4251
|
} catch (e) {}
|
|
3847
4252
|
}
|
|
3848
|
-
|
|
4253
|
+
B || (E = {
|
|
3849
4254
|
message: "Certificate signature is invalid.",
|
|
3850
4255
|
error: i.certificateError.bad_certificate
|
|
3851
4256
|
});
|
|
3852
4257
|
}
|
|
3853
|
-
null !==
|
|
4258
|
+
null !== E || I && !A || e.hasCertificate(T) || (E = {
|
|
3854
4259
|
message: "Certificate is not trusted.",
|
|
3855
4260
|
error: i.certificateError.unknown_ca
|
|
3856
4261
|
});
|
|
3857
4262
|
}
|
|
3858
|
-
if (null ===
|
|
4263
|
+
if (null === E && I && !T.isIssuer(I) && (E = {
|
|
3859
4264
|
message: "Certificate issuer is invalid.",
|
|
3860
4265
|
error: i.certificateError.bad_certificate
|
|
3861
|
-
}), null
|
|
4266
|
+
}), null !== E || !C && T.isIssuer(T) || (E = V(T, o, c[S], C, u)), null === E) for (var w = {
|
|
3862
4267
|
keyUsage: !0,
|
|
3863
|
-
basicConstraints: !0
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
4268
|
+
basicConstraints: !0,
|
|
4269
|
+
nameConstraints: !0
|
|
4270
|
+
}, R = 0; null === E && R < T.extensions.length; ++R) {
|
|
4271
|
+
var _ = T.extensions[R];
|
|
4272
|
+
_.critical && (!(_.name in w) || "nameConstraints" === _.name && "2.5.29.30" !== _.id) && (E = {
|
|
3867
4273
|
message: "Certificate has an unsupported critical extension.",
|
|
3868
4274
|
error: i.certificateError.unsupported_certificate
|
|
3869
4275
|
});
|
|
3870
4276
|
}
|
|
3871
|
-
if (null ===
|
|
3872
|
-
var
|
|
3873
|
-
|
|
3874
|
-
|
|
4277
|
+
if (null === E && (!C || 0 === t.length && (!I || A))) {
|
|
4278
|
+
var k = T.getExtension({
|
|
4279
|
+
id: "2.5.29.19"
|
|
4280
|
+
}),
|
|
4281
|
+
L = T.getExtension("keyUsage");
|
|
4282
|
+
if (null !== L && (L.keyCertSign && null !== k || (E = {
|
|
3875
4283
|
message: "Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",
|
|
3876
4284
|
error: i.certificateError.bad_certificate
|
|
3877
|
-
})), null ===
|
|
4285
|
+
})), null === E && null === k && (E = {
|
|
3878
4286
|
message: "Certificate is missing basicConstraints extension and cannot be used as a CA.",
|
|
3879
4287
|
error: i.certificateError.bad_certificate
|
|
3880
|
-
}), null !==
|
|
4288
|
+
}), null !== E || null === k || k.cA || (E = {
|
|
3881
4289
|
message: "Certificate basicConstraints indicates the certificate is not a CA.",
|
|
3882
4290
|
error: i.certificateError.bad_certificate
|
|
3883
|
-
}), null ===
|
|
4291
|
+
}), null === E && null !== k && "pathLenConstraint" in k) S - 1 > k.pathLenConstraint && (E = {
|
|
3884
4292
|
message: "Certificate basicConstraints pathLenConstraint violated.",
|
|
3885
4293
|
error: i.certificateError.bad_certificate
|
|
3886
4294
|
});
|
|
3887
4295
|
}
|
|
3888
|
-
var
|
|
3889
|
-
|
|
3890
|
-
if (!0 !==
|
|
4296
|
+
var U = null === E || E.error,
|
|
4297
|
+
D = r.verify ? r.verify(U, S, n) : U;
|
|
4298
|
+
if (!0 !== D) throw !0 === U && (E = {
|
|
3891
4299
|
message: "The application rejected the certificate.",
|
|
3892
4300
|
error: i.certificateError.bad_certificate
|
|
3893
|
-
}), (
|
|
3894
|
-
|
|
4301
|
+
}), (D || 0 === D) && ("object" != typeof D || a.util.isArray(D) ? "string" == typeof D && (E.error = D) : (D.message && (E.message = D.message), D.error && (E.error = D.error))), E;
|
|
4302
|
+
E = null, C = !1, ++S;
|
|
3895
4303
|
} while (t.length > 0);
|
|
3896
4304
|
return !0;
|
|
3897
4305
|
};
|
|
@@ -4003,9 +4411,12 @@ if (typeof window === 'undefined') {
|
|
|
4003
4411
|
return e.fillWithByte(r, r), !0;
|
|
4004
4412
|
}, n.ecb.prototype.unpad = function (e, t) {
|
|
4005
4413
|
if (t.overflow > 0) return !1;
|
|
4006
|
-
var r = e.length()
|
|
4007
|
-
|
|
4008
|
-
|
|
4414
|
+
var r = e.length();
|
|
4415
|
+
if (0 === r) return !0;
|
|
4416
|
+
var a = e.at(r - 1);
|
|
4417
|
+
if (0 === a || a > this.blockSize || a > r) return !1;
|
|
4418
|
+
for (var n = 2; n <= a; ++n) if (e.at(r - n) !== a) return !1;
|
|
4419
|
+
return e.truncate(a), !0;
|
|
4009
4420
|
}, n.cbc = function (e) {
|
|
4010
4421
|
e = e || {}, this.name = "CBC", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._ints = this.blockSize / 4, this._inBlock = new Array(this._ints), this._outBlock = new Array(this._ints);
|
|
4011
4422
|
}, n.cbc.prototype.start = function (e) {
|
|
@@ -4033,9 +4444,12 @@ if (typeof window === 'undefined') {
|
|
|
4033
4444
|
return e.fillWithByte(r, r), !0;
|
|
4034
4445
|
}, n.cbc.prototype.unpad = function (e, t) {
|
|
4035
4446
|
if (t.overflow > 0) return !1;
|
|
4036
|
-
var r = e.length()
|
|
4037
|
-
|
|
4038
|
-
|
|
4447
|
+
var r = e.length();
|
|
4448
|
+
if (0 === r) return !0;
|
|
4449
|
+
var a = e.at(r - 1);
|
|
4450
|
+
if (0 === a || a > this.blockSize || a > r) return !1;
|
|
4451
|
+
for (var n = 2; n <= a; ++n) if (e.at(r - n) !== a) return !1;
|
|
4452
|
+
return e.truncate(a), !0;
|
|
4039
4453
|
}, n.cfb = function (e) {
|
|
4040
4454
|
e = e || {}, this.name = "CFB", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._ints = this.blockSize / 4, this._inBlock = null, this._outBlock = new Array(this._ints), this._partialBlock = new Array(this._ints), this._partialOutput = a.util.createBuffer(), this._partialBytes = 0;
|
|
4041
4455
|
}, n.cfb.prototype.start = function (e) {
|
|
@@ -4101,7 +4515,8 @@ if (typeof window === 'undefined') {
|
|
|
4101
4515
|
if (!("iv" in e)) throw new Error("Invalid IV parameter.");
|
|
4102
4516
|
var t,
|
|
4103
4517
|
r = a.util.createBuffer(e.iv);
|
|
4104
|
-
if (this._cipherLength = 0, t = "additionalData" in e ? a.util.createBuffer(e.additionalData) : a.util.createBuffer(),
|
|
4518
|
+
if (this._cipherLength = 0, t = "additionalData" in e ? a.util.createBuffer(e.additionalData) : a.util.createBuffer(), void 0 !== e.tagLength && null !== e.tagLength ? this._tagLength = Number(e.tagLength) : this._tagLength = 128, -1 === [128, 120, 112, 104, 96, 64, 32].indexOf(this._tagLength)) throw new Error("Invalid tag length.");
|
|
4519
|
+
if (this._tag = null, e.decrypt && (this._tag = a.util.createBuffer(e.tag).getBytes(), this._tag.length !== this._tagLength / 8)) throw new Error("Authentication tag does not match tag length.");
|
|
4105
4520
|
this._hashBlock = new Array(this._ints), this.tag = null, this._hashSubkey = new Array(this._ints), this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey), this.componentBits = 4, this._m = this.generateHashTable(this._hashSubkey, this.componentBits);
|
|
4106
4521
|
var n = r.length();
|
|
4107
4522
|
if (12 === n) this._j0 = [r.getInt32(), r.getInt32(), r.getInt32(), 1];else {
|
|
@@ -4415,7 +4830,17 @@ if (typeof window === 'undefined') {
|
|
|
4415
4830
|
},
|
|
4416
4831
|
cipherSuite: a.util.bytesToHex(n.cipher_suite)
|
|
4417
4832
|
});
|
|
4418
|
-
|
|
4833
|
+
if (i) {
|
|
4834
|
+
if (n.compression_method !== u.CompressionMethod.none) return e.error(e, {
|
|
4835
|
+
message: "Unsupported compression method.",
|
|
4836
|
+
send: !0,
|
|
4837
|
+
alert: {
|
|
4838
|
+
level: u.Alert.Level.fatal,
|
|
4839
|
+
description: u.Alert.Description.illegal_parameter
|
|
4840
|
+
}
|
|
4841
|
+
});
|
|
4842
|
+
e.session.compressionMethod = n.compression_method;
|
|
4843
|
+
} else e.session.compressionMethod = u.CompressionMethod.none;
|
|
4419
4844
|
}
|
|
4420
4845
|
return n;
|
|
4421
4846
|
}, u.createSecurityParameters = function (e, t) {
|
|
@@ -4639,7 +5064,7 @@ if (typeof window === 'undefined') {
|
|
|
4639
5064
|
description: u.Alert.Description.record_overflow
|
|
4640
5065
|
}
|
|
4641
5066
|
});
|
|
4642
|
-
if (null === e.serverCertificate) {
|
|
5067
|
+
if (null === e.session.serverCertificate) {
|
|
4643
5068
|
var n = {
|
|
4644
5069
|
message: "No server certificate provided. Not enough security.",
|
|
4645
5070
|
send: !0,
|
|
@@ -4649,7 +5074,7 @@ if (typeof window === 'undefined') {
|
|
|
4649
5074
|
}
|
|
4650
5075
|
},
|
|
4651
5076
|
i = e.verify(e, n.alert.description, 0, []);
|
|
4652
|
-
|
|
5077
|
+
return !0 !== i && (i || 0 === i) && ("object" != typeof i || a.util.isArray(i) ? "number" == typeof i && (n.alert.description = i) : (i.message && (n.message = i.message), i.alert && (n.alert.description = i.alert))), e.error(e, n);
|
|
4653
5078
|
}
|
|
4654
5079
|
null !== e.session.certificateRequest && (t = u.createRecord(e, {
|
|
4655
5080
|
type: u.ContentType.handshake,
|
|
@@ -4802,7 +5227,7 @@ if (typeof window === 'undefined') {
|
|
|
4802
5227
|
if (i > r.length()) return e.fragmented = t, t.fragment = a.util.createBuffer(), r.read -= 4, e.process();
|
|
4803
5228
|
e.fragmented = null, r.read -= 4;
|
|
4804
5229
|
var s = r.bytes(i + 4);
|
|
4805
|
-
r.read += 4, n in
|
|
5230
|
+
r.read += 4, n in x[e.entity][e.expect] && (e.session || e.entity === u.ConnectionEnd.server) ? (e.entity !== u.ConnectionEnd.server || e.open || e.fail || (e.handshaking = !0, e.session = {
|
|
4806
5231
|
version: null,
|
|
4807
5232
|
extensions: {
|
|
4808
5233
|
server_name: {
|
|
@@ -4815,7 +5240,7 @@ if (typeof window === 'undefined') {
|
|
|
4815
5240
|
clientCertificate: null,
|
|
4816
5241
|
md5: a.md.md5.create(),
|
|
4817
5242
|
sha1: a.md.sha1.create()
|
|
4818
|
-
}), n !== u.HandshakeType.hello_request && n !== u.HandshakeType.certificate_verify && n !== u.HandshakeType.finished && (e.session.md5.update(s), e.session.sha1.update(s)),
|
|
5243
|
+
}), n !== u.HandshakeType.hello_request && n !== u.HandshakeType.certificate_verify && n !== u.HandshakeType.finished && (e.session.md5.update(s), e.session.sha1.update(s)), x[e.entity][e.expect][n](e, t, i)) : u.handleUnexpected(e, t);
|
|
4819
5244
|
}, u.handleApplicationData = function (e, t) {
|
|
4820
5245
|
e.data.putBuffer(t.fragment), e.dataReady(e), e.process();
|
|
4821
5246
|
}, u.handleHeartbeat = function (e, t) {
|
|
@@ -4824,7 +5249,7 @@ if (typeof window === 'undefined') {
|
|
|
4824
5249
|
i = r.getInt16(),
|
|
4825
5250
|
s = r.getBytes(i);
|
|
4826
5251
|
if (n === u.HeartbeatMessageType.heartbeat_request) {
|
|
4827
|
-
if (e.handshaking || i > s.length) return e.process();
|
|
5252
|
+
if (0 === e.handshakes || e.handshaking || i > s.length) return e.process();
|
|
4828
5253
|
u.queue(e, u.createRecord(e, {
|
|
4829
5254
|
type: u.ContentType.heartbeat,
|
|
4830
5255
|
data: u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response, s)
|
|
@@ -4850,13 +5275,13 @@ if (typeof window === 'undefined') {
|
|
|
4850
5275
|
T = 5,
|
|
4851
5276
|
I = 6,
|
|
4852
5277
|
A = u.handleUnexpected,
|
|
4853
|
-
|
|
4854
|
-
|
|
5278
|
+
b = u.handleChangeCipherSpec,
|
|
5279
|
+
B = u.handleAlert,
|
|
4855
5280
|
N = u.handleHandshake,
|
|
4856
|
-
|
|
4857
|
-
|
|
5281
|
+
w = u.handleApplicationData,
|
|
5282
|
+
R = u.handleHeartbeat,
|
|
4858
5283
|
_ = [];
|
|
4859
|
-
_[u.ConnectionEnd.client] = [[A,
|
|
5284
|
+
_[u.ConnectionEnd.client] = [[A, B, N, A, R], [A, B, N, A, R], [A, B, N, A, R], [A, B, N, A, R], [A, B, N, A, R], [b, B, A, A, R], [A, B, N, A, R], [A, B, N, w, R], [A, B, N, A, R]], _[u.ConnectionEnd.server] = [[A, B, N, A, R], [A, B, N, A, R], [A, B, N, A, R], [A, B, N, A, R], [b, B, A, A, R], [A, B, N, A, R], [A, B, N, w, R], [A, B, N, A, R]];
|
|
4860
5285
|
var k = u.handleHelloRequest,
|
|
4861
5286
|
L = u.handleServerHello,
|
|
4862
5287
|
U = u.handleCertificate,
|
|
@@ -4864,12 +5289,12 @@ if (typeof window === 'undefined') {
|
|
|
4864
5289
|
P = u.handleCertificateRequest,
|
|
4865
5290
|
V = u.handleServerHelloDone,
|
|
4866
5291
|
O = u.handleFinished,
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
var
|
|
5292
|
+
x = [];
|
|
5293
|
+
x[u.ConnectionEnd.client] = [[A, A, L, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, U, D, P, V, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, D, P, V, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, A, P, V, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, A, A, V, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, O], [k, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [k, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A]];
|
|
5294
|
+
var K = u.handleClientHello,
|
|
4870
5295
|
M = u.handleClientKeyExchange,
|
|
4871
5296
|
F = u.handleCertificateVerify;
|
|
4872
|
-
|
|
5297
|
+
x[u.ConnectionEnd.server] = [[A, K, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, U, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, M, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, O], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A]], u.generateKeys = function (e, t) {
|
|
4873
5298
|
var r = n,
|
|
4874
5299
|
a = t.client_random + t.server_random;
|
|
4875
5300
|
e.session.resuming || (t.master_secret = r(t.pre_master_secret, "master secret", a, 48).bytes(), t.pre_master_secret = null), a = t.server_random + t.client_random;
|
|
@@ -5296,7 +5721,7 @@ if (typeof window === 'undefined') {
|
|
|
5296
5721
|
}
|
|
5297
5722
|
};
|
|
5298
5723
|
o.reset();
|
|
5299
|
-
|
|
5724
|
+
o.handshake = function (e) {
|
|
5300
5725
|
if (o.entity !== u.ConnectionEnd.client) o.error(o, {
|
|
5301
5726
|
message: "Cannot initiate handshake as a server.",
|
|
5302
5727
|
fatal: !1
|
|
@@ -5322,52 +5747,74 @@ if (typeof window === 'undefined') {
|
|
|
5322
5747
|
data: u.createClientHello(o)
|
|
5323
5748
|
})), u.flush(o);
|
|
5324
5749
|
}
|
|
5325
|
-
}
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5750
|
+
};
|
|
5751
|
+
var c = !1,
|
|
5752
|
+
l = !1,
|
|
5753
|
+
p = function (e) {
|
|
5754
|
+
var t = 0;
|
|
5755
|
+
return e.fail || (null !== e.record && e.record.ready && e.record.fragment.isEmpty() && (e.record = null), null === e.record && (t = function (e) {
|
|
5756
|
+
var t = 0,
|
|
5757
|
+
r = e.input,
|
|
5758
|
+
n = r.length();
|
|
5759
|
+
if (n < 5) t = 5 - n;else {
|
|
5760
|
+
e.record = {
|
|
5761
|
+
type: r.getByte(),
|
|
5762
|
+
version: {
|
|
5763
|
+
major: r.getByte(),
|
|
5764
|
+
minor: r.getByte()
|
|
5765
|
+
},
|
|
5766
|
+
length: r.getInt16(),
|
|
5767
|
+
fragment: a.util.createBuffer(),
|
|
5768
|
+
ready: !1
|
|
5769
|
+
};
|
|
5770
|
+
var i = e.record.version.major === e.version.major;
|
|
5771
|
+
i && e.session && e.session.version && (i = e.record.version.minor === e.version.minor), i || e.error(e, {
|
|
5772
|
+
message: "Incompatible TLS version.",
|
|
5773
|
+
send: !0,
|
|
5774
|
+
alert: {
|
|
5775
|
+
level: u.Alert.Level.fatal,
|
|
5776
|
+
description: u.Alert.Description.protocol_version
|
|
5777
|
+
}
|
|
5778
|
+
});
|
|
5779
|
+
}
|
|
5780
|
+
return t;
|
|
5781
|
+
}(e)), e.fail || null === e.record || e.record.ready || (t = function (e) {
|
|
5782
|
+
var t = 0,
|
|
5783
|
+
r = e.input,
|
|
5784
|
+
a = r.length();
|
|
5785
|
+
if (a < e.record.length) t = e.record.length - a;else if (e.record.fragment.putBytes(r.getBytes(e.record.length)), r.compact(), e.state.current.read.update(e, e.record)) {
|
|
5786
|
+
if (null !== e.fragmented) {
|
|
5787
|
+
if (e.fragmented.type !== e.record.type) return e.error(e, {
|
|
5788
|
+
message: "Invalid fragmented record.",
|
|
5789
|
+
send: !0,
|
|
5790
|
+
alert: {
|
|
5791
|
+
level: u.Alert.Level.fatal,
|
|
5792
|
+
description: u.Alert.Description.unexpected_message
|
|
5793
|
+
}
|
|
5794
|
+
}), t;
|
|
5795
|
+
e.fragmented.fragment.putBuffer(e.record.fragment), e.record = e.fragmented;
|
|
5349
5796
|
}
|
|
5350
|
-
|
|
5351
|
-
}
|
|
5352
|
-
return t;
|
|
5353
|
-
}(o)), o.fail || null === o.record || o.record.ready || (t = function (e) {
|
|
5354
|
-
var t = 0,
|
|
5355
|
-
r = e.input,
|
|
5356
|
-
a = r.length();
|
|
5357
|
-
a < e.record.length ? t = e.record.length - a : (e.record.fragment.putBytes(r.getBytes(e.record.length)), r.compact(), e.state.current.read.update(e, e.record) && (null !== e.fragmented && (e.fragmented.type === e.record.type ? (e.fragmented.fragment.putBuffer(e.record.fragment), e.record = e.fragmented) : e.error(e, {
|
|
5358
|
-
message: "Invalid fragmented record.",
|
|
5359
|
-
send: !0,
|
|
5360
|
-
alert: {
|
|
5361
|
-
level: u.Alert.Level.fatal,
|
|
5362
|
-
description: u.Alert.Description.unexpected_message
|
|
5797
|
+
e.record.ready = !0;
|
|
5363
5798
|
}
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
a
|
|
5369
|
-
|
|
5370
|
-
}
|
|
5799
|
+
return t;
|
|
5800
|
+
}(e)), !e.fail && null !== e.record && e.record.ready && function (e, t) {
|
|
5801
|
+
var r = t.type - u.ContentType.change_cipher_spec,
|
|
5802
|
+
a = _[e.entity][e.expect];
|
|
5803
|
+
r in a ? a[r](e, t) : u.handleUnexpected(e, t);
|
|
5804
|
+
}(e, e.record)), t;
|
|
5805
|
+
};
|
|
5806
|
+
return o.process = function (e) {
|
|
5807
|
+
var t = 0;
|
|
5808
|
+
if (e && o.input.putBytes(e), c && void 0 === e) return l = !0, t;
|
|
5809
|
+
var r = c,
|
|
5810
|
+
a = l;
|
|
5811
|
+
c = !0, l = !1;
|
|
5812
|
+
try {
|
|
5813
|
+
for (t = p(o); l;) l = !1, p(o);
|
|
5814
|
+
} finally {
|
|
5815
|
+
c = r, l = a;
|
|
5816
|
+
}
|
|
5817
|
+
return t;
|
|
5371
5818
|
}, o.prepare = function (e) {
|
|
5372
5819
|
return u.queue(o, u.createRecord(o, {
|
|
5373
5820
|
type: u.ContentType.application_data,
|
|
@@ -5762,6 +6209,7 @@ if (typeof window === 'undefined') {
|
|
|
5762
6209
|
return null !== (r = "ENCRYPTED PRIVATE KEY" === n.type ? s.decryptPrivateKeyInfo(i.fromDer(r), t) : i.fromDer(r)) && (r = s.privateKeyFromAsn1(r)), r;
|
|
5763
6210
|
}, s.pbe.generatePkcs12Key = function (e, t, r, n, i, s) {
|
|
5764
6211
|
var o, c;
|
|
6212
|
+
if (!(n >= 1)) throw new Error("PKCS#12 key derivation iteration count must be >= 1.");
|
|
5765
6213
|
if (null == s) {
|
|
5766
6214
|
if (!("sha1" in a.md)) throw new Error('"sha1" hash algorithm unavailable.');
|
|
5767
6215
|
s = a.md.sha1.create();
|
|
@@ -5790,15 +6238,15 @@ if (typeof window === 'undefined') {
|
|
|
5790
6238
|
var I = new a.util.ByteBuffer();
|
|
5791
6239
|
I.putBytes(y.bytes()), I.putBytes(E.bytes());
|
|
5792
6240
|
for (var A = 0; A < n; A++) s.start(), s.update(I.getBytes()), I = s.digest();
|
|
5793
|
-
var
|
|
5794
|
-
for (c = 0; c < l; c++)
|
|
5795
|
-
var
|
|
6241
|
+
var b = new a.util.ByteBuffer();
|
|
6242
|
+
for (c = 0; c < l; c++) b.putByte(I.at(c % u));
|
|
6243
|
+
var B = Math.ceil(d / l) + Math.ceil(h / l),
|
|
5796
6244
|
N = new a.util.ByteBuffer();
|
|
5797
|
-
for (o = 0; o <
|
|
5798
|
-
var
|
|
5799
|
-
|
|
5800
|
-
for (c =
|
|
5801
|
-
N.putBuffer(
|
|
6245
|
+
for (o = 0; o < B; o++) {
|
|
6246
|
+
var w = new a.util.ByteBuffer(E.getBytes(l)),
|
|
6247
|
+
R = 511;
|
|
6248
|
+
for (c = b.length() - 1; c >= 0; c--) R >>= 8, R += b.at(c) + w.at(c), w.setAt(c, 255 & R);
|
|
6249
|
+
N.putBuffer(w);
|
|
5802
6250
|
}
|
|
5803
6251
|
E = N, p.putBuffer(I);
|
|
5804
6252
|
}
|
|
@@ -6217,8 +6665,8 @@ if (typeof window === 'undefined') {
|
|
|
6217
6665
|
for (var E = 1, S = s.digestLength, T = s.digestLength; T < g.length; T++) {
|
|
6218
6666
|
var I = g.charCodeAt(T),
|
|
6219
6667
|
A = 1 & I ^ 1,
|
|
6220
|
-
|
|
6221
|
-
m |= I &
|
|
6668
|
+
b = E ? 65534 : 0;
|
|
6669
|
+
m |= I & b, S += E &= A;
|
|
6222
6670
|
}
|
|
6223
6671
|
if (m || 1 !== g.charCodeAt(S)) throw new Error("Invalid RSAES-OAEP padding.");
|
|
6224
6672
|
return g.substring(S + 1);
|
|
@@ -6606,8 +7054,9 @@ if (typeof window === 'undefined') {
|
|
|
6606
7054
|
}
|
|
6607
7055
|
if (null === v) throw new Error("PKCS#12 uses unsupported MAC algorithm: " + C);
|
|
6608
7056
|
var E = new a.util.ByteBuffer(u.macSalt),
|
|
6609
|
-
S = "macIterations" in u ? parseInt(a.util.bytesToHex(u.macIterations), 16) : 1
|
|
6610
|
-
|
|
7057
|
+
S = "macIterations" in u ? parseInt(a.util.bytesToHex(u.macIterations), 16) : 1;
|
|
7058
|
+
if (!(S >= 1)) throw new Error("PKCS#12 MAC iteration count must be >= 1.");
|
|
7059
|
+
var T = s.generateKey(r, E, 3, S, m, v),
|
|
6611
7060
|
I = a.hmac.create();
|
|
6612
7061
|
if (I.start(v, T), I.update(g.value), I.getMac().getBytes() !== u.macDigest) throw new Error("PKCS#12 MAC could not be verified. Invalid password?");
|
|
6613
7062
|
} else if (Array.isArray(e.value) && e.value.length > 2) throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");
|
|
@@ -6671,18 +7120,18 @@ if (typeof window === 'undefined') {
|
|
|
6671
7120
|
A = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(i.oids.data).getBytes()), n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, n.toDer(I).getBytes())])]);
|
|
6672
7121
|
f.push(A);
|
|
6673
7122
|
}
|
|
6674
|
-
var
|
|
6675
|
-
|
|
7123
|
+
var b,
|
|
7124
|
+
B = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, f);
|
|
6676
7125
|
if (o.useMac) {
|
|
6677
7126
|
var N = a.md.sha1.create(),
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
_ = (e = s.generateKey(r,
|
|
6681
|
-
_.start(N, e), _.update(n.toDer(
|
|
7127
|
+
w = new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),
|
|
7128
|
+
R = o.count,
|
|
7129
|
+
_ = (e = s.generateKey(r, w, 3, R, 20), a.hmac.create());
|
|
7130
|
+
_.start(N, e), _.update(n.toDer(B).getBytes());
|
|
6682
7131
|
var k = _.getMac();
|
|
6683
|
-
|
|
7132
|
+
b = n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(i.oids.sha1).getBytes()), n.create(n.Class.UNIVERSAL, n.Type.NULL, !1, "")]), n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, k.getBytes())]), n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, w.getBytes()), n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(R).getBytes())]);
|
|
6684
7133
|
}
|
|
6685
|
-
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(3).getBytes()), n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(i.oids.data).getBytes()), n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, n.toDer(
|
|
7134
|
+
return n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.INTEGER, !1, n.integerToDer(3).getBytes()), n.create(n.Class.UNIVERSAL, n.Type.SEQUENCE, !0, [n.create(n.Class.UNIVERSAL, n.Type.OID, !1, n.oidToDer(i.oids.data).getBytes()), n.create(n.Class.CONTEXT_SPECIFIC, 0, !0, [n.create(n.Class.UNIVERSAL, n.Type.OCTETSTRING, !1, n.toDer(B).getBytes())])]), b]);
|
|
6686
7135
|
}, s.generateKey = a.pbe.generatePkcs12Key;
|
|
6687
7136
|
}, function (e, t, r) {
|
|
6688
7137
|
var a = r(0);
|
|
@@ -7030,11 +7479,11 @@ if (typeof window === 'undefined') {
|
|
|
7030
7479
|
c = null,
|
|
7031
7480
|
u = null;
|
|
7032
7481
|
function l(e, t, r) {
|
|
7033
|
-
for (var a, n, i, s, o, u, l, p, f, h, d, y, g, v, m, C, E, S, T, I, A,
|
|
7482
|
+
for (var a, n, i, s, o, u, l, p, f, h, d, y, g, v, m, C, E, S, T, I, A, b, B, N, w, R, _, k, L, U, D, P, V, O = r.length(); O >= 128;) {
|
|
7034
7483
|
for (_ = 0; _ < 16; ++_) t[_][0] = r.getInt32() >>> 0, t[_][1] = r.getInt32() >>> 0;
|
|
7035
7484
|
for (; _ < 80; ++_) a = (((k = (U = t[_ - 2])[0]) >>> 19 | (L = U[1]) << 13) ^ (L >>> 29 | k << 3) ^ k >>> 6) >>> 0, n = ((k << 13 | L >>> 19) ^ (L << 3 | k >>> 29) ^ (k << 26 | L >>> 6)) >>> 0, i = (((k = (P = t[_ - 15])[0]) >>> 1 | (L = P[1]) << 31) ^ (k >>> 8 | L << 24) ^ k >>> 7) >>> 0, s = ((k << 31 | L >>> 1) ^ (k << 24 | L >>> 8) ^ (k << 25 | L >>> 7)) >>> 0, D = t[_ - 7], V = t[_ - 16], L = n + D[1] + s + V[1], t[_][0] = a + D[0] + i + V[0] + (L / 4294967296 >>> 0) >>> 0, t[_][1] = L >>> 0;
|
|
7036
|
-
for (d = e[0][0], y = e[0][1], g = e[1][0], v = e[1][1], m = e[2][0], C = e[2][1], E = e[3][0], S = e[3][1], T = e[4][0], I = e[4][1], A = e[5][0],
|
|
7037
|
-
L = e[0][1] + y, e[0][0] = e[0][0] + d + (L / 4294967296 >>> 0) >>> 0, e[0][1] = L >>> 0, L = e[1][1] + v, e[1][0] = e[1][0] + g + (L / 4294967296 >>> 0) >>> 0, e[1][1] = L >>> 0, L = e[2][1] + C, e[2][0] = e[2][0] + m + (L / 4294967296 >>> 0) >>> 0, e[2][1] = L >>> 0, L = e[3][1] + S, e[3][0] = e[3][0] + E + (L / 4294967296 >>> 0) >>> 0, e[3][1] = L >>> 0, L = e[4][1] + I, e[4][0] = e[4][0] + T + (L / 4294967296 >>> 0) >>> 0, e[4][1] = L >>> 0, L = e[5][1] +
|
|
7485
|
+
for (d = e[0][0], y = e[0][1], g = e[1][0], v = e[1][1], m = e[2][0], C = e[2][1], E = e[3][0], S = e[3][1], T = e[4][0], I = e[4][1], A = e[5][0], b = e[5][1], B = e[6][0], N = e[6][1], w = e[7][0], R = e[7][1], _ = 0; _ < 80; ++_) l = ((T >>> 14 | I << 18) ^ (T >>> 18 | I << 14) ^ (I >>> 9 | T << 23)) >>> 0, p = (B ^ T & (A ^ B)) >>> 0, o = ((d >>> 28 | y << 4) ^ (y >>> 2 | d << 30) ^ (y >>> 7 | d << 25)) >>> 0, u = ((d << 4 | y >>> 28) ^ (y << 30 | d >>> 2) ^ (y << 25 | d >>> 7)) >>> 0, f = (d & g | m & (d ^ g)) >>> 0, h = (y & v | C & (y ^ v)) >>> 0, L = R + (((T << 18 | I >>> 14) ^ (T << 14 | I >>> 18) ^ (I << 23 | T >>> 9)) >>> 0) + ((N ^ I & (b ^ N)) >>> 0) + c[_][1] + t[_][1], a = w + l + p + c[_][0] + t[_][0] + (L / 4294967296 >>> 0) >>> 0, n = L >>> 0, i = o + f + ((L = u + h) / 4294967296 >>> 0) >>> 0, s = L >>> 0, w = B, R = N, B = A, N = b, A = T, b = I, T = E + a + ((L = S + n) / 4294967296 >>> 0) >>> 0, I = L >>> 0, E = m, S = C, m = g, C = v, g = d, v = y, d = a + i + ((L = n + s) / 4294967296 >>> 0) >>> 0, y = L >>> 0;
|
|
7486
|
+
L = e[0][1] + y, e[0][0] = e[0][0] + d + (L / 4294967296 >>> 0) >>> 0, e[0][1] = L >>> 0, L = e[1][1] + v, e[1][0] = e[1][0] + g + (L / 4294967296 >>> 0) >>> 0, e[1][1] = L >>> 0, L = e[2][1] + C, e[2][0] = e[2][0] + m + (L / 4294967296 >>> 0) >>> 0, e[2][1] = L >>> 0, L = e[3][1] + S, e[3][0] = e[3][0] + E + (L / 4294967296 >>> 0) >>> 0, e[3][1] = L >>> 0, L = e[4][1] + I, e[4][0] = e[4][0] + T + (L / 4294967296 >>> 0) >>> 0, e[4][1] = L >>> 0, L = e[5][1] + b, e[5][0] = e[5][0] + A + (L / 4294967296 >>> 0) >>> 0, e[5][1] = L >>> 0, L = e[6][1] + N, e[6][0] = e[6][0] + B + (L / 4294967296 >>> 0) >>> 0, e[6][1] = L >>> 0, L = e[7][1] + R, e[7][0] = e[7][0] + w + (L / 4294967296 >>> 0) >>> 0, e[7][1] = L >>> 0, O -= 128;
|
|
7038
7487
|
}
|
|
7039
7488
|
}
|
|
7040
7489
|
}, function (e, t, r) {
|
|
@@ -7229,7 +7678,7 @@ if (typeof window === 'undefined') {
|
|
|
7229
7678
|
var r,
|
|
7230
7679
|
a = [P(), P(), P(), P()],
|
|
7231
7680
|
n = E(t, 32);
|
|
7232
|
-
for (n[0] &= 248, n[31] &= 127, n[31] |= 64, k(a, n),
|
|
7681
|
+
for (n[0] &= 248, n[31] &= 127, n[31] |= 64, k(a, n), b(e, a), r = 0; r < 32; ++r) t[r + 32] = e[r];
|
|
7233
7682
|
}(r, n), {
|
|
7234
7683
|
publicKey: r,
|
|
7235
7684
|
privateKey: n
|
|
@@ -7296,7 +7745,7 @@ if (typeof window === 'undefined') {
|
|
|
7296
7745
|
for (n = 0; n < r; ++n) e[64 + n] = t[n];
|
|
7297
7746
|
for (n = 0; n < 32; ++n) e[32 + n] = c[32 + n];
|
|
7298
7747
|
var l = E(e.subarray(32), r + 32);
|
|
7299
|
-
for (T(l), k(o, l),
|
|
7748
|
+
for (T(l), k(o, l), b(e, o), n = 32; n < 64; ++n) e[n] = a[n];
|
|
7300
7749
|
var p = E(e, r + 64);
|
|
7301
7750
|
for (T(p), n = 32; n < 64; ++n) s[n] = 0;
|
|
7302
7751
|
for (n = 0; n < 32; ++n) s[n] = l[n];
|
|
@@ -7341,17 +7790,26 @@ if (typeof window === 'undefined') {
|
|
|
7341
7790
|
var r;
|
|
7342
7791
|
for (r = 0; r < 16; ++r) e[r] = t[2 * r] + (t[2 * r + 1] << 8);
|
|
7343
7792
|
e[15] &= 32767;
|
|
7344
|
-
}(e[1], t),
|
|
7793
|
+
}(e[1], t), x(n, e[1]), K(i, n, d), O(n, n, e[2]), V(i, e[2], i), x(s, i), x(o, s), K(c, o, s), K(r, c, n), K(r, r, i), function (e, t) {
|
|
7345
7794
|
var r,
|
|
7346
7795
|
a = P();
|
|
7347
7796
|
for (r = 0; r < 16; ++r) a[r] = t[r];
|
|
7348
|
-
for (r = 250; r >= 0; --r)
|
|
7797
|
+
for (r = 250; r >= 0; --r) x(a, a), 1 !== r && K(a, a, t);
|
|
7349
7798
|
for (r = 0; r < 16; ++r) e[r] = a[r];
|
|
7350
|
-
}(r, r),
|
|
7351
|
-
if (
|
|
7352
|
-
|
|
7353
|
-
return
|
|
7799
|
+
}(r, r), K(r, r, n), K(r, r, i), K(r, r, i), K(e[0], r, i), x(a, e[0]), K(a, a, i), N(a, n) && K(e[0], e[0], C);
|
|
7800
|
+
if (x(a, e[0]), K(a, a, i), N(a, n)) return -1;
|
|
7801
|
+
R(e[0]) === t[31] >> 7 && O(e[0], f, e[0]);
|
|
7802
|
+
return K(e[3], e[0], e[1]), 0;
|
|
7354
7803
|
}(o, a)) return -1;
|
|
7804
|
+
if (function (e) {
|
|
7805
|
+
var t,
|
|
7806
|
+
r = new u(32),
|
|
7807
|
+
a = [P(e[0]), P(e[1]), P(e[2]), P(e[3])];
|
|
7808
|
+
for (t = 0; t < 3; ++t) I(a, a);
|
|
7809
|
+
if (b(r, a), 1 !== r[0]) return !1;
|
|
7810
|
+
for (t = 1; t < 32; ++t) if (0 !== r[t]) return !1;
|
|
7811
|
+
return !0;
|
|
7812
|
+
}(o)) return -1;
|
|
7355
7813
|
if (!function (e, t) {
|
|
7356
7814
|
var r;
|
|
7357
7815
|
for (r = 31; r >= 0; --r) {
|
|
@@ -7363,7 +7821,7 @@ if (typeof window === 'undefined') {
|
|
|
7363
7821
|
for (n = 0; n < r; ++n) e[n] = t[n];
|
|
7364
7822
|
for (n = 0; n < 32; ++n) e[n + 32] = a[n];
|
|
7365
7823
|
var c = E(e, r);
|
|
7366
|
-
if (T(c), _(s, o, c), k(o, t.subarray(32)), I(s, o),
|
|
7824
|
+
if (T(c), _(s, o, c), k(o, t.subarray(32)), I(s, o), b(i, s), r -= 64, w(t, 0, i, 0)) {
|
|
7367
7825
|
for (n = 0; n < r; ++n) e[n] = 0;
|
|
7368
7826
|
return -1;
|
|
7369
7827
|
}
|
|
@@ -7412,12 +7870,12 @@ if (typeof window === 'undefined') {
|
|
|
7412
7870
|
c = P(),
|
|
7413
7871
|
u = P(),
|
|
7414
7872
|
l = P();
|
|
7415
|
-
O(r, e[1], e[0]), O(l, t[1], t[0]),
|
|
7873
|
+
O(r, e[1], e[0]), O(l, t[1], t[0]), K(r, r, l), V(a, e[0], e[1]), V(l, t[0], t[1]), K(a, a, l), K(n, e[3], t[3]), K(n, n, y), K(i, e[2], t[2]), V(i, i, i), O(s, a, r), O(o, i, n), V(c, i, n), V(u, a, r), K(e[0], s, o), K(e[1], u, c), K(e[2], c, o), K(e[3], s, u);
|
|
7416
7874
|
}
|
|
7417
7875
|
function A(e, t, r) {
|
|
7418
7876
|
for (var a = 0; a < 4; ++a) D(e[a], t[a], r);
|
|
7419
7877
|
}
|
|
7420
|
-
function
|
|
7878
|
+
function b(e, t) {
|
|
7421
7879
|
var r = P(),
|
|
7422
7880
|
a = P(),
|
|
7423
7881
|
n = P();
|
|
@@ -7425,11 +7883,11 @@ if (typeof window === 'undefined') {
|
|
|
7425
7883
|
var r,
|
|
7426
7884
|
a = P();
|
|
7427
7885
|
for (r = 0; r < 16; ++r) a[r] = t[r];
|
|
7428
|
-
for (r = 253; r >= 0; --r)
|
|
7886
|
+
for (r = 253; r >= 0; --r) x(a, a), 2 !== r && 4 !== r && K(a, a, t);
|
|
7429
7887
|
for (r = 0; r < 16; ++r) e[r] = a[r];
|
|
7430
|
-
}(n, t[2]),
|
|
7888
|
+
}(n, t[2]), K(r, t[0], n), K(a, t[1], n), B(e, a), e[31] ^= R(r) << 7;
|
|
7431
7889
|
}
|
|
7432
|
-
function
|
|
7890
|
+
function B(e, t) {
|
|
7433
7891
|
var r,
|
|
7434
7892
|
a,
|
|
7435
7893
|
n,
|
|
@@ -7445,9 +7903,9 @@ if (typeof window === 'undefined') {
|
|
|
7445
7903
|
function N(e, t) {
|
|
7446
7904
|
var r = new u(32),
|
|
7447
7905
|
a = new u(32);
|
|
7448
|
-
return
|
|
7906
|
+
return B(r, e), B(a, t), w(r, 0, a, 0);
|
|
7449
7907
|
}
|
|
7450
|
-
function
|
|
7908
|
+
function w(e, t, r, a) {
|
|
7451
7909
|
return function (e, t, r, a, n) {
|
|
7452
7910
|
var i,
|
|
7453
7911
|
s = 0;
|
|
@@ -7455,9 +7913,9 @@ if (typeof window === 'undefined') {
|
|
|
7455
7913
|
return (1 & s - 1 >>> 8) - 1;
|
|
7456
7914
|
}(e, t, r, a, 32);
|
|
7457
7915
|
}
|
|
7458
|
-
function
|
|
7916
|
+
function R(e) {
|
|
7459
7917
|
var t = new u(32);
|
|
7460
|
-
return
|
|
7918
|
+
return B(t, e), 1 & t[0];
|
|
7461
7919
|
}
|
|
7462
7920
|
function _(e, t, r) {
|
|
7463
7921
|
var a, n;
|
|
@@ -7465,7 +7923,7 @@ if (typeof window === 'undefined') {
|
|
|
7465
7923
|
}
|
|
7466
7924
|
function k(e, t) {
|
|
7467
7925
|
var r = [P(), P(), P(), P()];
|
|
7468
|
-
L(r[0], g), L(r[1], v), L(r[2], h),
|
|
7926
|
+
L(r[0], g), L(r[1], v), L(r[2], h), K(r[3], g, v), _(e, r, t);
|
|
7469
7927
|
}
|
|
7470
7928
|
function L(e, t) {
|
|
7471
7929
|
var r;
|
|
@@ -7493,10 +7951,10 @@ if (typeof window === 'undefined') {
|
|
|
7493
7951
|
function O(e, t, r) {
|
|
7494
7952
|
for (var a = 0; a < 16; ++a) e[a] = t[a] - r[a];
|
|
7495
7953
|
}
|
|
7496
|
-
function
|
|
7497
|
-
|
|
7954
|
+
function x(e, t) {
|
|
7955
|
+
K(e, t, t);
|
|
7498
7956
|
}
|
|
7499
|
-
function
|
|
7957
|
+
function K(e, t, r) {
|
|
7500
7958
|
var a,
|
|
7501
7959
|
n,
|
|
7502
7960
|
i = 0,
|
|
@@ -7519,11 +7977,11 @@ if (typeof window === 'undefined') {
|
|
|
7519
7977
|
T = 0,
|
|
7520
7978
|
I = 0,
|
|
7521
7979
|
A = 0,
|
|
7522
|
-
B = 0,
|
|
7523
7980
|
b = 0,
|
|
7981
|
+
B = 0,
|
|
7524
7982
|
N = 0,
|
|
7525
|
-
R = 0,
|
|
7526
7983
|
w = 0,
|
|
7984
|
+
R = 0,
|
|
7527
7985
|
_ = 0,
|
|
7528
7986
|
k = 0,
|
|
7529
7987
|
L = 0,
|
|
@@ -7532,8 +7990,8 @@ if (typeof window === 'undefined') {
|
|
|
7532
7990
|
P = 0,
|
|
7533
7991
|
V = r[0],
|
|
7534
7992
|
O = r[1],
|
|
7535
|
-
|
|
7536
|
-
|
|
7993
|
+
x = r[2],
|
|
7994
|
+
K = r[3],
|
|
7537
7995
|
M = r[4],
|
|
7538
7996
|
F = r[5],
|
|
7539
7997
|
j = r[6],
|
|
@@ -7546,7 +8004,7 @@ if (typeof window === 'undefined') {
|
|
|
7546
8004
|
X = r[13],
|
|
7547
8005
|
W = r[14],
|
|
7548
8006
|
Z = r[15];
|
|
7549
|
-
i += (a = t[0]) * V, s += a * O, o += a *
|
|
8007
|
+
i += (a = t[0]) * V, s += a * O, o += a * x, c += a * K, u += a * M, l += a * F, p += a * j, f += a * G, h += a * q, d += a * H, y += a * Q, g += a * z, v += a * Y, m += a * X, C += a * W, E += a * Z, s += (a = t[1]) * V, o += a * O, c += a * x, u += a * K, l += a * M, p += a * F, f += a * j, h += a * G, d += a * q, y += a * H, g += a * Q, v += a * z, m += a * Y, C += a * X, E += a * W, S += a * Z, o += (a = t[2]) * V, c += a * O, u += a * x, l += a * K, p += a * M, f += a * F, h += a * j, d += a * G, y += a * q, g += a * H, v += a * Q, m += a * z, C += a * Y, E += a * X, S += a * W, T += a * Z, c += (a = t[3]) * V, u += a * O, l += a * x, p += a * K, f += a * M, h += a * F, d += a * j, y += a * G, g += a * q, v += a * H, m += a * Q, C += a * z, E += a * Y, S += a * X, T += a * W, I += a * Z, u += (a = t[4]) * V, l += a * O, p += a * x, f += a * K, h += a * M, d += a * F, y += a * j, g += a * G, v += a * q, m += a * H, C += a * Q, E += a * z, S += a * Y, T += a * X, I += a * W, A += a * Z, l += (a = t[5]) * V, p += a * O, f += a * x, h += a * K, d += a * M, y += a * F, g += a * j, v += a * G, m += a * q, C += a * H, E += a * Q, S += a * z, T += a * Y, I += a * X, A += a * W, b += a * Z, p += (a = t[6]) * V, f += a * O, h += a * x, d += a * K, y += a * M, g += a * F, v += a * j, m += a * G, C += a * q, E += a * H, S += a * Q, T += a * z, I += a * Y, A += a * X, b += a * W, B += a * Z, f += (a = t[7]) * V, h += a * O, d += a * x, y += a * K, g += a * M, v += a * F, m += a * j, C += a * G, E += a * q, S += a * H, T += a * Q, I += a * z, A += a * Y, b += a * X, B += a * W, N += a * Z, h += (a = t[8]) * V, d += a * O, y += a * x, g += a * K, v += a * M, m += a * F, C += a * j, E += a * G, S += a * q, T += a * H, I += a * Q, A += a * z, b += a * Y, B += a * X, N += a * W, w += a * Z, d += (a = t[9]) * V, y += a * O, g += a * x, v += a * K, m += a * M, C += a * F, E += a * j, S += a * G, T += a * q, I += a * H, A += a * Q, b += a * z, B += a * Y, N += a * X, w += a * W, R += a * Z, y += (a = t[10]) * V, g += a * O, v += a * x, m += a * K, C += a * M, E += a * F, S += a * j, T += a * G, I += a * q, A += a * H, b += a * Q, B += a * z, N += a * Y, w += a * X, R += a * W, _ += a * Z, g += (a = t[11]) * V, v += a * O, m += a * x, C += a * K, E += a * M, S += a * F, T += a * j, I += a * G, A += a * q, b += a * H, B += a * Q, N += a * z, w += a * Y, R += a * X, _ += a * W, k += a * Z, v += (a = t[12]) * V, m += a * O, C += a * x, E += a * K, S += a * M, T += a * F, I += a * j, A += a * G, b += a * q, B += a * H, N += a * Q, w += a * z, R += a * Y, _ += a * X, k += a * W, L += a * Z, m += (a = t[13]) * V, C += a * O, E += a * x, S += a * K, T += a * M, I += a * F, A += a * j, b += a * G, B += a * q, N += a * H, w += a * Q, R += a * z, _ += a * Y, k += a * X, L += a * W, U += a * Z, C += (a = t[14]) * V, E += a * O, S += a * x, T += a * K, I += a * M, A += a * F, b += a * j, B += a * G, N += a * q, w += a * H, R += a * Q, _ += a * z, k += a * Y, L += a * X, U += a * W, D += a * Z, E += (a = t[15]) * V, s += 38 * (T += a * x), o += 38 * (I += a * K), c += 38 * (A += a * M), u += 38 * (b += a * F), l += 38 * (B += a * j), p += 38 * (N += a * G), f += 38 * (w += a * q), h += 38 * (R += a * H), d += 38 * (_ += a * Q), y += 38 * (k += a * z), g += 38 * (L += a * Y), v += 38 * (U += a * X), m += 38 * (D += a * W), C += 38 * (P += a * Z), i = (a = (i += 38 * (S += a * O)) + (n = 1) + 65535) - 65536 * (n = Math.floor(a / 65536)), s = (a = s + n + 65535) - 65536 * (n = Math.floor(a / 65536)), o = (a = o + n + 65535) - 65536 * (n = Math.floor(a / 65536)), c = (a = c + n + 65535) - 65536 * (n = Math.floor(a / 65536)), u = (a = u + n + 65535) - 65536 * (n = Math.floor(a / 65536)), l = (a = l + n + 65535) - 65536 * (n = Math.floor(a / 65536)), p = (a = p + n + 65535) - 65536 * (n = Math.floor(a / 65536)), f = (a = f + n + 65535) - 65536 * (n = Math.floor(a / 65536)), h = (a = h + n + 65535) - 65536 * (n = Math.floor(a / 65536)), d = (a = d + n + 65535) - 65536 * (n = Math.floor(a / 65536)), y = (a = y + n + 65535) - 65536 * (n = Math.floor(a / 65536)), g = (a = g + n + 65535) - 65536 * (n = Math.floor(a / 65536)), v = (a = v + n + 65535) - 65536 * (n = Math.floor(a / 65536)), m = (a = m + n + 65535) - 65536 * (n = Math.floor(a / 65536)), C = (a = C + n + 65535) - 65536 * (n = Math.floor(a / 65536)), E = (a = E + n + 65535) - 65536 * (n = Math.floor(a / 65536)), i = (a = (i += n - 1 + 37 * (n - 1)) + (n = 1) + 65535) - 65536 * (n = Math.floor(a / 65536)), s = (a = s + n + 65535) - 65536 * (n = Math.floor(a / 65536)), o = (a = o + n + 65535) - 65536 * (n = Math.floor(a / 65536)), c = (a = c + n + 65535) - 65536 * (n = Math.floor(a / 65536)), u = (a = u + n + 65535) - 65536 * (n = Math.floor(a / 65536)), l = (a = l + n + 65535) - 65536 * (n = Math.floor(a / 65536)), p = (a = p + n + 65535) - 65536 * (n = Math.floor(a / 65536)), f = (a = f + n + 65535) - 65536 * (n = Math.floor(a / 65536)), h = (a = h + n + 65535) - 65536 * (n = Math.floor(a / 65536)), d = (a = d + n + 65535) - 65536 * (n = Math.floor(a / 65536)), y = (a = y + n + 65535) - 65536 * (n = Math.floor(a / 65536)), g = (a = g + n + 65535) - 65536 * (n = Math.floor(a / 65536)), v = (a = v + n + 65535) - 65536 * (n = Math.floor(a / 65536)), m = (a = m + n + 65535) - 65536 * (n = Math.floor(a / 65536)), C = (a = C + n + 65535) - 65536 * (n = Math.floor(a / 65536)), E = (a = E + n + 65535) - 65536 * (n = Math.floor(a / 65536)), i += n - 1 + 37 * (n - 1), e[0] = i, e[1] = s, e[2] = o, e[3] = c, e[4] = u, e[5] = l, e[6] = p, e[7] = f, e[8] = h, e[9] = d, e[10] = y, e[11] = g, e[12] = v, e[13] = m, e[14] = C, e[15] = E;
|
|
7550
8008
|
}
|
|
7551
8009
|
}, function (e, t, r) {
|
|
7552
8010
|
var a = r(0);
|