doc: warn about using strings as inputs in crypto#37248
Conversation
44d6475 to
4ebefd3
Compare
benjamingr
left a comment
There was a problem hiding this comment.
LGTM (with the marker lint stuff fixed.).
|
Good point @Trott, fixed. |
jasnell
left a comment
There was a problem hiding this comment.
We may want to consider eventually deprecating string use on these.
Trott
left a comment
There was a problem hiding this comment.
LGTM although I think the linter is going to want the bottom reference moved because they're in ASCII order so capitalization changes things.
@jasnell I have been in favor of that for certain APIs for a long time. The last time I brought it up, I remember that @bnoordhuis was against that. Strings do make sense in some cases, e.g. for KDFs, but, in my opinion, not for symmetric keys etc. I am working on a PR that deprecates unsafe output encodings (not input encodings). |
|
Landed in 01e4228. |
ba659df to
01e4228
Compare
PR-URL: #37248 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: nodejs#48052 Refs: nodejs#37248
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: #48052 Refs: #37248 PR-URL: #48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: #48052 Refs: #37248 PR-URL: #48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: #48052 Refs: #37248 PR-URL: #48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: nodejs#48052 Refs: nodejs#37248 PR-URL: nodejs#48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: nodejs#48052 Refs: nodejs#37248 PR-URL: nodejs#48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Add a reference to potential problems with using strings as HMAC keys. Also advise against exceeding the underlying hash function's block size when generating HMAC keys from a cryptographically secure source of entropy. Refs: nodejs#48052 Refs: nodejs#37248 PR-URL: nodejs#48121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Passing Unicode strings to cryptographic APIs can negatively affect security and safety due to the way Unicode encoding works. This change adds appropriate warnings.
The bot will label this as crypto but it's probably more appropriate for @nodejs/documentation or @nodejs/buffer.