-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
crypto: add cipher update/final methods encoding validation #45990
crypto: add cipher update/final methods encoding validation #45990
Conversation
Review requested:
|
eba9755
to
9bbecff
Compare
9bbecff
to
449cc81
Compare
Sorry, some-how missed js lint error in test. Fixed it, also updated first commit message. Please approve run @VoltrexKeyva |
@VoltrexKeyva any chance to approve?) |
449cc81
to
1853424
Compare
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.
We can do perfectly fine without a new error. Here's a combined diff of my suggested changes.
1853424
to
47f8bc3
Compare
47f8bc3
to
ca20150
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
if (normalizedEncoding === undefined) { | ||
throw new ERR_UNKNOWN_ENCODING(encoding); | ||
} | ||
assert(false, 'Cannot change encoding'); |
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.
why throw error by assert? it will be some internal error, no?
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.
We can replace the assert with a coded error in a follow up
semver-major
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.
I think it is better to have a coded error, can I make the change? @panva
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.
Sure, best wait until this change lands.
Landed in 5a7d4a7 |
Adds encoding validation to update and final cipher methods.
Refs: #45189