Skip to content

lib: remove the comment of base64 validation - #29201

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Aug 19, 2019 •

Copy link
Copy Markdown

Since there's a comment about the 'base64' validation needed, and this will result in a breaking change, so this should be removed.


  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Comment thread lib/internal/validators.js Outdated
Comment thread lib/internal/validators.js Outdated
mscdex
mscdex previously requested changes Aug 19, 2019

@mscdex mscdex left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a regex slows the cipher/hash update()s considerably (at least by half for a 1024 character string in my quick benchmarking). I think simply adding a length check would suffice.

If we wanted to be extra strict, we could check the number of bytes written in the C++ layer or something to help determine how valid the base64 string was, provided it didn't cause a serious performance regression.

@ghost

ghost commented Aug 20, 2019

Copy link
Copy Markdown
Author

@mscdex and @cjihrig,Thanks for suggestions and here's the fixture for them.

@addaleax addaleax added semver-major PRs that contain breaking changes and should be released in the next major version. buffer Issues and PRs related to the buffer subsystem. labels Aug 20, 2019
@addaleax

Copy link
Copy Markdown
Member

I’m sorry but I’m -1, this is a major breaking change that has the potential to break a lot of code with little benefit, we just shouldn’t do it at all imo.

@bnoordhuis

Copy link
Copy Markdown
Member

Then we should just remove the comment or replace it with a comment explaining why we're not doing validation? FWIW, I agree with Anna's assessment.

@ghost ghost changed the title lib: add the missing validation for 'base64' lib: remove the comment of base64 validation Aug 21, 2019
Since there's a comment about the 'base64' validation needed, and this
will result in a breaking change, so this should be removed.
@ghost

ghost commented Aug 21, 2019

Copy link
Copy Markdown
Author

@addaleax,OK, I've removed this comment to keep it clear.

@mscdex mscdex removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 21, 2019
@Trott

Trott commented Aug 21, 2019

Copy link
Copy Markdown
Member

@mscdex Are you OK with removing the comment?

@MaledongGit It may be better/easier to close this and open this simple change as a new PR.

/ping @bnoordhuis

@mscdex
mscdex dismissed their stale review August 22, 2019 03:26

PR changed

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 23, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

antsmartian pushed a commit that referenced this pull request Aug 24, 2019
Since there's a comment about the 'base64' validation needed, and this
will result in a breaking change, so this should be removed.

PR-URL: #29201
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@antsmartian

Copy link
Copy Markdown
Contributor

Landed in d5c3837 πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰

@ghost
ghost deleted the NewBase64Check branch August 24, 2019 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. buffer Issues and PRs related to the buffer subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants