jaredhanson / passport-openid

OpenID authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-openid/?utm_source=github&utm_medium=referral&utm_campaign=passport-openid&utm_content=about
MIT License
98 stars 90 forks source link

TypeError and crash in _xor() with node 0.10.x - API change #13

Closed dertseha closed 8 years ago

dertseha commented 11 years ago
.../passport-openid/node_modules/openid/openid.js:94
    r += String.fromCharCode(a.charCodeAt(i) ^ b.charCodeAt(i));

TypeError: Object (binary garbage) has no method 'charCodeAt' (referring to b) at _xor()

As per http://nodejs.org/docs/v0.10.0/api/crypto.html#crypto_recent_api_changes , the crypto API now defaults to buffer objects instead of binary.

jaredhanson commented 11 years ago

This is actually a bug in node-openid, which seems similar to this one: https://github.com/havard/node-openid/issues/95

Once that dependency is updated for compatibility with node 0.10.x, passport-openid should be good to go.

dertseha commented 11 years ago

gah - sorry, issue posted at wrong project. I should go to sleep ;) But thank you for referencing.

jaredhanson commented 11 years ago

No worries. Ping me here if I need to change any dependencies once a new openid module is published to npm.

dertseha commented 11 years ago

The fix has been pushed: https://github.com/havard/node-openid/issues/95#issuecomment-15587983 As passport-openid is dependent on 0.5.x, this update is covered. Thank you!