From 1e5de6fe973a6f9a6b2d2c11003bb300debfb890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 24 Apr 2018 16:21:27 +0200 Subject: [PATCH] crypto: add using directives for v8::Int32, Uint32 Backport-PR-URL: https://github.com/nodejs/node/pull/20706 PR-URL: https://github.com/nodejs/node/pull/20225 Refs: https://github.com/nodejs/node/pull/20039 Reviewed-By: James M Snell Reviewed-By: Daniel Bevenius Reviewed-By: Ben Noordhuis --- src/node_crypto.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fc6368536707f4..61232aa6ebf3e8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -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; @@ -2698,9 +2700,9 @@ void CipherBase::Init(const FunctionCallbackInfo& args) { // represent a valid length at this point. unsigned int auth_tag_len; if (args[2]->IsUint32()) { - auth_tag_len = args[2].As()->Value(); + auth_tag_len = args[2].As()->Value(); } else { - CHECK(args[2]->IsInt32() && args[2].As()->Value() == -1); + CHECK(args[2]->IsInt32() && args[2].As()->Value() == -1); auth_tag_len = kNoAuthTagLength; } @@ -2792,9 +2794,9 @@ void CipherBase::InitIv(const FunctionCallbackInfo& args) { // represent a valid length at this point. unsigned int auth_tag_len; if (args[3]->IsUint32()) { - auth_tag_len = args[3].As()->Value(); + auth_tag_len = args[3].As()->Value(); } else { - CHECK(args[3]->IsInt32() && args[3].As()->Value() == -1); + CHECK(args[3]->IsInt32() && args[3].As()->Value() == -1); auth_tag_len = kNoAuthTagLength; } @@ -2998,7 +3000,7 @@ void CipherBase::SetAAD(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 2); CHECK(args[1]->IsInt32()); - int plaintext_len = args[1].As()->Value(); + int plaintext_len = args[1].As()->Value(); if (!cipher->SetAAD(Buffer::Data(args[0]), Buffer::Length(args[0]), plaintext_len))