crypto, string_bytes: treat `buffer` str as `utf8` by indutny · Pull Request #5522 · nodejs/node

@indutny

Do not treat crypto inputs as `binary` strings, convert them to Buffers
using `new Buffer(..., 'utf8')`, or using newly updated StringBytes
APIs.

@indutny mentioned this pull request

Mar 2, 2016

4 tasks

@Trott Trott added the crypto

Issues and PRs related to the crypto subsystem.

label

Mar 2, 2016

@indutny indutny added the semver-major

PRs that contain breaking changes and should be released in the next major version.

label

Mar 2, 2016

@indutny indutny deleted the feature/no-default-binary-in-crypto.js branch

March 2, 2016 18:25

indutny added a commit that referenced this pull request

Mar 2, 2016
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>

fanatid added a commit to browserify/hash-base that referenced this pull request

Apr 29, 2016

omsmith added a commit to omsmith/pouchdb that referenced this pull request

Apr 29, 2016

omsmith added a commit to omsmith/pouchdb that referenced this pull request

Apr 29, 2016

daleharvey pushed a commit to apache/pouchdb that referenced this pull request

Apr 29, 2016

This was referenced

Sep 15, 2016

lmoe pushed a commit to lmoe/node that referenced this pull request

Feb 16, 2017
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.

addaleax pushed a commit that referenced this pull request

Mar 11, 2017
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>

jungx098 pushed a commit to jungx098/node that referenced this pull request

Mar 21, 2017
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>