crypto: add using directives for v8::Int32, Uint32
PR-URL: https://github.com/nodejs/node/pull/20225 Refs: https://github.com/nodejs/node/pull/20039 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
4809db9317
commit
9d35f696e8
@ -72,6 +72,7 @@ using v8::External;
|
||||
using v8::FunctionCallbackInfo;
|
||||
using v8::FunctionTemplate;
|
||||
using v8::HandleScope;
|
||||
using v8::Int32;
|
||||
using v8::Integer;
|
||||
using v8::Isolate;
|
||||
using v8::Local;
|
||||
@ -84,6 +85,7 @@ using v8::PropertyAttribute;
|
||||
using v8::ReadOnly;
|
||||
using v8::Signature;
|
||||
using v8::String;
|
||||
using v8::Uint32;
|
||||
using v8::Value;
|
||||
|
||||
|
||||
@ -2705,9 +2707,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].As<v8::Uint32>()->Value();
|
||||
auth_tag_len = args[2].As<Uint32>()->Value();
|
||||
} else {
|
||||
CHECK(args[2]->IsInt32() && args[2].As<v8::Int32>()->Value() == -1);
|
||||
CHECK(args[2]->IsInt32() && args[2].As<Int32>()->Value() == -1);
|
||||
auth_tag_len = kNoAuthTagLength;
|
||||
}
|
||||
|
||||
@ -2799,9 +2801,9 @@ void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
|
||||
// represent a valid length at this point.
|
||||
unsigned int auth_tag_len;
|
||||
if (args[3]->IsUint32()) {
|
||||
auth_tag_len = args[3].As<v8::Uint32>()->Value();
|
||||
auth_tag_len = args[3].As<Uint32>()->Value();
|
||||
} else {
|
||||
CHECK(args[3]->IsInt32() && args[3].As<v8::Int32>()->Value() == -1);
|
||||
CHECK(args[3]->IsInt32() && args[3].As<Int32>()->Value() == -1);
|
||||
auth_tag_len = kNoAuthTagLength;
|
||||
}
|
||||
|
||||
@ -3002,7 +3004,7 @@ void CipherBase::SetAAD(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
CHECK_EQ(args.Length(), 2);
|
||||
CHECK(args[1]->IsInt32());
|
||||
int plaintext_len = args[1].As<v8::Int32>()->Value();
|
||||
int plaintext_len = args[1].As<Int32>()->Value();
|
||||
|
||||
if (!cipher->SetAAD(Buffer::Data(args[0]), Buffer::Length(args[0]),
|
||||
plaintext_len))
|
||||
|
Loading…
x
Reference in New Issue
Block a user