-
Notifications
You must be signed in to change notification settings - Fork 30k
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: use kNoAuthTagLength in InitAuthenticated #20225
crypto: use kNoAuthTagLength in InitAuthenticated #20225
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.
LGTM modulo comment.
src/node_crypto.cc
Outdated
int auth_tag_len = args[2].As<v8::Int32>()->Value(); | ||
unsigned int auth_tag_len; | ||
if (args[2]->IsUint32()) { | ||
auth_tag_len = args[2]->Uint32Value(); |
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.
Can you use the overload that takes a Local<Context>
or use the args[2].As<Uint32>()->Value()
idiom?
src/node_crypto.cc
Outdated
@@ -2705,9 +2705,9 @@ void CipherBase::Init(const FunctionCallbackInfo<Value>& args) { | |||
// represent a valid length at this point. | |||
unsigned int auth_tag_len; | |||
if (args[2]->IsUint32()) { | |||
auth_tag_len = args[2]->Uint32Value(); | |||
auth_tag_len = args[2].As<v8::Uint32>()->Value(); |
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.
Can you add using v8::Uint32;
and using v8::Int32;
at the top?
PR-URL: #20225 Refs: #20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
PR-URL: #20225 Refs: #20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Should this be backported to |
PR-URL: nodejs#20225 Refs: nodejs#20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
PR-URL: nodejs#20225 Refs: nodejs#20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Backport-PR-URL: #20706 PR-URL: #20225 Refs: #20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Backport-PR-URL: #20706 PR-URL: #20225 Refs: #20039 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
As suggested by @bnoordhuis in #20039, this changes
InitAuthenticated
to accept anunsigned int auth_tag_len
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes