Skip to content

Commit 969398d

Browse files
tniessenMylesBorins
authored andcommittedMar 30, 2018
crypto: reuse variable instead of reevaluation
Backport-PR-URL: #19115 PR-URL: #17735 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 4d2efa2 commit 969398d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/node_crypto.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -3256,7 +3256,7 @@ void CipherBase::Init(const char* cipher_type,
32563256
nullptr,
32573257
reinterpret_cast<unsigned char*>(key),
32583258
reinterpret_cast<unsigned char*>(iv),
3259-
kind_ == kCipher);
3259+
encrypt);
32603260
initialised_ = true;
32613261
}
32623262

@@ -3324,7 +3324,7 @@ void CipherBase::InitIv(const char* cipher_type,
33243324
nullptr,
33253325
reinterpret_cast<const unsigned char*>(key),
33263326
reinterpret_cast<const unsigned char*>(iv),
3327-
kind_ == kCipher);
3327+
encrypt);
33283328
initialised_ = true;
33293329
}
33303330

0 commit comments

Comments
 (0)
Please sign in to comment.