Skip to content

Commit

Permalink
Default to plain hash algorithm names with createSign/createVerify
Browse files Browse the repository at this point in the history
  • Loading branch information
arekinath committed Apr 29, 2016
1 parent 763f4a6 commit b200b8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ Key.prototype.createVerify = function (hashAlgo) {

var v, nm, err;
try {
nm = this.type.toUpperCase() + '-';
if (this.type === 'ecdsa')
nm = 'ecdsa-with-';
nm += hashAlgo.toUpperCase();
nm = hashAlgo.toUpperCase();
v = crypto.createVerify(nm);
} catch (e) {
err = e;
Expand Down
5 changes: 1 addition & 4 deletions lib/private-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ PrivateKey.prototype.createSign = function (hashAlgo) {

var v, nm, err;
try {
nm = this.type.toUpperCase() + '-';
if (this.type === 'ecdsa')
nm = 'ecdsa-with-';
nm += hashAlgo.toUpperCase();
nm = hashAlgo.toUpperCase();
v = crypto.createSign(nm);
} catch (e) {
err = e;
Expand Down

0 comments on commit b200b8a

Please sign in to comment.