summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2017-12-22 18:51:33 +0100
committerJames M Snell <jasnell@gmail.com>2018-04-14 10:50:47 -0700
commitd81a7b4baae32efd63b8c9595c654502d64be4e3 (patch)
tree3d4e165de48af8ad28dac089faef59fd3238c90b /src
parent2b0825e77feb262cf862982cabf7a67bf58f4d5b (diff)
downloadandroid-node-v8-d81a7b4baae32efd63b8c9595c654502d64be4e3.tar.gz
android-node-v8-d81a7b4baae32efd63b8c9595c654502d64be4e3.tar.bz2
android-node-v8-d81a7b4baae32efd63b8c9595c654502d64be4e3.zip
crypto: throw on invalid authentication tag length
Refs: https://github.com/nodejs/node/issues/17523 PR-URL: https://github.com/nodejs/node/pull/17825 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 50a8b6942b..1a1eca297b 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2912,11 +2912,10 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
const int mode = EVP_CIPHER_CTX_mode(cipher->ctx_);
if (mode == EVP_CIPH_GCM_MODE) {
if (tag_len > 16 || (tag_len < 12 && tag_len != 8 && tag_len != 4)) {
- char msg[125];
+ char msg[50];
snprintf(msg, sizeof(msg),
- "Permitting authentication tag lengths of %u bytes is deprecated. "
- "Valid GCM tag lengths are 4, 8, 12, 13, 14, 15, 16.", tag_len);
- ProcessEmitDeprecationWarning(cipher->env(), msg, "DEP0090");
+ "Invalid GCM authentication tag length: %u", tag_len);
+ return cipher->env()->ThrowError(msg);
}
}