This repository was archived by the owner on Apr 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
tls: disable RC4, add --cipher-list command line switch #14414
Closed
jasnell
wants to merge
2
commits into
nodejs:v0.12.2-release
from
jasnell:v0.12.2-update-cipher-suite-with-switches
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright Joyent, Inc. and other Node contributors. | ||
| // | ||
| // Permission is hereby granted, free of charge, to any person obtaining a | ||
| // copy of this software and associated documentation files (the | ||
| // "Software"), to deal in the Software without restriction, including | ||
| // without limitation the rights to use, copy, modify, merge, publish, | ||
| // distribute, sublicense, and/or sell copies of the Software, and to permit | ||
| // persons to whom the Software is furnished to do so, subject to the | ||
| // following conditions: | ||
| // | ||
| // The above copyright notice and this permission notice shall be included | ||
| // in all copies or substantial portions of the Software. | ||
| // | ||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
| // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
| // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
| // USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
| var spawn = require('child_process').spawn; | ||
| var assert = require('assert'); | ||
| var tls = require('tls'); | ||
|
|
||
| function doTest(checklist, env, useswitch) { | ||
| var options; | ||
| if (env && useswitch === 1) { | ||
| options = {env:env}; | ||
| } | ||
| var args = ['-e', 'console.log(require(\'tls\').DEFAULT_CIPHERS)']; | ||
|
|
||
| switch(useswitch) { | ||
| case 1: | ||
| // Test --cipher-test | ||
| args.unshift('--cipher-list=' + env); | ||
| break; | ||
| case 2: | ||
| // Test --enable-legacy-cipher-list | ||
| args.unshift('--enable-legacy-cipher-list=' + env); | ||
| break; | ||
| case 3: | ||
| // Test NODE_LEGACY_CIPHER_LIST | ||
| if (env) options = {env:{"NODE_LEGACY_CIPHER_LIST": env}}; | ||
| break; | ||
| default: | ||
| // Test NODE_CIPHER_LIST | ||
| if (env) options = {env:env}; | ||
| } | ||
|
|
||
| var out = ''; | ||
| spawn(process.execPath, args, options). | ||
| stdout. | ||
| on('data', function(data) { | ||
| out += data; | ||
| }). | ||
| on('end', function() { | ||
| assert.equal(out.trim(), checklist); | ||
| }); | ||
| } | ||
|
|
||
| doTest(tls.DEFAULT_CIPHERS); // test the default | ||
| doTest('ABC', {'NODE_CIPHER_LIST':'ABC'}); // test the envar | ||
| doTest('ABC', 'ABC', 1); // test the --cipher-list switch | ||
|
|
||
| ['v0.10.38', 'v0.10.39', 'v0.12.2'].forEach(function(ver) { | ||
| doTest(tls.getLegacyCiphers(ver), ver, 2); | ||
| doTest(tls.getLegacyCiphers(ver), ver, 3); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paraphrasing my previous comment for the corresponding PR targeted to v0.10.x:
I'm wondering if we need to support a
--cipher-listcommand line option in v0.12.x. Adding support for--enable-legacy-cipher-listalready breaks the contract of not adding additional API in patch releases, and it seems sufficient to handle the use case of users not wanting to use the new default ciphers list.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent on introducing --cipher-list in v0.10.x and v0.12.x is to avoid
the possibility of having to make these kinds of changes in the future. If,
for instance, another one of the default ciphers comes under scrutiny and
we have to switch it off, rather than having to bump the maintenance
release again we can simply tell folks to use the command line switch or
envar to override the list entirely and go from there.
On Tue, Apr 7, 2015 at 5:29 PM, Julien Gilli [email protected]
wrote: