summaryrefslogtreecommitdiff
path: root/src/node_crypto.h
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-04-13 18:02:46 +0200
committerTobias Nießen <tniessen@tnie.de>2018-04-23 01:55:09 +0200
commit358d8ffad650b6fb966082e7bd1460b0d6a4eacc (patch)
treeff6262822e193167ec4758a92cea0bf03216d33f /src/node_crypto.h
parent854f840243b0b531f9569f9304a6810b01bd9778 (diff)
downloadandroid-node-v8-358d8ffad650b6fb966082e7bd1460b0d6a4eacc.tar.gz
android-node-v8-358d8ffad650b6fb966082e7bd1460b0d6a4eacc.tar.bz2
android-node-v8-358d8ffad650b6fb966082e7bd1460b0d6a4eacc.zip
crypto: allow to restrict valid GCM tag length
This change allows users to restrict accepted GCM authentication tag lengths to a single value. PR-URL: https://github.com/nodejs/node/pull/20039 Fixes: https://github.com/nodejs/node/issues/17523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yihong Wang <yh.wang@ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r--src/node_crypto.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 2f7c904ee9..3c166f5dcc 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -359,6 +359,7 @@ class CipherBase : public BaseObject {
kErrorMessageSize,
kErrorState
};
+ static const unsigned kNoAuthTagLength = static_cast<unsigned>(-1);
void Init(const char* cipher_type,
const char* key_buf,
@@ -398,7 +399,7 @@ class CipherBase : public BaseObject {
ctx_(nullptr),
kind_(kind),
auth_tag_set_(false),
- auth_tag_len_(0),
+ auth_tag_len_(kNoAuthTagLength),
pending_auth_failed_(false) {
MakeWeak<CipherBase>(this);
}