Commit 4c8d96b
crypto: add more keylen sanity checks in pbkdf2
issue #2987 makes the point that crypto.pbkdf2 should not fail silently
and accept invalid but numeric values like NaN and Infinity. We already
check if the keylen is lower than 0, so extending that to NaN and
Infinity should make sense.
Fixes: #2987
PR-URL: #3029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>1 parent 798dad2 commit 4c8d96bCopy full SHA for 4c8d96b
File tree
Expand file treeCollapse file tree
2 files changed
+33
-4
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
2 files changed
+33
-4
lines changedOpen diff view settings
Collapse file
+5-4Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
19 | 19 | |
20 | 20 | |
21 | 21 | |
| 22 | + |
22 | 23 | |
23 | 24 | |
24 | 25 | |
| ||
4760 | 4761 | |
4761 | 4762 | |
4762 | 4763 | |
4763 | | - |
| 4764 | + |
4764 | 4765 | |
4765 | 4766 | |
4766 | 4767 | |
| ||
4813 | 4814 | |
4814 | 4815 | |
4815 | 4816 | |
4816 | | - |
4817 | | - |
| 4817 | + |
| 4818 | + |
4818 | 4819 | |
4819 | 4820 | |
4820 | 4821 | |
| ||
4841 | 4842 | |
4842 | 4843 | |
4843 | 4844 | |
4844 | | - |
| 4845 | + |
4845 | 4846 | |
4846 | 4847 | |
4847 | 4848 | |
|
Collapse file
test/parallel/test-crypto-pbkdf2.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-pbkdf2.js+28Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
0 commit comments