crypto: add more keylen sanity checks in pbkdf2 · nodejs/node@4c8d96b · GitHub
Skip to content

Commit 4c8d96b

Browse files
Johannrvagg
authored andcommitted
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 4c8d96b

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

src/node_crypto.cc

Lines changed: 5 additions & 4 deletions

test/parallel/test-crypto-pbkdf2.js

Lines changed: 28 additions & 0 deletions

0 commit comments

Comments
 (0)