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: use the most recently added matching SecureContext in default SNICallback. #34638

Closed
wants to merge 365 commits into from

Conversation

mkrawczuk
Copy link
Contributor

@mkrawczuk mkrawczuk commented Aug 5, 2020

Fixes: #34110

  • 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

@nodejs-github-bot
Copy link
Collaborator

@masx200
Copy link
Contributor

masx200 commented Aug 5, 2020

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse

The reverse() method reverses an array in place. The first array element becomes the last, and the last array element becomes the first.

Array.prototype.reverse() This method will change the original array, which produces unnecessary side effects and will cause a great performance loss.

@masx200
Copy link
Contributor

masx200 commented Aug 5, 2020

We should not use the Array.prototype.reverse() method. For the same servername, when the server.addContext and SNICallback method is used more than 2 times, an error will occur in half of the cases.

@masx200
Copy link
Contributor

masx200 commented Aug 5, 2020

#34444

Since we are solving the same problem, could you help me write a test for this pull request?

https://github.com/masx200/node/tree/patch-2

@masx200
Copy link
Contributor

masx200 commented Aug 6, 2020

#34110

@mkrawczuk
Copy link
Contributor Author

Thank you @masx200 , good catch.

Unfortunately, your PR contains numerous linting errors that you should be aware of, if you actually ran make -j4 test.
Please read the contributing guidelines:
https://github.com/nodejs/node/blob/master/CONTRIBUTING.md

Regarding tests - below guide for writing tests should be helpful:
https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md
When writing a new tests, I usually get a lot of inspiration from other tests in the test/ catalog.

@Trott
Copy link
Member

Trott commented Aug 10, 2020

It seems that there are two competing PRs for this? Which one should land?

@mkrawczuk
Copy link
Contributor Author

Well I reported the issue and stated I have a WIP fix. And the other one still has multiple unresolved ssues.

@mkrawczuk
Copy link
Contributor Author

Seems to have gotten a little stuck. What do we need to move further?
cc @Trott @addaleax @bnoordhuis

@Trott
Copy link
Member

Trott commented Sep 22, 2020

@nodejs/crypto

watilde and others added 16 commits October 16, 2020 11:43
Refs: web-platform-tests/wpt#25987

PR-URL: nodejs#35636
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
It is already installed in the GitHub runners.

PR-URL: nodejs#35638
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The other way is deprecated.

PR-URL: nodejs#35638
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This adds support for DNS Certification Authority Authorization
(RFC 8659) to Node.js.

PR-URL: nodejs#35466
Fixes: nodejs#19239
Refs: nodejs#14713
Reviewed-By: Anna Henningsen <anna@addaleax.net>
0 is deprecated. Change to 1, which is experimental.

PR-URL: nodejs#35672
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#35642
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Since the section refers to EventEmitter, instances in the example
should be created of the same class EventEmitter.

PR-URL: nodejs#33513
Reviewed-By: James M Snell <jasnell@gmail.com>
Currently we are returning the stringified error code while in other
process methods we are throwin a UVException and only exclusion is in
the CPUUsage. Converted it to follow the convention.

PR-URL: nodejs#34762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs#35086
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#35522
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Use `common.mustCall` and `util.debuglog`. Remove unnecessary functions

PR-URL: nodejs#32805
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#35690
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#35653
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: nodejs#35657
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#35593
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This is in preparation for updating remark-preset-lint-node to 1.17.1.

PR-URL: nodejs#35668
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danbev and others added 6 commits November 9, 2020 11:02
Original commit message:
  Fix alloc/dealloc size mismatch for v8::BackingStore

  On newer compilers the {operator delete} with explicit {size_t}
  argument would be instantiated for {v8::BackingStore} and used
  in the destructor of {std::unique_ptr<v8::BackingStore>}. The {size_t}
  argument is wrong though, since the pointer actually points
  to a {v8::internal::BackingStore} object.
  The solution is to explicitly provide a {operator delete}, preventing
  an implicitly generated {size_t} operator.

  Bug:v8:11081

  Change-Id: Iee0aa47a67f0e41000bea628942f7e3d70198b83
  Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2506712
  Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
  Reviewed-by: Camillo Bruni <cbruni@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#70916}

PR-URL: nodejs#35939
Fixes: nodejs#35669
Refs: v8/v8@9a49b22
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
A test was added for this in 6f34498 but because it was a test in the
`internet` directory, it was not run on CI and it was not noticed that
the test was failing. This fixes the error that was causing the test to
fail.

PR-URL: nodejs#35979
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#36017
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#27413
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#32655
Fixes: nodejs#32559
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
PR-URL: nodejs#34543
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
@aduh95
Copy link
Contributor

aduh95 commented Nov 9, 2020

@mkrawczuk can you fix the linter issue please?

13:01:05 �[4m�[33mdoc/api/crypto.md�[39m�[24m
13:01:05   1455:1-1475:4  �[33mwarning�[39m  changes[1]: list of versions is not in order  nodejs-yaml-comments  remark-lint
13:01:05   1578:1-1598:4  �[33mwarning�[39m  changes[1]: list of versions is not in order  nodejs-yaml-comments  remark-lint
13:01:05   3325:1-3333:4  �[33mwarning�[39m  changes[0]: list of versions is not in order  nodejs-yaml-comments  remark-lint
13:01:05   3393:1-3404:4  �[33mwarning�[39m  changes[1]: list of versions is not in order  nodejs-yaml-comments  remark-lint

@aduh95 aduh95 added stalled Issues and PRs that are stalled. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 9, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2020

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

lundibundi and others added 17 commits November 9, 2020 19:00
Refs: nodejs#34944 (comment)
Co-authored-by: Anna Henningsen <anna@addaleax.net>

PR-URL: nodejs#35000
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs#35197
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
In stream write encoding can be null.

Fixes: nodejs#33715

PR-URL: nodejs#35372
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#35633
Fixes: nodejs#35600
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#35999
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
`EventTarget` is exposed on the global scope, there is no need to use
`--expose-internals` flag in the tests.

Refs: nodejs#35496

PR-URL: nodejs#36002
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
nodejs#35993 (comment)

PR-URL: nodejs#35995
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#36024
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Make the linter recommend replacing `globalThis.Map` by
`primordials.SafeMap`, and similar for `Set`, `WeakSet`, and `WeakMap`.

PR-URL: nodejs#36026
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
PR-URL: nodejs#35679
Fixes: nodejs#35629
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#36012
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Don't write to a stream which already has a full buffer.

Fixes: nodejs#35341

PR-URL: nodejs#35348
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Search the default installation path for NASM installed by a user
without administrator privileges when not found on the Path or in
the default system-wide installation path.

PR-URL: nodejs#36014
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@mkrawczuk
Copy link
Contributor Author

@aduh95 rebasing on top of fresh master seems to have fixed the linter issue. However looks like I broke this PR with a merge. Closing it and opening a new one: #36072

@mkrawczuk mkrawczuk closed this Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review wanted PRs that need reviews. stalled Issues and PRs that are stalled. tls Issues and PRs related to the tls subsystem.
Projects
None yet