Skip to content

Commit 44cb0d3

Browse files
tniessenMylesBorins
authored andcommitted
crypto: reuse variable instead of reevaluation
Backport-PR-URL: nodejs#19114 PR-URL: nodejs#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 bc66f08 commit 44cb0d3

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
@@ -3449,7 +3449,7 @@ void CipherBase::Init(const char* cipher_type,
34493449
nullptr,
34503450
reinterpret_cast<unsigned char*>(key),
34513451
reinterpret_cast<unsigned char*>(iv),
3452-
kind_ == kCipher);
3452+
encrypt);
34533453
}
34543454

34553455

@@ -3518,7 +3518,7 @@ void CipherBase::InitIv(const char* cipher_type,
35183518
nullptr,
35193519
reinterpret_cast<const unsigned char*>(key),
35203520
reinterpret_cast<const unsigned char*>(iv),
3521-
kind_ == kCipher);
3521+
encrypt);
35223522
}
35233523

35243524

0 commit comments

Comments
 (0)