| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Do not treat crypto inputs as `binary` strings, convert them to Buffers using `new Buffer(..., 'utf8')`, or using newly updated StringBytes APIs.
|
cc @nodejs/collaborators @nodejs/ctc |
Sorry, something went wrong.
Sorry, something went wrong.
|
Is this semver-major? |
Sorry, something went wrong.
|
It is. |
Sorry, something went wrong.
|
Can you remove BINARY from enum encoding in src/node.h as well? |
Sorry, something went wrong.
|
Oh wait, the intent is to change the default, not remove it altogether? LGTM in that case. |
Sorry, something went wrong.
|
Thank you, @bnoordhuis . How should we handle this major breakage @nodejs/ctc ? There is hardly a way to deprecate it, because it is a change of default value. Should we just land it and write some blog posts on this change? |
Sorry, something went wrong.
|
Yeah, I think that's likely best. Not sure there's a better way. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
Do not treat crypto inputs as `binary` strings, convert them to Buffers using `new Buffer(..., 'utf8')`, or using newly updated StringBytes APIs. PR-URL: #5522 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
|
@indutny Please don't land major changes so fast? |
Sorry, something went wrong.
|
Yeah... for stuff like this perhaps give it a day or two to give more people a chance to review. I wouldn't anticipate any issues with this one but still... |
Sorry, something went wrong.
|
Oh, sorry... What's our process on this? |
Sorry, something went wrong.
|
For a major I think it's something like at least 48 hours. |
Sorry, something went wrong.
|
|
||
| The `crypto.DEFAULT_ENCODING` mechanism is provided for backwards compatibility | ||
| with legacy programs that expect `'binary'` to be the default encoding. | ||
| with legacy programs that expect `'utf8'` to be the default encoding. |
There was a problem hiding this comment.
This sentence doesn't make much sense anymore since legacy programs were not assuming utf8, but binary.
Sorry, something went wrong.
There was a problem hiding this comment.
Gosh, this is true.
Sorry, something went wrong.
There was a problem hiding this comment.
May I ask you to submit follow-up PR to fix this?
Sorry, something went wrong.
|
For reference (so there can be broad agreement or else we can talk about updating it to be more accurate) from the current version of the Collaborator Guide:
It does not appear to be in the Collaborator Guide, but the doc for onboarding, or at least the one I bookmarked at my onboarding, says:
If that's still correct, it's probably worth mentioning in the Collaborator Guide. (We may also want to get at least a tiny bit more specific than "in some form".) |
Sorry, something went wrong.
|
For anything but trivial or otherwise urgent changes we should be leaving at least 48 hours. This is kind of major and deserves the chance for more discussion to flush out any possible objections. |
Sorry, something went wrong.
The default encoding was switched to utf8 in nodejs/node#5522
The default encoding was switched to utf8 in nodejs/node#5522
The default encoding was switched to utf8 in nodejs/node#5522
|
Just saw websockets/ws#716. Did someone write a blog post / example in docs on what Node users need to change (for example, with hash#update calls)? |
Sorry, something went wrong.
|
This PR made sweeping backwards-incompatible changes to the crypto API, but did not include documentation. cf. #10265 |
Sorry, something went wrong.
|
@sam-github clearly this PR changes all occurrences of binary to utf8 in the docs. What kind of documentation do you mean? |
Sorry, something went wrong.
|
So, that basically boils down to "existing behaviour was undocumented, so there were no docs to change", which is one way to look at it. I'm not necessarily saying that this PR shouldn't have landed without you being forced to document the crypto APIs, but I am saying that users of APIs like pbkdf2() (see #10265) could never have figured out from the docs that there has been a change, which is a problem that needs flagging. Which is why I commented here, so that future readers of this PR can know that the changes it made weren't documented. |
Sorry, something went wrong.
|
I agree we could do better on this. However, careful reader of docs would notice: https://github.com/nodejs/node/pull/5522/files#diff-efc9444c79e30e68a167275387a55aa6R813 Which says that default encoding is utf8. |
Sorry, something went wrong.
|
So I can't say that it was completely undocumented, just wasn't in pbkdf documentation itself. |
Sorry, something went wrong.
PullRequest nodejs#5522 and nodejs#5500 described the change of the default encoding into UTF8 in crypto functions. This however was only changed for the non-streaming API. The streaming API still used binary as the default encoding. This commit will change the default streaming API encoding to UTF8 to make both APIs behave the same. It will also add tests to validate the behavior.
PullRequest #5522 and #5500 described the change of the default encoding into UTF8 in crypto functions. This however was only changed for the non-streaming API. The streaming API still used binary as the default encoding. This commit will change the default streaming API encoding to UTF8 to make both APIs behave the same. It will also add tests to validate the behavior. Refs: #5522 Refs: #5500 PR-URL: #8611 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PullRequest nodejs#5522 and nodejs#5500 described the change of the default encoding into UTF8 in crypto functions. This however was only changed for the non-streaming API. The streaming API still used binary as the default encoding. This commit will change the default streaming API encoding to UTF8 to make both APIs behave the same. It will also add tests to validate the behavior. Refs: nodejs#5522 Refs: nodejs#5500 PR-URL: nodejs#8611 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
| Back | FazBrowse Home | New Git URL |
Pull Request check-list
Please make sure to review and check all of these items:
this change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Affected core subsystem(s)
Please provide affected core subsystem(s) (like buffer, cluster, crypto, etc)
Description of change
Do not treat crypto inputs as binary strings, convert them to Buffers
using new Buffer(..., 'utf8'), or using newly updated StringBytes
APIs.