-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: remove the comment of base64 validation #29201
Conversation
There was a problem hiding this comment.
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.
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. |
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. |
Since there's a comment about the 'base64' validation needed, and this will result in a breaking change, so this should be removed.
@addaleax,OK, I've removed this comment to keep it clear. |
@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 |
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 <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Landed in d5c3837 🎉 🎉 🎉 🎉 |
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), orvcbuild test
(Windows) passes