Closed
Conversation
Contributor
Author
$ node -v
v5.6.0
$ node
> require('crypto').pbkdf2Sync('password', 'salt', 1, NaN)
TypeError: Bad key length
$ nvm use 0.10
$ node -v
v0.10.42
$ node
> require('crypto').pbkdf2Sync('password', 'salt', 1, NaN)
<SlowBuffer >Different behavior for different node versions :( |
test/index.js
Outdated
|
|
||
| // put NaN and Infinity | ||
| fixtures.invalid[fixtures.invalid.length - 2].dkLen = NaN | ||
| fixtures.invalid[fixtures.invalid.length - 1].dkLen = Infinity |
Member
There was a problem hiding this comment.
I'd rather add these fixtures inline here, then do this weird modification which is error prone for others adding tests.
Contributor
Author
There was a problem hiding this comment.
Agree, any ideas how tests dkLen with NaN and Infinity?
95120f2 to
f64f48d
Compare
f64f48d to
b1fff11
Compare
Contributor
Author
|
updated |
Member
|
... all failed except Node 4? Interesting |
Member
1) node pbkdf2 pbkdf2-compat pbkdf2Sync sha[1/224/256/384/512] should throw Bad key length:
AssertionError: Missing expected exception..
at Function._throws (assert.js:301:5)
at Function.assert.throws (assert.js:318:11)
at Context.<anonymous> (test/index.js:95:24) |
Contributor
Author
|
What version of node v4 you are using? May be your version not include nodejs/node@4c8d96b ? (checks on |
Member
|
@fanatid I'm referring to the CI. |
Contributor
Author
|
@dcousens I'll fix with this PR after nodejs/node#5397 will be merged and released |
Contributor
|
merged as part of #27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #22