Skip to content
Browse files

Fix removal of btwoc encoding. Fix encoding of shared secret.

  • Loading branch information...
1 parent f40afcc commit 99815b61ed1e4024c56902a54231a510451b2a88 @havard committed Apr 12, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/convert.js
  2. +1 −1 openid.js
View
2 lib/convert.js
@@ -39,7 +39,7 @@ function btwoc(i)
function unbtwoc(i)
{
- if(i.charCodeAt(0) == String.fromCharCode(0))
+ if(i[0] === String.fromCharCode(0))
{
return i.substr(1);
}
View
2 openid.js
@@ -713,7 +713,7 @@ openid.associate = function(provider, callback, strict, algorithm)
else
{
var serverPublic = _fromBase64(data.dh_server_public);
- var sharedSecret = dh.computeSecret(serverPublic);
+ var sharedSecret = convert.btwoc(dh.computeSecret(serverPublic));
var hash = crypto.createHash(hashAlgorithm);
hash.update(sharedSecret);
sharedSecret = hash.digest();

0 comments on commit 99815b6

Please sign in to comment.
Something went wrong with that request. Please try again.