Skip to content

crypto: throw on invalid authentication tag length - #17825

Closed
tniessen wants to merge 3 commits into
nodejs:masterfrom
tniessen:throw-auth-tag-length
Closed

crypto: throw on invalid authentication tag length#17825
tniessen wants to merge 3 commits into
nodejs:masterfrom
tniessen:throw-auth-tag-length

Conversation

@tniessen

@tniessentniessen commented Dec 22, 2017

Copy link
Copy Markdown
Member

This is a follow-up to #17566.

Refs: #17523

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

crypto

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Dec 22, 2017
@tniessen

Copy link
Copy Markdown
MemberAuthor

cc @nodejs/crypto @willclarktech

@tniessentniessen added notable-change PRs with changes that should be highlighted in changelogs. semver-major PRs that contain breaking changes and should be released in the next major version. labels Dec 22, 2017
@tniessen
tniessenforce-pushed the throw-auth-tag-length branch 2 times, most recently from 42d00bb to dc0f9f0CompareDecember 28, 2017 18:16
@tniessen

Copy link
Copy Markdown
MemberAuthor

ping @nodejs/crypto

@tniessen

Copy link
Copy Markdown
MemberAuthor

ping @nodejs/tsc as this is a semver-major change

Comment threadsrc/node_crypto.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer keeping the invalid tag_len in the message for debuggability, but it's not blocking.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, done! :)

@joyeecheung

joyeecheung commented Jan 6, 2018

Copy link
Copy Markdown
Member

By the way, the original deprecation does not seem to appear in deprecations.md, should we assign a code for it and move it to end-of-life now?

@tniessen

Copy link
Copy Markdown
MemberAuthor

By the way, the original deprecation does not seem to appear in deprecations.md, should we assign a code for it and move it to end-of-life now?

That's a good idea, I will open a PR.

@tniessentniessen added the blocked PRs that are blocked by other issues or PRs. label Jan 11, 2018
@tniessentniessen added this to the 11.0.0 milestone Jan 11, 2018
@ChALkeRChALkeR added the security Issues and PRs related to security. label Jan 27, 2018
@targos

Copy link
Copy Markdown
Member

What is blocking this?

@tniessen

Copy link
Copy Markdown
MemberAuthor

@targos This cannot be landed in the same semver-major release as #18017 (at least that's what I assume is our rule for deprecation cycles).

@tniessen
tniessenforce-pushed the throw-auth-tag-length branch from 5debc52 to 6ee8771CompareApril 11, 2018 11:54
@tniessen
tniessenforce-pushed the throw-auth-tag-length branch from 6ee8771 to 2e68afcCompareApril 11, 2018 12:00
@tniessentniessen removed the blocked PRs that are blocked by other issues or PRs. label Apr 11, 2018
@tniessen

Copy link
Copy Markdown
MemberAuthor

@tniessen

Copy link
Copy Markdown
MemberAuthor

@joyeecheung PTAL :)

@jasnell

Copy link
Copy Markdown
Member

Failure in CI is unrelated.

@jasnell

Copy link
Copy Markdown
Member

I'm going to land this but I'm not going to pull it in to 10.x

jasnell pushed a commit that referenced this pull request Apr 14, 2018
Refs: #17523
PR-URL: #17825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Apr 14, 2018
PR-URL: #17825
Refs: #17523
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Apr 14, 2018
PR-URL: #17825
Refs: #17523
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in d81a7b4, cf35085, and 985d180

@jasnelljasnell closed this Apr 14, 2018
@tniessen

Copy link
Copy Markdown
MemberAuthor

I'm going to land this but I'm not going to pull it in to 10.x

@jasnell Thank you, this was part of the 11.0.0 milestone and was not supposed to land on node 10 :)

@tniessentniessen added the deprecations Issues and PRs related to deprecations. label Apr 28, 2018
tniessen added a commit to tniessen/node that referenced this pull request May 23, 2018
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
tniessen added a commit that referenced this pull request Jun 1, 2018
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 <daniel.bevenius@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
@tniessentniessen mentioned this pull request Jun 21, 2018
3 tasks
targos pushed a commit that referenced this pull request Jun 24, 2018
Given that #17825 and
#20039 have landed on master, this
statement is no longer true.
PR-URL: #21445
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.cryptoIssues and PRs related to the crypto subsystem.deprecationsIssues and PRs related to deprecations.notable-changePRs with changes that should be highlighted in changelogs.securityIssues and PRs related to security.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@tniessen@joyeecheung@targos@jasnell@bnoordhuis@ChALkeR@nodejs-github-bot