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

crypto: Remove unused access of tlsext_hostname. #10882

Closed
wants to merge 1 commit into from

Conversation

davidben
Copy link
Contributor

The return value of loadSession is ultimately ignored, so don't fill it in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid. It dates to 048e0e7 when the SNI value was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the input and return NULL.

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

crypto

@nodejs-github-bot nodejs-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. tls Issues and PRs related to the tls subsystem. lts-watch-v6.x labels Jan 18, 2017
@@ -1816,17 +1816,6 @@ void SSLWrap<Base>::LoadSession(const FunctionCallbackInfo<Value>& args) {
if (w->next_sess_ != nullptr)
SSL_SESSION_free(w->next_sess_);
w->next_sess_ = sess;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just left the error case silently ignoring it. Happy to change it if you'd prefer something else.

@@ -0,0 +1,94 @@
'use strict';
const common = require('../common');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is basically entirely copied from test-tls-session-cache.js with tweaks, so it's probably doing more than it actually needs to.

Copy link
Contributor

Choose a reason for hiding this comment

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

can you just add the condition you are testing to test-tls-session-cache.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@mscdex mscdex removed the crypto Issues and PRs related to the crypto subsystem. label Jan 18, 2017
@mscdex
Copy link
Contributor

mscdex commented Jan 18, 2017

/cc @indutny

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM but would it be possible to merge the test into the existing test? It's duplicating quite a bit of finicky code right now.

@davidben
Copy link
Contributor Author

@bnoordhuis Oh yeah, that's much tidier. Done.

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

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. CI: https://ci.nodejs.org/job/node-test-pull-request/5946/

It's possible the ARM buildbots report failure while the status is green when you click through. Known issue, can be safely ignored.

Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

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

Please run make test - the linter failure is real.

@davidben
Copy link
Contributor Author

@sam-github Oops. Fixed.

@bnoordhuis
Copy link
Member

@davidben
Copy link
Contributor Author

I see some red in that link, but I'm not sure how to read it. What's the error?

@sam-github
Copy link
Contributor

test/arm is known to fail, sqaush and force push, and I'll retest

@sam-github
Copy link
Contributor

also, rebase against master

@sam-github
Copy link
Contributor

And fix the commit message, it should be

crypto: remove unused access of tlsext_hostname

No capital, no period.

The return value of loadSession is ultimately ignored, so don't fill it
in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid.
It dates to 048e0e7 when the SNI value
was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the
input and return NULL. Add a test for this case based on
test-tls-session-cache.js.
@davidben
Copy link
Contributor Author

davidben commented Jan 25, 2017

Squashed and rebased (and comment reworded).

@jasnell
Copy link
Member

jasnell commented Feb 2, 2017

ping @sam-github

@sam-github
Copy link
Contributor

Landed in e34ee1d

@sam-github sam-github closed this Feb 13, 2017
sam-github pushed a commit that referenced this pull request Feb 13, 2017
The return value of loadSession is ultimately ignored, so don't fill it
in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid.
It dates to 048e0e7 when the SNI value
was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the
input and return NULL. Add a test for this case based on
test-tls-session-cache.js.

PR-URL: #10882
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
The return value of loadSession is ultimately ignored, so don't fill it
in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid.
It dates to 048e0e7 when the SNI value
was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the
input and return NULL. Add a test for this case based on
test-tls-session-cache.js.

PR-URL: nodejs#10882
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@ChALkeR ChALkeR mentioned this pull request Feb 15, 2017
2 tasks
@jasnell
Copy link
Member

jasnell commented Mar 7, 2017

needs a backport PR in order to land on v4 or v6

@davidben
Copy link
Contributor Author

davidben commented Mar 7, 2017

To clarify, is that a request for me to put one together or just a note for you all? (I'm not familiar with how your branching arrangement works.)

@jasnell
Copy link
Member

jasnell commented Mar 7, 2017

@davidben ... just a note :-) if someone felt that this needed to go into v6 or v4, then a manual backport would be required because the commit is not landing cleanly as is. Feel free to ignore :-)

@sam-github
Copy link
Contributor

I think we should backport as much as possible, not because we desperately need this PR, but because if we don't land it, subsequent PRs might start not backporting as easily due to conflicts.

@davidben if this applies to 6.x and 4.x (it looks like it would), do you have time to backport?

@davidben
Copy link
Contributor Author

davidben commented Mar 8, 2017

Looks like the reason it doesn't apply cleanly is because of #10685 and #10698 which were not backported. Though those two really don't apply cleanly. :-)

I dunno how far back you want to go here. Doing just the merge is straightforward enough; I can either switch all my lets back to vars and strictEquals to equals or leave them alone and assume the existing lines will be done by a future backport. Dunno if that would just cause more trouble by getting things out of order. (Do you intend to backport those two?)

@sam-github
Copy link
Contributor

Its not clear at this moment what should be backported. Lets wait and see. @gibfahn did the two PRs you mentioned by running eslint in fixup mode, it would probably be easier to repeat that than to actually backport.

@gibfahn
Copy link
Member

gibfahn commented Mar 9, 2017

@davidben Yep, let me backport those two PRs first.

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++. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants