Skip to content

Commit

Permalink
src: rename return var in VerifySpkac functions
Browse files Browse the repository at this point in the history
This commit renames the verification result variable, that is currently
named i, to verify_result.

PR-URL: #20218
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and MylesBorins committed May 4, 2018
1 parent a4dae6c commit bd2e521
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5148,7 +5148,7 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) {


bool VerifySpkac(const char* data, unsigned int len) {
bool i = false;
bool verify_result = false;
EVP_PKEY* pkey = nullptr;
NETSCAPE_SPKI* spki = nullptr;

Expand All @@ -5160,7 +5160,7 @@ bool VerifySpkac(const char* data, unsigned int len) {
if (pkey == nullptr)
goto exit;

i = NETSCAPE_SPKI_verify(spki, pkey) > 0;
verify_result = NETSCAPE_SPKI_verify(spki, pkey) > 0;

exit:
if (pkey != nullptr)
Expand All @@ -5169,23 +5169,23 @@ bool VerifySpkac(const char* data, unsigned int len) {
if (spki != nullptr)
NETSCAPE_SPKI_free(spki);

return i;
return verify_result;
}


void VerifySpkac(const FunctionCallbackInfo<Value>& args) {
bool i = false;
bool verify_result = false;

size_t length = Buffer::Length(args[0]);
if (length == 0)
return args.GetReturnValue().Set(i);
return args.GetReturnValue().Set(verify_result);

char* data = Buffer::Data(args[0]);
CHECK_NE(data, nullptr);

i = VerifySpkac(data, length);
verify_result = VerifySpkac(data, length);

args.GetReturnValue().Set(i);
args.GetReturnValue().Set(verify_result);
}


Expand Down

0 comments on commit bd2e521

Please sign in to comment.