flagmint-js-sdk 1.2.3 → 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,10 +1201,9 @@ 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") {
|
|
@@ -1223,7 +1221,7 @@ class yu {
|
|
|
1223
1221
|
}, this.socket.onerror = (f) => {
|
|
1224
1222
|
console.error("[WebSocketTransport] Error:", f);
|
|
1225
1223
|
}, this.socket.onclose = (f) => {
|
|
1226
|
-
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) {
|
|
1227
1225
|
this.setConnectionState("failed"), s(new Error("Unauthorized: Invalid API key"));
|
|
1228
1226
|
return;
|
|
1229
1227
|
}
|
|
@@ -1245,19 +1243,6 @@ class yu {
|
|
|
1245
1243
|
cleanupSocket() {
|
|
1246
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);
|
|
1247
1245
|
}
|
|
1248
|
-
startHeartbeat() {
|
|
1249
|
-
this.lastHeartbeatTime = Date.now(), this.heartbeatIntervalId = setInterval(() => {
|
|
1250
|
-
var s, o;
|
|
1251
|
-
if (Date.now() - this.lastHeartbeatTime > this.heartbeatTimeoutMs) {
|
|
1252
|
-
console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."), (s = this.socket) == null || s.close();
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
((o = this.socket) == null ? void 0 : o.readyState) === 1 && this.socket.send(JSON.stringify({ type: "ping" }));
|
|
1256
|
-
}, 1e4);
|
|
1257
|
-
}
|
|
1258
|
-
stopHeartbeat() {
|
|
1259
|
-
this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null);
|
|
1260
|
-
}
|
|
1261
1246
|
setConnectionState(n) {
|
|
1262
1247
|
var s;
|
|
1263
1248
|
(s = this.onConnectionStateCallback) == null || s.call(this, n);
|
|
@@ -1287,7 +1272,7 @@ class yu {
|
|
|
1287
1272
|
this.onConnectionStateCallback = n;
|
|
1288
1273
|
}
|
|
1289
1274
|
destroy() {
|
|
1290
|
-
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;
|
|
1291
1276
|
}
|
|
1292
1277
|
sendContext(n) {
|
|
1293
1278
|
if (!this.socket || this.socket.readyState !== 1) {
|
|
@@ -12820,7 +12805,7 @@ Er.padLength = 64;
|
|
|
12820
12805
|
Er.prototype._digest = function(n) {
|
|
12821
12806
|
return n === "hex" ? u0.toHex32(this.h.slice(0, 7), "big") : u0.split32(this.h.slice(0, 7), "big");
|
|
12822
12807
|
};
|
|
12823
|
-
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 = [
|
|
12824
12809
|
1116352408,
|
|
12825
12810
|
3609767458,
|
|
12826
12811
|
1899447441,
|
|
@@ -13002,7 +12987,7 @@ function tr() {
|
|
|
13002
12987
|
4215389547,
|
|
13003
12988
|
1541459225,
|
|
13004
12989
|
327033209
|
|
13005
|
-
], this.k =
|
|
12990
|
+
], this.k = e2, this.W = new Array(160);
|
|
13006
12991
|
}
|
|
13007
12992
|
Ne.inherits(tr, Mo);
|
|
13008
12993
|
var xo = tr;
|
|
@@ -13014,7 +12999,7 @@ tr.prototype._prepareBlock = function(n, s) {
|
|
|
13014
12999
|
for (var o = this.W, m = 0; m < 32; m++)
|
|
13015
13000
|
o[m] = n[s + m];
|
|
13016
13001
|
for (; m < o.length; m += 2) {
|
|
13017
|
-
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];
|
|
13018
13003
|
o[m] = Xp(
|
|
13019
13004
|
f,
|
|
13020
13005
|
g,
|
|
@@ -13041,7 +13026,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13041
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];
|
|
13042
13027
|
Gp(this.k.length === o.length);
|
|
13043
13028
|
for (var H = 0; H < o.length; H += 2) {
|
|
13044
|
-
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(
|
|
13045
13030
|
At,
|
|
13046
13031
|
Bt,
|
|
13047
13032
|
Ct,
|
|
@@ -13052,7 +13037,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13052
13037
|
t,
|
|
13053
13038
|
r,
|
|
13054
13039
|
i
|
|
13055
|
-
), d =
|
|
13040
|
+
), d = t2(
|
|
13056
13041
|
At,
|
|
13057
13042
|
Bt,
|
|
13058
13043
|
Ct,
|
|
@@ -13064,7 +13049,7 @@ tr.prototype._update = function(n, s) {
|
|
|
13064
13049
|
r,
|
|
13065
13050
|
i
|
|
13066
13051
|
);
|
|
13067
|
-
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);
|
|
13068
13053
|
var c = Rf(At, Bt, Ct, Et), v = Tf(At, Bt, Ct, Et);
|
|
13069
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);
|
|
13070
13055
|
}
|
|
@@ -13073,51 +13058,51 @@ tr.prototype._update = function(n, s) {
|
|
|
13073
13058
|
tr.prototype._digest = function(n) {
|
|
13074
13059
|
return n === "hex" ? Ne.toHex32(this.h, "big") : Ne.split32(this.h, "big");
|
|
13075
13060
|
};
|
|
13076
|
-
function
|
|
13061
|
+
function r2(h, n, s, o, m) {
|
|
13077
13062
|
var f = h & s ^ ~h & m;
|
|
13078
13063
|
return f < 0 && (f += 4294967296), f;
|
|
13079
13064
|
}
|
|
13080
|
-
function
|
|
13065
|
+
function i2(h, n, s, o, m, f) {
|
|
13081
13066
|
var g = n & o ^ ~n & f;
|
|
13082
13067
|
return g < 0 && (g += 4294967296), g;
|
|
13083
13068
|
}
|
|
13084
|
-
function
|
|
13069
|
+
function n2(h, n, s, o, m) {
|
|
13085
13070
|
var f = h & s ^ h & m ^ s & m;
|
|
13086
13071
|
return f < 0 && (f += 4294967296), f;
|
|
13087
13072
|
}
|
|
13088
|
-
function
|
|
13073
|
+
function f2(h, n, s, o, m, f) {
|
|
13089
13074
|
var g = n & o ^ n & f ^ o & f;
|
|
13090
13075
|
return g < 0 && (g += 4294967296), g;
|
|
13091
13076
|
}
|
|
13092
|
-
function
|
|
13077
|
+
function a2(h, n) {
|
|
13093
13078
|
var s = ur(h, n, 28), o = ur(n, h, 2), m = ur(n, h, 7), f = s ^ o ^ m;
|
|
13094
13079
|
return f < 0 && (f += 4294967296), f;
|
|
13095
13080
|
}
|
|
13096
|
-
function
|
|
13081
|
+
function h2(h, n) {
|
|
13097
13082
|
var s = lr(h, n, 28), o = lr(n, h, 2), m = lr(n, h, 7), f = s ^ o ^ m;
|
|
13098
13083
|
return f < 0 && (f += 4294967296), f;
|
|
13099
13084
|
}
|
|
13100
|
-
function
|
|
13085
|
+
function s2(h, n) {
|
|
13101
13086
|
var s = ur(h, n, 14), o = ur(h, n, 18), m = ur(n, h, 9), f = s ^ o ^ m;
|
|
13102
13087
|
return f < 0 && (f += 4294967296), f;
|
|
13103
13088
|
}
|
|
13104
|
-
function
|
|
13089
|
+
function o2(h, n) {
|
|
13105
13090
|
var s = lr(h, n, 14), o = lr(h, n, 18), m = lr(n, h, 9), f = s ^ o ^ m;
|
|
13106
13091
|
return f < 0 && (f += 4294967296), f;
|
|
13107
13092
|
}
|
|
13108
|
-
function
|
|
13093
|
+
function u2(h, n) {
|
|
13109
13094
|
var s = ur(h, n, 1), o = ur(h, n, 8), m = yo(h, n, 7), f = s ^ o ^ m;
|
|
13110
13095
|
return f < 0 && (f += 4294967296), f;
|
|
13111
13096
|
}
|
|
13112
|
-
function
|
|
13097
|
+
function l2(h, n) {
|
|
13113
13098
|
var s = lr(h, n, 1), o = lr(h, n, 8), m = wo(h, n, 7), f = s ^ o ^ m;
|
|
13114
13099
|
return f < 0 && (f += 4294967296), f;
|
|
13115
13100
|
}
|
|
13116
|
-
function
|
|
13101
|
+
function d2(h, n) {
|
|
13117
13102
|
var s = ur(h, n, 19), o = ur(n, h, 29), m = yo(h, n, 6), f = s ^ o ^ m;
|
|
13118
13103
|
return f < 0 && (f += 4294967296), f;
|
|
13119
13104
|
}
|
|
13120
|
-
function
|
|
13105
|
+
function c2(h, n) {
|
|
13121
13106
|
var s = lr(h, n, 19), o = lr(n, h, 29), m = wo(h, n, 6), f = s ^ o ^ m;
|
|
13122
13107
|
return f < 0 && (f += 4294967296), f;
|
|
13123
13108
|
}
|
|
@@ -13145,7 +13130,7 @@ function kr() {
|
|
|
13145
13130
|
];
|
|
13146
13131
|
}
|
|
13147
13132
|
l0.inherits(kr, _o);
|
|
13148
|
-
var
|
|
13133
|
+
var v2 = kr;
|
|
13149
13134
|
kr.blockSize = 1024;
|
|
13150
13135
|
kr.outSize = 384;
|
|
13151
13136
|
kr.hmacStrength = 192;
|
|
@@ -13156,9 +13141,9 @@ kr.prototype._digest = function(n) {
|
|
|
13156
13141
|
_i.sha1 = Dp;
|
|
13157
13142
|
_i.sha224 = Yp;
|
|
13158
13143
|
_i.sha256 = go;
|
|
13159
|
-
_i.sha384 =
|
|
13144
|
+
_i.sha384 = v2;
|
|
13160
13145
|
_i.sha512 = xo;
|
|
13161
|
-
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;
|
|
13162
13147
|
function mr() {
|
|
13163
13148
|
if (!(this instanceof mr))
|
|
13164
13149
|
return new mr();
|
|
@@ -13174,15 +13159,15 @@ mr.prototype._update = function(n, s) {
|
|
|
13174
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++) {
|
|
13175
13160
|
var D = Pa(
|
|
13176
13161
|
cn(
|
|
13177
|
-
Da(o, Na(k, m, f, g), n[
|
|
13178
|
-
|
|
13162
|
+
Da(o, Na(k, m, f, g), n[b2[k] + s], m2(k)),
|
|
13163
|
+
w2[k]
|
|
13179
13164
|
),
|
|
13180
13165
|
y
|
|
13181
13166
|
);
|
|
13182
13167
|
o = y, y = g, g = cn(f, 10), f = m, m = D, D = Pa(
|
|
13183
13168
|
cn(
|
|
13184
|
-
Da(S, Na(79 - k, B, M, x), n[
|
|
13185
|
-
|
|
13169
|
+
Da(S, Na(79 - k, B, M, x), n[y2[k] + s], g2(k)),
|
|
13170
|
+
M2[k]
|
|
13186
13171
|
),
|
|
13187
13172
|
I
|
|
13188
13173
|
), S = I, I = x, x = cn(M, 10), M = B, B = D;
|
|
@@ -13195,13 +13180,13 @@ mr.prototype._digest = function(n) {
|
|
|
13195
13180
|
function Na(h, n, s, o) {
|
|
13196
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);
|
|
13197
13182
|
}
|
|
13198
|
-
function
|
|
13183
|
+
function m2(h) {
|
|
13199
13184
|
return h <= 15 ? 0 : h <= 31 ? 1518500249 : h <= 47 ? 1859775393 : h <= 63 ? 2400959708 : 2840853838;
|
|
13200
13185
|
}
|
|
13201
|
-
function
|
|
13186
|
+
function g2(h) {
|
|
13202
13187
|
return h <= 15 ? 1352829926 : h <= 31 ? 1548603684 : h <= 47 ? 1836072691 : h <= 63 ? 2053994217 : 0;
|
|
13203
13188
|
}
|
|
13204
|
-
var
|
|
13189
|
+
var b2 = [
|
|
13205
13190
|
0,
|
|
13206
13191
|
1,
|
|
13207
13192
|
2,
|
|
@@ -13282,7 +13267,7 @@ var bm = [
|
|
|
13282
13267
|
6,
|
|
13283
13268
|
15,
|
|
13284
13269
|
13
|
|
13285
|
-
],
|
|
13270
|
+
], y2 = [
|
|
13286
13271
|
5,
|
|
13287
13272
|
14,
|
|
13288
13273
|
7,
|
|
@@ -13363,7 +13348,7 @@ var bm = [
|
|
|
13363
13348
|
3,
|
|
13364
13349
|
9,
|
|
13365
13350
|
11
|
|
13366
|
-
],
|
|
13351
|
+
], w2 = [
|
|
13367
13352
|
11,
|
|
13368
13353
|
14,
|
|
13369
13354
|
15,
|
|
@@ -13444,7 +13429,7 @@ var bm = [
|
|
|
13444
13429
|
8,
|
|
13445
13430
|
5,
|
|
13446
13431
|
6
|
|
13447
|
-
],
|
|
13432
|
+
], M2 = [
|
|
13448
13433
|
8,
|
|
13449
13434
|
9,
|
|
13450
13435
|
9,
|
|
@@ -13525,15 +13510,15 @@ var bm = [
|
|
|
13525
13510
|
13,
|
|
13526
13511
|
11,
|
|
13527
13512
|
11
|
|
13528
|
-
],
|
|
13513
|
+
], x2 = Xt, _2 = We;
|
|
13529
13514
|
function vi(h, n, s) {
|
|
13530
13515
|
if (!(this instanceof vi))
|
|
13531
13516
|
return new vi(h, n, s);
|
|
13532
|
-
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));
|
|
13533
13518
|
}
|
|
13534
|
-
var
|
|
13519
|
+
var S2 = vi;
|
|
13535
13520
|
vi.prototype._init = function(n) {
|
|
13536
|
-
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);
|
|
13537
13522
|
for (var s = n.length; s < this.blockSize; s++)
|
|
13538
13523
|
n.push(0);
|
|
13539
13524
|
for (s = 0; s < n.length; s++)
|
|
@@ -13550,10 +13535,10 @@ vi.prototype.digest = function(n) {
|
|
|
13550
13535
|
};
|
|
13551
13536
|
(function(h) {
|
|
13552
13537
|
var n = h;
|
|
13553
|
-
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;
|
|
13554
13539
|
})(rf);
|
|
13555
13540
|
var Cf, $a;
|
|
13556
|
-
function
|
|
13541
|
+
function A2() {
|
|
13557
13542
|
return $a || ($a = 1, Cf = {
|
|
13558
13543
|
doubles: {
|
|
13559
13544
|
step: 4,
|
|
@@ -14451,7 +14436,7 @@ function Am() {
|
|
|
14451
14436
|
});
|
|
14452
14437
|
var S;
|
|
14453
14438
|
try {
|
|
14454
|
-
S =
|
|
14439
|
+
S = A2();
|
|
14455
14440
|
} catch (B) {
|
|
14456
14441
|
S = void 0;
|
|
14457
14442
|
}
|
|
@@ -14485,7 +14470,7 @@ function Am() {
|
|
|
14485
14470
|
]
|
|
14486
14471
|
});
|
|
14487
14472
|
})(ef);
|
|
14488
|
-
var
|
|
14473
|
+
var B2 = rf, Jr = O0, Bo = We;
|
|
14489
14474
|
function Dr(h) {
|
|
14490
14475
|
if (!(this instanceof Dr))
|
|
14491
14476
|
return new Dr(h);
|
|
@@ -14496,7 +14481,7 @@ function Dr(h) {
|
|
|
14496
14481
|
"Not enough entropy. Minimum is: " + this.minEntropy + " bits"
|
|
14497
14482
|
), this._init(n, s, o);
|
|
14498
14483
|
}
|
|
14499
|
-
var
|
|
14484
|
+
var E2 = Dr;
|
|
14500
14485
|
Dr.prototype._init = function(n, s, o) {
|
|
14501
14486
|
var m = n.concat(s).concat(o);
|
|
14502
14487
|
this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);
|
|
@@ -14505,7 +14490,7 @@ Dr.prototype._init = function(n, s, o) {
|
|
|
14505
14490
|
this._update(m), this._reseed = 1, this.reseedInterval = 281474976710656;
|
|
14506
14491
|
};
|
|
14507
14492
|
Dr.prototype._hmac = function() {
|
|
14508
|
-
return new
|
|
14493
|
+
return new B2.hmac(this.hash, this.K);
|
|
14509
14494
|
};
|
|
14510
14495
|
Dr.prototype._update = function(n) {
|
|
14511
14496
|
var s = this._hmac().update(this.V).update([0]);
|
|
@@ -14526,11 +14511,11 @@ Dr.prototype.generate = function(n, s, o, m) {
|
|
|
14526
14511
|
var g = f.slice(0, n);
|
|
14527
14512
|
return this._update(o), this._reseed++, Jr.encode(g, s);
|
|
14528
14513
|
};
|
|
14529
|
-
var
|
|
14514
|
+
var k2 = Rr, I2 = ze, d0 = I2.assert;
|
|
14530
14515
|
function Fe(h, n) {
|
|
14531
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);
|
|
14532
14517
|
}
|
|
14533
|
-
var
|
|
14518
|
+
var R2 = Fe;
|
|
14534
14519
|
Fe.fromPublic = function(n, s, o) {
|
|
14535
14520
|
return s instanceof Fe ? s : new Fe(n, {
|
|
14536
14521
|
pub: s,
|
|
@@ -14554,7 +14539,7 @@ Fe.prototype.getPrivate = function(n) {
|
|
|
14554
14539
|
return n === "hex" ? this.priv.toString(16, 2) : this.priv;
|
|
14555
14540
|
};
|
|
14556
14541
|
Fe.prototype._importPrivate = function(n, s) {
|
|
14557
|
-
this.priv = new
|
|
14542
|
+
this.priv = new k2(n, s || 16), this.priv = this.priv.umod(this.ec.curve.n);
|
|
14558
14543
|
};
|
|
14559
14544
|
Fe.prototype._importPublic = function(n, s) {
|
|
14560
14545
|
if (n.x || n.y) {
|
|
@@ -14575,14 +14560,14 @@ Fe.prototype.verify = function(n, s, o) {
|
|
|
14575
14560
|
Fe.prototype.inspect = function() {
|
|
14576
14561
|
return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
|
|
14577
14562
|
};
|
|
14578
|
-
var In = Rr, H0 = ze,
|
|
14563
|
+
var In = Rr, H0 = ze, T2 = H0.assert;
|
|
14579
14564
|
function ff(h, n) {
|
|
14580
14565
|
if (h instanceof ff)
|
|
14581
14566
|
return h;
|
|
14582
|
-
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);
|
|
14583
14568
|
}
|
|
14584
|
-
var
|
|
14585
|
-
function
|
|
14569
|
+
var C2 = ff;
|
|
14570
|
+
function F2() {
|
|
14586
14571
|
this.place = 0;
|
|
14587
14572
|
}
|
|
14588
14573
|
function Ff(h, n) {
|
|
@@ -14603,7 +14588,7 @@ function Ua(h) {
|
|
|
14603
14588
|
}
|
|
14604
14589
|
ff.prototype._importDER = function(n, s) {
|
|
14605
14590
|
n = H0.toArray(n, s);
|
|
14606
|
-
var o = new
|
|
14591
|
+
var o = new F2();
|
|
14607
14592
|
if (n[o.place++] !== 48)
|
|
14608
14593
|
return !1;
|
|
14609
14594
|
var m = Ff(n, o);
|
|
@@ -14651,11 +14636,11 @@ ff.prototype.toDER = function(n) {
|
|
|
14651
14636
|
return qf(g, f.length), g = g.concat(f), H0.encode(g, n);
|
|
14652
14637
|
};
|
|
14653
14638
|
var Pf, La;
|
|
14654
|
-
function
|
|
14639
|
+
function q2() {
|
|
14655
14640
|
if (La)
|
|
14656
14641
|
return Pf;
|
|
14657
14642
|
La = 1;
|
|
14658
|
-
var h = Rr, n =
|
|
14643
|
+
var h = Rr, n = E2, s = ze, o = ef, m = P0(), f = s.assert, g = R2, y = C2;
|
|
14659
14644
|
function S(B) {
|
|
14660
14645
|
if (!(this instanceof S))
|
|
14661
14646
|
return new S(B);
|
|
@@ -14806,12 +14791,12 @@ _e.prototype.getSecret = function(n) {
|
|
|
14806
14791
|
_e.prototype.getPublic = function(n) {
|
|
14807
14792
|
return nn.encode(this.pubBytes(), n);
|
|
14808
14793
|
};
|
|
14809
|
-
var
|
|
14794
|
+
var P2 = _e, D2 = Rr, af = ze, za = af.assert, hf = af.cachedProperty, N2 = af.parseBytes;
|
|
14810
14795
|
function ri(h, n) {
|
|
14811
|
-
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 = {
|
|
14812
14797
|
R: n.slice(0, h.encodingLength),
|
|
14813
14798
|
S: n.slice(h.encodingLength)
|
|
14814
|
-
}), 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;
|
|
14815
14800
|
}
|
|
14816
14801
|
hf(ri, "S", function() {
|
|
14817
14802
|
return this.eddsa.decodeInt(this.Sencoded());
|
|
@@ -14831,13 +14816,13 @@ ri.prototype.toBytes = function() {
|
|
|
14831
14816
|
ri.prototype.toHex = function() {
|
|
14832
14817
|
return af.encode(this.toBytes(), "hex").toUpperCase();
|
|
14833
14818
|
};
|
|
14834
|
-
var $
|
|
14819
|
+
var $2 = ri, U2 = rf, L2 = ef, pi = ze, O2 = pi.assert, ko = pi.parseBytes, Io = P2, Ka = $2;
|
|
14835
14820
|
function $e(h) {
|
|
14836
|
-
if (
|
|
14821
|
+
if (O2(h === "ed25519", "only tested with ed25519 so far"), !(this instanceof $e))
|
|
14837
14822
|
return new $e(h);
|
|
14838
|
-
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;
|
|
14839
14824
|
}
|
|
14840
|
-
var
|
|
14825
|
+
var z2 = $e;
|
|
14841
14826
|
$e.prototype.sign = function(n, s) {
|
|
14842
14827
|
n = ko(n);
|
|
14843
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);
|
|
@@ -14885,7 +14870,7 @@ var Ha;
|
|
|
14885
14870
|
function Z0() {
|
|
14886
14871
|
return Ha || (Ha = 1, function(h) {
|
|
14887
14872
|
var n = h;
|
|
14888
|
-
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;
|
|
14889
14874
|
}(kf)), kf;
|
|
14890
14875
|
}
|
|
14891
14876
|
var rr = {}, Df = {}, W0 = { exports: {} };
|
|
@@ -16068,8 +16053,8 @@ W0.exports;
|
|
|
16068
16053
|
};
|
|
16069
16054
|
})(h, Gt);
|
|
16070
16055
|
})(W0);
|
|
16071
|
-
var
|
|
16072
|
-
function
|
|
16056
|
+
var K2 = W0.exports, Nf = {}, Za;
|
|
16057
|
+
function H2() {
|
|
16073
16058
|
return Za || (Za = 1, function(h) {
|
|
16074
16059
|
var n = fn(), s = Jt, o = h;
|
|
16075
16060
|
o.define = function(g, y) {
|
|
@@ -16105,7 +16090,7 @@ function Hm() {
|
|
|
16105
16090
|
};
|
|
16106
16091
|
}(Nf)), Nf;
|
|
16107
16092
|
}
|
|
16108
|
-
var $f = {}, Ro = {},
|
|
16093
|
+
var $f = {}, Ro = {}, Z2 = Jt;
|
|
16109
16094
|
function Ge(h) {
|
|
16110
16095
|
this._reporterState = {
|
|
16111
16096
|
obj: null,
|
|
@@ -16166,7 +16151,7 @@ Ge.prototype.wrapResult = function(n) {
|
|
|
16166
16151
|
function mi(h, n) {
|
|
16167
16152
|
this.path = h, this.rethrow(n);
|
|
16168
16153
|
}
|
|
16169
|
-
|
|
16154
|
+
Z2(mi, Error);
|
|
16170
16155
|
mi.prototype.rethrow = function(n) {
|
|
16171
16156
|
if (this.message = n + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, mi), !this.stack)
|
|
16172
16157
|
try {
|
|
@@ -16229,7 +16214,7 @@ function Va() {
|
|
|
16229
16214
|
}, vn;
|
|
16230
16215
|
}
|
|
16231
16216
|
var Uf, Ya;
|
|
16232
|
-
function
|
|
16217
|
+
function W2() {
|
|
16233
16218
|
if (Ya)
|
|
16234
16219
|
return Uf;
|
|
16235
16220
|
Ya = 1;
|
|
@@ -16557,11 +16542,11 @@ var Ja;
|
|
|
16557
16542
|
function Ui() {
|
|
16558
16543
|
return Ja || (Ja = 1, function(h) {
|
|
16559
16544
|
var n = h;
|
|
16560
|
-
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();
|
|
16561
16546
|
}($f)), $f;
|
|
16562
16547
|
}
|
|
16563
16548
|
var Lf = {}, Of = {}, Ga;
|
|
16564
|
-
function
|
|
16549
|
+
function V2() {
|
|
16565
16550
|
return Ga || (Ga = 1, function(h) {
|
|
16566
16551
|
var n = To();
|
|
16567
16552
|
h.tagClass = {
|
|
@@ -16613,7 +16598,7 @@ function To() {
|
|
|
16613
16598
|
var g = o[f];
|
|
16614
16599
|
m[g] = f;
|
|
16615
16600
|
}), m;
|
|
16616
|
-
}, n.der =
|
|
16601
|
+
}, n.der = V2();
|
|
16617
16602
|
}(Lf)), Lf;
|
|
16618
16603
|
}
|
|
16619
16604
|
var zf = {}, Kf, ja;
|
|
@@ -16788,7 +16773,7 @@ function Co() {
|
|
|
16788
16773
|
return Kf;
|
|
16789
16774
|
}
|
|
16790
16775
|
var Hf, Qa;
|
|
16791
|
-
function
|
|
16776
|
+
function Y2() {
|
|
16792
16777
|
if (Qa)
|
|
16793
16778
|
return Hf;
|
|
16794
16779
|
Qa = 1;
|
|
@@ -16820,10 +16805,10 @@ function Ym() {
|
|
|
16820
16805
|
}, Hf;
|
|
16821
16806
|
}
|
|
16822
16807
|
var th;
|
|
16823
|
-
function
|
|
16808
|
+
function J2() {
|
|
16824
16809
|
return th || (th = 1, function(h) {
|
|
16825
16810
|
var n = h;
|
|
16826
|
-
n.der = Co(), n.pem =
|
|
16811
|
+
n.der = Co(), n.pem = Y2();
|
|
16827
16812
|
}(zf)), zf;
|
|
16828
16813
|
}
|
|
16829
16814
|
var Zf = {}, Wf, eh;
|
|
@@ -16976,7 +16961,7 @@ function Fo() {
|
|
|
16976
16961
|
return Wf;
|
|
16977
16962
|
}
|
|
16978
16963
|
var Vf, rh;
|
|
16979
|
-
function
|
|
16964
|
+
function G2() {
|
|
16980
16965
|
if (rh)
|
|
16981
16966
|
return Vf;
|
|
16982
16967
|
rh = 1;
|
|
@@ -16992,17 +16977,17 @@ function Gm() {
|
|
|
16992
16977
|
}, Vf;
|
|
16993
16978
|
}
|
|
16994
16979
|
var ih;
|
|
16995
|
-
function
|
|
16980
|
+
function X2() {
|
|
16996
16981
|
return ih || (ih = 1, function(h) {
|
|
16997
16982
|
var n = h;
|
|
16998
|
-
n.der = Fo(), n.pem =
|
|
16983
|
+
n.der = Fo(), n.pem = G2();
|
|
16999
16984
|
}(Zf)), Zf;
|
|
17000
16985
|
}
|
|
17001
16986
|
var nh;
|
|
17002
16987
|
function fn() {
|
|
17003
16988
|
return nh || (nh = 1, function(h) {
|
|
17004
16989
|
var n = h;
|
|
17005
|
-
n.bignum =
|
|
16990
|
+
n.bignum = K2, n.define = H2().define, n.base = Ui(), n.constants = To(), n.decoders = J2(), n.encoders = X2();
|
|
17006
16991
|
}(Df)), Df;
|
|
17007
16992
|
}
|
|
17008
16993
|
var ir = fn(), fh = ir.define("Time", function() {
|
|
@@ -17010,7 +16995,7 @@ var ir = fn(), fh = ir.define("Time", function() {
|
|
|
17010
16995
|
utcTime: this.utctime(),
|
|
17011
16996
|
generalTime: this.gentime()
|
|
17012
16997
|
});
|
|
17013
|
-
}),
|
|
16998
|
+
}), j2 = ir.define("AttributeTypeValue", function() {
|
|
17014
16999
|
this.seq().obj(
|
|
17015
17000
|
this.key("type").objid(),
|
|
17016
17001
|
this.key("value").any()
|
|
@@ -17021,52 +17006,52 @@ var ir = fn(), fh = ir.define("Time", function() {
|
|
|
17021
17006
|
this.key("parameters").optional(),
|
|
17022
17007
|
this.key("curve").objid().optional()
|
|
17023
17008
|
);
|
|
17024
|
-
}),
|
|
17009
|
+
}), Q2 = ir.define("SubjectPublicKeyInfo", function() {
|
|
17025
17010
|
this.seq().obj(
|
|
17026
17011
|
this.key("algorithm").use(V0),
|
|
17027
17012
|
this.key("subjectPublicKey").bitstr()
|
|
17028
17013
|
);
|
|
17029
|
-
}),
|
|
17030
|
-
this.setof(
|
|
17031
|
-
}),
|
|
17032
|
-
this.seqof(
|
|
17014
|
+
}), tm = ir.define("RelativeDistinguishedName", function() {
|
|
17015
|
+
this.setof(j2);
|
|
17016
|
+
}), em = ir.define("RDNSequence", function() {
|
|
17017
|
+
this.seqof(tm);
|
|
17033
17018
|
}), ah = ir.define("Name", function() {
|
|
17034
17019
|
this.choice({
|
|
17035
|
-
rdnSequence: this.use(
|
|
17020
|
+
rdnSequence: this.use(em)
|
|
17036
17021
|
});
|
|
17037
|
-
}),
|
|
17022
|
+
}), rm = ir.define("Validity", function() {
|
|
17038
17023
|
this.seq().obj(
|
|
17039
17024
|
this.key("notBefore").use(fh),
|
|
17040
17025
|
this.key("notAfter").use(fh)
|
|
17041
17026
|
);
|
|
17042
|
-
}),
|
|
17027
|
+
}), im = ir.define("Extension", function() {
|
|
17043
17028
|
this.seq().obj(
|
|
17044
17029
|
this.key("extnID").objid(),
|
|
17045
17030
|
this.key("critical").bool().def(!1),
|
|
17046
17031
|
this.key("extnValue").octstr()
|
|
17047
17032
|
);
|
|
17048
|
-
}),
|
|
17033
|
+
}), nm = ir.define("TBSCertificate", function() {
|
|
17049
17034
|
this.seq().obj(
|
|
17050
17035
|
this.key("version").explicit(0).int().optional(),
|
|
17051
17036
|
this.key("serialNumber").int(),
|
|
17052
17037
|
this.key("signature").use(V0),
|
|
17053
17038
|
this.key("issuer").use(ah),
|
|
17054
|
-
this.key("validity").use(
|
|
17039
|
+
this.key("validity").use(rm),
|
|
17055
17040
|
this.key("subject").use(ah),
|
|
17056
|
-
this.key("subjectPublicKeyInfo").use(
|
|
17041
|
+
this.key("subjectPublicKeyInfo").use(Q2),
|
|
17057
17042
|
this.key("issuerUniqueID").implicit(1).bitstr().optional(),
|
|
17058
17043
|
this.key("subjectUniqueID").implicit(2).bitstr().optional(),
|
|
17059
|
-
this.key("extensions").explicit(3).seqof(
|
|
17044
|
+
this.key("extensions").explicit(3).seqof(im).optional()
|
|
17060
17045
|
);
|
|
17061
|
-
}),
|
|
17046
|
+
}), fm = ir.define("X509Certificate", function() {
|
|
17062
17047
|
this.seq().obj(
|
|
17063
|
-
this.key("tbsCertificate").use(
|
|
17048
|
+
this.key("tbsCertificate").use(nm),
|
|
17064
17049
|
this.key("signatureAlgorithm").use(V0),
|
|
17065
17050
|
this.key("signatureValue").bitstr()
|
|
17066
17051
|
);
|
|
17067
|
-
}),
|
|
17068
|
-
rr.certificate =
|
|
17069
|
-
var
|
|
17052
|
+
}), am = fm, nr = fn();
|
|
17053
|
+
rr.certificate = am;
|
|
17054
|
+
var hm = nr.define("RSAPrivateKey", function() {
|
|
17070
17055
|
this.seq().obj(
|
|
17071
17056
|
this.key("version").int(),
|
|
17072
17057
|
this.key("modulus").int(),
|
|
@@ -17079,14 +17064,14 @@ var h2 = nr.define("RSAPrivateKey", function() {
|
|
|
17079
17064
|
this.key("coefficient").int()
|
|
17080
17065
|
);
|
|
17081
17066
|
});
|
|
17082
|
-
rr.RSAPrivateKey =
|
|
17083
|
-
var
|
|
17067
|
+
rr.RSAPrivateKey = hm;
|
|
17068
|
+
var sm = nr.define("RSAPublicKey", function() {
|
|
17084
17069
|
this.seq().obj(
|
|
17085
17070
|
this.key("modulus").int(),
|
|
17086
17071
|
this.key("publicExponent").int()
|
|
17087
17072
|
);
|
|
17088
17073
|
});
|
|
17089
|
-
rr.RSAPublicKey =
|
|
17074
|
+
rr.RSAPublicKey = sm;
|
|
17090
17075
|
var qo = nr.define("AlgorithmIdentifier", function() {
|
|
17091
17076
|
this.seq().obj(
|
|
17092
17077
|
this.key("algorithm").objid(),
|
|
@@ -17098,22 +17083,22 @@ var qo = nr.define("AlgorithmIdentifier", function() {
|
|
|
17098
17083
|
this.key("g").int()
|
|
17099
17084
|
).optional()
|
|
17100
17085
|
);
|
|
17101
|
-
}),
|
|
17086
|
+
}), om = nr.define("SubjectPublicKeyInfo", function() {
|
|
17102
17087
|
this.seq().obj(
|
|
17103
17088
|
this.key("algorithm").use(qo),
|
|
17104
17089
|
this.key("subjectPublicKey").bitstr()
|
|
17105
17090
|
);
|
|
17106
17091
|
});
|
|
17107
|
-
rr.PublicKey =
|
|
17108
|
-
var
|
|
17092
|
+
rr.PublicKey = om;
|
|
17093
|
+
var um = nr.define("PrivateKeyInfo", function() {
|
|
17109
17094
|
this.seq().obj(
|
|
17110
17095
|
this.key("version").int(),
|
|
17111
17096
|
this.key("algorithm").use(qo),
|
|
17112
17097
|
this.key("subjectPrivateKey").octstr()
|
|
17113
17098
|
);
|
|
17114
17099
|
});
|
|
17115
|
-
rr.PrivateKey =
|
|
17116
|
-
var
|
|
17100
|
+
rr.PrivateKey = um;
|
|
17101
|
+
var lm = nr.define("EncryptedPrivateKeyInfo", function() {
|
|
17117
17102
|
this.seq().obj(
|
|
17118
17103
|
this.key("algorithm").seq().obj(
|
|
17119
17104
|
this.key("id").objid(),
|
|
@@ -17134,8 +17119,8 @@ var l2 = nr.define("EncryptedPrivateKeyInfo", function() {
|
|
|
17134
17119
|
this.key("subjectPrivateKey").octstr()
|
|
17135
17120
|
);
|
|
17136
17121
|
});
|
|
17137
|
-
rr.EncryptedPrivateKey =
|
|
17138
|
-
var
|
|
17122
|
+
rr.EncryptedPrivateKey = lm;
|
|
17123
|
+
var dm = nr.define("DSAPrivateKey", function() {
|
|
17139
17124
|
this.seq().obj(
|
|
17140
17125
|
this.key("version").int(),
|
|
17141
17126
|
this.key("p").int(),
|
|
@@ -17145,30 +17130,30 @@ var d2 = nr.define("DSAPrivateKey", function() {
|
|
|
17145
17130
|
this.key("priv_key").int()
|
|
17146
17131
|
);
|
|
17147
17132
|
});
|
|
17148
|
-
rr.DSAPrivateKey =
|
|
17133
|
+
rr.DSAPrivateKey = dm;
|
|
17149
17134
|
rr.DSAparam = nr.define("DSAparam", function() {
|
|
17150
17135
|
this.int();
|
|
17151
17136
|
});
|
|
17152
|
-
var
|
|
17137
|
+
var cm = nr.define("ECParameters", function() {
|
|
17153
17138
|
this.choice({
|
|
17154
17139
|
namedCurve: this.objid()
|
|
17155
17140
|
});
|
|
17156
|
-
}),
|
|
17141
|
+
}), vm = nr.define("ECPrivateKey", function() {
|
|
17157
17142
|
this.seq().obj(
|
|
17158
17143
|
this.key("version").int(),
|
|
17159
17144
|
this.key("privateKey").octstr(),
|
|
17160
|
-
this.key("parameters").optional().explicit(0).use(
|
|
17145
|
+
this.key("parameters").optional().explicit(0).use(cm),
|
|
17161
17146
|
this.key("publicKey").optional().explicit(1).bitstr()
|
|
17162
17147
|
);
|
|
17163
17148
|
});
|
|
17164
|
-
rr.ECPrivateKey =
|
|
17149
|
+
rr.ECPrivateKey = vm;
|
|
17165
17150
|
rr.signature = nr.define("signature", function() {
|
|
17166
17151
|
this.seq().obj(
|
|
17167
17152
|
this.key("r").int(),
|
|
17168
17153
|
this.key("s").int()
|
|
17169
17154
|
);
|
|
17170
17155
|
});
|
|
17171
|
-
const
|
|
17156
|
+
const pm = {
|
|
17172
17157
|
"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
|
|
17173
17158
|
"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
|
|
17174
17159
|
"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
|
|
@@ -17182,29 +17167,29 @@ const p2 = {
|
|
|
17182
17167
|
"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
|
|
17183
17168
|
"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
|
|
17184
17169
|
};
|
|
17185
|
-
var
|
|
17186
|
-
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;
|
|
17187
17172
|
if (o) {
|
|
17188
|
-
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);
|
|
17189
17174
|
M.push(x.update(S)), M.push(x.final()), m = pn.concat(M);
|
|
17190
17175
|
} else {
|
|
17191
|
-
var f = s.match(
|
|
17176
|
+
var f = s.match(bm);
|
|
17192
17177
|
m = pn.from(f[2].replace(/[\r\n]/g, ""), "base64");
|
|
17193
17178
|
}
|
|
17194
|
-
var I = s.match(
|
|
17179
|
+
var I = s.match(gm)[1];
|
|
17195
17180
|
return {
|
|
17196
17181
|
tag: I,
|
|
17197
17182
|
data: m
|
|
17198
17183
|
};
|
|
17199
|
-
}, qe = rr,
|
|
17200
|
-
function
|
|
17201
|
-
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 = [];
|
|
17202
17187
|
return M.push(B.update(g)), M.push(B.final()), c0.concat(M);
|
|
17203
17188
|
}
|
|
17204
17189
|
function Po(h) {
|
|
17205
17190
|
var n;
|
|
17206
17191
|
typeof h == "object" && !c0.isBuffer(h) && (n = h.passphrase, h = h.key), typeof h == "string" && (h = c0.from(h));
|
|
17207
|
-
var s =
|
|
17192
|
+
var s = _m(h, n), o = s.tag, m = s.data, f, g;
|
|
17208
17193
|
switch (o) {
|
|
17209
17194
|
case "CERTIFICATE":
|
|
17210
17195
|
g = qe.certificate.decode(m, "der").tbsCertificate.subjectPublicKeyInfo;
|
|
@@ -17226,7 +17211,7 @@ function Po(h) {
|
|
|
17226
17211
|
throw new Error("unknown key id " + f);
|
|
17227
17212
|
}
|
|
17228
17213
|
case "ENCRYPTED PRIVATE KEY":
|
|
17229
|
-
m = qe.EncryptedPrivateKey.decode(m, "der"), m =
|
|
17214
|
+
m = qe.EncryptedPrivateKey.decode(m, "der"), m = Bm(m, n);
|
|
17230
17215
|
case "PRIVATE KEY":
|
|
17231
17216
|
switch (g = qe.PrivateKey.decode(m, "der"), f = g.algorithm.algorithm.join("."), f) {
|
|
17232
17217
|
case "1.2.840.113549.1.1.1":
|
|
@@ -17273,7 +17258,7 @@ const Do = {
|
|
|
17273
17258
|
"1.3.132.0.35": "p521"
|
|
17274
17259
|
};
|
|
17275
17260
|
var hh;
|
|
17276
|
-
function
|
|
17261
|
+
function Em() {
|
|
17277
17262
|
if (hh)
|
|
17278
17263
|
return Ci.exports;
|
|
17279
17264
|
hh = 1;
|
|
@@ -17362,7 +17347,7 @@ function E2() {
|
|
|
17362
17347
|
return Ci.exports = S, Ci.exports.getKey = I, Ci.exports.makeKey = L, Ci.exports;
|
|
17363
17348
|
}
|
|
17364
17349
|
var Yf, sh;
|
|
17365
|
-
function
|
|
17350
|
+
function km() {
|
|
17366
17351
|
if (sh)
|
|
17367
17352
|
return Yf;
|
|
17368
17353
|
sh = 1;
|
|
@@ -17416,11 +17401,11 @@ function k2() {
|
|
|
17416
17401
|
return Yf = f, Yf;
|
|
17417
17402
|
}
|
|
17418
17403
|
var Jf, oh;
|
|
17419
|
-
function
|
|
17404
|
+
function Im() {
|
|
17420
17405
|
if (oh)
|
|
17421
17406
|
return Jf;
|
|
17422
17407
|
oh = 1;
|
|
17423
|
-
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;
|
|
17424
17409
|
Object.keys(g).forEach(function(x) {
|
|
17425
17410
|
g[x].id = h.from(g[x].id, "hex"), g[x.toLowerCase()] = g[x];
|
|
17426
17411
|
});
|
|
@@ -18650,12 +18635,12 @@ Y0.exports;
|
|
|
18650
18635
|
};
|
|
18651
18636
|
})(h, Gt);
|
|
18652
18637
|
})(Y0);
|
|
18653
|
-
var
|
|
18654
|
-
function
|
|
18638
|
+
var Rm = Y0.exports, Gf, uh;
|
|
18639
|
+
function Tm() {
|
|
18655
18640
|
if (uh)
|
|
18656
18641
|
return Gf;
|
|
18657
18642
|
uh = 1;
|
|
18658
|
-
var h = Z0(), n =
|
|
18643
|
+
var h = Z0(), n = Rm;
|
|
18659
18644
|
Gf = function(g) {
|
|
18660
18645
|
return new o(g);
|
|
18661
18646
|
};
|
|
@@ -18724,12 +18709,12 @@ function T2() {
|
|
|
18724
18709
|
}
|
|
18725
18710
|
return Gf;
|
|
18726
18711
|
}
|
|
18727
|
-
var No = {},
|
|
18712
|
+
var No = {}, Cm = Gi, v0 = Ot.Buffer, $o = function(h, n) {
|
|
18728
18713
|
for (var s = v0.alloc(0), o = 0, m; s.length < n; )
|
|
18729
|
-
m =
|
|
18714
|
+
m = Fm(o++), s = v0.concat([s, Cm("sha1").update(h).update(m).digest()]);
|
|
18730
18715
|
return s.slice(0, n);
|
|
18731
18716
|
};
|
|
18732
|
-
function
|
|
18717
|
+
function Fm(h) {
|
|
18733
18718
|
var n = v0.allocUnsafe(4);
|
|
18734
18719
|
return n.writeUInt32BE(h, 0), n;
|
|
18735
18720
|
}
|
|
@@ -19917,67 +19902,67 @@ J0.exports;
|
|
|
19917
19902
|
};
|
|
19918
19903
|
})(h, Gt);
|
|
19919
19904
|
})(J0);
|
|
19920
|
-
var G0 = J0.exports, lh = G0,
|
|
19921
|
-
function
|
|
19922
|
-
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());
|
|
19923
19908
|
}
|
|
19924
|
-
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) {
|
|
19925
19910
|
var m;
|
|
19926
19911
|
n.padding ? m = n.padding : o ? m = 1 : m = 4;
|
|
19927
|
-
var f =
|
|
19912
|
+
var f = Dm(n), g;
|
|
19928
19913
|
if (m === 4)
|
|
19929
|
-
g =
|
|
19914
|
+
g = Om(f, s);
|
|
19930
19915
|
else if (m === 1)
|
|
19931
|
-
g =
|
|
19916
|
+
g = zm(f, s, o);
|
|
19932
19917
|
else if (m === 3) {
|
|
19933
19918
|
if (g = new X0(s), g.cmp(f.modulus) >= 0)
|
|
19934
19919
|
throw new Error("data too long for modulus");
|
|
19935
19920
|
} else
|
|
19936
19921
|
throw new Error("unknown padding");
|
|
19937
|
-
return o ?
|
|
19922
|
+
return o ? Um(g, f) : $m(g, f);
|
|
19938
19923
|
};
|
|
19939
|
-
function
|
|
19940
|
-
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;
|
|
19941
19926
|
if (o > s - g - 2)
|
|
19942
19927
|
throw new Error("message too long");
|
|
19943
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));
|
|
19944
19929
|
return new X0(je.concat([je.alloc(1), x, M], s));
|
|
19945
19930
|
}
|
|
19946
|
-
function
|
|
19931
|
+
function zm(h, n, s) {
|
|
19947
19932
|
var o = n.length, m = h.modulus.byteLength();
|
|
19948
19933
|
if (o > m - 11)
|
|
19949
19934
|
throw new Error("message too long");
|
|
19950
19935
|
var f;
|
|
19951
|
-
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));
|
|
19952
19937
|
}
|
|
19953
|
-
function
|
|
19938
|
+
function Km(h) {
|
|
19954
19939
|
for (var n = je.allocUnsafe(h), s = 0, o = p0(h * 2), m = 0, f; s < h; )
|
|
19955
19940
|
m === o.length && (o = p0(h * 2), m = 0), f = o[m++], f && (n[s++] = f);
|
|
19956
19941
|
return n;
|
|
19957
19942
|
}
|
|
19958
|
-
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) {
|
|
19959
19944
|
var m;
|
|
19960
19945
|
n.padding ? m = n.padding : o ? m = 1 : m = 4;
|
|
19961
|
-
var f =
|
|
19946
|
+
var f = Hm(n), g = f.modulus.byteLength();
|
|
19962
19947
|
if (s.length > g || new mh(s).cmp(f.modulus) >= 0)
|
|
19963
19948
|
throw new Error("decryption error");
|
|
19964
19949
|
var y;
|
|
19965
|
-
o ? y =
|
|
19950
|
+
o ? y = Vm(new mh(s), f) : y = Zm(s, f);
|
|
19966
19951
|
var S = Hi.alloc(g - y.length);
|
|
19967
19952
|
if (y = Hi.concat([S, y], g), m === 4)
|
|
19968
|
-
return
|
|
19953
|
+
return Jm(f, y);
|
|
19969
19954
|
if (m === 1)
|
|
19970
|
-
return
|
|
19955
|
+
return Gm(f, y, o);
|
|
19971
19956
|
if (m === 3)
|
|
19972
19957
|
return y;
|
|
19973
19958
|
throw new Error("unknown padding");
|
|
19974
19959
|
};
|
|
19975
|
-
function
|
|
19976
|
-
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;
|
|
19977
19962
|
if (n[0] !== 0)
|
|
19978
19963
|
throw new Error("decryption error");
|
|
19979
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));
|
|
19980
|
-
if (
|
|
19965
|
+
if (Xm(o, S.slice(0, m)))
|
|
19981
19966
|
throw new Error("decryption error");
|
|
19982
19967
|
for (var B = m; S[B] === 0; )
|
|
19983
19968
|
B++;
|
|
@@ -19985,7 +19970,7 @@ function J2(h, n) {
|
|
|
19985
19970
|
throw new Error("decryption error");
|
|
19986
19971
|
return S.slice(B);
|
|
19987
19972
|
}
|
|
19988
|
-
function
|
|
19973
|
+
function Gm(h, n, s) {
|
|
19989
19974
|
for (var o = n.slice(0, 2), m = 2, f = 0; n[m++] !== 0; )
|
|
19990
19975
|
if (m >= n.length) {
|
|
19991
19976
|
f++;
|
|
@@ -19996,7 +19981,7 @@ function G2(h, n, s) {
|
|
|
19996
19981
|
throw new Error("decryption error");
|
|
19997
19982
|
return n.slice(m);
|
|
19998
19983
|
}
|
|
19999
|
-
function
|
|
19984
|
+
function Xm(h, n) {
|
|
20000
19985
|
h = Hi.from(h), n = Hi.from(n);
|
|
20001
19986
|
var s = 0, o = h.length;
|
|
20002
19987
|
h.length !== n.length && (s++, o = Math.min(h.length, n.length));
|
|
@@ -20005,7 +19990,7 @@ function X2(h, n) {
|
|
|
20005
19990
|
return s;
|
|
20006
19991
|
}
|
|
20007
19992
|
(function(h) {
|
|
20008
|
-
h.publicEncrypt =
|
|
19993
|
+
h.publicEncrypt = Lm, h.privateDecrypt = Ym, h.privateEncrypt = function(s, o) {
|
|
20009
19994
|
return h.publicEncrypt(s, o, !0);
|
|
20010
19995
|
}, h.publicDecrypt = function(s, o) {
|
|
20011
19996
|
return h.privateDecrypt(s, o, !0);
|
|
@@ -20033,8 +20018,8 @@ function Wo(h, n, s) {
|
|
|
20033
20018
|
if (h + n > s || h > Ko)
|
|
20034
20019
|
throw new RangeError("buffer too small");
|
|
20035
20020
|
}
|
|
20036
|
-
m0 && m0.getRandomValues || !ye.browser ? (Ni.randomFill =
|
|
20037
|
-
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) {
|
|
20038
20023
|
if (!zo.isBuffer(h) && !(h instanceof Gt.Uint8Array))
|
|
20039
20024
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
20040
20025
|
if (typeof n == "function")
|
|
@@ -20067,7 +20052,7 @@ function Vo(h, n, s, o) {
|
|
|
20067
20052
|
var g = bh(s);
|
|
20068
20053
|
return g.copy(h, n), h;
|
|
20069
20054
|
}
|
|
20070
|
-
function
|
|
20055
|
+
function Qm(h, n, s) {
|
|
20071
20056
|
if (typeof n == "undefined" && (n = 0), !zo.isBuffer(h) && !(h instanceof Gt.Uint8Array))
|
|
20072
20057
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
20073
20058
|
return Zo(n, h.length), s === void 0 && (s = h.length - n), Wo(s, n, h.length), Vo(h, n, s);
|
|
@@ -20095,8 +20080,8 @@ function Yo() {
|
|
|
20095
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;
|
|
20096
20081
|
var f = Q1();
|
|
20097
20082
|
Ut.DiffieHellmanGroup = f.DiffieHellmanGroup, Ut.createDiffieHellmanGroup = f.createDiffieHellmanGroup, Ut.getDiffieHellman = f.getDiffieHellman, Ut.createDiffieHellman = f.createDiffieHellman, Ut.DiffieHellman = f.DiffieHellman;
|
|
20098
|
-
var g =
|
|
20099
|
-
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();
|
|
20100
20085
|
var y = No;
|
|
20101
20086
|
Ut.publicEncrypt = y.publicEncrypt, Ut.privateEncrypt = y.privateEncrypt, Ut.publicDecrypt = y.publicDecrypt, Ut.privateDecrypt = y.privateDecrypt;
|
|
20102
20087
|
var S = Ni;
|