Skip to content

Commit

Permalink
use narwhals sha.hmac_sha()
Browse files Browse the repository at this point in the history
  • Loading branch information
nevilleburnell committed Sep 22, 2009
1 parent 4a62ec2 commit d2fc5ba
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ update(OAuth.SignatureMethod, {
}
}
sortable.sort(function(a,b) {
if (a[0] < b[0]) return -1;
if (a[0] < b[0]) return -1;
if (a[0] > b[0]) return 1;
return 0;
});
Expand All @@ -539,17 +539,7 @@ OAuth.SignatureMethod.registerMethodClass(["PLAINTEXT", "PLAINTEXT-Accessor"],
OAuth.SignatureMethod.registerMethodClass(["HMAC-SHA1", "HMAC-SHA1-Accessor"],
OAuth.SignatureMethod.makeSubclass(
function getSignature(baseString) {

// TODO - use narwhals SHA and binary stuff
// narwhal sha doesnt export sha(key data)
// when I exported it, it throws TypeError: Cannot find function charCodeAt in object 326179446,-189091963,955596113,-182440090,1319247055. on rhino
//
// so for the time being I have ported OAuths SHA(key data), which of course doesnt understand narwhal binary
//
// var signature = base64.encode(SHA.core_hmac_sha(this.key, baseString));

var signature = require("sha1").b64_hmac_sha1(this.key, baseString);
return signature;
return base64.encode(SHA.hmac_sha(this.key, baseString));
}
));

Expand Down

0 comments on commit d2fc5ba

Please sign in to comment.