flagmint-js-sdk 1.2.2 → 1.2.4
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/flagmint.es.js
CHANGED
|
@@ -1176,9 +1176,8 @@ class bu {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
1178
|
class yu {
|
|
1179
|
-
// 30 seconds
|
|
1180
1179
|
constructor(n, s, o = 5, m = 1e3) {
|
|
1181
|
-
this.wsUrl = n, this.apiKey = s, this.maxRetries = o, this.initialBackoffMs = m, this.socket = null, this.flags = {}, this.context = null, this.isReady = !1, this.initialFlagsReceived = !1, this.initialFlagsPromise = null, this.retries = 0, this.reconnectTimeoutId = null
|
|
1180
|
+
this.wsUrl = n, this.apiKey = s, this.maxRetries = o, this.initialBackoffMs = m, this.socket = null, this.flags = {}, this.context = null, this.isReady = !1, this.initialFlagsReceived = !1, this.initialFlagsPromise = null, this.retries = 0, this.reconnectTimeoutId = null;
|
|
1182
1181
|
}
|
|
1183
1182
|
init() {
|
|
1184
1183
|
return ke(this, null, function* () {
|
|
@@ -1202,14 +1201,17 @@ class yu {
|
|
|
1202
1201
|
this.cleanupSocket(), this.setConnectionState("connecting");
|
|
1203
1202
|
const m = this.getWebSocketImplementation();
|
|
1204
1203
|
this.socket = new m(`${this.wsUrl}?apiKey=${this.apiKey}`), this.socket.onopen = () => {
|
|
1205
|
-
console.log("[WebSocketTransport] Connected"), this.isReady = !0, this.retries = 0, this.setConnectionState("connected"), this.context && this.sendContext(this.context),
|
|
1204
|
+
console.log("[WebSocketTransport] Connected"), this.isReady = !0, this.retries = 0, this.setConnectionState("connected"), this.context && this.sendContext(this.context), n();
|
|
1206
1205
|
}, this.socket.onmessage = (f) => {
|
|
1207
1206
|
var g;
|
|
1208
|
-
this.lastHeartbeatTime = Date.now();
|
|
1209
1207
|
try {
|
|
1210
1208
|
const y = JSON.parse(f.data);
|
|
1211
1209
|
if (console.log("[WebSocketTransport] Message received:", y), y.type === "ping") {
|
|
1212
|
-
this.socket && this.socket.readyState === 1
|
|
1210
|
+
this.socket && this.socket.readyState === 1 && this.socket.send(JSON.stringify({ type: "pong" }));
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
if (y.type === "pong") {
|
|
1214
|
+
console.log("[WebSocketTransport] Pong received");
|
|
1213
1215
|
return;
|
|
1214
1216
|
}
|
|
1215
1217
|
y.type === "flags" && (console.log("[WebSocketTransport] Flags update received"), this.flags = y.flags, this.initialFlagsReceived = !0, (g = this.onFlagsUpdatedCallback) == null || g.call(this, this.flags));
|
|
@@ -1219,7 +1221,7 @@ class yu {
|
|
|
1219
1221
|
}, this.socket.onerror = (f) => {
|
|
1220
1222
|
console.error("[WebSocketTransport] Error:", f);
|
|
1221
1223
|
}, this.socket.onclose = (f) => {
|
|
1222
|
-
if (console.log("[WebSocketTransport] Connection closed:", f.code), this.isReady = !1, this.
|
|
1224
|
+
if (console.log("[WebSocketTransport] Connection closed:", f.code), this.isReady = !1, this.setConnectionState("disconnected"), f.code === 1008 || f.code === 4001) {
|
|
1223
1225
|
this.setConnectionState("failed"), s(new Error("Unauthorized: Invalid API key"));
|
|
1224
1226
|
return;
|
|
1225
1227
|
}
|
|
@@ -1241,19 +1243,6 @@ class yu {
|
|
|
1241
1243
|
cleanupSocket() {
|
|
1242
1244
|
this.socket && (this.socket.onopen = null, this.socket.onmessage = null, this.socket.onerror = null, this.socket.onclose = null, this.socket.readyState === 1 && this.socket.close(), this.socket = null);
|
|
1243
1245
|
}
|
|
1244
|
-
startHeartbeat() {
|
|
1245
|
-
this.lastHeartbeatTime = Date.now(), this.heartbeatIntervalId = setInterval(() => {
|
|
1246
|
-
var s, o;
|
|
1247
|
-
if (Date.now() - this.lastHeartbeatTime > this.heartbeatTimeoutMs) {
|
|
1248
|
-
console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."), (s = this.socket) == null || s.close();
|
|
1249
|
-
return;
|
|
1250
|
-
}
|
|
1251
|
-
((o = this.socket) == null ? void 0 : o.readyState) === 1 && this.socket.send(JSON.stringify({ type: "ping" }));
|
|
1252
|
-
}, 1e4);
|
|
1253
|
-
}
|
|
1254
|
-
stopHeartbeat() {
|
|
1255
|
-
this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null);
|
|
1256
|
-
}
|
|
1257
1246
|
setConnectionState(n) {
|
|
1258
1247
|
var s;
|
|
1259
1248
|
(s = this.onConnectionStateCallback) == null || s.call(this, n);
|
|
@@ -1283,7 +1272,7 @@ class yu {
|
|
|
1283
1272
|
this.onConnectionStateCallback = n;
|
|
1284
1273
|
}
|
|
1285
1274
|
destroy() {
|
|
1286
|
-
console.log("[WebSocketTransport] Destroying..."), this.
|
|
1275
|
+
console.log("[WebSocketTransport] Destroying..."), this.reconnectTimeoutId !== null && (clearTimeout(this.reconnectTimeoutId), this.reconnectTimeoutId = null), this.cleanupSocket(), this.flags = {}, this.context = null, this.isReady = !1, this.initialFlagsReceived = !1, this.initialFlagsPromise = null, this.onFlagsUpdatedCallback = void 0, this.onConnectionStateCallback = void 0, this.retries = 0;
|
|
1287
1276
|
}
|
|
1288
1277
|
sendContext(n) {
|
|
1289
1278
|
if (!this.socket || this.socket.readyState !== 1) {
|
|
@@ -12816,7 +12805,7 @@ Er.padLength = 64;
|
|
|
12816
12805
|
Er.prototype._digest = function(n) {
|
|
12817
12806
|
return n === "hex" ? u0.toHex32(this.h.slice(0, 7), "big") : u0.split32(this.h.slice(0, 7), "big");
|
|
12818
12807
|
};
|
|
12819
|
-
var Ne = Xt, Jp = xi, Gp = We, ur = Ne.rotr64_hi, lr = Ne.rotr64_lo, yo = Ne.shr64_hi, wo = Ne.shr64_lo, Tr = Ne.sum64, Rf = Ne.sum64_hi, Tf = Ne.sum64_lo, Xp = Ne.sum64_4_hi, jp = Ne.sum64_4_lo, Qp = Ne.sum64_5_hi,
|
|
12808
|
+
var Ne = Xt, Jp = xi, Gp = We, ur = Ne.rotr64_hi, lr = Ne.rotr64_lo, yo = Ne.shr64_hi, wo = Ne.shr64_lo, Tr = Ne.sum64, Rf = Ne.sum64_hi, Tf = Ne.sum64_lo, Xp = Ne.sum64_4_hi, jp = Ne.sum64_4_lo, Qp = Ne.sum64_5_hi, t2 = Ne.sum64_5_lo, Mo = Jp.BlockHash, e2 = [
|
|
12820
12809
|
1116352408,
|
|
12821
12810
|
3609767458,
|
|
12822
12811
|
1899447441,
|
|
@@ -12998,7 +12987,7 @@ function tr() {
|
|
|
12998
12987
|
4215389547,
|
|
12999
12988
|
1541459225,
|
|
13000
12989
|
327033209
|
|
13001
|
-
], this.k =
|
|
12990
|
+
], this.k = e2, this.W = new Array(160);
|
|
13002
12991
|
}
|
|
13003
12992
|
Ne.inherits(tr, Mo);
|
|
13004
12993
|
var xo = tr;
|
|
@@ -13010,7 +12999,7 @@ tr.prototype._prepareBlock = function(n, s) {
|
|
|
13010
12999
|
for (var o = this.W, m = 0; m < 32; m++)
|
|
13011
13000
|
o[m] = n[s + m];
|
|
13012
13001
|
for (; m < o.length; m += 2) {
|
|
13013
|
-
var f =
|
|
13002
|
+
var f = d2(o[m - 4], o[m - 3]), g = c2(o[m - 4], o[m - 3]), y = o[m - 14], S = o[m - 13], B = u2(o[m - 30], o[m - 29]), M = l2(o[m - 30], o[m - 29]), x = o[m - 32], I = o[m - 31];
|
|
13014
13003
|
o[m] = Xp(
|
|
13015
13004
|
f,
|
|
13016
13005
|
g,
|
|
@@ -13037,7 +13026,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13037
13026
|
var o = this.W, m = this.h[0], f = this.h[1], g = this.h[2], y = this.h[3], S = this.h[4], B = this.h[5], M = this.h[6], x = this.h[7], I = this.h[8], k = this.h[9], D = this.h[10], L = this.h[11], W = this.h[12], z = this.h[13], $ = this.h[14], lt = this.h[15];
|
|
13038
13027
|
Gp(this.k.length === o.length);
|
|
13039
13028
|
for (var H = 0; H < o.length; H += 2) {
|
|
13040
|
-
var At = $, Bt = lt, Ct =
|
|
13029
|
+
var At = $, Bt = lt, Ct = s2(I, k), Et = o2(I, k), Y = r2(I, k, D, L, W), It = i2(I, k, D, L, W, z), p = this.k[H], t = this.k[H + 1], r = o[H], i = o[H + 1], a = Qp(
|
|
13041
13030
|
At,
|
|
13042
13031
|
Bt,
|
|
13043
13032
|
Ct,
|
|
@@ -13048,7 +13037,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13048
13037
|
t,
|
|
13049
13038
|
r,
|
|
13050
13039
|
i
|
|
13051
|
-
), d =
|
|
13040
|
+
), d = t2(
|
|
13052
13041
|
At,
|
|
13053
13042
|
Bt,
|
|
13054
13043
|
Ct,
|
|
@@ -13060,7 +13049,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13060
13049
|
r,
|
|
13061
13050
|
i
|
|
13062
13051
|
);
|
|
13063
|
-
At =
|
|
13052
|
+
At = a2(m, f), Bt = h2(m, f), Ct = n2(m, f, g, y, S), Et = f2(m, f, g, y, S, B);
|
|
13064
13053
|
var c = Rf(At, Bt, Ct, Et), v = Tf(At, Bt, Ct, Et);
|
|
13065
13054
|
$ = W, lt = z, W = D, z = L, D = I, L = k, I = Rf(M, x, a, d), k = Tf(x, x, a, d), M = S, x = B, S = g, B = y, g = m, y = f, m = Rf(a, d, c, v), f = Tf(a, d, c, v);
|
|
13066
13055
|
}
|
|
@@ -13069,51 +13058,51 @@ tr.prototype._update = function(n, s) {
|
|
|
13069
13058
|
tr.prototype._digest = function(n) {
|
|
13070
13059
|
return n === "hex" ? Ne.toHex32(this.h, "big") : Ne.split32(this.h, "big");
|
|
13071
13060
|
};
|
|
13072
|
-
function
|
|
13061
|
+
function r2(h, n, s, o, m) {
|
|
13073
13062
|
var f = h & s ^ ~h & m;
|
|
13074
13063
|
return f < 0 && (f += 4294967296), f;
|
|
13075
13064
|
}
|
|
13076
|
-
function
|
|
13065
|
+
function i2(h, n, s, o, m, f) {
|
|
13077
13066
|
var g = n & o ^ ~n & f;
|
|
13078
13067
|
return g < 0 && (g += 4294967296), g;
|
|
13079
13068
|
}
|
|
13080
|
-
function
|
|
13069
|
+
function n2(h, n, s, o, m) {
|
|
13081
13070
|
var f = h & s ^ h & m ^ s & m;
|
|
13082
13071
|
return f < 0 && (f += 4294967296), f;
|
|
13083
13072
|
}
|
|
13084
|
-
function
|
|
13073
|
+
function f2(h, n, s, o, m, f) {
|
|
13085
13074
|
var g = n & o ^ n & f ^ o & f;
|
|
13086
13075
|
return g < 0 && (g += 4294967296), g;
|
|
13087
13076
|
}
|
|
13088
|
-
function
|
|
13077
|
+
function a2(h, n) {
|
|
13089
13078
|
var s = ur(h, n, 28), o = ur(n, h, 2), m = ur(n, h, 7), f = s ^ o ^ m;
|
|
13090
13079
|
return f < 0 && (f += 4294967296), f;
|
|
13091
13080
|
}
|
|
13092
|
-
function
|
|
13081
|
+
function h2(h, n) {
|
|
13093
13082
|
var s = lr(h, n, 28), o = lr(n, h, 2), m = lr(n, h, 7), f = s ^ o ^ m;
|
|
13094
13083
|
return f < 0 && (f += 4294967296), f;
|
|
13095
13084
|
}
|
|
13096
|
-
function
|
|
13085
|
+
function s2(h, n) {
|
|
13097
13086
|
var s = ur(h, n, 14), o = ur(h, n, 18), m = ur(n, h, 9), f = s ^ o ^ m;
|
|
13098
13087
|
return f < 0 && (f += 4294967296), f;
|
|
13099
13088
|
}
|
|
13100
|
-
function
|
|
13089
|
+
function o2(h, n) {
|
|
13101
13090
|
var s = lr(h, n, 14), o = lr(h, n, 18), m = lr(n, h, 9), f = s ^ o ^ m;
|
|
13102
13091
|
return f < 0 && (f += 4294967296), f;
|
|
13103
13092
|
}
|
|
13104
|
-
function
|
|
13093
|
+
function u2(h, n) {
|
|
13105
13094
|
var s = ur(h, n, 1), o = ur(h, n, 8), m = yo(h, n, 7), f = s ^ o ^ m;
|
|
13106
13095
|
return f < 0 && (f += 4294967296), f;
|
|
13107
13096
|
}
|
|
13108
|
-
function
|
|
13097
|
+
function l2(h, n) {
|
|
13109
13098
|
var s = lr(h, n, 1), o = lr(h, n, 8), m = wo(h, n, 7), f = s ^ o ^ m;
|
|
13110
13099
|
return f < 0 && (f += 4294967296), f;
|
|
13111
13100
|
}
|
|
13112
|
-
function
|
|
13101
|
+
function d2(h, n) {
|
|
13113
13102
|
var s = ur(h, n, 19), o = ur(n, h, 29), m = yo(h, n, 6), f = s ^ o ^ m;
|
|
13114
13103
|
return f < 0 && (f += 4294967296), f;
|
|
13115
13104
|
}
|
|
13116
|
-
function
|
|
13105
|
+
function c2(h, n) {
|
|
13117
13106
|
var s = lr(h, n, 19), o = lr(n, h, 29), m = wo(h, n, 6), f = s ^ o ^ m;
|
|
13118
13107
|
return f < 0 && (f += 4294967296), f;
|
|
13119
13108
|
}
|
|
@@ -13141,7 +13130,7 @@ function kr() {
|
|
|
13141
13130
|
];
|
|
13142
13131
|
}
|
|
13143
13132
|
l0.inherits(kr, _o);
|
|
13144
|
-
var
|
|
13133
|
+
var v2 = kr;
|
|
13145
13134
|
kr.blockSize = 1024;
|
|
13146
13135
|
kr.outSize = 384;
|
|
13147
13136
|
kr.hmacStrength = 192;
|
|
@@ -13152,9 +13141,9 @@ kr.prototype._digest = function(n) {
|
|
|
13152
13141
|
_i.sha1 = Dp;
|
|
13153
13142
|
_i.sha224 = Yp;
|
|
13154
13143
|
_i.sha256 = go;
|
|
13155
|
-
_i.sha384 =
|
|
13144
|
+
_i.sha384 = v2;
|
|
13156
13145
|
_i.sha512 = xo;
|
|
13157
|
-
var So = {}, jr = Xt,
|
|
13146
|
+
var So = {}, jr = Xt, p2 = xi, cn = jr.rotl32, Pa = jr.sum32, qi = jr.sum32_3, Da = jr.sum32_4, Ao = p2.BlockHash;
|
|
13158
13147
|
function mr() {
|
|
13159
13148
|
if (!(this instanceof mr))
|
|
13160
13149
|
return new mr();
|
|
@@ -13170,15 +13159,15 @@ mr.prototype._update = function(n, s) {
|
|
|
13170
13159
|
for (var o = this.h[0], m = this.h[1], f = this.h[2], g = this.h[3], y = this.h[4], S = o, B = m, M = f, x = g, I = y, k = 0; k < 80; k++) {
|
|
13171
13160
|
var D = Pa(
|
|
13172
13161
|
cn(
|
|
13173
|
-
Da(o, Na(k, m, f, g), n[
|
|
13174
|
-
|
|
13162
|
+
Da(o, Na(k, m, f, g), n[b2[k] + s], m2(k)),
|
|
13163
|
+
w2[k]
|
|
13175
13164
|
),
|
|
13176
13165
|
y
|
|
13177
13166
|
);
|
|
13178
13167
|
o = y, y = g, g = cn(f, 10), f = m, m = D, D = Pa(
|
|
13179
13168
|
cn(
|
|
13180
|
-
Da(S, Na(79 - k, B, M, x), n[
|
|
13181
|
-
|
|
13169
|
+
Da(S, Na(79 - k, B, M, x), n[y2[k] + s], g2(k)),
|
|
13170
|
+
M2[k]
|
|
13182
13171
|
),
|
|
13183
13172
|
I
|
|
13184
13173
|
), S = I, I = x, x = cn(M, 10), M = B, B = D;
|
|
@@ -13191,13 +13180,13 @@ mr.prototype._digest = function(n) {
|
|
|
13191
13180
|
function Na(h, n, s, o) {
|
|
13192
13181
|
return h <= 15 ? n ^ s ^ o : h <= 31 ? n & s | ~n & o : h <= 47 ? (n | ~s) ^ o : h <= 63 ? n & o | s & ~o : n ^ (s | ~o);
|
|
13193
13182
|
}
|
|
13194
|
-
function
|
|
13183
|
+
function m2(h) {
|
|
13195
13184
|
return h <= 15 ? 0 : h <= 31 ? 1518500249 : h <= 47 ? 1859775393 : h <= 63 ? 2400959708 : 2840853838;
|
|
13196
13185
|
}
|
|
13197
|
-
function
|
|
13186
|
+
function g2(h) {
|
|
13198
13187
|
return h <= 15 ? 1352829926 : h <= 31 ? 1548603684 : h <= 47 ? 1836072691 : h <= 63 ? 2053994217 : 0;
|
|
13199
13188
|
}
|
|
13200
|
-
var
|
|
13189
|
+
var b2 = [
|
|
13201
13190
|
0,
|
|
13202
13191
|
1,
|
|
13203
13192
|
2,
|
|
@@ -13278,7 +13267,7 @@ var bm = [
|
|
|
13278
13267
|
6,
|
|
13279
13268
|
15,
|
|
13280
13269
|
13
|
|
13281
|
-
],
|
|
13270
|
+
], y2 = [
|
|
13282
13271
|
5,
|
|
13283
13272
|
14,
|
|
13284
13273
|
7,
|
|
@@ -13359,7 +13348,7 @@ var bm = [
|
|
|
13359
13348
|
3,
|
|
13360
13349
|
9,
|
|
13361
13350
|
11
|
|
13362
|
-
],
|
|
13351
|
+
], w2 = [
|
|
13363
13352
|
11,
|
|
13364
13353
|
14,
|
|
13365
13354
|
15,
|
|
@@ -13440,7 +13429,7 @@ var bm = [
|
|
|
13440
13429
|
8,
|
|
13441
13430
|
5,
|
|
13442
13431
|
6
|
|
13443
|
-
],
|
|
13432
|
+
], M2 = [
|
|
13444
13433
|
8,
|
|
13445
13434
|
9,
|
|
13446
13435
|
9,
|
|
@@ -13521,15 +13510,15 @@ var bm = [
|
|
|
13521
13510
|
13,
|
|
13522
13511
|
11,
|
|
13523
13512
|
11
|
|
13524
|
-
],
|
|
13513
|
+
], x2 = Xt, _2 = We;
|
|
13525
13514
|
function vi(h, n, s) {
|
|
13526
13515
|
if (!(this instanceof vi))
|
|
13527
13516
|
return new vi(h, n, s);
|
|
13528
|
-
this.Hash = h, this.blockSize = h.blockSize / 8, this.outSize = h.outSize / 8, this.inner = null, this.outer = null, this._init(
|
|
13517
|
+
this.Hash = h, this.blockSize = h.blockSize / 8, this.outSize = h.outSize / 8, this.inner = null, this.outer = null, this._init(x2.toArray(n, s));
|
|
13529
13518
|
}
|
|
13530
|
-
var
|
|
13519
|
+
var S2 = vi;
|
|
13531
13520
|
vi.prototype._init = function(n) {
|
|
13532
|
-
n.length > this.blockSize && (n = new this.Hash().update(n).digest()),
|
|
13521
|
+
n.length > this.blockSize && (n = new this.Hash().update(n).digest()), _2(n.length <= this.blockSize);
|
|
13533
13522
|
for (var s = n.length; s < this.blockSize; s++)
|
|
13534
13523
|
n.push(0);
|
|
13535
13524
|
for (s = 0; s < n.length; s++)
|
|
@@ -13546,10 +13535,10 @@ vi.prototype.digest = function(n) {
|
|
|
13546
13535
|
};
|
|
13547
13536
|
(function(h) {
|
|
13548
13537
|
var n = h;
|
|
13549
|
-
n.utils = Xt, n.common = xi, n.sha = _i, n.ripemd = So, n.hmac =
|
|
13538
|
+
n.utils = Xt, n.common = xi, n.sha = _i, n.ripemd = So, n.hmac = S2, n.sha1 = n.sha.sha1, n.sha256 = n.sha.sha256, n.sha224 = n.sha.sha224, n.sha384 = n.sha.sha384, n.sha512 = n.sha.sha512, n.ripemd160 = n.ripemd.ripemd160;
|
|
13550
13539
|
})(rf);
|
|
13551
13540
|
var Cf, $a;
|
|
13552
|
-
function
|
|
13541
|
+
function A2() {
|
|
13553
13542
|
return $a || ($a = 1, Cf = {
|
|
13554
13543
|
doubles: {
|
|
13555
13544
|
step: 4,
|
|
@@ -14447,7 +14436,7 @@ function Am() {
|
|
|
14447
14436
|
});
|
|
14448
14437
|
var S;
|
|
14449
14438
|
try {
|
|
14450
|
-
S =
|
|
14439
|
+
S = A2();
|
|
14451
14440
|
} catch (B) {
|
|
14452
14441
|
S = void 0;
|
|
14453
14442
|
}
|
|
@@ -14481,7 +14470,7 @@ function Am() {
|
|
|
14481
14470
|
]
|
|
14482
14471
|
});
|
|
14483
14472
|
})(ef);
|
|
14484
|
-
var
|
|
14473
|
+
var B2 = rf, Jr = O0, Bo = We;
|
|
14485
14474
|
function Dr(h) {
|
|
14486
14475
|
if (!(this instanceof Dr))
|
|
14487
14476
|
return new Dr(h);
|
|
@@ -14492,7 +14481,7 @@ function Dr(h) {
|
|
|
14492
14481
|
"Not enough entropy. Minimum is: " + this.minEntropy + " bits"
|
|
14493
14482
|
), this._init(n, s, o);
|
|
14494
14483
|
}
|
|
14495
|
-
var
|
|
14484
|
+
var E2 = Dr;
|
|
14496
14485
|
Dr.prototype._init = function(n, s, o) {
|
|
14497
14486
|
var m = n.concat(s).concat(o);
|
|
14498
14487
|
this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);
|
|
@@ -14501,7 +14490,7 @@ Dr.prototype._init = function(n, s, o) {
|
|
|
14501
14490
|
this._update(m), this._reseed = 1, this.reseedInterval = 281474976710656;
|
|
14502
14491
|
};
|
|
14503
14492
|
Dr.prototype._hmac = function() {
|
|
14504
|
-
return new
|
|
14493
|
+
return new B2.hmac(this.hash, this.K);
|
|
14505
14494
|
};
|
|
14506
14495
|
Dr.prototype._update = function(n) {
|
|
14507
14496
|
var s = this._hmac().update(this.V).update([0]);
|
|
@@ -14522,11 +14511,11 @@ Dr.prototype.generate = function(n, s, o, m) {
|
|
|
14522
14511
|
var g = f.slice(0, n);
|
|
14523
14512
|
return this._update(o), this._reseed++, Jr.encode(g, s);
|
|
14524
14513
|
};
|
|
14525
|
-
var
|
|
14514
|
+
var k2 = Rr, I2 = ze, d0 = I2.assert;
|
|
14526
14515
|
function Fe(h, n) {
|
|
14527
14516
|
this.ec = h, this.priv = null, this.pub = null, n.priv && this._importPrivate(n.priv, n.privEnc), n.pub && this._importPublic(n.pub, n.pubEnc);
|
|
14528
14517
|
}
|
|
14529
|
-
var
|
|
14518
|
+
var R2 = Fe;
|
|
14530
14519
|
Fe.fromPublic = function(n, s, o) {
|
|
14531
14520
|
return s instanceof Fe ? s : new Fe(n, {
|
|
14532
14521
|
pub: s,
|
|
@@ -14550,7 +14539,7 @@ Fe.prototype.getPrivate = function(n) {
|
|
|
14550
14539
|
return n === "hex" ? this.priv.toString(16, 2) : this.priv;
|
|
14551
14540
|
};
|
|
14552
14541
|
Fe.prototype._importPrivate = function(n, s) {
|
|
14553
|
-
this.priv = new
|
|
14542
|
+
this.priv = new k2(n, s || 16), this.priv = this.priv.umod(this.ec.curve.n);
|
|
14554
14543
|
};
|
|
14555
14544
|
Fe.prototype._importPublic = function(n, s) {
|
|
14556
14545
|
if (n.x || n.y) {
|
|
@@ -14571,14 +14560,14 @@ Fe.prototype.verify = function(n, s, o) {
|
|
|
14571
14560
|
Fe.prototype.inspect = function() {
|
|
14572
14561
|
return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
|
|
14573
14562
|
};
|
|
14574
|
-
var In = Rr, H0 = ze,
|
|
14563
|
+
var In = Rr, H0 = ze, T2 = H0.assert;
|
|
14575
14564
|
function ff(h, n) {
|
|
14576
14565
|
if (h instanceof ff)
|
|
14577
14566
|
return h;
|
|
14578
|
-
this._importDER(h, n) || (
|
|
14567
|
+
this._importDER(h, n) || (T2(h.r && h.s, "Signature without r or s"), this.r = new In(h.r, 16), this.s = new In(h.s, 16), h.recoveryParam === void 0 ? this.recoveryParam = null : this.recoveryParam = h.recoveryParam);
|
|
14579
14568
|
}
|
|
14580
|
-
var
|
|
14581
|
-
function
|
|
14569
|
+
var C2 = ff;
|
|
14570
|
+
function F2() {
|
|
14582
14571
|
this.place = 0;
|
|
14583
14572
|
}
|
|
14584
14573
|
function Ff(h, n) {
|
|
@@ -14599,7 +14588,7 @@ function Ua(h) {
|
|
|
14599
14588
|
}
|
|
14600
14589
|
ff.prototype._importDER = function(n, s) {
|
|
14601
14590
|
n = H0.toArray(n, s);
|
|
14602
|
-
var o = new
|
|
14591
|
+
var o = new F2();
|
|
14603
14592
|
if (n[o.place++] !== 48)
|
|
14604
14593
|
return !1;
|
|
14605
14594
|
var m = Ff(n, o);
|
|
@@ -14647,11 +14636,11 @@ ff.prototype.toDER = function(n) {
|
|
|
14647
14636
|
return qf(g, f.length), g = g.concat(f), H0.encode(g, n);
|
|
14648
14637
|
};
|
|
14649
14638
|
var Pf, La;
|
|
14650
|
-
function
|
|
14639
|
+
function q2() {
|
|
14651
14640
|
if (La)
|
|
14652
14641
|
return Pf;
|
|
14653
14642
|
La = 1;
|
|
14654
|
-
var h = Rr, n =
|
|
14643
|
+
var h = Rr, n = E2, s = ze, o = ef, m = P0(), f = s.assert, g = R2, y = C2;
|
|
14655
14644
|
function S(B) {
|
|
14656
14645
|
if (!(this instanceof S))
|
|
14657
14646
|
return new S(B);
|
|
@@ -14802,12 +14791,12 @@ _e.prototype.getSecret = function(n) {
|
|
|
14802
14791
|
_e.prototype.getPublic = function(n) {
|
|
14803
14792
|
return nn.encode(this.pubBytes(), n);
|
|
14804
14793
|
};
|
|
14805
|
-
var
|
|
14794
|
+
var P2 = _e, D2 = Rr, af = ze, za = af.assert, hf = af.cachedProperty, N2 = af.parseBytes;
|
|
14806
14795
|
function ri(h, n) {
|
|
14807
|
-
this.eddsa = h, typeof n != "object" && (n =
|
|
14796
|
+
this.eddsa = h, typeof n != "object" && (n = N2(n)), Array.isArray(n) && (za(n.length === h.encodingLength * 2, "Signature has invalid size"), n = {
|
|
14808
14797
|
R: n.slice(0, h.encodingLength),
|
|
14809
14798
|
S: n.slice(h.encodingLength)
|
|
14810
|
-
}), za(n.R && n.S, "Signature without R or S"), h.isPoint(n.R) && (this._R = n.R), n.S instanceof
|
|
14799
|
+
}), za(n.R && n.S, "Signature without R or S"), h.isPoint(n.R) && (this._R = n.R), n.S instanceof D2 && (this._S = n.S), this._Rencoded = Array.isArray(n.R) ? n.R : n.Rencoded, this._Sencoded = Array.isArray(n.S) ? n.S : n.Sencoded;
|
|
14811
14800
|
}
|
|
14812
14801
|
hf(ri, "S", function() {
|
|
14813
14802
|
return this.eddsa.decodeInt(this.Sencoded());
|
|
@@ -14827,13 +14816,13 @@ ri.prototype.toBytes = function() {
|
|
|
14827
14816
|
ri.prototype.toHex = function() {
|
|
14828
14817
|
return af.encode(this.toBytes(), "hex").toUpperCase();
|
|
14829
14818
|
};
|
|
14830
|
-
var $
|
|
14819
|
+
var $2 = ri, U2 = rf, L2 = ef, pi = ze, O2 = pi.assert, ko = pi.parseBytes, Io = P2, Ka = $2;
|
|
14831
14820
|
function $e(h) {
|
|
14832
|
-
if (
|
|
14821
|
+
if (O2(h === "ed25519", "only tested with ed25519 so far"), !(this instanceof $e))
|
|
14833
14822
|
return new $e(h);
|
|
14834
|
-
h =
|
|
14823
|
+
h = L2[h].curve, this.curve = h, this.g = h.g, this.g.precompute(h.n.bitLength() + 1), this.pointClass = h.point().constructor, this.encodingLength = Math.ceil(h.n.bitLength() / 8), this.hash = U2.sha512;
|
|
14835
14824
|
}
|
|
14836
|
-
var
|
|
14825
|
+
var z2 = $e;
|
|
14837
14826
|
$e.prototype.sign = function(n, s) {
|
|
14838
14827
|
n = ko(n);
|
|
14839
14828
|
var o = this.keyFromSecret(s), m = this.hashInt(o.messagePrefix(), n), f = this.g.mul(m), g = this.encodePoint(f), y = this.hashInt(g, o.pubBytes(), n).mul(o.priv()), S = m.add(y).umod(this.curve.n);
|
|
@@ -14881,7 +14870,7 @@ var Ha;
|
|
|
14881
14870
|
function Z0() {
|
|
14882
14871
|
return Ha || (Ha = 1, function(h) {
|
|
14883
14872
|
var n = h;
|
|
14884
|
-
n.version = Kv.version, n.utils = ze, n.rand = P0(), n.curve = z0, n.curves = ef, n.ec =
|
|
14873
|
+
n.version = Kv.version, n.utils = ze, n.rand = P0(), n.curve = z0, n.curves = ef, n.ec = q2(), n.eddsa = z2;
|
|
14885
14874
|
}(kf)), kf;
|
|
14886
14875
|
}
|
|
14887
14876
|
var rr = {}, Df = {}, W0 = { exports: {} };
|
|
@@ -16064,8 +16053,8 @@ W0.exports;
|
|
|
16064
16053
|
};
|
|
16065
16054
|
})(h, Gt);
|
|
16066
16055
|
})(W0);
|
|
16067
|
-
var
|
|
16068
|
-
function
|
|
16056
|
+
var K2 = W0.exports, Nf = {}, Za;
|
|
16057
|
+
function H2() {
|
|
16069
16058
|
return Za || (Za = 1, function(h) {
|
|
16070
16059
|
var n = fn(), s = Jt, o = h;
|
|
16071
16060
|
o.define = function(g, y) {
|
|
@@ -16101,7 +16090,7 @@ function Hm() {
|
|
|
16101
16090
|
};
|
|
16102
16091
|
}(Nf)), Nf;
|
|
16103
16092
|
}
|
|
16104
|
-
var $f = {}, Ro = {},
|
|
16093
|
+
var $f = {}, Ro = {}, Z2 = Jt;
|
|
16105
16094
|
function Ge(h) {
|
|
16106
16095
|
this._reporterState = {
|
|
16107
16096
|
obj: null,
|
|
@@ -16162,7 +16151,7 @@ Ge.prototype.wrapResult = function(n) {
|
|
|
16162
16151
|
function mi(h, n) {
|
|
16163
16152
|
this.path = h, this.rethrow(n);
|
|
16164
16153
|
}
|
|
16165
|
-
|
|
16154
|
+
Z2(mi, Error);
|
|
16166
16155
|
mi.prototype.rethrow = function(n) {
|
|
16167
16156
|
if (this.message = n + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, mi), !this.stack)
|
|
16168
16157
|
try {
|
|
@@ -16225,7 +16214,7 @@ function Va() {
|
|
|
16225
16214
|
}, vn;
|
|
16226
16215
|
}
|
|
16227
16216
|
var Uf, Ya;
|
|
16228
|
-
function
|
|
16217
|
+
function W2() {
|
|
16229
16218
|
if (Ya)
|
|
16230
16219
|
return Uf;
|
|
16231
16220
|
Ya = 1;
|
|
@@ -16553,11 +16542,11 @@ var Ja;
|
|
|
16553
16542
|
function Ui() {
|
|
16554
16543
|
return Ja || (Ja = 1, function(h) {
|
|
16555
16544
|
var n = h;
|
|
16556
|
-
n.Reporter = Ro.Reporter, n.DecoderBuffer = Va().DecoderBuffer, n.EncoderBuffer = Va().EncoderBuffer, n.Node =
|
|
16545
|
+
n.Reporter = Ro.Reporter, n.DecoderBuffer = Va().DecoderBuffer, n.EncoderBuffer = Va().EncoderBuffer, n.Node = W2();
|
|
16557
16546
|
}($f)), $f;
|
|
16558
16547
|
}
|
|
16559
16548
|
var Lf = {}, Of = {}, Ga;
|
|
16560
|
-
function
|
|
16549
|
+
function V2() {
|
|
16561
16550
|
return Ga || (Ga = 1, function(h) {
|
|
16562
16551
|
var n = To();
|
|
16563
16552
|
h.tagClass = {
|
|
@@ -16609,7 +16598,7 @@ function To() {
|
|
|
16609
16598
|
var g = o[f];
|
|
16610
16599
|
m[g] = f;
|
|
16611
16600
|
}), m;
|
|
16612
|
-
}, n.der =
|
|
16601
|
+
}, n.der = V2();
|
|
16613
16602
|
}(Lf)), Lf;
|
|
16614
16603
|
}
|
|
16615
16604
|
var zf = {}, Kf, ja;
|
|
@@ -16784,7 +16773,7 @@ function Co() {
|
|
|
16784
16773
|
return Kf;
|
|
16785
16774
|
}
|
|
16786
16775
|
var Hf, Qa;
|
|
16787
|
-
function
|
|
16776
|
+
function Y2() {
|
|
16788
16777
|
if (Qa)
|
|
16789
16778
|
return Hf;
|
|
16790
16779
|
Qa = 1;
|
|
@@ -16816,10 +16805,10 @@ function Ym() {
|
|
|
16816
16805
|
}, Hf;
|
|
16817
16806
|
}
|
|
16818
16807
|
var th;
|
|
16819
|
-
function
|
|
16808
|
+
function J2() {
|
|
16820
16809
|
return th || (th = 1, function(h) {
|
|
16821
16810
|
var n = h;
|
|
16822
|
-
n.der = Co(), n.pem =
|
|
16811
|
+
n.der = Co(), n.pem = Y2();
|
|
16823
16812
|
}(zf)), zf;
|
|
16824
16813
|
}
|
|
16825
16814
|
var Zf = {}, Wf, eh;
|
|
@@ -16972,7 +16961,7 @@ function Fo() {
|
|
|
16972
16961
|
return Wf;
|
|
16973
16962
|
}
|
|
16974
16963
|
var Vf, rh;
|
|
16975
|
-
function
|
|
16964
|
+
function G2() {
|
|
16976
16965
|
if (rh)
|
|
16977
16966
|
return Vf;
|
|
16978
16967
|
rh = 1;
|
|
@@ -16988,17 +16977,17 @@ function Gm() {
|
|
|
16988
16977
|
}, Vf;
|
|
16989
16978
|
}
|
|
16990
16979
|
var ih;
|
|
16991
|
-
function
|
|
16980
|
+
function X2() {
|
|
16992
16981
|
return ih || (ih = 1, function(h) {
|
|
16993
16982
|
var n = h;
|
|
16994
|
-
n.der = Fo(), n.pem =
|
|
16983
|
+
n.der = Fo(), n.pem = G2();
|
|
16995
16984
|
}(Zf)), Zf;
|
|
16996
16985
|
}
|
|
16997
16986
|
var nh;
|
|
16998
16987
|
function fn() {
|
|
16999
16988
|
return nh || (nh = 1, function(h) {
|
|
17000
16989
|
var n = h;
|
|
17001
|
-
n.bignum =
|
|
16990
|
+
n.bignum = K2, n.define = H2().define, n.base = Ui(), n.constants = To(), n.decoders = J2(), n.encoders = X2();
|
|
17002
16991
|
}(Df)), Df;
|
|
17003
16992
|
}
|
|
17004
16993
|
var ir = fn(), fh = ir.define("Time", function() {
|
|
@@ -17006,7 +16995,7 @@ var ir = fn(), fh = ir.define("Time", function() {
|
|
|
17006
16995
|
utcTime: this.utctime(),
|
|
17007
16996
|
generalTime: this.gentime()
|
|
17008
16997
|
});
|
|
17009
|
-
}),
|
|
16998
|
+
}), j2 = ir.define("AttributeTypeValue", function() {
|
|
17010
16999
|
this.seq().obj(
|
|
17011
17000
|
this.key("type").objid(),
|
|
17012
17001
|
this.key("value").any()
|
|
@@ -17017,52 +17006,52 @@ var ir = fn(), fh = ir.define("Time", function() {
|
|
|
17017
17006
|
this.key("parameters").optional(),
|
|
17018
17007
|
this.key("curve").objid().optional()
|
|
17019
17008
|
);
|
|
17020
|
-
}),
|
|
17009
|
+
}), Q2 = ir.define("SubjectPublicKeyInfo", function() {
|
|
17021
17010
|
this.seq().obj(
|
|
17022
17011
|
this.key("algorithm").use(V0),
|
|
17023
17012
|
this.key("subjectPublicKey").bitstr()
|
|
17024
17013
|
);
|
|
17025
|
-
}),
|
|
17026
|
-
this.setof(
|
|
17027
|
-
}),
|
|
17028
|
-
this.seqof(
|
|
17014
|
+
}), tm = ir.define("RelativeDistinguishedName", function() {
|
|
17015
|
+
this.setof(j2);
|
|
17016
|
+
}), em = ir.define("RDNSequence", function() {
|
|
17017
|
+
this.seqof(tm);
|
|
17029
17018
|
}), ah = ir.define("Name", function() {
|
|
17030
17019
|
this.choice({
|
|
17031
|
-
rdnSequence: this.use(
|
|
17020
|
+
rdnSequence: this.use(em)
|
|
17032
17021
|
});
|
|
17033
|
-
}),
|
|
17022
|
+
}), rm = ir.define("Validity", function() {
|
|
17034
17023
|
this.seq().obj(
|
|
17035
17024
|
this.key("notBefore").use(fh),
|
|
17036
17025
|
this.key("notAfter").use(fh)
|
|
17037
17026
|
);
|
|
17038
|
-
}),
|
|
17027
|
+
}), im = ir.define("Extension", function() {
|
|
17039
17028
|
this.seq().obj(
|
|
17040
17029
|
this.key("extnID").objid(),
|
|
17041
17030
|
this.key("critical").bool().def(!1),
|
|
17042
17031
|
this.key("extnValue").octstr()
|
|
17043
17032
|
);
|
|
17044
|
-
}),
|
|
17033
|
+
}), nm = ir.define("TBSCertificate", function() {
|
|
17045
17034
|
this.seq().obj(
|
|
17046
17035
|
this.key("version").explicit(0).int().optional(),
|
|
17047
17036
|
this.key("serialNumber").int(),
|
|
17048
17037
|
this.key("signature").use(V0),
|
|
17049
17038
|
this.key("issuer").use(ah),
|
|
17050
|
-
this.key("validity").use(
|
|
17039
|
+
this.key("validity").use(rm),
|
|
17051
17040
|
this.key("subject").use(ah),
|
|
17052
|
-
this.key("subjectPublicKeyInfo").use(
|
|
17041
|
+
this.key("subjectPublicKeyInfo").use(Q2),
|
|
17053
17042
|
this.key("issuerUniqueID").implicit(1).bitstr().optional(),
|
|
17054
17043
|
this.key("subjectUniqueID").implicit(2).bitstr().optional(),
|
|
17055
|
-
this.key("extensions").explicit(3).seqof(
|
|
17044
|
+
this.key("extensions").explicit(3).seqof(im).optional()
|
|
17056
17045
|
);
|
|
17057
|
-
}),
|
|
17046
|
+
}), fm = ir.define("X509Certificate", function() {
|
|
17058
17047
|
this.seq().obj(
|
|
17059
|
-
this.key("tbsCertificate").use(
|
|
17048
|
+
this.key("tbsCertificate").use(nm),
|
|
17060
17049
|
this.key("signatureAlgorithm").use(V0),
|
|
17061
17050
|
this.key("signatureValue").bitstr()
|
|
17062
17051
|
);
|
|
17063
|
-
}),
|
|
17064
|
-
rr.certificate =
|
|
17065
|
-
var
|
|
17052
|
+
}), am = fm, nr = fn();
|
|
17053
|
+
rr.certificate = am;
|
|
17054
|
+
var hm = nr.define("RSAPrivateKey", function() {
|
|
17066
17055
|
this.seq().obj(
|
|
17067
17056
|
this.key("version").int(),
|
|
17068
17057
|
this.key("modulus").int(),
|
|
@@ -17075,14 +17064,14 @@ var h2 = nr.define("RSAPrivateKey", function() {
|
|
|
17075
17064
|
this.key("coefficient").int()
|
|
17076
17065
|
);
|
|
17077
17066
|
});
|
|
17078
|
-
rr.RSAPrivateKey =
|
|
17079
|
-
var
|
|
17067
|
+
rr.RSAPrivateKey = hm;
|
|
17068
|
+
var sm = nr.define("RSAPublicKey", function() {
|
|
17080
17069
|
this.seq().obj(
|
|
17081
17070
|
this.key("modulus").int(),
|
|
17082
17071
|
this.key("publicExponent").int()
|
|
17083
17072
|
);
|
|
17084
17073
|
});
|
|
17085
|
-
rr.RSAPublicKey =
|
|
17074
|
+
rr.RSAPublicKey = sm;
|
|
17086
17075
|
var qo = nr.define("AlgorithmIdentifier", function() {
|
|
17087
17076
|
this.seq().obj(
|
|
17088
17077
|
this.key("algorithm").objid(),
|
|
@@ -17094,22 +17083,22 @@ var qo = nr.define("AlgorithmIdentifier", function() {
|
|
|
17094
17083
|
this.key("g").int()
|
|
17095
17084
|
).optional()
|
|
17096
17085
|
);
|
|
17097
|
-
}),
|
|
17086
|
+
}), om = nr.define("SubjectPublicKeyInfo", function() {
|
|
17098
17087
|
this.seq().obj(
|
|
17099
17088
|
this.key("algorithm").use(qo),
|
|
17100
17089
|
this.key("subjectPublicKey").bitstr()
|
|
17101
17090
|
);
|
|
17102
17091
|
});
|
|
17103
|
-
rr.PublicKey =
|
|
17104
|
-
var
|
|
17092
|
+
rr.PublicKey = om;
|
|
17093
|
+
var um = nr.define("PrivateKeyInfo", function() {
|
|
17105
17094
|
this.seq().obj(
|
|
17106
17095
|
this.key("version").int(),
|
|
17107
17096
|
this.key("algorithm").use(qo),
|
|
17108
17097
|
this.key("subjectPrivateKey").octstr()
|
|
17109
17098
|
);
|
|
17110
17099
|
});
|
|
17111
|
-
rr.PrivateKey =
|
|
17112
|
-
var
|
|
17100
|
+
rr.PrivateKey = um;
|
|
17101
|
+
var lm = nr.define("EncryptedPrivateKeyInfo", function() {
|
|
17113
17102
|
this.seq().obj(
|
|
17114
17103
|
this.key("algorithm").seq().obj(
|
|
17115
17104
|
this.key("id").objid(),
|
|
@@ -17130,8 +17119,8 @@ var l2 = nr.define("EncryptedPrivateKeyInfo", function() {
|
|
|
17130
17119
|
this.key("subjectPrivateKey").octstr()
|
|
17131
17120
|
);
|
|
17132
17121
|
});
|
|
17133
|
-
rr.EncryptedPrivateKey =
|
|
17134
|
-
var
|
|
17122
|
+
rr.EncryptedPrivateKey = lm;
|
|
17123
|
+
var dm = nr.define("DSAPrivateKey", function() {
|
|
17135
17124
|
this.seq().obj(
|
|
17136
17125
|
this.key("version").int(),
|
|
17137
17126
|
this.key("p").int(),
|
|
@@ -17141,30 +17130,30 @@ var d2 = nr.define("DSAPrivateKey", function() {
|
|
|
17141
17130
|
this.key("priv_key").int()
|
|
17142
17131
|
);
|
|
17143
17132
|
});
|
|
17144
|
-
rr.DSAPrivateKey =
|
|
17133
|
+
rr.DSAPrivateKey = dm;
|
|
17145
17134
|
rr.DSAparam = nr.define("DSAparam", function() {
|
|
17146
17135
|
this.int();
|
|
17147
17136
|
});
|
|
17148
|
-
var
|
|
17137
|
+
var cm = nr.define("ECParameters", function() {
|
|
17149
17138
|
this.choice({
|
|
17150
17139
|
namedCurve: this.objid()
|
|
17151
17140
|
});
|
|
17152
|
-
}),
|
|
17141
|
+
}), vm = nr.define("ECPrivateKey", function() {
|
|
17153
17142
|
this.seq().obj(
|
|
17154
17143
|
this.key("version").int(),
|
|
17155
17144
|
this.key("privateKey").octstr(),
|
|
17156
|
-
this.key("parameters").optional().explicit(0).use(
|
|
17145
|
+
this.key("parameters").optional().explicit(0).use(cm),
|
|
17157
17146
|
this.key("publicKey").optional().explicit(1).bitstr()
|
|
17158
17147
|
);
|
|
17159
17148
|
});
|
|
17160
|
-
rr.ECPrivateKey =
|
|
17149
|
+
rr.ECPrivateKey = vm;
|
|
17161
17150
|
rr.signature = nr.define("signature", function() {
|
|
17162
17151
|
this.seq().obj(
|
|
17163
17152
|
this.key("r").int(),
|
|
17164
17153
|
this.key("s").int()
|
|
17165
17154
|
);
|
|
17166
17155
|
});
|
|
17167
|
-
const
|
|
17156
|
+
const pm = {
|
|
17168
17157
|
"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
|
|
17169
17158
|
"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
|
|
17170
17159
|
"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
|
|
@@ -17178,29 +17167,29 @@ const p2 = {
|
|
|
17178
17167
|
"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
|
|
17179
17168
|
"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
|
|
17180
17169
|
};
|
|
17181
|
-
var
|
|
17182
|
-
var s = h.toString(), o = s.match(
|
|
17170
|
+
var mm = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, gm = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, bm = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, ym = Wn, wm = Le, pn = Ot.Buffer, Mm = function(h, n) {
|
|
17171
|
+
var s = h.toString(), o = s.match(mm), m;
|
|
17183
17172
|
if (o) {
|
|
17184
|
-
var g = "aes" + o[1], y = pn.from(o[2], "hex"), S = pn.from(o[3].replace(/[\r\n]/g, ""), "base64"), B =
|
|
17173
|
+
var g = "aes" + o[1], y = pn.from(o[2], "hex"), S = pn.from(o[3].replace(/[\r\n]/g, ""), "base64"), B = ym(n, y.slice(0, 8), parseInt(o[1], 10)).key, M = [], x = wm.createDecipheriv(g, B, y);
|
|
17185
17174
|
M.push(x.update(S)), M.push(x.final()), m = pn.concat(M);
|
|
17186
17175
|
} else {
|
|
17187
|
-
var f = s.match(
|
|
17176
|
+
var f = s.match(bm);
|
|
17188
17177
|
m = pn.from(f[2].replace(/[\r\n]/g, ""), "base64");
|
|
17189
17178
|
}
|
|
17190
|
-
var I = s.match(
|
|
17179
|
+
var I = s.match(gm)[1];
|
|
17191
17180
|
return {
|
|
17192
17181
|
tag: I,
|
|
17193
17182
|
data: m
|
|
17194
17183
|
};
|
|
17195
|
-
}, qe = rr,
|
|
17196
|
-
function
|
|
17197
|
-
var s = h.algorithm.decrypt.kde.kdeparams.salt, o = parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), m =
|
|
17184
|
+
}, qe = rr, xm = pm, _m = Mm, Sm = Le, Am = Un, c0 = Ot.Buffer;
|
|
17185
|
+
function Bm(h, n) {
|
|
17186
|
+
var s = h.algorithm.decrypt.kde.kdeparams.salt, o = parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), m = xm[h.algorithm.decrypt.cipher.algo.join(".")], f = h.algorithm.decrypt.cipher.iv, g = h.subjectPrivateKey, y = parseInt(m.split("-")[1], 10) / 8, S = Am.pbkdf2Sync(n, s, o, y, "sha1"), B = Sm.createDecipheriv(m, S, f), M = [];
|
|
17198
17187
|
return M.push(B.update(g)), M.push(B.final()), c0.concat(M);
|
|
17199
17188
|
}
|
|
17200
17189
|
function Po(h) {
|
|
17201
17190
|
var n;
|
|
17202
17191
|
typeof h == "object" && !c0.isBuffer(h) && (n = h.passphrase, h = h.key), typeof h == "string" && (h = c0.from(h));
|
|
17203
|
-
var s =
|
|
17192
|
+
var s = _m(h, n), o = s.tag, m = s.data, f, g;
|
|
17204
17193
|
switch (o) {
|
|
17205
17194
|
case "CERTIFICATE":
|
|
17206
17195
|
g = qe.certificate.decode(m, "der").tbsCertificate.subjectPublicKeyInfo;
|
|
@@ -17222,7 +17211,7 @@ function Po(h) {
|
|
|
17222
17211
|
throw new Error("unknown key id " + f);
|
|
17223
17212
|
}
|
|
17224
17213
|
case "ENCRYPTED PRIVATE KEY":
|
|
17225
|
-
m = qe.EncryptedPrivateKey.decode(m, "der"), m =
|
|
17214
|
+
m = qe.EncryptedPrivateKey.decode(m, "der"), m = Bm(m, n);
|
|
17226
17215
|
case "PRIVATE KEY":
|
|
17227
17216
|
switch (g = qe.PrivateKey.decode(m, "der"), f = g.algorithm.algorithm.join("."), f) {
|
|
17228
17217
|
case "1.2.840.113549.1.1.1":
|
|
@@ -17269,7 +17258,7 @@ const Do = {
|
|
|
17269
17258
|
"1.3.132.0.35": "p521"
|
|
17270
17259
|
};
|
|
17271
17260
|
var hh;
|
|
17272
|
-
function
|
|
17261
|
+
function Em() {
|
|
17273
17262
|
if (hh)
|
|
17274
17263
|
return Ci.exports;
|
|
17275
17264
|
hh = 1;
|
|
@@ -17358,7 +17347,7 @@ function E2() {
|
|
|
17358
17347
|
return Ci.exports = S, Ci.exports.getKey = I, Ci.exports.makeKey = L, Ci.exports;
|
|
17359
17348
|
}
|
|
17360
17349
|
var Yf, sh;
|
|
17361
|
-
function
|
|
17350
|
+
function km() {
|
|
17362
17351
|
if (sh)
|
|
17363
17352
|
return Yf;
|
|
17364
17353
|
sh = 1;
|
|
@@ -17412,11 +17401,11 @@ function k2() {
|
|
|
17412
17401
|
return Yf = f, Yf;
|
|
17413
17402
|
}
|
|
17414
17403
|
var Jf, oh;
|
|
17415
|
-
function
|
|
17404
|
+
function Im() {
|
|
17416
17405
|
if (oh)
|
|
17417
17406
|
return Jf;
|
|
17418
17407
|
oh = 1;
|
|
17419
|
-
var h = Ot.Buffer, n = Gi, s = Av, o = Jt, m =
|
|
17408
|
+
var h = Ot.Buffer, n = Gi, s = Av, o = Jt, m = Em(), f = km(), g = Zh;
|
|
17420
17409
|
Object.keys(g).forEach(function(x) {
|
|
17421
17410
|
g[x].id = h.from(g[x].id, "hex"), g[x.toLowerCase()] = g[x];
|
|
17422
17411
|
});
|
|
@@ -18646,12 +18635,12 @@ Y0.exports;
|
|
|
18646
18635
|
};
|
|
18647
18636
|
})(h, Gt);
|
|
18648
18637
|
})(Y0);
|
|
18649
|
-
var
|
|
18650
|
-
function
|
|
18638
|
+
var Rm = Y0.exports, Gf, uh;
|
|
18639
|
+
function Tm() {
|
|
18651
18640
|
if (uh)
|
|
18652
18641
|
return Gf;
|
|
18653
18642
|
uh = 1;
|
|
18654
|
-
var h = Z0(), n =
|
|
18643
|
+
var h = Z0(), n = Rm;
|
|
18655
18644
|
Gf = function(g) {
|
|
18656
18645
|
return new o(g);
|
|
18657
18646
|
};
|
|
@@ -18720,12 +18709,12 @@ function T2() {
|
|
|
18720
18709
|
}
|
|
18721
18710
|
return Gf;
|
|
18722
18711
|
}
|
|
18723
|
-
var No = {},
|
|
18712
|
+
var No = {}, Cm = Gi, v0 = Ot.Buffer, $o = function(h, n) {
|
|
18724
18713
|
for (var s = v0.alloc(0), o = 0, m; s.length < n; )
|
|
18725
|
-
m =
|
|
18714
|
+
m = Fm(o++), s = v0.concat([s, Cm("sha1").update(h).update(m).digest()]);
|
|
18726
18715
|
return s.slice(0, n);
|
|
18727
18716
|
};
|
|
18728
|
-
function
|
|
18717
|
+
function Fm(h) {
|
|
18729
18718
|
var n = v0.allocUnsafe(4);
|
|
18730
18719
|
return n.writeUInt32BE(h, 0), n;
|
|
18731
18720
|
}
|
|
@@ -19913,67 +19902,67 @@ J0.exports;
|
|
|
19913
19902
|
};
|
|
19914
19903
|
})(h, Gt);
|
|
19915
19904
|
})(J0);
|
|
19916
|
-
var G0 = J0.exports, lh = G0,
|
|
19917
|
-
function
|
|
19918
|
-
return
|
|
19905
|
+
var G0 = J0.exports, lh = G0, qm = Ot.Buffer;
|
|
19906
|
+
function Pm(h, n) {
|
|
19907
|
+
return qm.from(h.toRed(lh.mont(n.modulus)).redPow(new lh(n.publicExponent)).fromRed().toArray());
|
|
19919
19908
|
}
|
|
19920
|
-
var Lo =
|
|
19909
|
+
var Lo = Pm, Dm = sf, p0 = gi, Nm = Gi, dh = $o, ch = Uo, X0 = G0, $m = Lo, Um = U0, je = Ot.Buffer, Lm = function(n, s, o) {
|
|
19921
19910
|
var m;
|
|
19922
19911
|
n.padding ? m = n.padding : o ? m = 1 : m = 4;
|
|
19923
|
-
var f =
|
|
19912
|
+
var f = Dm(n), g;
|
|
19924
19913
|
if (m === 4)
|
|
19925
|
-
g =
|
|
19914
|
+
g = Om(f, s);
|
|
19926
19915
|
else if (m === 1)
|
|
19927
|
-
g =
|
|
19916
|
+
g = zm(f, s, o);
|
|
19928
19917
|
else if (m === 3) {
|
|
19929
19918
|
if (g = new X0(s), g.cmp(f.modulus) >= 0)
|
|
19930
19919
|
throw new Error("data too long for modulus");
|
|
19931
19920
|
} else
|
|
19932
19921
|
throw new Error("unknown padding");
|
|
19933
|
-
return o ?
|
|
19922
|
+
return o ? Um(g, f) : $m(g, f);
|
|
19934
19923
|
};
|
|
19935
|
-
function
|
|
19936
|
-
var s = h.modulus.byteLength(), o = n.length, m =
|
|
19924
|
+
function Om(h, n) {
|
|
19925
|
+
var s = h.modulus.byteLength(), o = n.length, m = Nm("sha1").update(je.alloc(0)).digest(), f = m.length, g = 2 * f;
|
|
19937
19926
|
if (o > s - g - 2)
|
|
19938
19927
|
throw new Error("message too long");
|
|
19939
19928
|
var y = je.alloc(s - o - g - 2), S = s - f - 1, B = p0(f), M = ch(je.concat([m, y, je.alloc(1, 1), n], S), dh(B, S)), x = ch(B, dh(M, f));
|
|
19940
19929
|
return new X0(je.concat([je.alloc(1), x, M], s));
|
|
19941
19930
|
}
|
|
19942
|
-
function
|
|
19931
|
+
function zm(h, n, s) {
|
|
19943
19932
|
var o = n.length, m = h.modulus.byteLength();
|
|
19944
19933
|
if (o > m - 11)
|
|
19945
19934
|
throw new Error("message too long");
|
|
19946
19935
|
var f;
|
|
19947
|
-
return s ? f = je.alloc(m - o - 3, 255) : f =
|
|
19936
|
+
return s ? f = je.alloc(m - o - 3, 255) : f = Km(m - o - 3), new X0(je.concat([je.from([0, s ? 1 : 2]), f, je.alloc(1), n], m));
|
|
19948
19937
|
}
|
|
19949
|
-
function
|
|
19938
|
+
function Km(h) {
|
|
19950
19939
|
for (var n = je.allocUnsafe(h), s = 0, o = p0(h * 2), m = 0, f; s < h; )
|
|
19951
19940
|
m === o.length && (o = p0(h * 2), m = 0), f = o[m++], f && (n[s++] = f);
|
|
19952
19941
|
return n;
|
|
19953
19942
|
}
|
|
19954
|
-
var
|
|
19943
|
+
var Hm = sf, vh = $o, ph = Uo, mh = G0, Zm = U0, Wm = Gi, Vm = Lo, Hi = Ot.Buffer, Ym = function(n, s, o) {
|
|
19955
19944
|
var m;
|
|
19956
19945
|
n.padding ? m = n.padding : o ? m = 1 : m = 4;
|
|
19957
|
-
var f =
|
|
19946
|
+
var f = Hm(n), g = f.modulus.byteLength();
|
|
19958
19947
|
if (s.length > g || new mh(s).cmp(f.modulus) >= 0)
|
|
19959
19948
|
throw new Error("decryption error");
|
|
19960
19949
|
var y;
|
|
19961
|
-
o ? y =
|
|
19950
|
+
o ? y = Vm(new mh(s), f) : y = Zm(s, f);
|
|
19962
19951
|
var S = Hi.alloc(g - y.length);
|
|
19963
19952
|
if (y = Hi.concat([S, y], g), m === 4)
|
|
19964
|
-
return
|
|
19953
|
+
return Jm(f, y);
|
|
19965
19954
|
if (m === 1)
|
|
19966
|
-
return
|
|
19955
|
+
return Gm(f, y, o);
|
|
19967
19956
|
if (m === 3)
|
|
19968
19957
|
return y;
|
|
19969
19958
|
throw new Error("unknown padding");
|
|
19970
19959
|
};
|
|
19971
|
-
function
|
|
19972
|
-
var s = h.modulus.byteLength(), o =
|
|
19960
|
+
function Jm(h, n) {
|
|
19961
|
+
var s = h.modulus.byteLength(), o = Wm("sha1").update(Hi.alloc(0)).digest(), m = o.length;
|
|
19973
19962
|
if (n[0] !== 0)
|
|
19974
19963
|
throw new Error("decryption error");
|
|
19975
19964
|
var f = n.slice(1, m + 1), g = n.slice(m + 1), y = ph(f, vh(g, m)), S = ph(g, vh(y, s - m - 1));
|
|
19976
|
-
if (
|
|
19965
|
+
if (Xm(o, S.slice(0, m)))
|
|
19977
19966
|
throw new Error("decryption error");
|
|
19978
19967
|
for (var B = m; S[B] === 0; )
|
|
19979
19968
|
B++;
|
|
@@ -19981,7 +19970,7 @@ function J2(h, n) {
|
|
|
19981
19970
|
throw new Error("decryption error");
|
|
19982
19971
|
return S.slice(B);
|
|
19983
19972
|
}
|
|
19984
|
-
function
|
|
19973
|
+
function Gm(h, n, s) {
|
|
19985
19974
|
for (var o = n.slice(0, 2), m = 2, f = 0; n[m++] !== 0; )
|
|
19986
19975
|
if (m >= n.length) {
|
|
19987
19976
|
f++;
|
|
@@ -19992,7 +19981,7 @@ function G2(h, n, s) {
|
|
|
19992
19981
|
throw new Error("decryption error");
|
|
19993
19982
|
return n.slice(m);
|
|
19994
19983
|
}
|
|
19995
|
-
function
|
|
19984
|
+
function Xm(h, n) {
|
|
19996
19985
|
h = Hi.from(h), n = Hi.from(n);
|
|
19997
19986
|
var s = 0, o = h.length;
|
|
19998
19987
|
h.length !== n.length && (s++, o = Math.min(h.length, n.length));
|
|
@@ -20001,7 +19990,7 @@ function X2(h, n) {
|
|
|
20001
19990
|
return s;
|
|
20002
19991
|
}
|
|
20003
19992
|
(function(h) {
|
|
20004
|
-
h.publicEncrypt =
|
|
19993
|
+
h.publicEncrypt = Lm, h.privateDecrypt = Ym, h.privateEncrypt = function(s, o) {
|
|
20005
19994
|
return h.publicEncrypt(s, o, !0);
|
|
20006
19995
|
}, h.publicDecrypt = function(s, o) {
|
|
20007
19996
|
return h.privateDecrypt(s, o, !0);
|
|
@@ -20029,8 +20018,8 @@ function Wo(h, n, s) {
|
|
|
20029
20018
|
if (h + n > s || h > Ko)
|
|
20030
20019
|
throw new RangeError("buffer too small");
|
|
20031
20020
|
}
|
|
20032
|
-
m0 && m0.getRandomValues || !ye.browser ? (Ni.randomFill =
|
|
20033
|
-
function
|
|
20021
|
+
m0 && m0.getRandomValues || !ye.browser ? (Ni.randomFill = jm, Ni.randomFillSync = Qm) : (Ni.randomFill = gh, Ni.randomFillSync = gh);
|
|
20022
|
+
function jm(h, n, s, o) {
|
|
20034
20023
|
if (!zo.isBuffer(h) && !(h instanceof Gt.Uint8Array))
|
|
20035
20024
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
20036
20025
|
if (typeof n == "function")
|
|
@@ -20063,7 +20052,7 @@ function Vo(h, n, s, o) {
|
|
|
20063
20052
|
var g = bh(s);
|
|
20064
20053
|
return g.copy(h, n), h;
|
|
20065
20054
|
}
|
|
20066
|
-
function
|
|
20055
|
+
function Qm(h, n, s) {
|
|
20067
20056
|
if (typeof n == "undefined" && (n = 0), !zo.isBuffer(h) && !(h instanceof Gt.Uint8Array))
|
|
20068
20057
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
20069
20058
|
return Zo(n, h.length), s === void 0 && (s = h.length - n), Wo(s, n, h.length), Vo(h, n, s);
|
|
@@ -20091,8 +20080,8 @@ function Yo() {
|
|
|
20091
20080
|
Ut.Cipher = m.Cipher, Ut.createCipher = m.createCipher, Ut.Cipheriv = m.Cipheriv, Ut.createCipheriv = m.createCipheriv, Ut.Decipher = m.Decipher, Ut.createDecipher = m.createDecipher, Ut.Decipheriv = m.Decipheriv, Ut.createDecipheriv = m.createDecipheriv, Ut.getCiphers = m.getCiphers, Ut.listCiphers = m.listCiphers;
|
|
20092
20081
|
var f = Q1();
|
|
20093
20082
|
Ut.DiffieHellmanGroup = f.DiffieHellmanGroup, Ut.createDiffieHellmanGroup = f.createDiffieHellmanGroup, Ut.getDiffieHellman = f.getDiffieHellman, Ut.createDiffieHellman = f.createDiffieHellman, Ut.DiffieHellman = f.DiffieHellman;
|
|
20094
|
-
var g =
|
|
20095
|
-
Ut.createSign = g.createSign, Ut.Sign = g.Sign, Ut.createVerify = g.createVerify, Ut.Verify = g.Verify, Ut.createECDH =
|
|
20083
|
+
var g = Im();
|
|
20084
|
+
Ut.createSign = g.createSign, Ut.Sign = g.Sign, Ut.createVerify = g.createVerify, Ut.Verify = g.Verify, Ut.createECDH = Tm();
|
|
20096
20085
|
var y = No;
|
|
20097
20086
|
Ut.publicEncrypt = y.publicEncrypt, Ut.privateEncrypt = y.privateEncrypt, Ut.publicDecrypt = y.publicDecrypt, Ut.privateDecrypt = y.privateDecrypt;
|
|
20098
20087
|
var S = Ni;
|