mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
crypto: deprecate implicitly shortened GCM tags
This introduces a doc-only deprecation of using GCM authentication tags that are shorter than the cipher's block size, unless the user specified the authTagLength option. Refs: https://github.com/nodejs/node/issues/52327 PR-URL: https://github.com/nodejs/node/pull/52345 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
c82f3c9e80
commit
8f61b658de
6 files changed
+107
-2
No files matched your search
@@ -659,12 +659,12 @@ function _expectWarning(name, expected, code) {
|
||||
expected = [[expected, code]];
|
||||
} else if (!Array.isArray(expected)) {
|
||||
expected = Object.entries(expected).map(([a, b]) => [b, a]);
|
||||
} else if (!(Array.isArray(expected[0]))) {
|
||||
} else if (expected.length !== 0 && !Array.isArray(expected[0])) {
|
||||
expected = [[expected[0], expected[1]]];
|
||||
}
|
||||
// Deprecation codes are mandatory, everything else is not.
|
||||
if (name === 'DeprecationWarning') {
|
||||
expected.forEach(([_, code]) => assert(code, expected));
|
||||
expected.forEach(([_, code]) => assert(code, `Missing deprecation code: ${expected}`));
|
||||
}
|
||||
return mustCall((warning) => {
|
||||
const expectedProperties = expected.shift();
|
||||
|
||||
Reference in new issue
Block a user