summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-04-23 07:11:09 +0200
committerAnna Henningsen <anna@addaleax.net>2018-05-14 19:18:00 +0200
commitfd5adbc9c3cb9342d9a698505af4d37bb6134d4f (patch)
tree820d999ac7211070107624e218eb67e6bb29498b
parent5ea1a58db90a9bd9df2a93e1b45333925668c6cc (diff)
downloadnode-new-fd5adbc9c3cb9342d9a698505af4d37bb6134d4f.tar.gz
src: fix node_crypto.cc compiler warnings
Currently the following compiler warnings are issued by clang: ../src/node_crypto.cc:2801:56: warning: '&&' within '||' [-Wlogical-op-parentheses] return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16; ~~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ../src/node_crypto.cc:2801:56: note: place parentheses around the '&&' expression to silence this warning return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16; ^ ../src/node_crypto.cc:2925:51: warning: '&&' within '||' [-Wlogical-op-parentheses] if (cipher->auth_tag_len_ != kNoAuthTagLength && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ ../src/node_crypto.cc:2925:51: note: place parentheses around the '&&' expression to silence this warning if (cipher->auth_tag_len_ != kNoAuthTagLength && ^ This commit adds parenthesis around these expressions to silence the warnings. Backport-PR-URL: https://github.com/nodejs/node/pull/20706 PR-URL: https://github.com/nodejs/node/pull/20216 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--src/node_crypto.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index f9cb015f0b..07f221c02a 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2791,7 +2791,7 @@ void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
static bool IsValidGCMTagLength(unsigned int tag_len) {
- return tag_len == 4 || tag_len == 8 || tag_len >= 12 && tag_len <= 16;
+ return tag_len == 4 || tag_len == 8 || (tag_len >= 12 && tag_len <= 16);
}
bool CipherBase::InitAuthenticated(const char *cipher_type, int iv_len,