Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to crypto.pbkdf2 in Node v0.10 broke auth example #1571

Merged
merged 1 commit into from
Apr 13, 2013
Merged

Change to crypto.pbkdf2 in Node v0.10 broke auth example #1571

merged 1 commit into from
Apr 13, 2013

Conversation

jlubawy
Copy link
Contributor

@jlubawy jlubawy commented Apr 5, 2013

The function crypto.pbkdf2 has changed from returning a String in Node v0.8 to a SlowBuffer in Node v0.10 (nodejs/node-v0.x-archive#5003) effectively breaking the authentication scheme used in the auth example (not to mention https://github.com/visionmedia/node-pwd).

The change causes the line if (hash == user.hash) return fn(null, user); in the app.js authentication function to always evaluate as false using Node v0.10 (#1559).

Using the recommendations from (nodejs/node-v0.x-archive#5003) I modified the hash function in pass.js to return a base64 encoded hash at all times fixing the issue using Node v0.10 and not breaking the example using Node v0.8 (tested both).

tj added a commit that referenced this pull request Apr 13, 2013
Change to crypto.pbkdf2 in Node v0.10 broke auth example
@tj tj merged commit 49cc1a7 into expressjs:master Apr 13, 2013
rlidwka pushed a commit to rlidwka/express that referenced this pull request Aug 6, 2014
Change to crypto.pbkdf2 in Node v0.10 broke auth example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants