Skip to content

Commit

Permalink
Fix for node 6.x. Be explicit about crypto update input encoding latin1
Browse files Browse the repository at this point in the history
  • Loading branch information
dschenkelman committed Jan 20, 2017
1 parent 3df3060 commit 97d4bd1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
before_install: npm i -g npm@1.4.28
node_js:
- 0.8
- 0.10
- 4
- 6
2 changes: 1 addition & 1 deletion lib/passport-wsfed-saml2/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ SAML.prototype.validateSignature = function (xml, options, callback) {
var base64cer = embeddedSignature[0].firstChild.toString();
var shasum = crypto.createHash('sha1');
var der = new Buffer(base64cer, 'base64').toString('binary');
shasum.update(der);
shasum.update(der, 'latin1');
self.calculatedThumbprint = shasum.digest('hex');

// using embedded cert, so options.cert is not used anymore
Expand Down
2 changes: 1 addition & 1 deletion lib/passport-wsfed-saml2/samlp.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var removeHeaders = function (cert) {

var sign = function (content, key, algorithm) {
var signer = crypto.createSign(algorithm.toUpperCase());
signer.update(content);
signer.update(content, 'latin1');
return signer.sign(key, 'base64');
};

Expand Down

0 comments on commit 97d4bd1

Please sign in to comment.