Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS cleanups #25861

Closed
wants to merge 6 commits into from
Closed

TLS cleanups #25861

wants to merge 6 commits into from

Conversation

sam-github
Copy link
Contributor

@sam-github sam-github commented Feb 1, 2019

Minor TLS cleanups, mostly small refactors for clarity, and updates to documentation, with a few lib/_tls_wrap debug statements thrown in.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Feb 1, 2019
Declaration is unused, it was added by mistake in 46c5c33.
Make it clear which of the multiple interfaces a TLSWrap method is
implementing by grouping and commenting the related methods.
`tls` shadows the global `tls` require, and isn't indicative of the
arument type.
- Don't use both break and return simultaneously.
- Use case:/UNREACHABLE() to enforce that all cases are handled, instead
  of CHECK().
The const_cast used to be necessary for SSL_get_app_data() in OpenSSL
0.9.7, but node doesn't compile against OpenSSL versions that old.
However, now it's needed for the recently introduced
SSL_renegotiate_pending(), which is not const-correct as of 1.1.1a.
@sam-github sam-github added the tls Issues and PRs related to the tls subsystem. label Feb 1, 2019
@sam-github
Copy link
Contributor Author

@nodejs/crypto

@sam-github
Copy link
Contributor Author

@nodejs/collaborators please take a look

Copy link
Member

@indutny indutny left a comment

Choose a reason for hiding this comment

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

LGTM

lib/_tls_wrap.js Show resolved Hide resolved
@sam-github
Copy link
Contributor Author

sam-github commented Feb 5, 2019

@joyeecheung git node land says "No CI runs detected" for this, but as you can see, there are. I could just land it, but maybe you are interested in taking a look? EDIT: This isn't the first time I've seen this lately, the other times I just wrote them off as flakiness, but maybe its a more persistent issue, so I'll leave this as a demo. I'm using git node 1.14.0.

@Trott
Copy link
Member

Trott commented Feb 5, 2019

@sam-github You probably need to add a CI: comment. I just tried and it said "No CI runs detected". Let's see what happens if we add this:

CI: https://ci.nodejs.org/job/node-test-pull-request/20516/

@Trott
Copy link
Member

Trott commented Feb 5, 2019

^^^^ Yup, adding that comment fixed it.

@sam-github
Copy link
Contributor Author

@Trott Thanks! I had no idea the comment was required.

@sam-github
Copy link
Contributor Author

sam-github commented Feb 5, 2019

Landed in b1cc1af...62b4796.

@sam-github sam-github closed this Feb 5, 2019
@sam-github sam-github deleted the tls-cleanups branch February 5, 2019 23:18
sam-github added a commit that referenced this pull request Feb 5, 2019
Declaration is unused, it was added by mistake in 46c5c33.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit that referenced this pull request Feb 5, 2019
Make it clear which of the multiple interfaces a TLSWrap method is
implementing by grouping and commenting the related methods.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit that referenced this pull request Feb 5, 2019
`tls` shadows the global `tls` require, and isn't indicative of the
arument type.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit that referenced this pull request Feb 5, 2019
- Don't use both break and return simultaneously.
- Use case:/UNREACHABLE() to enforce that all cases are handled, instead
  of CHECK().

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit that referenced this pull request Feb 5, 2019
The const_cast used to be necessary for SSL_get_app_data() in OpenSSL
0.9.7, but node doesn't compile against OpenSSL versions that old.
However, now it's needed for the recently introduced
SSL_renegotiate_pending(), which is not const-correct as of 1.1.1a.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit that referenced this pull request Feb 5, 2019
PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax pushed a commit that referenced this pull request Feb 6, 2019
Declaration is unused, it was added by mistake in 46c5c33.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax pushed a commit that referenced this pull request Feb 6, 2019
Make it clear which of the multiple interfaces a TLSWrap method is
implementing by grouping and commenting the related methods.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Feb 7, 2019
- Don't use both break and return simultaneously.
- Use case:/UNREACHABLE() to enforce that all cases are handled, instead
  of CHECK().

Backport-PR-URL: nodejs#25968
PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Feb 7, 2019
PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Backport-PR-URL: nodejs#25968
addaleax pushed a commit that referenced this pull request Feb 8, 2019
- Don't use both break and return simultaneously.
- Use case:/UNREACHABLE() to enforce that all cases are handled, instead
  of CHECK().

Backport-PR-URL: #25968
PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
addaleax pushed a commit that referenced this pull request Feb 8, 2019
PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Backport-PR-URL: #25968

Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@targos targos mentioned this pull request Feb 14, 2019
sam-github added a commit to sam-github/node that referenced this pull request Apr 29, 2019
Declaration is unused, it was added by mistake in 46c5c33.

PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Apr 29, 2019
Make it clear which of the multiple interfaces a TLSWrap method is
implementing by grouping and commenting the related methods.

PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Apr 29, 2019
`tls` shadows the global `tls` require, and isn't indicative of the
arument type.

PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Apr 29, 2019
The const_cast used to be necessary for SSL_get_app_data() in OpenSSL
0.9.7, but node doesn't compile against OpenSSL versions that old.
However, now it's needed for the recently introduced
SSL_renegotiate_pending(), which is not const-correct as of 1.1.1a.

PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
sam-github added a commit to sam-github/node that referenced this pull request Apr 29, 2019
- Don't use both break and return simultaneously.
- Use case:/UNREACHABLE() to enforce that all cases are handled, instead
  of CHECK().

Backport-PR-URL: nodejs#25968
PR-URL: nodejs#25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to 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++. lib / src Issues and PRs related to general changes in the lib or src directory. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants