crypto: throw on invalid authentication tag length#17825
crypto: throw on invalid authentication tag length#17825tniessen wants to merge 3 commits intonodejs:masterfrom
Conversation
|
cc @nodejs/crypto @willclarktech |
42d00bb to
dc0f9f0
Compare
|
ping @nodejs/crypto |
|
ping @nodejs/tsc as this is a semver-major change |
src/node_crypto.cc
Outdated
There was a problem hiding this comment.
I would prefer keeping the invalid tag_len in the message for debuggability, but it's not blocking.
|
By the way, the original deprecation does not seem to appear in |
That's a good idea, I will open a PR. |
5a09d9f to
5debc52
Compare
|
What is blocking this? |
5debc52 to
6ee8771
Compare
6ee8771 to
2e68afc
Compare
|
@joyeecheung PTAL :) |
|
Failure in CI is unrelated. |
|
I'm going to land this but I'm not going to pull it in to 10.x |
Refs: #17523 PR-URL: #17825 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #17825 Refs: #17523 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #17825 Refs: #17523 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
@jasnell Thank you, this was part of the 11.0.0 milestone and was not supposed to land on node 10 :) |
The current implementation performs limited checks only and silently ignores superfluous bytes of the authentication tag. This change makes setAuthTag throw when - the user-specified authTagLength does not match the actual tag length, especially when the authentication tag is longer than 16 bytes, and when - the mode is GCM, no authTagLength option has been specified and the tag length is not a valid GCM tag length. This change makes the conditional assignment in SetAuthTag unnecessary, which is replaced with a CHECK. Refs: nodejs#17825
The current implementation performs limited checks only and silently ignores superfluous bytes of the authentication tag. This change makes setAuthTag throw when - the user-specified authTagLength does not match the actual tag length, especially when the authentication tag is longer than 16 bytes, and when - the mode is GCM, no authTagLength option has been specified and the tag length is not a valid GCM tag length. This change makes the conditional assignment in SetAuthTag unnecessary, which is replaced with a CHECK. Refs: #17825 PR-URL: #20040 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Yihong Wang <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Given that #17825 and #20039 have landed on master, this statement is no longer true. PR-URL: #21445 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
This is a follow-up to #17566.
Refs: #17523
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
crypto