Skip to content

Commit 42b2a65

Browse files
committed
Using old hash APIs for webpack compatible
1 parent 2196faf commit 42b2a65

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ node_js:
33
- '0.10'
44
- '0.12'
55
- 'iojs-v1.3'
6-
- 'iojs-v1.5'
6+
- 'iojs-v2.3'
77

88
sudo: false
99

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ Questions, comments, bug reports, and pull requests are all welcome.
209209

210210
## Changelog
211211

212+
### 0.2.24
213+
* Using old hash APIs for webpack compatible
214+
212215
### 0.2.22
213216
* `encryptPrivate` and `decryptPublic` now using only pkcs1 (type 1) padding.
214217

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-rsa",
3-
"version": "0.2.23",
3+
"version": "0.2.24",
44
"description": "Node.js RSA library",
55
"main": "src/NodeRSA.js",
66
"scripts": {

src/schemes/pss.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ module.exports.makeScheme = function (key, options) {
168168
var salt = DB.slice(DB.length - sLen);
169169

170170
var mHash = crypt.createHash(hash);
171-
mHash.end(M);
172-
mHash = mHash.read();
171+
mHash.update(M);
172+
mHash = mHash.digest();
173173

174174
var Mapostrophe = new Buffer(8 + hLen + sLen);
175175
Mapostrophe.fill(0, 0, 8);
176176
mHash.copy(Mapostrophe, 8);
177177
salt.copy(Mapostrophe, 8 + mHash.length);
178178

179179
var Hapostrophe = crypt.createHash(hash);
180-
Hapostrophe.end(Mapostrophe);
181-
Hapostrophe = Hapostrophe.read();
180+
Hapostrophe.update(Mapostrophe);
181+
Hapostrophe = Hapostrophe.digest();
182182

183183
return H.toString("hex") === Hapostrophe.toString("hex");
184184
};

0 commit comments

Comments
 (0)