Skip to content

Commit 969398d

Browse files
tniessenMylesBorins
authored andcommitted
crypto: reuse variable instead of reevaluation
Backport-PR-URL: #19115 PR-URL: #17735 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
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

Lines changed: 2 additions & 2 deletions
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)