meteor-node-stubs 1.2.10 → 1.2.12
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
v1.2.12 - 2024-10-31
|
|
2
|
+
|
|
3
|
+
* Update `elliptic` to v6.6.0 to address a security vulnerability.
|
|
4
|
+
|
|
5
|
+
v1.2.11 - 2024-10-25
|
|
6
|
+
|
|
7
|
+
* Update `rimraf` to v5 to remove vulnerable `inflight` dependency.
|
|
8
|
+
|
|
1
9
|
v1.2.8 - 2024-04-01
|
|
2
10
|
* Add new dependency `@meteorjs/crypto-browserify` to replace `crypto-browserify` as it had unsafe dependencies.
|
|
3
11
|
|
|
@@ -78,8 +78,27 @@ EC.prototype.genKeyPair = function genKeyPair(options) {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {
|
|
82
|
-
var
|
|
81
|
+
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) {
|
|
82
|
+
var byteLength;
|
|
83
|
+
if (BN.isBN(msg) || typeof msg === 'number') {
|
|
84
|
+
msg = new BN(msg, 16);
|
|
85
|
+
byteLength = msg.byteLength();
|
|
86
|
+
} else if (typeof msg === 'object') {
|
|
87
|
+
// BN assumes an array-like input and asserts length
|
|
88
|
+
byteLength = msg.length;
|
|
89
|
+
msg = new BN(msg, 16);
|
|
90
|
+
} else {
|
|
91
|
+
// BN converts the value to string
|
|
92
|
+
var str = msg.toString();
|
|
93
|
+
// HEX encoding
|
|
94
|
+
byteLength = (str.length + 1) >>> 1;
|
|
95
|
+
msg = new BN(str, 16);
|
|
96
|
+
}
|
|
97
|
+
// Allow overriding
|
|
98
|
+
if (typeof bitLength !== 'number') {
|
|
99
|
+
bitLength = byteLength * 8;
|
|
100
|
+
}
|
|
101
|
+
var delta = bitLength - this.n.bitLength();
|
|
83
102
|
if (delta > 0)
|
|
84
103
|
msg = msg.ushrn(delta);
|
|
85
104
|
if (!truncOnly && msg.cmp(this.n) >= 0)
|
|
@@ -97,7 +116,7 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
97
116
|
options = {};
|
|
98
117
|
|
|
99
118
|
key = this.keyFromPrivate(key, enc);
|
|
100
|
-
msg = this._truncateToN(
|
|
119
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
101
120
|
|
|
102
121
|
// Zero-extend key to provide enough entropy
|
|
103
122
|
var bytes = this.n.byteLength();
|
|
@@ -153,8 +172,11 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
153
172
|
}
|
|
154
173
|
};
|
|
155
174
|
|
|
156
|
-
EC.prototype.verify = function verify(msg, signature, key, enc) {
|
|
157
|
-
|
|
175
|
+
EC.prototype.verify = function verify(msg, signature, key, enc, options) {
|
|
176
|
+
if (!options)
|
|
177
|
+
options = {};
|
|
178
|
+
|
|
179
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
158
180
|
key = this.keyFromPublic(key, enc);
|
|
159
181
|
signature = new Signature(signature, 'hex');
|
|
160
182
|
|
|
@@ -111,8 +111,8 @@ KeyPair.prototype.sign = function sign(msg, enc, options) {
|
|
|
111
111
|
return this.ec.sign(msg, this, enc, options);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
KeyPair.prototype.verify = function verify(msg, signature) {
|
|
115
|
-
return this.ec.verify(msg, signature, this);
|
|
114
|
+
KeyPair.prototype.verify = function verify(msg, signature, options) {
|
|
115
|
+
return this.ec.verify(msg, signature, this, undefined, options);
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
KeyPair.prototype.inspect = function inspect() {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "meteor-node-stubs",
|
|
3
3
|
"author": "Ben Newman <ben@meteor.com>",
|
|
4
4
|
"description": "Stub implementations of Node built-in modules, a la Browserify",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.12",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/meteor/meteor/blob/devel/npm-packages/meteor-node-stubs/README.md",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"console-browserify": "^1.2.0",
|
|
19
19
|
"constants-browserify": "^1.0.0",
|
|
20
20
|
"domain-browser": "^4.23.0",
|
|
21
|
-
"elliptic": "^6.
|
|
21
|
+
"elliptic": "^6.6.0",
|
|
22
22
|
"events": "^3.3.0",
|
|
23
23
|
"https-browserify": "^1.0.0",
|
|
24
24
|
"os-browserify": "^0.3.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vm-browserify"
|
|
63
63
|
],
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"rimraf": "^
|
|
65
|
+
"rimraf": "^5.0.10"
|
|
66
66
|
},
|
|
67
67
|
"repository": {
|
|
68
68
|
"type": "git",
|
package/scripts/build-deps.js
CHANGED
|
@@ -2,6 +2,7 @@ var fs = require("fs");
|
|
|
2
2
|
var path = require("path");
|
|
3
3
|
var depsDir = path.join(__dirname, "..", "deps");
|
|
4
4
|
var map = require("../map.json");
|
|
5
|
+
var rr = require("rimraf");
|
|
5
6
|
|
|
6
7
|
// Each file in the `deps` directory expresses the dependencies of a stub.
|
|
7
8
|
// For example, `deps/http.js` calls `require("http-browserify")` to
|
|
@@ -14,16 +15,15 @@ var map = require("../map.json");
|
|
|
14
15
|
// bundled. Note that these modules should not be `require`d at runtime,
|
|
15
16
|
// but merely scanned at bundling time.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
18
|
+
rr.rimrafSync(depsDir);
|
|
19
|
+
|
|
20
|
+
fs.mkdirSync(depsDir);
|
|
21
|
+
|
|
22
|
+
Object.keys(map).forEach(function (id) {
|
|
23
|
+
fs.writeFileSync(
|
|
24
|
+
path.join(depsDir, id + ".js"),
|
|
25
|
+
typeof map[id] === "string"
|
|
26
|
+
? "require(" + JSON.stringify(map[id]) + ");\n"
|
|
27
|
+
: ""
|
|
28
|
+
);
|
|
29
29
|
});
|