diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000000..4aad29c328ab --- /dev/null +++ b/.clang-format @@ -0,0 +1,111 @@ +--- +Language: Cpp +# BasedOnStyle: Google +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: false +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^' + Priority: 2 + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +TabWidth: 8 +UseTab: Never diff --git a/.eslintrc.js b/.eslintrc.js index 98568dd9bc43..c2125133933f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -110,6 +110,7 @@ module.exports = { 'no-invalid-regexp': 'error', 'no-irregular-whitespace': 'error', 'no-lonely-if': 'error', + 'no-misleading-character-class': 'error', 'no-mixed-requires': 'error', 'no-mixed-spaces-and-tabs': 'error', 'no-multi-spaces': ['error', { ignoreEOLComments: true }], diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.md b/.github/ISSUE_TEMPLATE/1-bug-report.md new file mode 100644 index 000000000000..69b9bf63250f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug-report.md @@ -0,0 +1,24 @@ +--- +name: "\U0001F41B Bug report" +about: Create a report to help us improve + +--- + + + +* **Version**: +* **Platform**: +* **Subsystem**: + + diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.md b/.github/ISSUE_TEMPLATE/2-feature-request.md new file mode 100644 index 000000000000..0d40bfdd110b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature-request.md @@ -0,0 +1,20 @@ +--- +name: "\U0001F680 Feature request" +about: Suggest an idea for this project + +--- + + + +**Is your feature request related to a problem? Please describe.** +Please describe the problem you are trying to solve. + +**Describe the solution you'd like** +Please describe the desired behavior. + +**Describe alternatives you've considered** +Please describe alternative solutions or features you have considered. diff --git a/.github/ISSUE_TEMPLATE/3-help.md b/.github/ISSUE_TEMPLATE/3-help.md new file mode 100644 index 000000000000..f1a1acdfc70b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3-help.md @@ -0,0 +1,10 @@ +--- +name: "⁉️ Need help with Node.js?" +about: Please file an issue in our help repo. + +--- + +If you have a question about Node.js that is not a bug report or feature +request, please post it in https://github.com/nodejs/help! + +Questions posted to this repository will be closed. diff --git a/.github/ISSUE_TEMPLATE/4-nodejs-org.md b/.github/ISSUE_TEMPLATE/4-nodejs-org.md new file mode 100644 index 000000000000..917e560a50c0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/4-nodejs-org.md @@ -0,0 +1,11 @@ +--- +name: "\U0001F310 Found a problem with nodejs.org?" +about: Please file an issue in the Node.js website repo. + +--- + +If you have a question, suggestion or issue regarding our website, +please post it in https://github.com/nodejs/nodejs.org! + +Issues with the Node.js API documentation should be posted here. All other +issues regarding the website will be closed. diff --git a/.gitignore b/.gitignore index d8b381203b6a..255a4c5a4bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !test/fixtures/**/.* !tools/node_modules/**/.* !tools/doc/node_modules/**/.* +!.clang-format !.editorconfig !.eslintignore !.eslintrc.js @@ -106,8 +107,10 @@ deps/npm/node_modules/.bin/ /*.pkg /SHASUMS*.txt* +# api docs artifacts +tools/doc/node_modules + # test artifacts -tools/faketime tools/remark-cli/node_modules tools/remark-preset-lint-node/node_modules icu_config.gypi diff --git a/BUILDING.md b/BUILDING.md index d35211fc43b4..1f73422e6956 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -4,7 +4,7 @@ Depending on what platform or features you require, the build process may differ slightly. After you've successfully built a binary, running the test suite to validate that the binary works as intended is a good next step. -If you consistently can reproduce a test failure, search for it in the +If you can reproduce a test failure consistently, search for it in the [Node.js issue tracker](https://github.com/nodejs/node/issues) or file a new issue. @@ -34,7 +34,7 @@ Support is divided into three tiers: ### Supported platforms The community does not build or test against end-of-life distributions (EoL). -Thus we do not recommend that you use Node on end-of-life or unsupported +Thus, we do not recommend that you use Node on end-of-life or unsupported platforms in production. | System | Support type | Version | Architectures | Notes | diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b95caba105..54764cc3626c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,8 @@ release. -10.8.0
+10.9.0
+10.8.0
10.7.0
10.6.0
10.5.0
diff --git a/LICENSE b/LICENSE index 5dffdb791b08..7fc997b4f04d 100644 --- a/LICENSE +++ b/LICENSE @@ -1035,6 +1035,109 @@ The externally maintained libraries used by Node.js are: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ +- inspector_protocol, located at tools/inspector_protocol, is licensed as follows: + """ + // Copyright 2016 The Chromium Authors. All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are + // met: + // + // * Redistributions of source code must retain the above copyright + // notice, this list of conditions and the following disclaimer. + // * Redistributions in binary form must reproduce the above + // copyright notice, this list of conditions and the following disclaimer + // in the documentation and/or other materials provided with the + // distribution. + // * Neither the name of Google Inc. nor the names of its + // contributors may be used to endorse or promote products derived from + // this software without specific prior written permission. + // + // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ + +- jinja2, located at tools/jinja2, is licensed as follows: + """ + Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details. + + Some rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ + +- markupsafe, located at tools/markupsafe, is licensed as follows: + """ + Copyright (c) 2010 by Armin Ronacher and contributors. See AUTHORS + for more details. + + Some rights reserved. + + Redistribution and use in source and binary forms of the software as well + as documentation, with or without modification, are permitted provided + that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND + CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + """ + - cpplint.py, located at tools/cpplint.py, is licensed as follows: """ Copyright (c) 2009 Google Inc. All rights reserved. diff --git a/Makefile b/Makefile index 81dbd9f4d194..231948c15b95 100644 --- a/Makefile +++ b/Makefile @@ -94,13 +94,17 @@ $(NODE_G_EXE): config.gypi out/Makefile CODE_CACHE_DIR ?= out/$(BUILDTYPE)/obj/gen CODE_CACHE_FILE ?= $(CODE_CACHE_DIR)/node_code_cache.cc +ifeq ($(BUILDTYPE),Debug) +CONFIG_FLAGS += --debug +endif .PHONY: with-code-cache with-code-cache: - $(PYTHON) ./configure + @echo $(CONFIG_FLAGS) + $(PYTHON) ./configure $(CONFIG_FLAGS) $(MAKE) mkdir -p $(CODE_CACHE_DIR) out/$(BUILDTYPE)/$(NODE_EXE) --expose-internals tools/generate_code_cache.js $(CODE_CACHE_FILE) - $(PYTHON) ./configure --code-cache-path $(CODE_CACHE_FILE) + $(PYTHON) ./configure --code-cache-path $(CODE_CACHE_FILE) $(CONFIG_FLAGS) $(MAKE) .PHONY: test-code-cache @@ -314,25 +318,22 @@ benchmark/napi/function_args/build/Release/binding.node: all \ --directory="$(shell pwd)/benchmark/napi/function_args" \ --nodedir="$(shell pwd)" -# Implicitly depends on $(NODE_EXE). We don't depend on it explicitly because -# it always triggers a rebuild due to it being a .PHONY rule. See the comment -# near the build-addons rule for more background. -test/gc/build/Release/binding.node: test/gc/binding.cc test/gc/binding.gyp - $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ - --python="$(PYTHON)" \ - --directory="$(shell pwd)/test/gc" \ - --nodedir="$(shell pwd)" - DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md ifeq ($(OSTYPE),aix) DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp endif -test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) +node_use_openssl = $(shell $(call available-node,"-p" \ + "process.versions.openssl != undefined")) +test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules +ifeq ($(node_use_openssl),true) $(RM) -r test/addons/??_*/ [ -x $(NODE) ] && $(NODE) $< || node $< touch $@ +else + @echo "Skipping .docbuildstamp (no crypto)" +endif ADDONS_BINDING_GYPS := \ $(filter-out test/addons/??_*/binding.gyp, \ @@ -342,19 +343,26 @@ ADDONS_BINDING_SOURCES := \ $(filter-out test/addons/??_*/*.cc, $(wildcard test/addons/*/*.cc)) \ $(filter-out test/addons/??_*/*.h, $(wildcard test/addons/*/*.h)) +ADDONS_PREREQS := config.gypi \ + deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ + deps/uv/include/*.h deps/v8/include/*.h \ + src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h + +define run_build_addons +env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ + npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ + "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" \ + $1 +touch $2 +endef + # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. # Depends on node-gyp package.json so that build-addons is (re)executed when # node-gyp is updated as part of an npm update. -test/addons/.buildstamp: config.gypi \ - deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ +test/addons/.buildstamp: $(ADDONS_PREREQS) \ $(ADDONS_BINDING_GYPS) $(ADDONS_BINDING_SOURCES) \ - deps/uv/include/*.h deps/v8/include/*.h \ - src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \ test/addons/.docbuildstamp - env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ - npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ - "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" "$$PWD/test/addons" - touch $@ + @$(call run_build_addons,"$$PWD/test/addons",$@) .PHONY: build-addons # .buildstamp needs $(NODE_EXE) but cannot depend on it @@ -375,17 +383,10 @@ ADDONS_NAPI_BINDING_SOURCES := \ $(filter-out test/addons-napi/??_*/*.h, $(wildcard test/addons-napi/*/*.h)) # Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale. -test/addons-napi/.buildstamp: config.gypi \ - deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ +test/addons-napi/.buildstamp: $(ADDONS_PREREQS) \ $(ADDONS_NAPI_BINDING_GYPS) $(ADDONS_NAPI_BINDING_SOURCES) \ - deps/uv/include/*.h deps/v8/include/*.h \ - src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \ src/node_api.h src/node_api_types.h - env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ - npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ - "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" \ - "$$PWD/test/addons-napi" - touch $@ + @$(call run_build_addons,"$$PWD/test/addons-napi",$@) .PHONY: build-addons-napi # .buildstamp needs $(NODE_EXE) but cannot depend on it @@ -405,20 +406,12 @@ clear-stalled: echo $${PS_OUT} | xargs kill -9; \ fi -.PHONY: test-gc -test-gc: all test/gc/build/Release/binding.node - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) gc - -.PHONY: test-gc-clean -test-gc-clean: - $(RM) -r test/gc/build - test-build: | all build-addons build-addons-napi test-build-addons-napi: all build-addons-napi .PHONY: test-all -test-all: test-build test/gc/build/Release/binding.node ## Run everything in test/. +test-all: test-build ## Run everything in test/. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug,release test-all-valgrind: test-build @@ -548,13 +541,6 @@ test-addons-clean: $(RM) test/addons/.buildstamp test/addons/.docbuildstamp $(MAKE) test-addons-napi-clean -test-timers: - $(MAKE) --directory=tools faketime - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) timers - -test-timers-clean: - $(MAKE) --directory=tools clean - test-async-hooks: $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) async-hooks @@ -657,15 +643,15 @@ available-node = \ run-npm-install = $(PWD)/$(NPM) install --production --no-package-lock run-npm-ci = $(PWD)/$(NPM) ci -gen-json = tools/doc/generate.js --format=json $< > $@ -gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \ - --analytics=$(DOCS_ANALYTICS) $< > $@ +tools/doc/node_modules/js-yaml/package.json: + cd tools/doc && $(call available-node,$(run-npm-install)) -out/doc/api/%.json: doc/api/%.md tools/doc/generate.js tools/doc/json.js - $(call available-node, $(gen-json)) +gen-api = tools/doc/generate.js --node-version=$(FULLVERSION) \ + --analytics=$(DOCS_ANALYTICS) $< --output-directory=out/doc/api -out/doc/api/%.html: doc/api/%.md tools/doc/generate.js tools/doc/html.js - $(call available-node, $(gen-html)) +out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.js \ + tools/doc/html.js tools/doc/json.js + $(call available-node, $(gen-api)) out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.js $(call available-node, tools/doc/allhtml.js) @@ -1084,17 +1070,18 @@ lint-md-build: tools/remark-cli/node_modules \ tools/doc/node_modules \ tools/remark-preset-lint-node/node_modules -.PHONY: tools/doc/node_modules -tools/doc/node_modules: - @cd tools/doc && $(call available-node,$(run-npm-install)) +tools/doc/node_modules: tools/doc/package.json +ifeq ($(node_use_openssl),true) + cd tools/doc && $(call available-node,$(run-npm-install)) +else + @echo "Skipping tools/doc/node_modules (no crypto)" +endif .PHONY: lint-md ifneq ("","$(wildcard tools/remark-cli/node_modules/)") LINT_MD_DOC_FILES = $(shell ls doc/*.md doc/**/*.md) run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES) -node_use_openssl = $(shell $(call available-node,"-p" \ - "process.versions.openssl != undefined")) # Lint all changed markdown files under doc/ tools/.docmdlintstamp: $(LINT_MD_DOC_FILES) ifeq ($(node_use_openssl),true) @@ -1105,7 +1092,7 @@ else @echo "Skipping Markdown linter on docs (no crypto)" endif -LINT_MD_TARGETS = src lib benchmark tools/doc tools/icu +LINT_MD_TARGETS = src lib benchmark test tools/doc tools/icu LINT_MD_ROOT_DOCS := $(wildcard *.md) LINT_MD_MISC_FILES := $(shell find $(LINT_MD_TARGETS) -type f \ -not -path '*node_modules*' -name '*.md') $(LINT_MD_ROOT_DOCS) @@ -1185,7 +1172,6 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \ test/cctest/*.h \ test/addons-napi/*/*.cc \ test/addons-napi/*/*.h \ - test/gc/binding.cc \ tools/icu/*.cc \ tools/icu/*.h \ )) @@ -1194,6 +1180,33 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \ # and the actual filename is generated so it won't match header guards ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard +format-cpp-build: + cd tools/clang-format && $(call available-node,$(run-npm-install)) + +format-cpp-clean: + $(RM) -r tools/clang-format/node_modules + +CLANG_FORMAT_START ?= HEAD +.PHONY: format-cpp +# To format staged changes: +# $ make format-cpp +# To format HEAD~1...HEAD (latest commit): +# $ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp +# To format diff between master and current branch head (master...HEAD): +# $ CLANG_FORMAT_START=master make format-cpp +format-cpp: ## Format C++ diff from $CLANG_FORMAT_START to current changes +ifneq ("","$(wildcard tools/clang-format/node_modules/)") + @echo "Formatting C++ diff from $(CLANG_FORMAT_START).." + @$(PYTHON) tools/clang-format/node_modules/.bin/git-clang-format \ + --binary=tools/clang-format/node_modules/.bin/clang-format \ + --style=file \ + $(CLANG_FORMAT_START) -- \ + $(LINT_CPP_FILES) +else + @echo "clang-format is not installed." + @echo "To install (requires internet access) run: $ make format-cpp-build" +endif + .PHONY: lint-cpp # Lints the C++ code with cpplint.py and check-imports.py. lint-cpp: tools/.cpplintstamp diff --git a/README.md b/README.md index 1016482d8073..f7ef7c66b191 100644 --- a/README.md +++ b/README.md @@ -373,6 +373,8 @@ For more information about the governance of the Node.js project, see **Jeremiah Senkpiel** <fishrock123@rocketmail.com> * [gabrielschulhof](https://github.com/gabrielschulhof) - **Gabriel Schulhof** <gabriel.schulhof@intel.com> +* [gdams](https://github.com/gdams) - +**George Adams** <george.adams@uk.ibm.com> (he/him) * [geek](https://github.com/geek) - **Wyatt Preul** <wpreul@gmail.com> * [gibfahn](https://github.com/gibfahn) - @@ -471,6 +473,8 @@ For more information about the governance of the Node.js project, see **Ron Korving** <ron@ronkorving.nl> * [RReverser](https://github.com/RReverser) - **Ingvar Stepanyan** <me@rreverser.com> +* [rubys](https://github.com/rubys) - +**Sam Ruby** <rubys@intertwingly.net> * [rvagg](https://github.com/rvagg) - **Rod Vagg** <rod@vagg.org> * [ryzokuken](https://github.com/ryzokuken) - diff --git a/benchmark/assert/deepequal-buffer.js b/benchmark/assert/deepequal-buffer.js index fe3f6f9754c3..baf3e1766c15 100644 --- a/benchmark/assert/deepequal-buffer.js +++ b/benchmark/assert/deepequal-buffer.js @@ -3,17 +3,16 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - n: [1e5], - len: [1e2, 1e4], + n: [2e4], + len: [1e2, 1e3], + strict: [0, 1], method: [ 'deepEqual', - 'deepStrictEqual', - 'notDeepEqual', - 'notDeepStrictEqual' + 'notDeepEqual' ] }); -function main({ len, n, method }) { +function main({ len, n, method, strict }) { if (!method) method = 'deepEqual'; const data = Buffer.allocUnsafe(len + 1); @@ -24,6 +23,9 @@ function main({ len, n, method }) { data.copy(expected); data.copy(expectedWrong); + if (strict) { + method = method.replace('eep', 'eepStrict'); + } const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; diff --git a/benchmark/assert/deepequal-map.js b/benchmark/assert/deepequal-map.js index c6c7173fe8ed..c15e1c9a360c 100644 --- a/benchmark/assert/deepequal-map.js +++ b/benchmark/assert/deepequal-map.js @@ -7,21 +7,14 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } = const bench = common.createBenchmark(main, { n: [5e2], len: [5e2], + strict: [0, 1], method: [ 'deepEqual_primitiveOnly', - 'deepStrictEqual_primitiveOnly', 'deepEqual_objectOnly', - 'deepStrictEqual_objectOnly', 'deepEqual_mixed', - 'deepStrictEqual_mixed', - 'deepEqual_looseMatches', 'notDeepEqual_primitiveOnly', - 'notDeepStrictEqual_primitiveOnly', 'notDeepEqual_objectOnly', - 'notDeepStrictEqual_objectOnly', - 'notDeepEqual_mixed', - 'notDeepStrictEqual_mixed', - 'notDeepEqual_looseMatches', + 'notDeepEqual_mixed' ] }); @@ -37,7 +30,7 @@ function benchmark(method, n, values, values2) { bench.end(n); } -function main({ n, len, method }) { +function main({ n, len, method, strict }) { const array = Array(len).fill(1); var values, values2; @@ -46,74 +39,33 @@ function main({ n, len, method }) { // Empty string falls through to next line as default, mostly for tests. case 'deepEqual_primitiveOnly': values = array.map((_, i) => [`str_${i}`, 123]); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_primitiveOnly': - values = array.map((_, i) => [`str_${i}`, 123]); - benchmark(deepStrictEqual, n, values); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'deepEqual_objectOnly': values = array.map((_, i) => [[`str_${i}`, 1], 123]); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_objectOnly': - values = array.map((_, i) => [[`str_${i}`, 1], 123]); - benchmark(deepStrictEqual, n, values); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'deepEqual_mixed': values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_mixed': - values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]); - benchmark(deepStrictEqual, n, values); - break; - case 'deepEqual_looseMatches': - values = array.map((_, i) => [i, i]); - values2 = values.slice().map((v) => [String(v[0]), String(v[1])]); - benchmark(deepEqual, n, values, values2); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'notDeepEqual_primitiveOnly': values = array.map((_, i) => [`str_${i}`, 123]); values2 = values.slice(0); values2[Math.floor(len / 2)] = ['w00t', 123]; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_primitiveOnly': - values = array.map((_, i) => [`str_${i}`, 123]); - values2 = values.slice(0); - values2[Math.floor(len / 2)] = ['w00t', 123]; - benchmark(notDeepStrictEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; case 'notDeepEqual_objectOnly': values = array.map((_, i) => [[`str_${i}`, 1], 123]); values2 = values.slice(0); values2[Math.floor(len / 2)] = [['w00t'], 123]; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_objectOnly': - values = array.map((_, i) => [[`str_${i}`, 1], 123]); - values2 = values.slice(0); - values2[Math.floor(len / 2)] = [['w00t'], 123]; - benchmark(notDeepStrictEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; case 'notDeepEqual_mixed': values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]); values2 = values.slice(0); values2[0] = ['w00t', 123]; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_mixed': - values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]); - values2 = values.slice(0); - values2[0] = ['w00t', 123]; - benchmark(notDeepStrictEqual, n, values, values2); - break; - case 'notDeepEqual_looseMatches': - values = array.map((_, i) => [i, i]); - values2 = values.slice().map((v) => [String(v[0]), String(v[1])]); - values2[len - 1] = [String(len + 1), String(len + 1)]; - benchmark(notDeepEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; default: throw new Error(`Unsupported method ${method}`); diff --git a/benchmark/assert/deepequal-object.js b/benchmark/assert/deepequal-object.js index 124943b19ec7..1a9c826a00d4 100644 --- a/benchmark/assert/deepequal-object.js +++ b/benchmark/assert/deepequal-object.js @@ -4,13 +4,12 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - n: [1e6], - size: [1e2, 1e3, 1e4], + n: [5e3], + size: [1e2, 1e3, 5e4], + strict: [0, 1], method: [ 'deepEqual', - 'deepStrictEqual', - 'notDeepEqual', - 'notDeepStrictEqual' + 'notDeepEqual' ] }); @@ -20,14 +19,16 @@ function createObj(source, add = '') { nope: { bar: `123${add}`, a: [1, 2, 3], - baz: n + baz: n, + c: {}, + b: [] } })); } -function main({ size, n, method }) { +function main({ size, n, method, strict }) { // TODO: Fix this "hack". `n` should not be manipulated. - n = n / size; + n = Math.min(Math.ceil(n / size), 20); if (!method) method = 'deepEqual'; @@ -37,6 +38,9 @@ function main({ size, n, method }) { const expected = createObj(source); const expectedWrong = createObj(source, '4'); + if (strict) { + method = method.replace('eep', 'eepStrict'); + } const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; diff --git a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js index 4578e5a250f3..71637c28cea9 100644 --- a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js +++ b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js @@ -5,29 +5,22 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } = require('assert'); const primValues = { - 'null': null, - 'undefined': undefined, 'string': 'a', 'number': 1, - 'boolean': true, 'object': { 0: 'a' }, - 'array': [1, 2, 3], - 'new-array': new Array([1, 2, 3]) + 'array': [1, 2, 3] }; const bench = common.createBenchmark(main, { primitive: Object.keys(primValues), n: [25], - len: [1e5], + len: [2e4], + strict: [0, 1], method: [ 'deepEqual_Array', - 'deepStrictEqual_Array', 'notDeepEqual_Array', - 'notDeepStrictEqual_Array', 'deepEqual_Set', - 'deepStrictEqual_Set', - 'notDeepEqual_Set', - 'notDeepStrictEqual_Set' + 'notDeepEqual_Set' ] }); @@ -39,7 +32,7 @@ function run(fn, n, actual, expected) { bench.end(n); } -function main({ n, len, primitive, method }) { +function main({ n, len, primitive, method, strict }) { const prim = primValues[primitive]; const actual = []; const expected = []; @@ -62,28 +55,17 @@ function main({ n, len, primitive, method }) { // Empty string falls through to next line as default, mostly for tests. case '': case 'deepEqual_Array': - run(deepEqual, n, actual, expected); - break; - case 'deepStrictEqual_Array': - run(deepStrictEqual, n, actual, expected); + run(strict ? deepStrictEqual : deepEqual, n, actual, expected); break; case 'notDeepEqual_Array': - run(notDeepEqual, n, actual, expectedWrong); - break; - case 'notDeepStrictEqual_Array': - run(notDeepStrictEqual, n, actual, expectedWrong); + run(strict ? notDeepStrictEqual : notDeepEqual, n, actual, expectedWrong); break; case 'deepEqual_Set': - run(deepEqual, n, actualSet, expectedSet); - break; - case 'deepStrictEqual_Set': - run(deepStrictEqual, n, actualSet, expectedSet); + run(strict ? deepStrictEqual : deepEqual, n, actualSet, expectedSet); break; case 'notDeepEqual_Set': - run(notDeepEqual, n, actualSet, expectedWrongSet); - break; - case 'notDeepStrictEqual_Set': - run(notDeepStrictEqual, n, actualSet, expectedWrongSet); + run(strict ? notDeepStrictEqual : notDeepEqual, + n, actualSet, expectedWrongSet); break; default: throw new Error(`Unsupported method "${method}"`); diff --git a/benchmark/assert/deepequal-prims-and-objs-big-loop.js b/benchmark/assert/deepequal-prims-and-objs-big-loop.js index f1183dab32a3..13abaf107fdf 100644 --- a/benchmark/assert/deepequal-prims-and-objs-big-loop.js +++ b/benchmark/assert/deepequal-prims-and-objs-big-loop.js @@ -3,28 +3,23 @@ const common = require('../common.js'); const assert = require('assert'); const primValues = { - 'null': null, - 'undefined': undefined, 'string': 'a', 'number': 1, - 'boolean': true, 'object': { 0: 'a' }, - 'array': [1, 2, 3], - 'new-array': new Array([1, 2, 3]) + 'array': [1, 2, 3] }; const bench = common.createBenchmark(main, { primitive: Object.keys(primValues), - n: [1e6], + n: [2e4], + strict: [0, 1], method: [ 'deepEqual', - 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' ] }); -function main({ n, primitive, method }) { +function main({ n, primitive, method, strict }) { if (!method) method = 'deepEqual'; const prim = primValues[primitive]; @@ -32,6 +27,9 @@ function main({ n, primitive, method }) { const expected = prim; const expectedWrong = 'b'; + if (strict) { + method = method.replace('eep', 'eepStrict'); + } const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; diff --git a/benchmark/assert/deepequal-set.js b/benchmark/assert/deepequal-set.js index 6769e5e37faf..1f4061afb2a3 100644 --- a/benchmark/assert/deepequal-set.js +++ b/benchmark/assert/deepequal-set.js @@ -7,21 +7,14 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } = const bench = common.createBenchmark(main, { n: [5e2], len: [5e2], + strict: [0, 1], method: [ 'deepEqual_primitiveOnly', - 'deepStrictEqual_primitiveOnly', 'deepEqual_objectOnly', - 'deepStrictEqual_objectOnly', 'deepEqual_mixed', - 'deepStrictEqual_mixed', - 'deepEqual_looseMatches', 'notDeepEqual_primitiveOnly', - 'notDeepStrictEqual_primitiveOnly', 'notDeepEqual_objectOnly', - 'notDeepStrictEqual_objectOnly', - 'notDeepEqual_mixed', - 'notDeepStrictEqual_mixed', - 'notDeepEqual_looseMatches', + 'notDeepEqual_mixed' ] }); @@ -37,7 +30,7 @@ function benchmark(method, n, values, values2) { bench.end(n); } -function main({ n, len, method }) { +function main({ n, len, method, strict }) { const array = Array(len).fill(1); var values, values2; @@ -47,60 +40,29 @@ function main({ n, len, method }) { // Empty string falls through to next line as default, mostly for tests. case 'deepEqual_primitiveOnly': values = array.map((_, i) => `str_${i}`); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_primitiveOnly': - values = array.map((_, i) => `str_${i}`); - benchmark(deepStrictEqual, n, values); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'deepEqual_objectOnly': values = array.map((_, i) => [`str_${i}`, null]); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_objectOnly': - values = array.map((_, i) => [`str_${i}`, null]); - benchmark(deepStrictEqual, n, values); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'deepEqual_mixed': values = array.map((_, i) => { return i % 2 ? [`str_${i}`, null] : `str_${i}`; }); - benchmark(deepEqual, n, values); - break; - case 'deepStrictEqual_mixed': - values = array.map((_, i) => { - return i % 2 ? [`str_${i}`, null] : `str_${i}`; - }); - benchmark(deepStrictEqual, n, values); - break; - case 'deepEqual_looseMatches': - values = array.map((_, i) => i); - values2 = values.slice().map((v) => String(v)); - benchmark(deepEqual, n, values, values2); + benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; case 'notDeepEqual_primitiveOnly': values = array.map((_, i) => `str_${i}`); values2 = values.slice(0); values2[Math.floor(len / 2)] = 'w00t'; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_primitiveOnly': - values = array.map((_, i) => `str_${i}`); - values2 = values.slice(0); - values2[Math.floor(len / 2)] = 'w00t'; - benchmark(notDeepStrictEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; case 'notDeepEqual_objectOnly': values = array.map((_, i) => [`str_${i}`, null]); values2 = values.slice(0); values2[Math.floor(len / 2)] = ['w00t']; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_objectOnly': - values = array.map((_, i) => [`str_${i}`, null]); - values2 = values.slice(0); - values2[Math.floor(len / 2)] = ['w00t']; - benchmark(notDeepStrictEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; case 'notDeepEqual_mixed': values = array.map((_, i) => { @@ -108,21 +70,7 @@ function main({ n, len, method }) { }); values2 = values.slice(); values2[0] = 'w00t'; - benchmark(notDeepEqual, n, values, values2); - break; - case 'notDeepStrictEqual_mixed': - values = array.map((_, i) => { - return i % 2 ? [`str_${i}`, null] : `str_${i}`; - }); - values2 = values.slice(); - values2[0] = 'w00t'; - benchmark(notDeepStrictEqual, n, values, values2); - break; - case 'notDeepEqual_looseMatches': - values = array.map((_, i) => i); - values2 = values.slice().map((v) => String(v)); - values2[len - 1] = String(len + 1); - benchmark(notDeepEqual, n, values, values2); + benchmark(strict ? notDeepStrictEqual : notDeepEqual, n, values, values2); break; default: throw new Error(`Unsupported method "${method}"`); diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js index c4d8f434bf4e..9f9c68a67312 100644 --- a/benchmark/assert/deepequal-typedarrays.js +++ b/benchmark/assert/deepequal-typedarrays.js @@ -6,39 +6,39 @@ const bench = common.createBenchmark(main, { type: [ 'Int8Array', 'Uint8Array', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', 'Float32Array', 'Float64Array', 'Uint8ClampedArray', ], - n: [1], + n: [5e2], + strict: [0, 1], method: [ 'deepEqual', - 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' ], - len: [1e6] + len: [1e2, 5e3] }); -function main({ type, n, len, method }) { +function main({ type, n, len, method, strict }) { if (!method) method = 'deepEqual'; const clazz = global[type]; const actual = new clazz(len); const expected = new clazz(len); - const expectedWrong = Buffer.alloc(len); + const expectedWrong = new clazz(len); const wrongIndex = Math.floor(len / 2); expectedWrong[wrongIndex] = 123; + if (strict) { + method = method.replace('eep', 'eepStrict'); + } const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; bench.start(); for (var i = 0; i < n; ++i) { + actual[0] = i; + value2[0] = i; fn(actual, value2); } bench.end(n); diff --git a/benchmark/assert/ok.js b/benchmark/assert/ok.js index 849be65539ae..4869a9de69c3 100644 --- a/benchmark/assert/ok.js +++ b/benchmark/assert/ok.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - n: [1e9] + n: [1e5] }); function main({ n }) { diff --git a/benchmark/assert/throws.js b/benchmark/assert/throws.js index a8a7bd4509e1..1788630cb2f9 100644 --- a/benchmark/assert/throws.js +++ b/benchmark/assert/throws.js @@ -4,10 +4,9 @@ const common = require('../common.js'); const { throws, doesNotThrow } = require('assert'); const bench = common.createBenchmark(main, { - n: [1e6], + n: [1e4], method: [ 'doesNotThrow', - 'throws', 'throws_TypeError', 'throws_RegExp' ] @@ -30,13 +29,6 @@ function main({ n, method }) { } bench.end(n); break; - case 'throws': - bench.start(); - for (i = 0; i < n; ++i) { - throws(throwError); - } - bench.end(n); - break; case 'throws_TypeError': bench.start(); for (i = 0; i < n; ++i) { diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index a7670d99efc3..da61f90a6472 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -5,8 +5,6 @@ const bench = common.createBenchmark(main, { n: [12e6] }); -process.maxTickDepth = Infinity; - function main({ n }) { let counter = n; function cb4(arg1, arg2, arg3, arg4) { diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index 1ad32c806181..c88e042b965e 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -4,8 +4,6 @@ const bench = common.createBenchmark(main, { n: [12e6] }); -process.maxTickDepth = Infinity; - function main({ n }) { let counter = n; bench.start(); diff --git a/common.gypi b/common.gypi index b03e0a07ee9a..f2c474e65242 100644 --- a/common.gypi +++ b/common.gypi @@ -29,7 +29,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.19', + 'v8_embedder_string': '-node.14', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, diff --git a/configure b/configure index f89812cc9481..c9d598b79920 100755 --- a/configure +++ b/configure @@ -1074,8 +1074,14 @@ def configure_library(lib, output): # libpath needs to be provided ahead libraries if options.__dict__[shared_lib + '_libpath']: - output['libraries'] += [ - '-L%s' % options.__dict__[shared_lib + '_libpath']] + if flavor == 'win': + if 'msvs_settings' not in output: + output['msvs_settings'] = { 'VCLinkerTool': { 'AdditionalOptions': [] } } + output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [ + '/LIBPATH:%s' % options.__dict__[shared_lib + '_libpath']] + else: + output['libraries'] += [ + '-L%s' % options.__dict__[shared_lib + '_libpath']] elif pkg_libpath: output['libraries'] += [pkg_libpath] diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm b/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm index 7ebb1a0112d8..91428207085e 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "BSD-x86_64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1076,6 +1076,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1242,10 +1246,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3992,6 +4008,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6330,6 +6352,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7329,6 +7357,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7501,8 +7533,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7523,10 +7555,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7682,6 +7727,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7722,7 +7768,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8104,6 +8153,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8224,9 +8276,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9255,6 +9316,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10735,6 +10800,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11272,6 +11341,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11642,6 +11712,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12647,6 +12718,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12996,6 +13076,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13004,6 +13092,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aes-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aes-x86_64.s index aa7a1ea1cf9b..488ae6d781ac 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aes-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _x86_64_AES_encrypt,@function .align 16 _x86_64_AES_encrypt: diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-mb-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-mb-x86_64.s index d49379783298..3dcd55d3f59a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-mb-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s index c7c53e8771e1..ca193ddb9ea4 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha1_enc diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s index 70eed05b00c1..427a1c7d1232 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha256_enc diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-x86_64.s index cd8b00f25983..e18f87c4e60c 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/aesni-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_encrypt .type aesni_encrypt,@function diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/bsaes-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/bsaes-x86_64.s index 0fd201167f64..c76c5a8afb47 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/bsaes-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/bsaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/vpaes-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/vpaes-x86_64.s index bf7c2b0b6f6b..d19329894079 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/vpaes-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/aes/vpaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-avx2.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-avx2.s index a2cccde63604..ee619092c9b7 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-avx2.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-avx2.s @@ -1,4 +1,4 @@ -.text +.text .globl rsaz_1024_sqr_avx2 .type rsaz_1024_sqr_avx2,@function diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-x86_64.s index b6797a68498e..795cebe1d743 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/rsaz-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-gf2m.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-gf2m.s index f4e5337565bb..a0b78a0565f7 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-gf2m.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-gf2m.s @@ -1,4 +1,4 @@ -.text +.text .type _mul_1x1,@function .align 16 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont.s index d19d4662b492..3a78cd844090 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont.s @@ -1,4 +1,4 @@ -.text +.text @@ -197,30 +197,30 @@ bn_mul_mont: xorq %r14,%r14 movq (%rsp),%rax - leaq (%rsp),%rsi movq %r9,%r15 - jmp .Lsub + .align 16 .Lsub: sbbq (%rcx,%r14,8),%rax movq %rax,(%rdi,%r14,8) - movq 8(%rsi,%r14,8),%rax + movq 8(%rsp,%r14,8),%rax leaq 1(%r14),%r14 decq %r15 jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax - movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx + movq %r9,(%rsp,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy @@ -574,10 +574,10 @@ bn_mul4x_mont: cmpq %r9,%r14 jb .Louter4x movq 16(%rsp,%r9,8),%rdi + leaq -4(%r9),%r15 movq 0(%rsp),%rax - pxor %xmm0,%xmm0 movq 8(%rsp),%rdx - shrq $2,%r9 + shrq $2,%r15 leaq (%rsp),%rsi xorq %r14,%r14 @@ -585,9 +585,7 @@ bn_mul4x_mont: movq 16(%rsi),%rbx movq 24(%rsi),%rbp sbbq 8(%rcx),%rdx - leaq -1(%r9),%r15 - jmp .Lsub4x -.align 16 + .Lsub4x: movq %rax,0(%rdi,%r14,8) movq %rdx,8(%rdi,%r14,8) @@ -614,34 +612,35 @@ bn_mul4x_mont: sbbq $0,%rax movq %rbp,24(%rdi,%r14,8) - xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx - leaq -1(%r9),%r15 - orq %rcx,%rsi - - movdqu (%rsi),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,(%rdi) + pxor %xmm0,%xmm0 +.byte 102,72,15,110,224 + pcmpeqd %xmm5,%xmm5 + pshufd $0,%xmm4,%xmm4 + movq %r9,%r15 + pxor %xmm4,%xmm5 + shrq $2,%r15 + xorl %eax,%eax + jmp .Lcopy4x .align 16 .Lcopy4x: - movdqu 16(%rsi,%r14,1),%xmm2 - movdqu 32(%rsi,%r14,1),%xmm1 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) - movdqa %xmm0,32(%rsp,%r14,1) - movdqu %xmm1,32(%rdi,%r14,1) - leaq 32(%r14),%r14 + movdqa (%rsp,%rax,1),%xmm1 + movdqu (%rdi,%rax,1),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax,1),%xmm3 + movdqa %xmm0,(%rsp,%rax,1) + por %xmm2,%xmm1 + movdqu 16(%rdi,%rax,1),%xmm2 + movdqu %xmm1,(%rdi,%rax,1) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax,1) + por %xmm2,%xmm3 + movdqu %xmm3,16(%rdi,%rax,1) + leaq 32(%rax),%rax decq %r15 jnz .Lcopy4x - - shlq $2,%r9 - movdqu 16(%rsi,%r14,1),%xmm2 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont5.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont5.s index a2fccf088e75..0dd53512f9c9 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont5.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/bn/x86_64-mont5.s @@ -1,4 +1,4 @@ -.text +.text @@ -393,18 +393,19 @@ bn_mul_mont_gather5: jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h index 42960ff4599a..a77851f6c8f3 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h @@ -35,4 +35,4 @@ static const char cflags[] = { 'n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 3 00:38:12 2018" +#define DATE "built on: Tue Aug 14 23:13:00 2018" diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/camellia/cmll-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/camellia/cmll-x86_64.s index 1117381f316d..1dead91b1752 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/camellia/cmll-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/camellia/cmll-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl Camellia_EncryptBlock diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/chacha/chacha-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/chacha/chacha-x86_64.s index 044b8f031efa..a9fed05fd7e3 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/chacha/chacha-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/chacha/chacha-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s index ce86d5d969f7..62a7ac611f37 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl ecp_nistz256_precomputed .type ecp_nistz256_precomputed,@object .align 4096 @@ -2372,7 +2372,7 @@ ecp_nistz256_precomputed: .long 0x2a849870,0x4d33dd99,0x41576335,0xa716964b,0x179be0e5,0xff5e3a9b,0x83b13632,0x5b9d6b1b,0xa52f313b,0x3b8bd7d4,0x637a4660,0xc9dd95a0,0x0b3e218f,0x30035962,0xc7b28a3c,0xce1481a3 .long 0x43228d83,0xab41b43a,0x4ad63f99,0x24ae1c30,0x46a51229,0x8e525f1a,0xcd26d2b4,0x14af860f,0x3f714aa1,0xd6baef61,0xeb78795e,0xf51865ad,0xe6a9d694,0xd3e21fce,0x8a37b527,0x82ceb1dd .size ecp_nistz256_precomputed,.-ecp_nistz256_precomputed -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/md5/md5-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/md5/md5-x86_64.s index 0aa90515d6c9..0defe666bb75 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/md5/md5-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/md5/md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl md5_block_asm_data_order diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s index d1a1c895a39b..21e49925f1ae 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _aesni_ctr32_ghash_6x,@function .align 32 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/ghash-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/ghash-x86_64.s index 10f5987415a1..0116ef1c94c4 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/ghash-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/modes/ghash-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl gcm_gmult_4bit diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/poly1305/poly1305-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/poly1305/poly1305-x86_64.s index 5662696481ed..8b2e361ea1cd 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/poly1305/poly1305-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/poly1305/poly1305-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s index 9c7110f4ef09..aab3c6db13d9 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl rc4_md5_enc diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-x86_64.s index bdd0da3bd138..781b48b9eb44 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/rc4/rc4-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl RC4 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-mb-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-mb-x86_64.s index d2857f3288bf..d266d776ec66 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-mb-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-x86_64.s index 195a148bb9b2..dbeebed9a0a8 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha1_block_data_order diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-mb-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-mb-x86_64.s index bd72a459ab24..f2896b4d6e33 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-mb-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-x86_64.s index 23b932e1de4a..8264a7dbdf10 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha256_block_data_order diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha512-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha512-x86_64.s index a1021c17a966..6f8488a38a9b 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha512-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/sha/sha512-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha512_block_data_order diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/whrlpool/wp-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/whrlpool/wp-x86_64.s index f83130ea6863..a4d55b6afc34 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/whrlpool/wp-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/whrlpool/wp-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl whirlpool_block .type whirlpool_block,@function diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/x86_64cpuid.s b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/x86_64cpuid.s index 5a109c6fd915..7e1f5e27408c 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/x86_64cpuid.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/x86_64cpuid.s @@ -6,7 +6,7 @@ .hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,16,4 -.text +.text .globl OPENSSL_atomic_add .type OPENSSL_atomic_add,@function diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/engines/e_padlock-x86_64.s b/deps/openssl/config/archs/BSD-x86_64/asm/engines/e_padlock-x86_64.s index 3e5ab736fd86..38c02c188ee1 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/engines/e_padlock-x86_64.s +++ b/deps/openssl/config/archs/BSD-x86_64/asm/engines/e_padlock-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl padlock_capability .type padlock_capability,@function .align 16 @@ -1020,7 +1020,7 @@ padlock_ctr32_encrypt: .size padlock_ctr32_encrypt,.-padlock_ctr32_encrypt .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 -.data +.data .align 8 .Lpadlock_saved_context: .quad 0 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslconf.h index 9df0f86ed6ed..7dd2101053aa 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/openssl.gypi b/deps/openssl/config/archs/BSD-x86_64/asm/openssl.gypi index 5c26facf1166..5d135ede2c2f 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/openssl.gypi +++ b/deps/openssl/config/archs/BSD-x86_64/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm b/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm index 0815b65b4ce2..85457389c350 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "BSD-x86_64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1075,6 +1075,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1241,10 +1245,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3931,6 +3947,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6209,6 +6231,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7196,6 +7224,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7390,10 +7422,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7549,6 +7594,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7589,7 +7635,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7971,6 +8020,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8091,9 +8143,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9082,6 +9143,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10522,6 +10587,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11041,6 +11110,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11401,6 +11471,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12404,6 +12475,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12753,6 +12833,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12761,6 +12849,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h index 9bcf65021a97..52f1b831f32f 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 3 00:38:16 2018" +#define DATE "built on: Tue Aug 14 23:13:04 2018" diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h index e20916814d70..7b122bd86ee5 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/openssl.gypi b/deps/openssl/config/archs/BSD-x86_64/no-asm/openssl.gypi index f54f6ed68e9f..d603375ad407 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm b/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm index 77adc3e250c2..d54567212702 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "VC-WIN32", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1100,6 +1100,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1266,10 +1270,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3974,6 +3990,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6306,6 +6328,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7305,6 +7333,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7499,10 +7531,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7658,6 +7703,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7698,7 +7744,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8037,6 +8086,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8157,9 +8209,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9161,6 +9222,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10637,6 +10702,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11166,6 +11235,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11534,6 +11604,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12539,6 +12610,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12888,6 +12968,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12896,6 +12984,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bf/bf-586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bf/bf-586.asm index 1da1e643bb37..78d5e7375e0f 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bf/bf-586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bf/bf-586.asm @@ -10,7 +10,7 @@ global _BF_encrypt align 16 _BF_encrypt: L$_BF_encrypt_begin: - ; + ; push ebp push ebx mov ebx,DWORD [12+esp] @@ -24,7 +24,7 @@ L$_BF_encrypt_begin: mov ebx,DWORD [ebp] xor ecx,ecx xor edi,ebx - ; + ; ; Round 0 mov edx,DWORD [4+ebp] mov ebx,edi @@ -44,7 +44,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 1 mov edx,DWORD [8+ebp] mov ebx,esi @@ -64,7 +64,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 2 mov edx,DWORD [12+ebp] mov ebx,edi @@ -84,7 +84,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 3 mov edx,DWORD [16+ebp] mov ebx,esi @@ -104,7 +104,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 4 mov edx,DWORD [20+ebp] mov ebx,edi @@ -124,7 +124,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 5 mov edx,DWORD [24+ebp] mov ebx,esi @@ -144,7 +144,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 6 mov edx,DWORD [28+ebp] mov ebx,edi @@ -164,7 +164,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 7 mov edx,DWORD [32+ebp] mov ebx,esi @@ -184,7 +184,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 8 mov edx,DWORD [36+ebp] mov ebx,edi @@ -204,7 +204,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 9 mov edx,DWORD [40+ebp] mov ebx,esi @@ -224,7 +224,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 10 mov edx,DWORD [44+ebp] mov ebx,edi @@ -244,7 +244,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 11 mov edx,DWORD [48+ebp] mov ebx,esi @@ -264,7 +264,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 12 mov edx,DWORD [52+ebp] mov ebx,edi @@ -284,7 +284,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 13 mov edx,DWORD [56+ebp] mov ebx,esi @@ -304,7 +304,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 14 mov edx,DWORD [60+ebp] mov ebx,edi @@ -324,7 +324,7 @@ L$_BF_encrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 15 mov edx,DWORD [64+ebp] mov ebx,esi @@ -358,7 +358,7 @@ global _BF_decrypt align 16 _BF_decrypt: L$_BF_decrypt_begin: - ; + ; push ebp push ebx mov ebx,DWORD [12+esp] @@ -372,7 +372,7 @@ L$_BF_decrypt_begin: mov ebx,DWORD [68+ebp] xor ecx,ecx xor edi,ebx - ; + ; ; Round 16 mov edx,DWORD [64+ebp] mov ebx,edi @@ -392,7 +392,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 15 mov edx,DWORD [60+ebp] mov ebx,esi @@ -412,7 +412,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 14 mov edx,DWORD [56+ebp] mov ebx,edi @@ -432,7 +432,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 13 mov edx,DWORD [52+ebp] mov ebx,esi @@ -452,7 +452,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 12 mov edx,DWORD [48+ebp] mov ebx,edi @@ -472,7 +472,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 11 mov edx,DWORD [44+ebp] mov ebx,esi @@ -492,7 +492,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 10 mov edx,DWORD [40+ebp] mov ebx,edi @@ -512,7 +512,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 9 mov edx,DWORD [36+ebp] mov ebx,esi @@ -532,7 +532,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 8 mov edx,DWORD [32+ebp] mov ebx,edi @@ -552,7 +552,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 7 mov edx,DWORD [28+ebp] mov ebx,esi @@ -572,7 +572,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 6 mov edx,DWORD [24+ebp] mov ebx,edi @@ -592,7 +592,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 5 mov edx,DWORD [20+ebp] mov ebx,esi @@ -612,7 +612,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 4 mov edx,DWORD [16+ebp] mov ebx,edi @@ -632,7 +632,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 3 mov edx,DWORD [12+ebp] mov ebx,esi @@ -652,7 +652,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor edi,ebx - ; + ; ; Round 2 mov edx,DWORD [8+ebp] mov ebx,edi @@ -672,7 +672,7 @@ L$_BF_decrypt_begin: add ebx,edx xor eax,eax xor esi,ebx - ; + ; ; Round 1 mov edx,DWORD [4+ebp] mov ebx,esi @@ -706,7 +706,7 @@ global _BF_cbc_encrypt align 16 _BF_cbc_encrypt: L$_BF_cbc_encrypt_begin: - ; + ; push ebp push ebx push esi diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/bn-586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/bn-586.asm index 8534042b05a9..82002b353bfd 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/bn-586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/bn-586.asm @@ -108,7 +108,7 @@ L$000maw_non_sse2: push ebx push esi push edi - ; + ; xor esi,esi mov edi,DWORD [20+esp] mov ecx,DWORD [28+esp] @@ -191,7 +191,7 @@ L$006maw_loop: adc edx,0 mov DWORD [28+edi],eax mov esi,edx - ; + ; sub ecx,8 lea ebx,[32+ebx] lea edi,[32+edi] @@ -317,7 +317,7 @@ L$009mw_non_sse2: push ebx push esi push edi - ; + ; xor esi,esi mov edi,DWORD [20+esp] mov ebx,DWORD [24+esp] @@ -382,7 +382,7 @@ L$012mw_loop: adc edx,0 mov DWORD [28+edi],eax mov esi,edx - ; + ; add ebx,32 add edi,32 sub ebp,8 @@ -489,7 +489,7 @@ L$015sqr_non_sse2: push ebx push esi push edi - ; + ; mov esi,DWORD [20+esp] mov edi,DWORD [24+esp] mov ebx,DWORD [28+esp] @@ -536,7 +536,7 @@ L$018sw_loop: mul eax mov DWORD [56+esi],eax mov DWORD [60+esi],edx - ; + ; add edi,32 add esi,64 sub ebx,8 @@ -615,7 +615,7 @@ L$_bn_add_words_begin: push ebx push esi push edi - ; + ; mov ebx,DWORD [20+esp] mov esi,DWORD [24+esp] mov edi,DWORD [28+esp] @@ -696,7 +696,7 @@ L$021aw_loop: add ecx,edx adc eax,0 mov DWORD [28+ebx],ecx - ; + ; add esi,32 add edi,32 add ebx,32 @@ -795,7 +795,7 @@ L$_bn_sub_words_begin: push ebx push esi push edi - ; + ; mov ebx,DWORD [20+esp] mov esi,DWORD [24+esp] mov edi,DWORD [28+esp] @@ -876,7 +876,7 @@ L$024aw_loop: sub ecx,edx adc eax,0 mov DWORD [28+ebx],ecx - ; + ; add esi,32 add edi,32 add ebx,32 @@ -975,7 +975,7 @@ L$_bn_sub_part_words_begin: push ebx push esi push edi - ; + ; mov ebx,DWORD [20+esp] mov esi,DWORD [24+esp] mov edi,DWORD [28+esp] @@ -1056,7 +1056,7 @@ L$027aw_loop: sub ecx,edx adc eax,0 mov DWORD [28+ebx],ecx - ; + ; add esi,32 add edi,32 add ebx,32 @@ -1248,7 +1248,7 @@ L$032pw_neg_loop: sub ecx,edx adc eax,0 mov DWORD [28+ebx],ecx - ; + ; add edi,32 add ebx,32 sub ebp,8 @@ -1379,7 +1379,7 @@ L$034pw_pos_loop: sub ecx,eax mov DWORD [28+ebx],ecx jnc NEAR L$042pw_nc7 - ; + ; add esi,32 add ebx,32 sub ebp,8 @@ -1462,7 +1462,7 @@ L$041pw_nc6: mov ecx,DWORD [28+esi] mov DWORD [28+ebx],ecx L$042pw_nc7: - ; + ; add esi,32 add ebx,32 sub ebp,8 diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/x86-mont.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/x86-mont.asm index bf237b633a5f..090630c3a00c 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/x86-mont.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/bn/x86-mont.asm @@ -448,16 +448,18 @@ L$016sub: lea edx,[1+edx] jge NEAR L$016sub sbb eax,0 - and esi,eax - not eax - mov ebp,edi - and ebp,eax - or esi,ebp + mov edx,-1 + xor edx,eax + jmp NEAR L$017copy align 16 L$017copy: - mov eax,DWORD [ebx*4+esi] - mov DWORD [ebx*4+edi],eax + mov esi,DWORD [32+ebx*4+esp] + mov ebp,DWORD [ebx*4+edi] mov DWORD [32+ebx*4+esp],ecx + and esi,eax + and ebp,edx + or ebp,esi + mov DWORD [ebx*4+edi],ebp dec ebx jge NEAR L$017copy mov esp,DWORD [24+esp] diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h index 29159b7a1898..74eb547a2951 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h @@ -9,4 +9,4 @@ static const char cflags[] = { 'c','o','m','p','i','l','e','r',':',' ','c','c','\0' }; #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 3 00:38:59 2018" +#define DATE "built on: Tue Aug 14 23:13:47 2018" diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/crypt586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/crypt586.asm index 912b2b9e90f4..2af8af39d662 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/crypt586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/crypt586.asm @@ -15,7 +15,7 @@ L$_fcrypt_body_begin: push ebx push esi push edi - ; + ; ; Load the 2 words xor edi,edi xor esi,esi @@ -24,7 +24,7 @@ L$_fcrypt_body_begin: mov ebp,DWORD [28+esp] push DWORD 25 L$000start: - ; + ; ; Round 0 mov eax,DWORD [36+esp] mov edx,esi @@ -74,7 +74,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 1 mov eax,DWORD [36+esp] mov edx,edi @@ -124,7 +124,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 2 mov eax,DWORD [36+esp] mov edx,esi @@ -174,7 +174,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 3 mov eax,DWORD [36+esp] mov edx,edi @@ -224,7 +224,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 4 mov eax,DWORD [36+esp] mov edx,esi @@ -274,7 +274,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 5 mov eax,DWORD [36+esp] mov edx,edi @@ -324,7 +324,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 6 mov eax,DWORD [36+esp] mov edx,esi @@ -374,7 +374,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 7 mov eax,DWORD [36+esp] mov edx,edi @@ -424,7 +424,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 8 mov eax,DWORD [36+esp] mov edx,esi @@ -474,7 +474,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 9 mov eax,DWORD [36+esp] mov edx,edi @@ -524,7 +524,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 10 mov eax,DWORD [36+esp] mov edx,esi @@ -574,7 +574,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 11 mov eax,DWORD [36+esp] mov edx,edi @@ -624,7 +624,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 12 mov eax,DWORD [36+esp] mov edx,esi @@ -674,7 +674,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 13 mov eax,DWORD [36+esp] mov edx,edi @@ -724,7 +724,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor esi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 14 mov eax,DWORD [36+esp] mov edx,esi @@ -774,7 +774,7 @@ L$000start: mov ebx,DWORD [0x500+edx*1+ebp] xor edi,ebx mov ebp,DWORD [32+esp] - ; + ; ; Round 15 mov eax,DWORD [36+esp] mov edx,edi @@ -831,7 +831,7 @@ L$000start: mov esi,eax mov DWORD [esp],ebx jnz NEAR L$000start - ; + ; ; FP mov edx,DWORD [28+esp] ror edi,1 @@ -840,35 +840,35 @@ L$000start: and esi,0xaaaaaaaa xor eax,esi xor edi,esi - ; + ; rol eax,23 mov esi,eax xor eax,edi and eax,0x03fc03fc xor esi,eax xor edi,eax - ; + ; rol esi,10 mov eax,esi xor esi,edi and esi,0x33333333 xor eax,esi xor edi,esi - ; + ; rol edi,18 mov esi,edi xor edi,eax and edi,0xfff0000f xor esi,edi xor eax,edi - ; + ; rol esi,12 mov edi,esi xor esi,eax and esi,0xf0f0f0f0 xor edi,esi xor eax,esi - ; + ; ror eax,4 mov DWORD [edx],eax mov DWORD [4+edx],edi diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/des-586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/des-586.asm index d4a46e16060f..3d6ee2a5e4b3 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/des-586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/des/des-586.asm @@ -951,7 +951,7 @@ _DES_encrypt1: L$_DES_encrypt1_begin: push esi push edi - ; + ; ; Load the 2 words mov esi,DWORD [12+esp] xor ecx,ecx @@ -960,7 +960,7 @@ L$_DES_encrypt1_begin: mov eax,DWORD [esi] mov ebx,DWORD [28+esp] mov edi,DWORD [4+esi] - ; + ; ; IP rol eax,4 mov esi,eax @@ -968,35 +968,35 @@ L$_DES_encrypt1_begin: and eax,0xf0f0f0f0 xor esi,eax xor edi,eax - ; + ; rol edi,20 mov eax,edi xor edi,esi and edi,0xfff0000f xor eax,edi xor esi,edi - ; + ; rol eax,14 mov edi,eax xor eax,esi and eax,0x33333333 xor edi,eax xor esi,eax - ; + ; rol esi,22 mov eax,esi xor esi,edi and esi,0x03fc03fc xor eax,esi xor edi,esi - ; + ; rol eax,9 mov esi,eax xor eax,edi and eax,0xaaaaaaaa xor esi,eax xor edi,eax - ; + ; rol edi,1 call L$000pic_point L$000pic_point: @@ -1010,7 +1010,7 @@ L$000pic_point: L$001decrypt: call __x86_DES_decrypt L$002done: - ; + ; ; FP mov edx,DWORD [20+esp] ror esi,1 @@ -1019,35 +1019,35 @@ L$002done: and edi,0xaaaaaaaa xor eax,edi xor esi,edi - ; + ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax - ; + ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi - ; + ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi - ; + ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi - ; + ; ror eax,4 mov DWORD [edx],eax mov DWORD [4+edx],esi @@ -1062,7 +1062,7 @@ _DES_encrypt2: L$_DES_encrypt2_begin: push esi push edi - ; + ; ; Load the 2 words mov eax,DWORD [12+esp] xor ecx,ecx @@ -1085,7 +1085,7 @@ L$003pic_point: L$004decrypt: call __x86_DES_decrypt L$005done: - ; + ; ; Fixup ror edi,3 mov eax,DWORD [20+esp] @@ -1106,12 +1106,12 @@ L$_DES_encrypt3_begin: push ebp push esi push edi - ; + ; ; Load the data words mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] sub esp,12 - ; + ; ; IP rol edi,4 mov edx,edi @@ -1119,35 +1119,35 @@ L$_DES_encrypt3_begin: and edi,0xf0f0f0f0 xor edx,edi xor esi,edi - ; + ; rol esi,20 mov edi,esi xor esi,edx and esi,0xfff0000f xor edi,esi xor edx,esi - ; + ; rol edi,14 mov esi,edi xor edi,edx and edi,0x33333333 xor esi,edi xor edx,edi - ; + ; rol edx,22 mov edi,edx xor edx,esi and edx,0x03fc03fc xor edi,edx xor esi,edx - ; + ; rol edi,9 mov edx,edi xor edi,esi and edi,0xaaaaaaaa xor edx,edi xor esi,edi - ; + ; ror edx,3 ror esi,2 mov DWORD [4+ebx],esi @@ -1170,7 +1170,7 @@ L$_DES_encrypt3_begin: add esp,12 mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] - ; + ; ; FP rol esi,2 rol edi,3 @@ -1179,35 +1179,35 @@ L$_DES_encrypt3_begin: and edi,0xaaaaaaaa xor eax,edi xor esi,edi - ; + ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax - ; + ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi - ; + ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi - ; + ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi - ; + ; ror eax,4 mov DWORD [ebx],eax mov DWORD [4+ebx],esi @@ -1225,12 +1225,12 @@ L$_DES_decrypt3_begin: push ebp push esi push edi - ; + ; ; Load the data words mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] sub esp,12 - ; + ; ; IP rol edi,4 mov edx,edi @@ -1238,35 +1238,35 @@ L$_DES_decrypt3_begin: and edi,0xf0f0f0f0 xor edx,edi xor esi,edi - ; + ; rol esi,20 mov edi,esi xor esi,edx and esi,0xfff0000f xor edi,esi xor edx,esi - ; + ; rol edi,14 mov esi,edi xor edi,edx and edi,0x33333333 xor esi,edi xor edx,edi - ; + ; rol edx,22 mov edi,edx xor edx,esi and edx,0x03fc03fc xor edi,edx xor esi,edx - ; + ; rol edi,9 mov edx,edi xor edi,esi and edi,0xaaaaaaaa xor edx,edi xor esi,edi - ; + ; ror edx,3 ror esi,2 mov DWORD [4+ebx],esi @@ -1289,7 +1289,7 @@ L$_DES_decrypt3_begin: add esp,12 mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] - ; + ; ; FP rol esi,2 rol edi,3 @@ -1298,35 +1298,35 @@ L$_DES_decrypt3_begin: and edi,0xaaaaaaaa xor eax,edi xor esi,edi - ; + ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax - ; + ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi - ; + ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi - ; + ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi - ; + ; ror eax,4 mov DWORD [ebx],eax mov DWORD [4+ebx],esi @@ -1339,7 +1339,7 @@ global _DES_ncbc_encrypt align 16 _DES_ncbc_encrypt: L$_DES_ncbc_encrypt_begin: - ; + ; push ebp push ebx push esi @@ -1517,7 +1517,7 @@ global _DES_ede3_cbc_encrypt align 16 _DES_ede3_cbc_encrypt: L$_DES_ede3_cbc_encrypt_begin: - ; + ; push ebp push ebx push esi diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/ec/ecp_nistz256-x86.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/ec/ecp_nistz256-x86.asm index 8203213818f3..7383523877ee 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/ec/ecp_nistz256-x86.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/ec/ecp_nistz256-x86.asm @@ -3829,7 +3829,7 @@ L$_ecp_nistz256_scatter_w7_begin: mov edi,DWORD [20+esp] mov esi,DWORD [24+esp] mov ebp,DWORD [28+esp] - lea edi,[ebp*1+edi-1] + lea edi,[ebp*1+edi] mov ebp,16 L$007scatter_w7_loop: mov eax,DWORD [esi] diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/md5/md5-586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/md5/md5-586.asm index efa6b5f8949b..90663d022d71 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/md5/md5-586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/md5/md5-586.asm @@ -26,7 +26,7 @@ L$_md5_block_asm_data_order_begin: mov ecx,DWORD [8+edi] mov edx,DWORD [12+edi] L$000start: - ; + ; ; R0 section mov edi,ecx mov ebp,DWORD [esi] @@ -190,7 +190,7 @@ L$000start: rol ebx,22 mov edi,ecx add ebx,ecx - ; + ; ; R1 section ; R1 16 xor edi,ebx @@ -352,7 +352,7 @@ L$000start: mov edi,ecx rol ebx,20 add ebx,ecx - ; + ; ; R2 section ; R2 32 xor edi,edx @@ -498,7 +498,7 @@ L$000start: mov edi,-1 rol ebx,23 add ebx,ecx - ; + ; ; R3 section ; R3 48 xor edi,edx diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/ripemd/rmd-586.asm b/deps/openssl/config/archs/VC-WIN32/asm/crypto/ripemd/rmd-586.asm index 0a0588884572..a5ab6836728a 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/ripemd/rmd-586.asm +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/ripemd/rmd-586.asm @@ -21,7 +21,7 @@ L$_ripemd160_block_asm_data_order_begin: push ebx sub esp,108 L$000start: - ; + ; mov ebx,DWORD [eax] mov ebp,DWORD [4+eax] mov DWORD [esp],ebx diff --git a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslconf.h index 630bb306230e..19c35390f167 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/VC-WIN32/asm/openssl.gypi b/deps/openssl/config/archs/VC-WIN32/asm/openssl.gypi index 10fa852b2adf..31ec4eb42c05 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/openssl.gypi +++ b/deps/openssl/config/archs/VC-WIN32/asm/openssl.gypi @@ -211,6 +211,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -567,6 +568,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm b/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm index a7afa26f5185..e4f7a3d14edf 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "VC-WIN32", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1099,6 +1099,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1265,10 +1269,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3961,6 +3977,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6245,6 +6267,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7232,6 +7260,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7404,9 +7436,9 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", "include", + "test", ".", ], "test/threadstest.o" => @@ -7426,10 +7458,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7585,6 +7630,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7625,7 +7671,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7964,6 +8013,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8084,9 +8136,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9080,6 +9141,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h index c58c6e6c40b8..a9c58caa468f 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h @@ -9,4 +9,4 @@ static const char cflags[] = { 'c','o','m','p','i','l','e','r',':',' ','c','c','\0' }; #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 3 00:39:00 2018" +#define DATE "built on: Tue Aug 14 23:13:48 2018" diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h index 1f09ee0d7fbe..eaf7b68125fa 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/openssl.gypi b/deps/openssl/config/archs/VC-WIN32/no-asm/openssl.gypi index 09aef657a42f..379f77ea5058 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm b/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm index 95949bf7a465..fefc45903a7c 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "VC-WIN64A", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1101,6 +1101,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1267,10 +1271,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -4023,6 +4039,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6367,6 +6389,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7366,6 +7394,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7560,10 +7592,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7719,6 +7764,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7759,7 +7805,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8098,6 +8147,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8218,9 +8270,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9254,6 +9315,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10738,6 +10803,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11275,6 +11344,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11645,6 +11715,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12650,6 +12721,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12999,6 +13079,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13007,6 +13095,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont.asm b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont.asm index f58343ff2b00..26908c313b2c 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont.asm +++ b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont.asm @@ -214,30 +214,30 @@ $L$inner_enter: xor r14,r14 mov rax,QWORD[rsp] - lea rsi,[rsp] mov r15,r9 - jmp NEAR $L$sub + ALIGN 16 $L$sub: sbb rax,QWORD[r14*8+rcx] mov QWORD[r14*8+rdi],rax - mov rax,QWORD[8+r14*8+rsi] + mov rax,QWORD[8+r14*8+rsp] lea r14,[1+r14] dec r15 jnz NEAR $L$sub sbb rax,0 + mov rbx,-1 + xor rbx,rax xor r14,r14 - and rsi,rax - not rax - mov rcx,rdi - and rcx,rax mov r15,r9 - or rsi,rcx -ALIGN 16 + $L$copy: - mov rax,QWORD[r14*8+rsi] - mov QWORD[r14*8+rsp],r14 - mov QWORD[r14*8+rdi],rax + mov rcx,QWORD[r14*8+rdi] + mov rdx,QWORD[r14*8+rsp] + and rcx,rbx + and rdx,rax + mov QWORD[r14*8+rsp],r9 + or rdx,rcx + mov QWORD[r14*8+rdi],rdx lea r14,[1+r14] sub r15,1 jnz NEAR $L$copy @@ -605,10 +605,10 @@ $L$inner4x: cmp r14,r9 jb NEAR $L$outer4x mov rdi,QWORD[16+r9*8+rsp] + lea r15,[((-4))+r9] mov rax,QWORD[rsp] - pxor xmm0,xmm0 mov rdx,QWORD[8+rsp] - shr r9,2 + shr r15,2 lea rsi,[rsp] xor r14,r14 @@ -616,9 +616,7 @@ $L$inner4x: mov rbx,QWORD[16+rsi] mov rbp,QWORD[24+rsi] sbb rdx,QWORD[8+rcx] - lea r15,[((-1))+r9] - jmp NEAR $L$sub4x -ALIGN 16 + $L$sub4x: mov QWORD[r14*8+rdi],rax mov QWORD[8+r14*8+rdi],rdx @@ -645,34 +643,35 @@ $L$sub4x: sbb rax,0 mov QWORD[24+r14*8+rdi],rbp - xor r14,r14 - and rsi,rax - not rax - mov rcx,rdi - and rcx,rax - lea r15,[((-1))+r9] - or rsi,rcx - - movdqu xmm1,XMMWORD[rsi] - movdqa XMMWORD[rsp],xmm0 - movdqu XMMWORD[rdi],xmm1 + pxor xmm0,xmm0 +DB 102,72,15,110,224 + pcmpeqd xmm5,xmm5 + pshufd xmm4,xmm4,0 + mov r15,r9 + pxor xmm5,xmm4 + shr r15,2 + xor eax,eax + jmp NEAR $L$copy4x ALIGN 16 $L$copy4x: - movdqu xmm2,XMMWORD[16+r14*1+rsi] - movdqu xmm1,XMMWORD[32+r14*1+rsi] - movdqa XMMWORD[16+r14*1+rsp],xmm0 - movdqu XMMWORD[16+r14*1+rdi],xmm2 - movdqa XMMWORD[32+r14*1+rsp],xmm0 - movdqu XMMWORD[32+r14*1+rdi],xmm1 - lea r14,[32+r14] + movdqa xmm1,XMMWORD[rax*1+rsp] + movdqu xmm2,XMMWORD[rax*1+rdi] + pand xmm1,xmm4 + pand xmm2,xmm5 + movdqa xmm3,XMMWORD[16+rax*1+rsp] + movdqa XMMWORD[rax*1+rsp],xmm0 + por xmm1,xmm2 + movdqu xmm2,XMMWORD[16+rax*1+rdi] + movdqu XMMWORD[rax*1+rdi],xmm1 + pand xmm3,xmm4 + pand xmm2,xmm5 + movdqa XMMWORD[16+rax*1+rsp],xmm0 + por xmm3,xmm2 + movdqu XMMWORD[16+rax*1+rdi],xmm3 + lea rax,[32+rax] dec r15 jnz NEAR $L$copy4x - - shl r9,2 - movdqu xmm2,XMMWORD[16+r14*1+rsi] - movdqa XMMWORD[16+r14*1+rsp],xmm0 - movdqu XMMWORD[16+r14*1+rdi],xmm2 mov rsi,QWORD[8+r9*8+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont5.asm b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont5.asm index e0fb22b79e35..de93630c8f5a 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont5.asm +++ b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/bn/x86_64-mont5.asm @@ -410,18 +410,19 @@ $L$sub: sbb rax,QWORD[r14*8+rcx] jnz NEAR $L$sub sbb rax,0 + mov rbx,-1 + xor rbx,rax xor r14,r14 - and rsi,rax - not rax - mov rcx,rdi - and rcx,rax mov r15,r9 - or rsi,rcx -ALIGN 16 + $L$copy: - mov rax,QWORD[r14*8+rsi] + mov rcx,QWORD[r14*8+rdi] + mov rdx,QWORD[r14*8+rsp] + and rcx,rbx + and rdx,rax mov QWORD[r14*8+rsp],r14 - mov QWORD[r14*8+rdi],rax + or rdx,rcx + mov QWORD[r14*8+rdi],rdx lea r14,[1+r14] sub r15,1 jnz NEAR $L$copy diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h index bae537d4013c..b4a762c77e93 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h @@ -9,4 +9,4 @@ static const char cflags[] = { 'c','o','m','p','i','l','e','r',':',' ','c','c','\0' }; #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 3 00:38:54 2018" +#define DATE "built on: Tue Aug 14 23:13:42 2018" diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/x86_64cpuid.asm b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/x86_64cpuid.asm index cda3538dbab3..2aede40d9eef 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/x86_64cpuid.asm +++ b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/x86_64cpuid.asm @@ -456,3 +456,4 @@ $L$tail_rdseed_bytes: $L$done_rdseed_bytes: DB 0F3h,0C3h ;repret + diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslconf.h index 01084232d8d7..fd1ca5612f3e 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/openssl.gypi b/deps/openssl/config/archs/VC-WIN64A/asm/openssl.gypi index 8fccfe154d19..b7ce577c2a1a 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/openssl.gypi +++ b/deps/openssl/config/archs/VC-WIN64A/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm b/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm index b7918f728d50..909baa10162a 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "VC-WIN64A", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1100,6 +1100,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1266,10 +1270,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3962,6 +3978,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6246,6 +6268,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7233,6 +7261,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7406,8 +7438,8 @@ our %unified_info = ( "test/testutil.o" => [ "crypto/include", - "test", "include", + "test", ".", ], "test/threadstest.o" => @@ -7427,10 +7459,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7586,6 +7631,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7626,7 +7672,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7965,6 +8014,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8085,9 +8137,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9081,6 +9142,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10525,6 +10590,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11044,6 +11113,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11404,6 +11474,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12407,6 +12478,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12756,6 +12836,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12764,6 +12852,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h index 12173ecb400e..c255115fe5fe 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h @@ -9,4 +9,4 @@ static const char cflags[] = { 'c','o','m','p','i','l','e','r',':',' ','c','c','\0' }; #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 3 00:38:58 2018" +#define DATE "built on: Tue Aug 14 23:13:46 2018" diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h index dfe71f8c6075..097c8ae7bfc6 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/openssl.gypi b/deps/openssl/config/archs/VC-WIN64A/no-asm/openssl.gypi index 54cef95adbde..d9f65b4a877a 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/aix-gcc/asm/configdata.pm b/deps/openssl/config/archs/aix-gcc/asm/configdata.pm index 4fe3ed16b6f1..e63eec47d846 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/aix-gcc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "aix-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -871,11 +871,6 @@ our %unified_info = ( "libcrypto", "libssl", ], - "test/buildtest_opensslconf" => - [ - "libcrypto", - "libssl", - ], "test/buildtest_opensslv" => [ "libcrypto", @@ -1084,6 +1079,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1250,10 +1249,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -2328,11 +2339,6 @@ our %unified_info = ( "test/generate_buildtest.pl", "ocsp", ], - "test/buildtest_opensslconf.c" => - [ - "test/generate_buildtest.pl", - "opensslconf", - ], "test/buildtest_opensslv.c" => [ "test/generate_buildtest.pl", @@ -3975,6 +3981,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6307,6 +6319,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7112,10 +7130,6 @@ our %unified_info = ( [ "include", ], - "test/buildtest_opensslconf.o" => - [ - "include", - ], "test/buildtest_opensslv.o" => [ "include", @@ -7298,6 +7312,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7470,9 +7488,9 @@ our %unified_info = ( ], "test/testutil.o" => [ + "test", "crypto/include", "include", - "test", ".", ], "test/threadstest.o" => @@ -7492,10 +7510,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7607,7 +7638,6 @@ our %unified_info = ( "test/buildtest_obj_mac", "test/buildtest_objects", "test/buildtest_ocsp", - "test/buildtest_opensslconf", "test/buildtest_opensslv", "test/buildtest_ossl_typ", "test/buildtest_pem", @@ -7652,6 +7682,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7692,7 +7723,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7942,9 +7976,6 @@ our %unified_info = ( "test/buildtest_ocsp" => [ ], - "test/buildtest_opensslconf" => - [ - ], "test/buildtest_opensslv" => [ ], @@ -8077,6 +8108,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8197,9 +8231,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9208,6 +9251,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10684,6 +10731,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11208,6 +11259,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11577,6 +11629,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12222,14 +12275,6 @@ our %unified_info = ( [ "test/buildtest_ocsp.c", ], - "test/buildtest_opensslconf" => - [ - "test/buildtest_opensslconf.o", - ], - "test/buildtest_opensslconf.o" => - [ - "test/buildtest_opensslconf.c", - ], "test/buildtest_opensslv" => [ "test/buildtest_opensslv.o", @@ -12588,6 +12633,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12937,6 +12991,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12945,6 +13007,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aes-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aes-ppc.s index 2b16116024d6..dad9e59c718a 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aes-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aes-ppc.s @@ -8,7 +8,7 @@ LAES_Te: mflr 3 addi 3,3,120 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -18,7 +18,7 @@ LAES_Td: mflr 3 addi 3,3,2360 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -739,7 +739,7 @@ Lenc_done: lwz 31,124(1) mtlr 0 addi 1,1,128 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -819,7 +819,7 @@ Lenc_loop: bc 16,0,Lenc_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -884,7 +884,7 @@ Lenc_loop: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1029,7 +1029,7 @@ Lenc_compact_done: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1173,7 +1173,7 @@ Ldec_done: lwz 31,124(1) mtlr 0 addi 1,1,128 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1253,7 +1253,7 @@ Ldec_loop: bc 16,0,Ldec_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -1318,7 +1318,7 @@ Ldec_loop: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1548,7 +1548,7 @@ Ldec_compact_done: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aesp8-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aesp8-ppc.s index bd2926e0b4a2..af77b045249a 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aesp8-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/aesp8-ppc.s @@ -14,7 +14,7 @@ Lconsts: mflr 6 addi 6,6,-0x48 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 @@ -277,7 +277,7 @@ Ldone: Lenc_key_abort: mr 3,6 - blr + blr .long 0 .byte 0,12,0x14,1,0,0,3,0 .long 0 @@ -325,7 +325,7 @@ Ldeckey: xor 3,3,3 Ldec_key_abort: addi 1,1,32 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,3,0 .long 0 @@ -392,7 +392,7 @@ Loop_enc: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -459,7 +459,7 @@ Loop_dec: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -620,7 +620,7 @@ Lcbc_done: stvx 2,10,7 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -910,8 +910,8 @@ Loop_cbc_dec8x: addic. 5,5,128 beq Lcbc_dec8x_done - nop - nop + nop + nop Loop_cbc_dec8x_tail: .long 0x11EFC548 @@ -999,15 +999,15 @@ Loop_cbc_dec8x_tail: cmplwi 5,32 blt Lcbc_dec8x_one - nop + nop beq Lcbc_dec8x_two cmplwi 5,64 blt Lcbc_dec8x_three - nop + nop beq Lcbc_dec8x_four cmplwi 5,96 blt Lcbc_dec8x_five - nop + nop beq Lcbc_dec8x_six Lcbc_dec8x_seven: @@ -1194,7 +1194,7 @@ Lcbc_dec8x_done: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1301,7 +1301,7 @@ Loop_ctr32_enc: stvx 2,0,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -1604,15 +1604,15 @@ Loop_ctr32_enc8x_middle: Lctr32_enc8x_break: cmpwi 5,-0x60 blt Lctr32_enc8x_one - nop + nop beq Lctr32_enc8x_two cmpwi 5,-0x40 blt Lctr32_enc8x_three - nop + nop beq Lctr32_enc8x_four cmpwi 5,-0x20 blt Lctr32_enc8x_five - nop + nop beq Lctr32_enc8x_six cmpwi 5,0x00 blt Lctr32_enc8x_seven @@ -1821,7 +1821,7 @@ Lctr32_enc8x_done: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1958,7 +1958,7 @@ Loop_xts_enc: .long 0x10620509 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2031,7 +2031,7 @@ Lxts_enc_done: Lxts_enc_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2171,7 +2171,7 @@ Loop_xts_dec: .long 0x10620549 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2236,7 +2236,7 @@ Loop_xts_dec_short: .long 0x10620549 - nop + nop .long 0x7C602799 @@ -2287,7 +2287,7 @@ Lxts_dec_done: Lxts_dec_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2618,11 +2618,11 @@ Loop_xts_enc6x: beq Lxts_enc6x_zero cmpwi 5,0x20 blt Lxts_enc6x_one - nop + nop beq Lxts_enc6x_two cmpwi 5,0x40 blt Lxts_enc6x_three - nop + nop beq Lxts_enc6x_four Lxts_enc6x_five: @@ -2719,7 +2719,7 @@ Lxts_enc6x_two: .align 4 Lxts_enc6x_one: vxor 7,5,17 - nop + nop Loop_xts_enc1x: .long 0x10E7C508 lvx 24,26,7 @@ -2855,7 +2855,7 @@ Lxts_enc6x_ret: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -2940,7 +2940,7 @@ _aesp8_xts_enc5x: .long 0x11AD1509 .long 0x11CE1D09 .long 0x11EF2509 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -3268,11 +3268,11 @@ Loop_xts_dec6x: beq Lxts_dec6x_zero cmpwi 5,0x20 blt Lxts_dec6x_one - nop + nop beq Lxts_dec6x_two cmpwi 5,0x40 blt Lxts_dec6x_three - nop + nop beq Lxts_dec6x_four Lxts_dec6x_five: @@ -3373,7 +3373,7 @@ Lxts_dec6x_two: .align 4 Lxts_dec6x_one: vxor 7,5,17 - nop + nop Loop_xts_dec1x: .long 0x10E7C548 lvx 24,26,7 @@ -3543,7 +3543,7 @@ Lxts_dec6x_ret: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3628,6 +3628,6 @@ _aesp8_xts_dec5x: .long 0x11CE1D49 .long 0x11EF2549 mtctr 9 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/vpaes-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/vpaes-ppc.s index 6f29a012fa7f..b264c900333a 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/vpaes-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/aes/vpaes-ppc.s @@ -95,7 +95,7 @@ Lconsts: mflr 12 addi 12,12,-0x308 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 @@ -135,7 +135,7 @@ _vpaes_encrypt_preheat: lvx 17, 12, 8 lvx 18, 12, 11 lvx 19, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -223,7 +223,7 @@ Lenc_entry: vxor 4, 4, 5 vxor 0, 0, 4 vperm 0, 0, 7, 1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -318,7 +318,7 @@ Lenc_done: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -360,7 +360,7 @@ _vpaes_decrypt_preheat: lvx 21, 12, 8 lvx 22, 12, 11 lvx 23, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -455,7 +455,7 @@ Ldec_entry: vxor 4, 4, 5 vxor 0, 1, 4 vperm 0, 0, 7, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -550,7 +550,7 @@ Ldec_done: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -777,7 +777,7 @@ Lcbc_abort: lwz 31,236(1) mtlr 0 addi 1,1,240 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,2,6,0 .long 0 @@ -831,7 +831,7 @@ _vpaes_key_preheat: lvx 24, 12, 9 lvx 25, 0, 12 lvx 26, 12, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1077,7 +1077,7 @@ Lschedule_mangle_done: vxor 6, 6, 6 vxor 7, 7, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1105,7 +1105,7 @@ _vpaes_schedule_192_smear: vor 0, 6, 6 vsldoi 6, 6, 9, 8 vsldoi 6, 9, 6, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1171,7 +1171,7 @@ _vpaes_schedule_low_round: vxor 0, 1, 7 vxor 7, 1, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1193,7 +1193,7 @@ _vpaes_schedule_transform: vperm 2, 13, 13, 2 vxor 0, 0, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1245,7 +1245,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .align 4 Lschedule_mangle_dec: @@ -1296,7 +1296,7 @@ Lschedule_mangle_dec: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1372,7 +1372,7 @@ Lschedule_mangle_dec: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -1455,7 +1455,8 @@ Lschedule_mangle_dec: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 + diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/bn-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/bn-ppc.s index 51fd8f0b4999..3f3b3057de02 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/bn-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/bn-ppc.s @@ -227,7 +227,7 @@ stw 9,24(3) stw 10,28(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -655,7 +655,7 @@ stw 9, 60(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -809,7 +809,7 @@ stw 10,24(3) stw 11,28(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1348,7 +1348,7 @@ adde 10,10,9 stw 12,56(3) stw 10,60(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1399,7 +1399,7 @@ Lppcasm_sub_mainloop: Lppcasm_sub_adios: subfze 3,0 andi. 3,3,1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1445,7 +1445,7 @@ Lppcasm_add_mainloop: bc 16,0,Lppcasm_add_mainloop Lppcasm_add_adios: addze 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1474,7 +1474,7 @@ Lppcasm_add_adios: cmplwi 0,5,0 bne Lppcasm_div1 li 3,-1 - blr + blr Lppcasm_div1: xor 0,0,0 li 8,32 @@ -1561,7 +1561,7 @@ Lppcasm_div8: b Lppcasm_divouterloop Lppcasm_div9: or 3,8,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1603,7 +1603,7 @@ Lppcasm_sqr_mainloop: stwu 8,4(3) bc 16,0,Lppcasm_sqr_mainloop Lppcasm_sqr_adios: - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1709,7 +1709,7 @@ Lppcasm_mw_REM: Lppcasm_mw_OVER: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1835,7 +1835,7 @@ Lppcasm_maw_leftover: Lppcasm_maw_adios: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc-mont.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc-mont.s index a9384f70b07d..267308a6ac3b 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc-mont.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc-mont.s @@ -9,7 +9,7 @@ li 3,0 bclr 12,0 cmpwi 8,32 - bgelr + bgelr slwi 8,8,2 li 12,-4096 addi 3,8,256 @@ -182,15 +182,16 @@ Lsub: lwzx 12,22,21 li 21,0 mtctr 8 subfe 3,21,3 - and 4,22,3 - andc 6,9,3 - or 4,4,6 .align 4 Lcopy: - lwzx 12,4,21 - stwx 12,9,21 + lwzx 12,22,21 + lwzx 10,9,21 + and 12,12,3 + andc 10,10,3 stwx 21,22,21 + or 10,10,12 + stwx 10,9,21 addi 21,21,4 bc 16,0,Lcopy @@ -209,7 +210,7 @@ Lcopy: lwz 30,-8(12) lwz 31,-4(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc64-mont.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc64-mont.s index 281d64ae7dc6..1506bcc03aae 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc64-mont.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/bn/ppc64-mont.s @@ -888,11 +888,8 @@ Lsub: lwz 24,12(10) li 12,0 subfe 3,12,3 - addi 10,1,196 + addi 4,1,196 subf 9,8,9 - and 4,10,3 - andc 6,9,3 - or 4,4,6 addi 10,1,192 mtctr 11 @@ -902,6 +899,10 @@ Lcopy: lwz 25,8(4) lwz 26,12(4) lwzu 27,16(4) + lwz 28,4(9) + lwz 29,8(9) + lwz 30,12(9) + lwz 31,16(9) std 12,8(22) std 12,16(22) std 12,24(22) @@ -910,6 +911,18 @@ Lcopy: std 12,48(22) std 12,56(22) stdu 12,64(22) + and 24,24,3 + and 25,25,3 + and 26,26,3 + and 27,27,3 + andc 28,28,3 + andc 29,29,3 + andc 30,30,3 + andc 31,31,3 + or 24,24,28 + or 25,25,29 + or 26,26,30 + or 27,27,31 stw 24,4(9) stw 25,8(9) stw 26,12(9) @@ -945,7 +958,7 @@ Lcopy: lfd 30,-16(12) lfd 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x8c,13,6,0 .long 0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/aix-gcc/asm/crypto/buildinf.h index f75553781fed..55bdf4131b04 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/buildinf.h @@ -26,4 +26,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: aix-gcc" -#define DATE "built on: Tue Apr 3 00:38:08 2018" +#define DATE "built on: Tue Aug 14 23:12:56 2018" diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/chacha/chacha-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/chacha/chacha-ppc.s index 9130400355be..e4e4612d3aab 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/chacha/chacha-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/chacha/chacha-ppc.s @@ -59,7 +59,7 @@ __ChaCha20_ctr32_int: lwz 31,156(1) mtlr 0 addi 1,1,160 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,5,0 .long 0 @@ -345,7 +345,7 @@ Loop: bne Loop_outer - blr + blr .align 4 Ltail: @@ -396,7 +396,7 @@ Loop_tail: stw 1,80(1) stw 1,84(1) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -554,7 +554,7 @@ Loop_outer_vmx: vspltisw 27,7 mtctr 0 - nop + nop Loop_vmx: vadduwm 0,0,1 add 16,16,20 @@ -1047,7 +1047,7 @@ Laligned_vmx: cmplwi 5,255 bgt Loop_outer_vmx - nop + nop Ldone_vmx: cmplwi 5,0 @@ -1100,7 +1100,7 @@ Ldone_vmx: lwz 31,364(1) mtlr 0 addi 1,1,368 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,18,5,0 .long 0 @@ -1113,7 +1113,7 @@ Lconsts: mflr 12 addi 12,12,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/modes/ghashp8-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/modes/ghashp8-ppc.s index 972f88d9b83f..81d7d24b74e9 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/modes/ghashp8-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/modes/ghashp8-ppc.s @@ -122,7 +122,7 @@ .long 0x7E4A1F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -171,7 +171,7 @@ .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -287,7 +287,7 @@ Leven: .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -554,7 +554,7 @@ Ldone_4x: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppc.s index 3063cd30a200..1adc3641dbb3 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppc.s @@ -35,7 +35,7 @@ Lno_key: xor 3,3,3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 @@ -236,7 +236,7 @@ Loop: lwz 31,92(1) addi 1,1,96 Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,18,4,0 @@ -300,7 +300,7 @@ Labort: lwz 30,88(1) lwz 31,92(1) addi 1,1,96 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppcfp.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppcfp.s index 17d3aeb19596..f4cc796fa70c 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppcfp.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/poly1305/poly1305-ppcfp.s @@ -145,7 +145,7 @@ Lno_key: xor 3,3,3 addi 1,1,24 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,2,0 @@ -460,7 +460,7 @@ Lentry: lfd 31,208(1) addi 1,1,216 Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,0,4,0 @@ -544,7 +544,7 @@ Labort: lwz 30,32(1) lwz 31,36(1) addi 1,1,40 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 @@ -555,7 +555,7 @@ LPICmeup: mflr 5 addi 5,5,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/ppccpuid.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/ppccpuid.s index 85665a604604..2eb7bd60a4b3 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/ppccpuid.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/ppccpuid.s @@ -5,7 +5,7 @@ .align 4 .OPENSSL_fpu_probe: fmr 0,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -14,7 +14,7 @@ .OPENSSL_ppc64_probe: fcfid 1,1 rldicl 0,0,32,32 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -23,7 +23,7 @@ .align 4 .OPENSSL_altivec_probe: .long 0x10000484 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -33,7 +33,7 @@ .OPENSSL_crypto207_probe: .long 0x7C000E99 .long 0x10000508 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -44,7 +44,7 @@ xor 0,0,0 .long 0x10600033 .long 0x10600031 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -76,7 +76,7 @@ xor 12,12,12 fmr 12,31 fmr 13,31 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -89,7 +89,7 @@ Ladd: lwarx 5,0,3 stwcx. 0,0,3 bne- Ladd mr 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -104,7 +104,7 @@ Loop_rdtsc: mftbu 4 cmplw 0,4,5 bne Loop_rdtsc - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -121,7 +121,7 @@ Little: mtctr 4 stb 0,0(3) addi 3,3,1 bc 16,0,$-8 - blr + blr Lot: andi. 5,3,3 beq Laligned stb 0,0(3) @@ -136,7 +136,7 @@ Laligned: bc 16,0,$-8 andi. 4,4,3 bne Little - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -162,7 +162,7 @@ Lno_data: li 3,0 sub 3,3,0 extrwi 3,3,1,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -193,7 +193,7 @@ Loop: mftb 6 bc 16,0,Loop mr 3,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -245,7 +245,8 @@ Loop2: Ldone2: srwi 4,4,2 sub 3,0,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 + diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha1-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha1-ppc.s index 41cf5f850a1d..2cbfbd5a3c2d 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha1-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha1-ppc.s @@ -100,7 +100,7 @@ Ldone: lwz 31,156(1) mtlr 0 addi 1,1,160 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1108,7 +1108,7 @@ Lsha1_block_private: mr 11,20 addi 4,4,64 bc 16,0,Lsha1_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256-ppc.s index 1b8f10817411..0be5e923ef56 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256-ppc.s @@ -120,7 +120,7 @@ Ldone: lwz 31,188(1) mtlr 0 addi 1,1,192 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1286,7 +1286,7 @@ Lrounds: cmplw 0,31,5 stw 15,28(3) bne Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1297,7 +1297,7 @@ LPICmeup: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256p8-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256p8-ppc.s index 8f73813109de..e252f6fe29b3 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256p8-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha256p8-ppc.s @@ -772,7 +772,7 @@ L16_xx: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -784,7 +784,7 @@ LPICmeup: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512-ppc.s index 82da5d2e4e2d..ca3c3629a098 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512-ppc.s @@ -127,7 +127,7 @@ Ldone: lwz 31,252(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -2972,7 +2972,7 @@ Lrounds: stw 4,164(1) cmplw 0,4,5 bne Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -2983,7 +2983,7 @@ LPICmeup: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512p8-ppc.s b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512p8-ppc.s index 08ca5b45730f..930f009de78c 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512p8-ppc.s +++ b/deps/openssl/config/archs/aix-gcc/asm/crypto/sha/sha512p8-ppc.s @@ -773,7 +773,7 @@ L16_xx: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -785,7 +785,7 @@ LPICmeup: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix-gcc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/aix-gcc/asm/include/openssl/opensslconf.h index 8f5c4f48d240..b3ae627c1af7 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/aix-gcc/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/aix-gcc/asm/openssl.gypi b/deps/openssl/config/archs/aix-gcc/asm/openssl.gypi index 68196fdabfda..552c22020ed5 100644 --- a/deps/openssl/config/archs/aix-gcc/asm/openssl.gypi +++ b/deps/openssl/config/archs/aix-gcc/asm/openssl.gypi @@ -217,6 +217,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -577,6 +578,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/aix-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/aix-gcc/no-asm/configdata.pm index b8674f95372b..47fc553ca8b5 100644 --- a/deps/openssl/config/archs/aix-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/aix-gcc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "aix-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3934,6 +3950,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6212,6 +6234,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7199,6 +7227,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7393,10 +7425,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7552,6 +7597,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7592,7 +7638,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7974,6 +8023,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8094,9 +8146,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9085,6 +9146,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10525,6 +10590,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11044,6 +11113,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11404,6 +11474,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12407,6 +12478,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12756,6 +12836,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12764,6 +12852,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/aix-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/aix-gcc/no-asm/crypto/buildinf.h index 8f97dac70a37..915064c8b3fe 100644 --- a/deps/openssl/config/archs/aix-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix-gcc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: aix-gcc" -#define DATE "built on: Tue Apr 3 00:38:09 2018" +#define DATE "built on: Tue Aug 14 23:12:58 2018" diff --git a/deps/openssl/config/archs/aix-gcc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/aix-gcc/no-asm/include/openssl/opensslconf.h index ae6ea775d719..de84cb510b9e 100644 --- a/deps/openssl/config/archs/aix-gcc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/aix-gcc/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/aix-gcc/no-asm/openssl.gypi b/deps/openssl/config/archs/aix-gcc/no-asm/openssl.gypi index 70dc22a3879d..eaa75cb78dbc 100644 --- a/deps/openssl/config/archs/aix-gcc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/aix-gcc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/aix64-gcc/asm/configdata.pm b/deps/openssl/config/archs/aix64-gcc/asm/configdata.pm index 1512a38c0e07..67d415bf12cf 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/aix64-gcc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "aix64-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1079,6 +1079,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1245,10 +1249,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3965,6 +3981,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6297,6 +6319,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7284,6 +7312,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7478,10 +7510,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7637,6 +7682,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7677,7 +7723,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8059,6 +8108,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8179,9 +8231,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9190,6 +9251,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10666,6 +10731,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11190,6 +11259,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11559,6 +11629,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12562,6 +12633,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12911,6 +12991,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12919,6 +13007,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aes-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aes-ppc.s index cc96236fe5b6..32c684cd9c00 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aes-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aes-ppc.s @@ -8,7 +8,7 @@ LAES_Te: mflr 3 addi 3,3,120 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -18,7 +18,7 @@ LAES_Td: mflr 3 addi 3,3,2360 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -739,7 +739,7 @@ Lenc_done: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -819,7 +819,7 @@ Lenc_loop: bc 16,0,Lenc_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -884,7 +884,7 @@ Lenc_loop: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1029,7 +1029,7 @@ Lenc_compact_done: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1173,7 +1173,7 @@ Ldec_done: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1253,7 +1253,7 @@ Ldec_loop: bc 16,0,Ldec_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -1318,7 +1318,7 @@ Ldec_loop: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1515,7 +1515,7 @@ Ldec_compact_done: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aesp8-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aesp8-ppc.s index 0893f20dc869..0c906d17987c 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aesp8-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/aesp8-ppc.s @@ -14,7 +14,7 @@ Lconsts: mflr 6 addi 6,6,-0x48 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 @@ -277,7 +277,7 @@ Ldone: Lenc_key_abort: mr 3,6 - blr + blr .long 0 .byte 0,12,0x14,1,0,0,3,0 .long 0 @@ -325,7 +325,7 @@ Ldeckey: xor 3,3,3 Ldec_key_abort: addi 1,1,64 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,3,0 .long 0 @@ -392,7 +392,7 @@ Loop_enc: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -459,7 +459,7 @@ Loop_dec: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -620,7 +620,7 @@ Lcbc_done: stvx 2,10,7 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -910,8 +910,8 @@ Loop_cbc_dec8x: addic. 5,5,128 beq Lcbc_dec8x_done - nop - nop + nop + nop Loop_cbc_dec8x_tail: .long 0x11EFC548 @@ -999,15 +999,15 @@ Loop_cbc_dec8x_tail: cmplwi 5,32 blt Lcbc_dec8x_one - nop + nop beq Lcbc_dec8x_two cmplwi 5,64 blt Lcbc_dec8x_three - nop + nop beq Lcbc_dec8x_four cmplwi 5,96 blt Lcbc_dec8x_five - nop + nop beq Lcbc_dec8x_six Lcbc_dec8x_seven: @@ -1194,7 +1194,7 @@ Lcbc_dec8x_done: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1301,7 +1301,7 @@ Loop_ctr32_enc: stvx 2,0,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -1604,15 +1604,15 @@ Loop_ctr32_enc8x_middle: Lctr32_enc8x_break: cmpwi 5,-0x60 blt Lctr32_enc8x_one - nop + nop beq Lctr32_enc8x_two cmpwi 5,-0x40 blt Lctr32_enc8x_three - nop + nop beq Lctr32_enc8x_four cmpwi 5,-0x20 blt Lctr32_enc8x_five - nop + nop beq Lctr32_enc8x_six cmpwi 5,0x00 blt Lctr32_enc8x_seven @@ -1821,7 +1821,7 @@ Lctr32_enc8x_done: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1958,7 +1958,7 @@ Loop_xts_enc: .long 0x10620509 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2031,7 +2031,7 @@ Lxts_enc_done: Lxts_enc_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2171,7 +2171,7 @@ Loop_xts_dec: .long 0x10620549 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2236,7 +2236,7 @@ Loop_xts_dec_short: .long 0x10620549 - nop + nop .long 0x7C602799 @@ -2287,7 +2287,7 @@ Lxts_dec_done: Lxts_dec_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2618,11 +2618,11 @@ Loop_xts_enc6x: beq Lxts_enc6x_zero cmpwi 5,0x20 blt Lxts_enc6x_one - nop + nop beq Lxts_enc6x_two cmpwi 5,0x40 blt Lxts_enc6x_three - nop + nop beq Lxts_enc6x_four Lxts_enc6x_five: @@ -2719,7 +2719,7 @@ Lxts_enc6x_two: .align 4 Lxts_enc6x_one: vxor 7,5,17 - nop + nop Loop_xts_enc1x: .long 0x10E7C508 lvx 24,26,7 @@ -2855,7 +2855,7 @@ Lxts_enc6x_ret: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -2940,7 +2940,7 @@ _aesp8_xts_enc5x: .long 0x11AD1509 .long 0x11CE1D09 .long 0x11EF2509 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -3268,11 +3268,11 @@ Loop_xts_dec6x: beq Lxts_dec6x_zero cmpwi 5,0x20 blt Lxts_dec6x_one - nop + nop beq Lxts_dec6x_two cmpwi 5,0x40 blt Lxts_dec6x_three - nop + nop beq Lxts_dec6x_four Lxts_dec6x_five: @@ -3373,7 +3373,7 @@ Lxts_dec6x_two: .align 4 Lxts_dec6x_one: vxor 7,5,17 - nop + nop Loop_xts_dec1x: .long 0x10E7C548 lvx 24,26,7 @@ -3543,7 +3543,7 @@ Lxts_dec6x_ret: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3628,6 +3628,6 @@ _aesp8_xts_dec5x: .long 0x11CE1D49 .long 0x11EF2549 mtctr 9 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/vpaes-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/vpaes-ppc.s index f2682de7c1fa..0e35758de862 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/vpaes-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/aes/vpaes-ppc.s @@ -95,7 +95,7 @@ Lconsts: mflr 12 addi 12,12,-0x308 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 @@ -135,7 +135,7 @@ _vpaes_encrypt_preheat: lvx 17, 12, 8 lvx 18, 12, 11 lvx 19, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -223,7 +223,7 @@ Lenc_entry: vxor 4, 4, 5 vxor 0, 0, 4 vperm 0, 0, 7, 1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -318,7 +318,7 @@ Lenc_done: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -360,7 +360,7 @@ _vpaes_decrypt_preheat: lvx 21, 12, 8 lvx 22, 12, 11 lvx 23, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -455,7 +455,7 @@ Ldec_entry: vxor 4, 4, 5 vxor 0, 1, 4 vperm 0, 0, 7, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -550,7 +550,7 @@ Ldec_done: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -777,7 +777,7 @@ Lcbc_abort: ld 31,264(1) mtlr 0 addi 1,1,272 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,2,6,0 .long 0 @@ -831,7 +831,7 @@ _vpaes_key_preheat: lvx 24, 12, 9 lvx 25, 0, 12 lvx 26, 12, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1077,7 +1077,7 @@ Lschedule_mangle_done: vxor 6, 6, 6 vxor 7, 7, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1105,7 +1105,7 @@ _vpaes_schedule_192_smear: vor 0, 6, 6 vsldoi 6, 6, 9, 8 vsldoi 6, 9, 6, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1171,7 +1171,7 @@ _vpaes_schedule_low_round: vxor 0, 1, 7 vxor 7, 1, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1193,7 +1193,7 @@ _vpaes_schedule_transform: vperm 2, 13, 13, 2 vxor 0, 0, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1245,7 +1245,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .align 4 Lschedule_mangle_dec: @@ -1296,7 +1296,7 @@ Lschedule_mangle_dec: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1372,7 +1372,7 @@ Lschedule_mangle_dec: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -1455,7 +1455,8 @@ Lschedule_mangle_dec: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 + diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/bn-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/bn-ppc.s index b8414b98f4e9..0f88fd28ff84 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/bn-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/bn-ppc.s @@ -227,7 +227,7 @@ std 9,48(3) std 10,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -655,7 +655,7 @@ std 9, 120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -809,7 +809,7 @@ std 10,48(3) std 11,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1348,7 +1348,7 @@ adde 10,10,9 std 12,112(3) std 10,120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1399,7 +1399,7 @@ Lppcasm_sub_mainloop: Lppcasm_sub_adios: subfze 3,0 andi. 3,3,1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1445,7 +1445,7 @@ Lppcasm_add_mainloop: bc 16,0,Lppcasm_add_mainloop Lppcasm_add_adios: addze 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1474,7 +1474,7 @@ Lppcasm_add_adios: cmpldi 0,5,0 bne Lppcasm_div1 li 3,-1 - blr + blr Lppcasm_div1: xor 0,0,0 li 8,64 @@ -1561,7 +1561,7 @@ Lppcasm_div8: b Lppcasm_divouterloop Lppcasm_div9: or 3,8,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1603,7 +1603,7 @@ Lppcasm_sqr_mainloop: stdu 8,8(3) bc 16,0,Lppcasm_sqr_mainloop Lppcasm_sqr_adios: - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1709,7 +1709,7 @@ Lppcasm_mw_REM: Lppcasm_mw_OVER: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1835,7 +1835,7 @@ Lppcasm_maw_leftover: Lppcasm_maw_adios: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc-mont.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc-mont.s index b767b00a5680..4b8b852812dd 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc-mont.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc-mont.s @@ -180,15 +180,16 @@ Lsub: ldx 12,22,21 li 21,0 mtctr 8 subfe 3,21,3 - and 4,22,3 - andc 6,9,3 - or 4,4,6 .align 4 Lcopy: - ldx 12,4,21 - stdx 12,9,21 + ldx 12,22,21 + ldx 10,9,21 + and 12,12,3 + andc 10,10,3 stdx 21,22,21 + or 10,10,12 + stdx 10,9,21 addi 21,21,8 bc 16,0,Lcopy @@ -207,7 +208,7 @@ Lcopy: ld 30,-16(12) ld 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc64-mont.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc64-mont.s index 2b5e5c9b2571..96ef2a9ea7b6 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc64-mont.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/bn/ppc64-mont.s @@ -679,16 +679,14 @@ Lsub: ldx 24,10,12 li 12,0 subfe 3,12,3 - and 4,10,3 - andc 6,9,3 - or 4,4,6 - addi 31,4,8 mtctr 11 .align 4 Lcopy: - ldx 24,4,12 - ldx 25,31,12 + ldx 24,10,12 + ldx 25,28,12 + ldx 26,9,12 + ldx 27,30,12 std 12,8(22) std 12,16(22) std 12,24(22) @@ -697,6 +695,12 @@ Lcopy: std 12,48(22) std 12,56(22) stdu 12,64(22) + and 24,24,3 + and 25,25,3 + andc 26,26,3 + andc 27,27,3 + or 24,24,26 + or 25,25,27 stdx 24,9,12 stdx 25,30,12 stdx 12,10,12 @@ -731,7 +735,7 @@ Lcopy: lfd 30,-16(12) lfd 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x8c,13,6,0 .long 0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/aix64-gcc/asm/crypto/buildinf.h index eb144269c776..bbb79117cab7 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/buildinf.h @@ -26,4 +26,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: aix64-gcc" -#define DATE "built on: Tue Apr 3 00:38:10 2018" +#define DATE "built on: Tue Aug 14 23:12:58 2018" diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/chacha/chacha-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/chacha/chacha-ppc.s index 60cf843569b0..89e9d28bad36 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/chacha/chacha-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/chacha/chacha-ppc.s @@ -59,7 +59,7 @@ __ChaCha20_ctr32_int: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,5,0 .long 0 @@ -345,7 +345,7 @@ Loop: bne Loop_outer - blr + blr .align 4 Ltail: @@ -396,7 +396,7 @@ Loop_tail: stw 1,104(1) stw 1,108(1) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -554,7 +554,7 @@ Loop_outer_vmx: vspltisw 27,7 mtctr 0 - nop + nop Loop_vmx: vadduwm 0,0,1 add 16,16,20 @@ -1047,7 +1047,7 @@ Laligned_vmx: cmpldi 5,255 bgt Loop_outer_vmx - nop + nop Ldone_vmx: cmpldi 5,0 @@ -1100,7 +1100,7 @@ Ldone_vmx: ld 31,456(1) mtlr 0 addi 1,1,464 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,18,5,0 .long 0 @@ -1113,7 +1113,7 @@ Lconsts: mflr 12 addi 12,12,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/modes/ghashp8-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/modes/ghashp8-ppc.s index 252ddc9d4ff9..db4f73d5590c 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/modes/ghashp8-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/modes/ghashp8-ppc.s @@ -122,7 +122,7 @@ .long 0x7E4A1F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -171,7 +171,7 @@ .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -287,7 +287,7 @@ Leven: .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -554,7 +554,7 @@ Ldone_4x: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppc.s index 0c976f6691df..e5253a563b51 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppc.s @@ -32,7 +32,7 @@ Lno_key: xor 3,3,3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 @@ -126,7 +126,7 @@ Loop: ld 31,184(1) addi 1,1,192 Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,5,4,0 @@ -166,7 +166,7 @@ Labort: li 12,12 stwbrx 8,11,4 stwbrx 7,12,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppcfp.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppcfp.s index a6393e8365be..912a1f593367 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppcfp.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/poly1305/poly1305-ppcfp.s @@ -145,7 +145,7 @@ Lno_key: xor 3,3,3 addi 1,1,48 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,2,0 @@ -460,7 +460,7 @@ Lentry: lfd 31,232(1) addi 1,1,240 Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,0,4,0 @@ -547,7 +547,7 @@ Labort: ld 30,64(1) ld 31,72(1) addi 1,1,80 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 @@ -558,7 +558,7 @@ LPICmeup: mflr 5 addi 5,5,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/ppccpuid.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/ppccpuid.s index d07c409ce4d7..4eabc3834422 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/ppccpuid.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/ppccpuid.s @@ -5,7 +5,7 @@ .align 4 .OPENSSL_fpu_probe: fmr 0,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -14,7 +14,7 @@ .OPENSSL_ppc64_probe: fcfid 1,1 rldicl 0,0,32,32 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -23,7 +23,7 @@ .align 4 .OPENSSL_altivec_probe: .long 0x10000484 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -33,7 +33,7 @@ .OPENSSL_crypto207_probe: .long 0x7C000E99 .long 0x10000508 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -44,7 +44,7 @@ xor 0,0,0 .long 0x10600033 .long 0x10600031 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -76,7 +76,7 @@ xor 12,12,12 fmr 12,31 fmr 13,31 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -89,7 +89,7 @@ Ladd: lwarx 5,0,3 stwcx. 0,0,3 bne- Ladd extsw 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -99,7 +99,7 @@ Ladd: lwarx 5,0,3 .align 4 .OPENSSL_rdtsc: mftb 3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -116,7 +116,7 @@ Little: mtctr 4 stb 0,0(3) addi 3,3,1 bc 16,0,$-8 - blr + blr Lot: andi. 5,3,3 beq Laligned stb 0,0(3) @@ -131,7 +131,7 @@ Laligned: bc 16,0,$-8 andi. 4,4,3 bne Little - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -157,7 +157,7 @@ Lno_data: li 3,0 sub 3,3,0 extrwi 3,3,1,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -188,7 +188,7 @@ Loop: mftb 6 bc 16,0,Loop mr 3,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -240,7 +240,8 @@ Loop2: Ldone2: srwi 4,4,2 sub 3,0,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 + diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha1-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha1-ppc.s index 28dcdd1419f5..1ffbb93d46af 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha1-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha1-ppc.s @@ -100,7 +100,7 @@ Ldone: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1108,7 +1108,7 @@ Lsha1_block_private: mr 11,20 addi 4,4,64 bc 16,0,Lsha1_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256-ppc.s index 8f1d4b312973..b77b0151df92 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256-ppc.s @@ -120,7 +120,7 @@ Ldone: ld 31,312(1) mtlr 0 addi 1,1,320 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1286,7 +1286,7 @@ Lrounds: cmpld 31,5 stw 15,28(3) bne Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1297,7 +1297,7 @@ LPICmeup: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256p8-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256p8-ppc.s index d765e581160c..fa3ea245144a 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256p8-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha256p8-ppc.s @@ -772,7 +772,7 @@ L16_xx: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -784,7 +784,7 @@ LPICmeup: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512-ppc.s index 3a2073c9c87b..910607909338 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512-ppc.s @@ -120,7 +120,7 @@ Ldone: ld 31,376(1) mtlr 0 addi 1,1,384 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1318,7 +1318,7 @@ Lrounds: cmpld 31,5 std 15,56(3) bne Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1329,7 +1329,7 @@ LPICmeup: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512p8-ppc.s b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512p8-ppc.s index a08d4748c105..60c23d4372fb 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512p8-ppc.s +++ b/deps/openssl/config/archs/aix64-gcc/asm/crypto/sha/sha512p8-ppc.s @@ -773,7 +773,7 @@ L16_xx: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -785,7 +785,7 @@ LPICmeup: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/aix64-gcc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/aix64-gcc/asm/include/openssl/opensslconf.h index 5f12b2933d9b..f4459a98a46d 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/aix64-gcc/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/aix64-gcc/asm/openssl.gypi b/deps/openssl/config/archs/aix64-gcc/asm/openssl.gypi index 0985c459cc98..44afda76b5ea 100644 --- a/deps/openssl/config/archs/aix64-gcc/asm/openssl.gypi +++ b/deps/openssl/config/archs/aix64-gcc/asm/openssl.gypi @@ -217,6 +217,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -577,6 +578,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/aix64-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/aix64-gcc/no-asm/configdata.pm index 5e25c7b88b42..0b737280d0cb 100644 --- a/deps/openssl/config/archs/aix64-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/aix64-gcc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "aix64-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3934,6 +3950,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6212,6 +6234,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7199,6 +7227,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7393,10 +7425,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7552,6 +7597,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7592,7 +7638,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7974,6 +8023,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8094,9 +8146,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9085,6 +9146,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10525,6 +10590,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11044,6 +11113,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11404,6 +11474,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12407,6 +12478,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12756,6 +12836,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12764,6 +12852,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/aix64-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/aix64-gcc/no-asm/crypto/buildinf.h index 88cd72b844a2..21038f0e3811 100644 --- a/deps/openssl/config/archs/aix64-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix64-gcc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: aix64-gcc" -#define DATE "built on: Tue Apr 3 00:38:11 2018" +#define DATE "built on: Tue Aug 14 23:12:59 2018" diff --git a/deps/openssl/config/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h index d2aa62353593..123e7f66ed27 100644 --- a/deps/openssl/config/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/aix64-gcc/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/aix64-gcc/no-asm/openssl.gypi b/deps/openssl/config/archs/aix64-gcc/no-asm/openssl.gypi index 25974f0d08fc..45566673058c 100644 --- a/deps/openssl/config/archs/aix64-gcc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/aix64-gcc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm b/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm index 0f822647dfce..5b271b6b96bd 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "darwin-i386-cc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3946,6 +3962,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6272,6 +6294,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7271,6 +7299,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7465,10 +7497,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7624,6 +7669,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7664,7 +7710,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8046,6 +8095,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8166,9 +8218,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9165,6 +9226,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10637,6 +10702,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11166,6 +11235,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11534,6 +11604,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12539,6 +12610,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12888,6 +12968,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12896,6 +12984,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bf/bf-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bf/bf-586.s index a7f782d965f3..bf0238473798 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bf/bf-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bf/bf-586.s @@ -11,7 +11,7 @@ L_BF_encrypt_begin: movl 16(%esp),%ebp pushl %esi pushl %edi - # Load the 2 words + # Load the 2 words movl (%ebx),%edi movl 4(%ebx),%esi xorl %eax,%eax @@ -19,7 +19,7 @@ L_BF_encrypt_begin: xorl %ecx,%ecx xorl %ebx,%edi - # Round 0 + # Round 0 movl 4(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -39,7 +39,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 1 + # Round 1 movl 8(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -59,7 +59,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 2 + # Round 2 movl 12(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -79,7 +79,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 3 + # Round 3 movl 16(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -99,7 +99,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 4 + # Round 4 movl 20(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -119,7 +119,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 5 + # Round 5 movl 24(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -139,7 +139,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 6 + # Round 6 movl 28(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -159,7 +159,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 7 + # Round 7 movl 32(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -179,7 +179,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 8 + # Round 8 movl 36(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -199,7 +199,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 9 + # Round 9 movl 40(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -219,7 +219,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 10 + # Round 10 movl 44(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -239,7 +239,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 11 + # Round 11 movl 48(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -259,7 +259,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 12 + # Round 12 movl 52(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -279,7 +279,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 13 + # Round 13 movl 56(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -299,7 +299,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 14 + # Round 14 movl 60(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -319,7 +319,7 @@ L_BF_encrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 15 + # Round 15 movl 64(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -336,7 +336,7 @@ L_BF_encrypt_begin: xorl %eax,%ebx movl 3144(%ebp,%edx,4),%edx addl %edx,%ebx - # Load parameter 0 (16) enc=1 + # Load parameter 0 (16) enc=1 movl 20(%esp),%eax xorl %ebx,%edi movl 68(%ebp),%edx @@ -359,7 +359,7 @@ L_BF_decrypt_begin: movl 16(%esp),%ebp pushl %esi pushl %edi - # Load the 2 words + # Load the 2 words movl (%ebx),%edi movl 4(%ebx),%esi xorl %eax,%eax @@ -367,7 +367,7 @@ L_BF_decrypt_begin: xorl %ecx,%ecx xorl %ebx,%edi - # Round 16 + # Round 16 movl 64(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -387,7 +387,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 15 + # Round 15 movl 60(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -407,7 +407,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 14 + # Round 14 movl 56(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -427,7 +427,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 13 + # Round 13 movl 52(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -447,7 +447,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 12 + # Round 12 movl 48(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -467,7 +467,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 11 + # Round 11 movl 44(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -487,7 +487,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 10 + # Round 10 movl 40(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -507,7 +507,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 9 + # Round 9 movl 36(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -527,7 +527,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 8 + # Round 8 movl 32(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -547,7 +547,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 7 + # Round 7 movl 28(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -567,7 +567,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 6 + # Round 6 movl 24(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -587,7 +587,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 5 + # Round 5 movl 20(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -607,7 +607,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 4 + # Round 4 movl 16(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -627,7 +627,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 3 + # Round 3 movl 12(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -647,7 +647,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%edi - # Round 2 + # Round 2 movl 8(%ebp),%edx movl %edi,%ebx xorl %edx,%esi @@ -667,7 +667,7 @@ L_BF_decrypt_begin: xorl %eax,%eax xorl %ebx,%esi - # Round 1 + # Round 1 movl 4(%ebp),%edx movl %esi,%ebx xorl %edx,%edi @@ -684,7 +684,7 @@ L_BF_decrypt_begin: xorl %eax,%ebx movl 3144(%ebp,%edx,4),%edx addl %edx,%ebx - # Load parameter 0 (1) enc=0 + # Load parameter 0 (1) enc=0 movl 20(%esp),%eax xorl %ebx,%edi movl (%ebp),%edx @@ -706,7 +706,7 @@ L_BF_cbc_encrypt_begin: pushl %esi pushl %edi movl 28(%esp),%ebp - # getting iv ptr from parameter 4 + # getting iv ptr from parameter 4 movl 36(%esp),%ebx movl (%ebx),%esi movl 4(%ebx),%edi @@ -717,9 +717,9 @@ L_BF_cbc_encrypt_begin: movl %esp,%ebx movl 36(%esp),%esi movl 40(%esp),%edi - # getting encrypt flag from parameter 5 + # getting encrypt flag from parameter 5 movl 56(%esp),%ecx - # get and push parameter 3 + # get and push parameter 3 movl 48(%esp),%eax pushl %eax pushl %ebx diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/bn-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/bn-586.s index 11f7e704c0a0..7e6ccce48743 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/bn-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/bn-586.s @@ -115,7 +115,7 @@ L001maw_non_sse2: jz L006maw_finish .align 4,0x90 L007maw_loop: - # Round 0 + # Round 0 movl (%ebx),%eax mull %ebp addl %esi,%eax @@ -124,7 +124,7 @@ L007maw_loop: adcl $0,%edx movl %eax,(%edi) movl %edx,%esi - # Round 4 + # Round 4 movl 4(%ebx),%eax mull %ebp addl %esi,%eax @@ -133,7 +133,7 @@ L007maw_loop: adcl $0,%edx movl %eax,4(%edi) movl %edx,%esi - # Round 8 + # Round 8 movl 8(%ebx),%eax mull %ebp addl %esi,%eax @@ -142,7 +142,7 @@ L007maw_loop: adcl $0,%edx movl %eax,8(%edi) movl %edx,%esi - # Round 12 + # Round 12 movl 12(%ebx),%eax mull %ebp addl %esi,%eax @@ -151,7 +151,7 @@ L007maw_loop: adcl $0,%edx movl %eax,12(%edi) movl %edx,%esi - # Round 16 + # Round 16 movl 16(%ebx),%eax mull %ebp addl %esi,%eax @@ -160,7 +160,7 @@ L007maw_loop: adcl $0,%edx movl %eax,16(%edi) movl %edx,%esi - # Round 20 + # Round 20 movl 20(%ebx),%eax mull %ebp addl %esi,%eax @@ -169,7 +169,7 @@ L007maw_loop: adcl $0,%edx movl %eax,20(%edi) movl %edx,%esi - # Round 24 + # Round 24 movl 24(%ebx),%eax mull %ebp addl %esi,%eax @@ -178,7 +178,7 @@ L007maw_loop: adcl $0,%edx movl %eax,24(%edi) movl %edx,%esi - # Round 28 + # Round 28 movl 28(%ebx),%eax mull %ebp addl %esi,%eax @@ -198,7 +198,7 @@ L006maw_finish: jnz L008maw_finish2 jmp L009maw_end L008maw_finish2: - # Tail Round 0 + # Tail Round 0 movl (%ebx),%eax mull %ebp addl %esi,%eax @@ -209,7 +209,7 @@ L008maw_finish2: movl %eax,(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 1 + # Tail Round 1 movl 4(%ebx),%eax mull %ebp addl %esi,%eax @@ -220,7 +220,7 @@ L008maw_finish2: movl %eax,4(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 2 + # Tail Round 2 movl 8(%ebx),%eax mull %ebp addl %esi,%eax @@ -231,7 +231,7 @@ L008maw_finish2: movl %eax,8(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 3 + # Tail Round 3 movl 12(%ebx),%eax mull %ebp addl %esi,%eax @@ -242,7 +242,7 @@ L008maw_finish2: movl %eax,12(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 4 + # Tail Round 4 movl 16(%ebx),%eax mull %ebp addl %esi,%eax @@ -253,7 +253,7 @@ L008maw_finish2: movl %eax,16(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 5 + # Tail Round 5 movl 20(%ebx),%eax mull %ebp addl %esi,%eax @@ -264,7 +264,7 @@ L008maw_finish2: movl %eax,20(%edi) movl %edx,%esi jz L009maw_end - # Tail Round 6 + # Tail Round 6 movl 24(%ebx),%eax mull %ebp addl %esi,%eax @@ -325,56 +325,56 @@ L011mw_non_sse2: andl $4294967288,%ebp jz L013mw_finish L014mw_loop: - # Round 0 + # Round 0 movl (%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,(%edi) movl %edx,%esi - # Round 4 + # Round 4 movl 4(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,4(%edi) movl %edx,%esi - # Round 8 + # Round 8 movl 8(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,8(%edi) movl %edx,%esi - # Round 12 + # Round 12 movl 12(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,12(%edi) movl %edx,%esi - # Round 16 + # Round 16 movl 16(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,16(%edi) movl %edx,%esi - # Round 20 + # Round 20 movl 20(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,20(%edi) movl %edx,%esi - # Round 24 + # Round 24 movl 24(%ebx),%eax mull %ecx addl %esi,%eax adcl $0,%edx movl %eax,24(%edi) movl %edx,%esi - # Round 28 + # Round 28 movl 28(%ebx),%eax mull %ecx addl %esi,%eax @@ -393,7 +393,7 @@ L013mw_finish: jnz L015mw_finish2 jmp L016mw_end L015mw_finish2: - # Tail Round 0 + # Tail Round 0 movl (%ebx),%eax mull %ecx addl %esi,%eax @@ -402,7 +402,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 1 + # Tail Round 1 movl 4(%ebx),%eax mull %ecx addl %esi,%eax @@ -411,7 +411,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 2 + # Tail Round 2 movl 8(%ebx),%eax mull %ecx addl %esi,%eax @@ -420,7 +420,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 3 + # Tail Round 3 movl 12(%ebx),%eax mull %ecx addl %esi,%eax @@ -429,7 +429,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 4 + # Tail Round 4 movl 16(%ebx),%eax mull %ecx addl %esi,%eax @@ -438,7 +438,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 5 + # Tail Round 5 movl 20(%ebx),%eax mull %ecx addl %esi,%eax @@ -447,7 +447,7 @@ L015mw_finish2: movl %edx,%esi decl %ebp jz L016mw_end - # Tail Round 6 + # Tail Round 6 movl 24(%ebx),%eax mull %ecx addl %esi,%eax @@ -498,42 +498,42 @@ L018sqr_non_sse2: andl $4294967288,%ebx jz L020sw_finish L021sw_loop: - # Round 0 + # Round 0 movl (%edi),%eax mull %eax movl %eax,(%esi) movl %edx,4(%esi) - # Round 4 + # Round 4 movl 4(%edi),%eax mull %eax movl %eax,8(%esi) movl %edx,12(%esi) - # Round 8 + # Round 8 movl 8(%edi),%eax mull %eax movl %eax,16(%esi) movl %edx,20(%esi) - # Round 12 + # Round 12 movl 12(%edi),%eax mull %eax movl %eax,24(%esi) movl %edx,28(%esi) - # Round 16 + # Round 16 movl 16(%edi),%eax mull %eax movl %eax,32(%esi) movl %edx,36(%esi) - # Round 20 + # Round 20 movl 20(%edi),%eax mull %eax movl %eax,40(%esi) movl %edx,44(%esi) - # Round 24 + # Round 24 movl 24(%edi),%eax mull %eax movl %eax,48(%esi) movl %edx,52(%esi) - # Round 28 + # Round 28 movl 28(%edi),%eax mull %eax movl %eax,56(%esi) @@ -547,49 +547,49 @@ L020sw_finish: movl 28(%esp),%ebx andl $7,%ebx jz L022sw_end - # Tail Round 0 + # Tail Round 0 movl (%edi),%eax mull %eax movl %eax,(%esi) decl %ebx movl %edx,4(%esi) jz L022sw_end - # Tail Round 1 + # Tail Round 1 movl 4(%edi),%eax mull %eax movl %eax,8(%esi) decl %ebx movl %edx,12(%esi) jz L022sw_end - # Tail Round 2 + # Tail Round 2 movl 8(%edi),%eax mull %eax movl %eax,16(%esi) decl %ebx movl %edx,20(%esi) jz L022sw_end - # Tail Round 3 + # Tail Round 3 movl 12(%edi),%eax mull %eax movl %eax,24(%esi) decl %ebx movl %edx,28(%esi) jz L022sw_end - # Tail Round 4 + # Tail Round 4 movl 16(%edi),%eax mull %eax movl %eax,32(%esi) decl %ebx movl %edx,36(%esi) jz L022sw_end - # Tail Round 5 + # Tail Round 5 movl 20(%edi),%eax mull %eax movl %eax,40(%esi) decl %ebx movl %edx,44(%esi) jz L022sw_end - # Tail Round 6 + # Tail Round 6 movl 24(%edi),%eax mull %eax movl %eax,48(%esi) @@ -626,7 +626,7 @@ L_bn_add_words_begin: andl $4294967288,%ebp jz L023aw_finish L024aw_loop: - # Round 0 + # Round 0 movl (%esi),%ecx movl (%edi),%edx addl %eax,%ecx @@ -635,7 +635,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,(%ebx) - # Round 1 + # Round 1 movl 4(%esi),%ecx movl 4(%edi),%edx addl %eax,%ecx @@ -644,7 +644,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,4(%ebx) - # Round 2 + # Round 2 movl 8(%esi),%ecx movl 8(%edi),%edx addl %eax,%ecx @@ -653,7 +653,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,8(%ebx) - # Round 3 + # Round 3 movl 12(%esi),%ecx movl 12(%edi),%edx addl %eax,%ecx @@ -662,7 +662,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,12(%ebx) - # Round 4 + # Round 4 movl 16(%esi),%ecx movl 16(%edi),%edx addl %eax,%ecx @@ -671,7 +671,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,16(%ebx) - # Round 5 + # Round 5 movl 20(%esi),%ecx movl 20(%edi),%edx addl %eax,%ecx @@ -680,7 +680,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,20(%ebx) - # Round 6 + # Round 6 movl 24(%esi),%ecx movl 24(%edi),%edx addl %eax,%ecx @@ -689,7 +689,7 @@ L024aw_loop: addl %edx,%ecx adcl $0,%eax movl %ecx,24(%ebx) - # Round 7 + # Round 7 movl 28(%esi),%ecx movl 28(%edi),%edx addl %eax,%ecx @@ -708,7 +708,7 @@ L023aw_finish: movl 32(%esp),%ebp andl $7,%ebp jz L025aw_end - # Tail Round 0 + # Tail Round 0 movl (%esi),%ecx movl (%edi),%edx addl %eax,%ecx @@ -719,7 +719,7 @@ L023aw_finish: decl %ebp movl %ecx,(%ebx) jz L025aw_end - # Tail Round 1 + # Tail Round 1 movl 4(%esi),%ecx movl 4(%edi),%edx addl %eax,%ecx @@ -730,7 +730,7 @@ L023aw_finish: decl %ebp movl %ecx,4(%ebx) jz L025aw_end - # Tail Round 2 + # Tail Round 2 movl 8(%esi),%ecx movl 8(%edi),%edx addl %eax,%ecx @@ -741,7 +741,7 @@ L023aw_finish: decl %ebp movl %ecx,8(%ebx) jz L025aw_end - # Tail Round 3 + # Tail Round 3 movl 12(%esi),%ecx movl 12(%edi),%edx addl %eax,%ecx @@ -752,7 +752,7 @@ L023aw_finish: decl %ebp movl %ecx,12(%ebx) jz L025aw_end - # Tail Round 4 + # Tail Round 4 movl 16(%esi),%ecx movl 16(%edi),%edx addl %eax,%ecx @@ -763,7 +763,7 @@ L023aw_finish: decl %ebp movl %ecx,16(%ebx) jz L025aw_end - # Tail Round 5 + # Tail Round 5 movl 20(%esi),%ecx movl 20(%edi),%edx addl %eax,%ecx @@ -774,7 +774,7 @@ L023aw_finish: decl %ebp movl %ecx,20(%ebx) jz L025aw_end - # Tail Round 6 + # Tail Round 6 movl 24(%esi),%ecx movl 24(%edi),%edx addl %eax,%ecx @@ -806,7 +806,7 @@ L_bn_sub_words_begin: andl $4294967288,%ebp jz L026aw_finish L027aw_loop: - # Round 0 + # Round 0 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -815,7 +815,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,(%ebx) - # Round 1 + # Round 1 movl 4(%esi),%ecx movl 4(%edi),%edx subl %eax,%ecx @@ -824,7 +824,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,4(%ebx) - # Round 2 + # Round 2 movl 8(%esi),%ecx movl 8(%edi),%edx subl %eax,%ecx @@ -833,7 +833,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,8(%ebx) - # Round 3 + # Round 3 movl 12(%esi),%ecx movl 12(%edi),%edx subl %eax,%ecx @@ -842,7 +842,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,12(%ebx) - # Round 4 + # Round 4 movl 16(%esi),%ecx movl 16(%edi),%edx subl %eax,%ecx @@ -851,7 +851,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,16(%ebx) - # Round 5 + # Round 5 movl 20(%esi),%ecx movl 20(%edi),%edx subl %eax,%ecx @@ -860,7 +860,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,20(%ebx) - # Round 6 + # Round 6 movl 24(%esi),%ecx movl 24(%edi),%edx subl %eax,%ecx @@ -869,7 +869,7 @@ L027aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,24(%ebx) - # Round 7 + # Round 7 movl 28(%esi),%ecx movl 28(%edi),%edx subl %eax,%ecx @@ -888,7 +888,7 @@ L026aw_finish: movl 32(%esp),%ebp andl $7,%ebp jz L028aw_end - # Tail Round 0 + # Tail Round 0 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -899,7 +899,7 @@ L026aw_finish: decl %ebp movl %ecx,(%ebx) jz L028aw_end - # Tail Round 1 + # Tail Round 1 movl 4(%esi),%ecx movl 4(%edi),%edx subl %eax,%ecx @@ -910,7 +910,7 @@ L026aw_finish: decl %ebp movl %ecx,4(%ebx) jz L028aw_end - # Tail Round 2 + # Tail Round 2 movl 8(%esi),%ecx movl 8(%edi),%edx subl %eax,%ecx @@ -921,7 +921,7 @@ L026aw_finish: decl %ebp movl %ecx,8(%ebx) jz L028aw_end - # Tail Round 3 + # Tail Round 3 movl 12(%esi),%ecx movl 12(%edi),%edx subl %eax,%ecx @@ -932,7 +932,7 @@ L026aw_finish: decl %ebp movl %ecx,12(%ebx) jz L028aw_end - # Tail Round 4 + # Tail Round 4 movl 16(%esi),%ecx movl 16(%edi),%edx subl %eax,%ecx @@ -943,7 +943,7 @@ L026aw_finish: decl %ebp movl %ecx,16(%ebx) jz L028aw_end - # Tail Round 5 + # Tail Round 5 movl 20(%esi),%ecx movl 20(%edi),%edx subl %eax,%ecx @@ -954,7 +954,7 @@ L026aw_finish: decl %ebp movl %ecx,20(%ebx) jz L028aw_end - # Tail Round 6 + # Tail Round 6 movl 24(%esi),%ecx movl 24(%edi),%edx subl %eax,%ecx @@ -986,7 +986,7 @@ L_bn_sub_part_words_begin: andl $4294967288,%ebp jz L029aw_finish L030aw_loop: - # Round 0 + # Round 0 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -995,7 +995,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,(%ebx) - # Round 1 + # Round 1 movl 4(%esi),%ecx movl 4(%edi),%edx subl %eax,%ecx @@ -1004,7 +1004,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,4(%ebx) - # Round 2 + # Round 2 movl 8(%esi),%ecx movl 8(%edi),%edx subl %eax,%ecx @@ -1013,7 +1013,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,8(%ebx) - # Round 3 + # Round 3 movl 12(%esi),%ecx movl 12(%edi),%edx subl %eax,%ecx @@ -1022,7 +1022,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,12(%ebx) - # Round 4 + # Round 4 movl 16(%esi),%ecx movl 16(%edi),%edx subl %eax,%ecx @@ -1031,7 +1031,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,16(%ebx) - # Round 5 + # Round 5 movl 20(%esi),%ecx movl 20(%edi),%edx subl %eax,%ecx @@ -1040,7 +1040,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,20(%ebx) - # Round 6 + # Round 6 movl 24(%esi),%ecx movl 24(%edi),%edx subl %eax,%ecx @@ -1049,7 +1049,7 @@ L030aw_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,24(%ebx) - # Round 7 + # Round 7 movl 28(%esi),%ecx movl 28(%edi),%edx subl %eax,%ecx @@ -1068,7 +1068,7 @@ L029aw_finish: movl 32(%esp),%ebp andl $7,%ebp jz L031aw_end - # Tail Round 0 + # Tail Round 0 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1082,7 +1082,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 1 + # Tail Round 1 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1096,7 +1096,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 2 + # Tail Round 2 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1110,7 +1110,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 3 + # Tail Round 3 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1124,7 +1124,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 4 + # Tail Round 4 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1138,7 +1138,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 5 + # Tail Round 5 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1152,7 +1152,7 @@ L029aw_finish: addl $4,%ebx decl %ebp jz L031aw_end - # Tail Round 6 + # Tail Round 6 movl (%esi),%ecx movl (%edi),%edx subl %eax,%ecx @@ -1171,14 +1171,14 @@ L031aw_end: cmpl $0,%ebp je L032pw_end jge L033pw_pos - # pw_neg + # pw_neg movl $0,%edx subl %ebp,%edx movl %edx,%ebp andl $4294967288,%ebp jz L034pw_neg_finish L035pw_neg_loop: - # dl<0 Round 0 + # dl<0 Round 0 movl $0,%ecx movl (%edi),%edx subl %eax,%ecx @@ -1187,7 +1187,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,(%ebx) - # dl<0 Round 1 + # dl<0 Round 1 movl $0,%ecx movl 4(%edi),%edx subl %eax,%ecx @@ -1196,7 +1196,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,4(%ebx) - # dl<0 Round 2 + # dl<0 Round 2 movl $0,%ecx movl 8(%edi),%edx subl %eax,%ecx @@ -1205,7 +1205,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,8(%ebx) - # dl<0 Round 3 + # dl<0 Round 3 movl $0,%ecx movl 12(%edi),%edx subl %eax,%ecx @@ -1214,7 +1214,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,12(%ebx) - # dl<0 Round 4 + # dl<0 Round 4 movl $0,%ecx movl 16(%edi),%edx subl %eax,%ecx @@ -1223,7 +1223,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,16(%ebx) - # dl<0 Round 5 + # dl<0 Round 5 movl $0,%ecx movl 20(%edi),%edx subl %eax,%ecx @@ -1232,7 +1232,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,20(%ebx) - # dl<0 Round 6 + # dl<0 Round 6 movl $0,%ecx movl 24(%edi),%edx subl %eax,%ecx @@ -1241,7 +1241,7 @@ L035pw_neg_loop: subl %edx,%ecx adcl $0,%eax movl %ecx,24(%ebx) - # dl<0 Round 7 + # dl<0 Round 7 movl $0,%ecx movl 28(%edi),%edx subl %eax,%ecx @@ -1261,7 +1261,7 @@ L034pw_neg_finish: subl %edx,%ebp andl $7,%ebp jz L032pw_end - # dl<0 Tail Round 0 + # dl<0 Tail Round 0 movl $0,%ecx movl (%edi),%edx subl %eax,%ecx @@ -1272,7 +1272,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,(%ebx) jz L032pw_end - # dl<0 Tail Round 1 + # dl<0 Tail Round 1 movl $0,%ecx movl 4(%edi),%edx subl %eax,%ecx @@ -1283,7 +1283,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,4(%ebx) jz L032pw_end - # dl<0 Tail Round 2 + # dl<0 Tail Round 2 movl $0,%ecx movl 8(%edi),%edx subl %eax,%ecx @@ -1294,7 +1294,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,8(%ebx) jz L032pw_end - # dl<0 Tail Round 3 + # dl<0 Tail Round 3 movl $0,%ecx movl 12(%edi),%edx subl %eax,%ecx @@ -1305,7 +1305,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,12(%ebx) jz L032pw_end - # dl<0 Tail Round 4 + # dl<0 Tail Round 4 movl $0,%ecx movl 16(%edi),%edx subl %eax,%ecx @@ -1316,7 +1316,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,16(%ebx) jz L032pw_end - # dl<0 Tail Round 5 + # dl<0 Tail Round 5 movl $0,%ecx movl 20(%edi),%edx subl %eax,%ecx @@ -1327,7 +1327,7 @@ L034pw_neg_finish: decl %ebp movl %ecx,20(%ebx) jz L032pw_end - # dl<0 Tail Round 6 + # dl<0 Tail Round 6 movl $0,%ecx movl 24(%edi),%edx subl %eax,%ecx @@ -1341,42 +1341,42 @@ L033pw_pos: andl $4294967288,%ebp jz L036pw_pos_finish L037pw_pos_loop: - # dl>0 Round 0 + # dl>0 Round 0 movl (%esi),%ecx subl %eax,%ecx movl %ecx,(%ebx) jnc L038pw_nc0 - # dl>0 Round 1 + # dl>0 Round 1 movl 4(%esi),%ecx subl %eax,%ecx movl %ecx,4(%ebx) jnc L039pw_nc1 - # dl>0 Round 2 + # dl>0 Round 2 movl 8(%esi),%ecx subl %eax,%ecx movl %ecx,8(%ebx) jnc L040pw_nc2 - # dl>0 Round 3 + # dl>0 Round 3 movl 12(%esi),%ecx subl %eax,%ecx movl %ecx,12(%ebx) jnc L041pw_nc3 - # dl>0 Round 4 + # dl>0 Round 4 movl 16(%esi),%ecx subl %eax,%ecx movl %ecx,16(%ebx) jnc L042pw_nc4 - # dl>0 Round 5 + # dl>0 Round 5 movl 20(%esi),%ecx subl %eax,%ecx movl %ecx,20(%ebx) jnc L043pw_nc5 - # dl>0 Round 6 + # dl>0 Round 6 movl 24(%esi),%ecx subl %eax,%ecx movl %ecx,24(%ebx) jnc L044pw_nc6 - # dl>0 Round 7 + # dl>0 Round 7 movl 28(%esi),%ecx subl %eax,%ecx movl %ecx,28(%ebx) @@ -1390,49 +1390,49 @@ L036pw_pos_finish: movl 36(%esp),%ebp andl $7,%ebp jz L032pw_end - # dl>0 Tail Round 0 + # dl>0 Tail Round 0 movl (%esi),%ecx subl %eax,%ecx movl %ecx,(%ebx) jnc L046pw_tail_nc0 decl %ebp jz L032pw_end - # dl>0 Tail Round 1 + # dl>0 Tail Round 1 movl 4(%esi),%ecx subl %eax,%ecx movl %ecx,4(%ebx) jnc L047pw_tail_nc1 decl %ebp jz L032pw_end - # dl>0 Tail Round 2 + # dl>0 Tail Round 2 movl 8(%esi),%ecx subl %eax,%ecx movl %ecx,8(%ebx) jnc L048pw_tail_nc2 decl %ebp jz L032pw_end - # dl>0 Tail Round 3 + # dl>0 Tail Round 3 movl 12(%esi),%ecx subl %eax,%ecx movl %ecx,12(%ebx) jnc L049pw_tail_nc3 decl %ebp jz L032pw_end - # dl>0 Tail Round 4 + # dl>0 Tail Round 4 movl 16(%esi),%ecx subl %eax,%ecx movl %ecx,16(%ebx) jnc L050pw_tail_nc4 decl %ebp jz L032pw_end - # dl>0 Tail Round 5 + # dl>0 Tail Round 5 movl 20(%esi),%ecx subl %eax,%ecx movl %ecx,20(%ebx) jnc L051pw_tail_nc5 decl %ebp jz L032pw_end - # dl>0 Tail Round 6 + # dl>0 Tail Round 6 movl 24(%esi),%ecx subl %eax,%ecx movl %ecx,24(%ebx) diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/co-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/co-586.s index 3e49f0a86744..d82fdcbc7d6b 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/co-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/co-586.s @@ -14,9 +14,9 @@ L_bn_mul_comba8_begin: movl (%esi),%eax xorl %ecx,%ecx movl (%edi),%edx - # ################## Calculate word 0 + # ################## Calculate word 0 xorl %ebp,%ebp - # mul a[0]*b[0] + # mul a[0]*b[0] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -25,17 +25,17 @@ L_bn_mul_comba8_begin: adcl $0,%ebp movl %ebx,(%eax) movl 4(%esi),%eax - # saved r[0] - # ################## Calculate word 1 + # saved r[0] + # ################## Calculate word 1 xorl %ebx,%ebx - # mul a[1]*b[0] + # mul a[1]*b[0] mull %edx addl %eax,%ecx movl (%esi),%eax adcl %edx,%ebp movl 4(%edi),%edx adcl $0,%ebx - # mul a[0]*b[1] + # mul a[0]*b[1] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -44,24 +44,24 @@ L_bn_mul_comba8_begin: adcl $0,%ebx movl %ecx,4(%eax) movl 8(%esi),%eax - # saved r[1] - # ################## Calculate word 2 + # saved r[1] + # ################## Calculate word 2 xorl %ecx,%ecx - # mul a[2]*b[0] + # mul a[2]*b[0] mull %edx addl %eax,%ebp movl 4(%esi),%eax adcl %edx,%ebx movl 4(%edi),%edx adcl $0,%ecx - # mul a[1]*b[1] + # mul a[1]*b[1] mull %edx addl %eax,%ebp movl (%esi),%eax adcl %edx,%ebx movl 8(%edi),%edx adcl $0,%ecx - # mul a[0]*b[2] + # mul a[0]*b[2] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -70,31 +70,31 @@ L_bn_mul_comba8_begin: adcl $0,%ecx movl %ebp,8(%eax) movl 12(%esi),%eax - # saved r[2] - # ################## Calculate word 3 + # saved r[2] + # ################## Calculate word 3 xorl %ebp,%ebp - # mul a[3]*b[0] + # mul a[3]*b[0] mull %edx addl %eax,%ebx movl 8(%esi),%eax adcl %edx,%ecx movl 4(%edi),%edx adcl $0,%ebp - # mul a[2]*b[1] + # mul a[2]*b[1] mull %edx addl %eax,%ebx movl 4(%esi),%eax adcl %edx,%ecx movl 8(%edi),%edx adcl $0,%ebp - # mul a[1]*b[2] + # mul a[1]*b[2] mull %edx addl %eax,%ebx movl (%esi),%eax adcl %edx,%ecx movl 12(%edi),%edx adcl $0,%ebp - # mul a[0]*b[3] + # mul a[0]*b[3] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -103,38 +103,38 @@ L_bn_mul_comba8_begin: adcl $0,%ebp movl %ebx,12(%eax) movl 16(%esi),%eax - # saved r[3] - # ################## Calculate word 4 + # saved r[3] + # ################## Calculate word 4 xorl %ebx,%ebx - # mul a[4]*b[0] + # mul a[4]*b[0] mull %edx addl %eax,%ecx movl 12(%esi),%eax adcl %edx,%ebp movl 4(%edi),%edx adcl $0,%ebx - # mul a[3]*b[1] + # mul a[3]*b[1] mull %edx addl %eax,%ecx movl 8(%esi),%eax adcl %edx,%ebp movl 8(%edi),%edx adcl $0,%ebx - # mul a[2]*b[2] + # mul a[2]*b[2] mull %edx addl %eax,%ecx movl 4(%esi),%eax adcl %edx,%ebp movl 12(%edi),%edx adcl $0,%ebx - # mul a[1]*b[3] + # mul a[1]*b[3] mull %edx addl %eax,%ecx movl (%esi),%eax adcl %edx,%ebp movl 16(%edi),%edx adcl $0,%ebx - # mul a[0]*b[4] + # mul a[0]*b[4] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -143,45 +143,45 @@ L_bn_mul_comba8_begin: adcl $0,%ebx movl %ecx,16(%eax) movl 20(%esi),%eax - # saved r[4] - # ################## Calculate word 5 + # saved r[4] + # ################## Calculate word 5 xorl %ecx,%ecx - # mul a[5]*b[0] + # mul a[5]*b[0] mull %edx addl %eax,%ebp movl 16(%esi),%eax adcl %edx,%ebx movl 4(%edi),%edx adcl $0,%ecx - # mul a[4]*b[1] + # mul a[4]*b[1] mull %edx addl %eax,%ebp movl 12(%esi),%eax adcl %edx,%ebx movl 8(%edi),%edx adcl $0,%ecx - # mul a[3]*b[2] + # mul a[3]*b[2] mull %edx addl %eax,%ebp movl 8(%esi),%eax adcl %edx,%ebx movl 12(%edi),%edx adcl $0,%ecx - # mul a[2]*b[3] + # mul a[2]*b[3] mull %edx addl %eax,%ebp movl 4(%esi),%eax adcl %edx,%ebx movl 16(%edi),%edx adcl $0,%ecx - # mul a[1]*b[4] + # mul a[1]*b[4] mull %edx addl %eax,%ebp movl (%esi),%eax adcl %edx,%ebx movl 20(%edi),%edx adcl $0,%ecx - # mul a[0]*b[5] + # mul a[0]*b[5] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -190,52 +190,52 @@ L_bn_mul_comba8_begin: adcl $0,%ecx movl %ebp,20(%eax) movl 24(%esi),%eax - # saved r[5] - # ################## Calculate word 6 + # saved r[5] + # ################## Calculate word 6 xorl %ebp,%ebp - # mul a[6]*b[0] + # mul a[6]*b[0] mull %edx addl %eax,%ebx movl 20(%esi),%eax adcl %edx,%ecx movl 4(%edi),%edx adcl $0,%ebp - # mul a[5]*b[1] + # mul a[5]*b[1] mull %edx addl %eax,%ebx movl 16(%esi),%eax adcl %edx,%ecx movl 8(%edi),%edx adcl $0,%ebp - # mul a[4]*b[2] + # mul a[4]*b[2] mull %edx addl %eax,%ebx movl 12(%esi),%eax adcl %edx,%ecx movl 12(%edi),%edx adcl $0,%ebp - # mul a[3]*b[3] + # mul a[3]*b[3] mull %edx addl %eax,%ebx movl 8(%esi),%eax adcl %edx,%ecx movl 16(%edi),%edx adcl $0,%ebp - # mul a[2]*b[4] + # mul a[2]*b[4] mull %edx addl %eax,%ebx movl 4(%esi),%eax adcl %edx,%ecx movl 20(%edi),%edx adcl $0,%ebp - # mul a[1]*b[5] + # mul a[1]*b[5] mull %edx addl %eax,%ebx movl (%esi),%eax adcl %edx,%ecx movl 24(%edi),%edx adcl $0,%ebp - # mul a[0]*b[6] + # mul a[0]*b[6] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -244,59 +244,59 @@ L_bn_mul_comba8_begin: adcl $0,%ebp movl %ebx,24(%eax) movl 28(%esi),%eax - # saved r[6] - # ################## Calculate word 7 + # saved r[6] + # ################## Calculate word 7 xorl %ebx,%ebx - # mul a[7]*b[0] + # mul a[7]*b[0] mull %edx addl %eax,%ecx movl 24(%esi),%eax adcl %edx,%ebp movl 4(%edi),%edx adcl $0,%ebx - # mul a[6]*b[1] + # mul a[6]*b[1] mull %edx addl %eax,%ecx movl 20(%esi),%eax adcl %edx,%ebp movl 8(%edi),%edx adcl $0,%ebx - # mul a[5]*b[2] + # mul a[5]*b[2] mull %edx addl %eax,%ecx movl 16(%esi),%eax adcl %edx,%ebp movl 12(%edi),%edx adcl $0,%ebx - # mul a[4]*b[3] + # mul a[4]*b[3] mull %edx addl %eax,%ecx movl 12(%esi),%eax adcl %edx,%ebp movl 16(%edi),%edx adcl $0,%ebx - # mul a[3]*b[4] + # mul a[3]*b[4] mull %edx addl %eax,%ecx movl 8(%esi),%eax adcl %edx,%ebp movl 20(%edi),%edx adcl $0,%ebx - # mul a[2]*b[5] + # mul a[2]*b[5] mull %edx addl %eax,%ecx movl 4(%esi),%eax adcl %edx,%ebp movl 24(%edi),%edx adcl $0,%ebx - # mul a[1]*b[6] + # mul a[1]*b[6] mull %edx addl %eax,%ecx movl (%esi),%eax adcl %edx,%ebp movl 28(%edi),%edx adcl $0,%ebx - # mul a[0]*b[7] + # mul a[0]*b[7] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -305,52 +305,52 @@ L_bn_mul_comba8_begin: adcl $0,%ebx movl %ecx,28(%eax) movl 28(%esi),%eax - # saved r[7] - # ################## Calculate word 8 + # saved r[7] + # ################## Calculate word 8 xorl %ecx,%ecx - # mul a[7]*b[1] + # mul a[7]*b[1] mull %edx addl %eax,%ebp movl 24(%esi),%eax adcl %edx,%ebx movl 8(%edi),%edx adcl $0,%ecx - # mul a[6]*b[2] + # mul a[6]*b[2] mull %edx addl %eax,%ebp movl 20(%esi),%eax adcl %edx,%ebx movl 12(%edi),%edx adcl $0,%ecx - # mul a[5]*b[3] + # mul a[5]*b[3] mull %edx addl %eax,%ebp movl 16(%esi),%eax adcl %edx,%ebx movl 16(%edi),%edx adcl $0,%ecx - # mul a[4]*b[4] + # mul a[4]*b[4] mull %edx addl %eax,%ebp movl 12(%esi),%eax adcl %edx,%ebx movl 20(%edi),%edx adcl $0,%ecx - # mul a[3]*b[5] + # mul a[3]*b[5] mull %edx addl %eax,%ebp movl 8(%esi),%eax adcl %edx,%ebx movl 24(%edi),%edx adcl $0,%ecx - # mul a[2]*b[6] + # mul a[2]*b[6] mull %edx addl %eax,%ebp movl 4(%esi),%eax adcl %edx,%ebx movl 28(%edi),%edx adcl $0,%ecx - # mul a[1]*b[7] + # mul a[1]*b[7] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -359,45 +359,45 @@ L_bn_mul_comba8_begin: adcl $0,%ecx movl %ebp,32(%eax) movl 28(%esi),%eax - # saved r[8] - # ################## Calculate word 9 + # saved r[8] + # ################## Calculate word 9 xorl %ebp,%ebp - # mul a[7]*b[2] + # mul a[7]*b[2] mull %edx addl %eax,%ebx movl 24(%esi),%eax adcl %edx,%ecx movl 12(%edi),%edx adcl $0,%ebp - # mul a[6]*b[3] + # mul a[6]*b[3] mull %edx addl %eax,%ebx movl 20(%esi),%eax adcl %edx,%ecx movl 16(%edi),%edx adcl $0,%ebp - # mul a[5]*b[4] + # mul a[5]*b[4] mull %edx addl %eax,%ebx movl 16(%esi),%eax adcl %edx,%ecx movl 20(%edi),%edx adcl $0,%ebp - # mul a[4]*b[5] + # mul a[4]*b[5] mull %edx addl %eax,%ebx movl 12(%esi),%eax adcl %edx,%ecx movl 24(%edi),%edx adcl $0,%ebp - # mul a[3]*b[6] + # mul a[3]*b[6] mull %edx addl %eax,%ebx movl 8(%esi),%eax adcl %edx,%ecx movl 28(%edi),%edx adcl $0,%ebp - # mul a[2]*b[7] + # mul a[2]*b[7] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -406,38 +406,38 @@ L_bn_mul_comba8_begin: adcl $0,%ebp movl %ebx,36(%eax) movl 28(%esi),%eax - # saved r[9] - # ################## Calculate word 10 + # saved r[9] + # ################## Calculate word 10 xorl %ebx,%ebx - # mul a[7]*b[3] + # mul a[7]*b[3] mull %edx addl %eax,%ecx movl 24(%esi),%eax adcl %edx,%ebp movl 16(%edi),%edx adcl $0,%ebx - # mul a[6]*b[4] + # mul a[6]*b[4] mull %edx addl %eax,%ecx movl 20(%esi),%eax adcl %edx,%ebp movl 20(%edi),%edx adcl $0,%ebx - # mul a[5]*b[5] + # mul a[5]*b[5] mull %edx addl %eax,%ecx movl 16(%esi),%eax adcl %edx,%ebp movl 24(%edi),%edx adcl $0,%ebx - # mul a[4]*b[6] + # mul a[4]*b[6] mull %edx addl %eax,%ecx movl 12(%esi),%eax adcl %edx,%ebp movl 28(%edi),%edx adcl $0,%ebx - # mul a[3]*b[7] + # mul a[3]*b[7] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -446,31 +446,31 @@ L_bn_mul_comba8_begin: adcl $0,%ebx movl %ecx,40(%eax) movl 28(%esi),%eax - # saved r[10] - # ################## Calculate word 11 + # saved r[10] + # ################## Calculate word 11 xorl %ecx,%ecx - # mul a[7]*b[4] + # mul a[7]*b[4] mull %edx addl %eax,%ebp movl 24(%esi),%eax adcl %edx,%ebx movl 20(%edi),%edx adcl $0,%ecx - # mul a[6]*b[5] + # mul a[6]*b[5] mull %edx addl %eax,%ebp movl 20(%esi),%eax adcl %edx,%ebx movl 24(%edi),%edx adcl $0,%ecx - # mul a[5]*b[6] + # mul a[5]*b[6] mull %edx addl %eax,%ebp movl 16(%esi),%eax adcl %edx,%ebx movl 28(%edi),%edx adcl $0,%ecx - # mul a[4]*b[7] + # mul a[4]*b[7] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -479,24 +479,24 @@ L_bn_mul_comba8_begin: adcl $0,%ecx movl %ebp,44(%eax) movl 28(%esi),%eax - # saved r[11] - # ################## Calculate word 12 + # saved r[11] + # ################## Calculate word 12 xorl %ebp,%ebp - # mul a[7]*b[5] + # mul a[7]*b[5] mull %edx addl %eax,%ebx movl 24(%esi),%eax adcl %edx,%ecx movl 24(%edi),%edx adcl $0,%ebp - # mul a[6]*b[6] + # mul a[6]*b[6] mull %edx addl %eax,%ebx movl 20(%esi),%eax adcl %edx,%ecx movl 28(%edi),%edx adcl $0,%ebp - # mul a[5]*b[7] + # mul a[5]*b[7] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -505,17 +505,17 @@ L_bn_mul_comba8_begin: adcl $0,%ebp movl %ebx,48(%eax) movl 28(%esi),%eax - # saved r[12] - # ################## Calculate word 13 + # saved r[12] + # ################## Calculate word 13 xorl %ebx,%ebx - # mul a[7]*b[6] + # mul a[7]*b[6] mull %edx addl %eax,%ecx movl 24(%esi),%eax adcl %edx,%ebp movl 28(%edi),%edx adcl $0,%ebx - # mul a[6]*b[7] + # mul a[6]*b[7] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -524,18 +524,18 @@ L_bn_mul_comba8_begin: adcl $0,%ebx movl %ecx,52(%eax) movl 28(%esi),%eax - # saved r[13] - # ################## Calculate word 14 + # saved r[13] + # ################## Calculate word 14 xorl %ecx,%ecx - # mul a[7]*b[7] + # mul a[7]*b[7] mull %edx addl %eax,%ebp movl 20(%esp),%eax adcl %edx,%ebx adcl $0,%ecx movl %ebp,56(%eax) - # saved r[14] - # save r[15] + # saved r[14] + # save r[15] movl %ebx,60(%eax) popl %ebx popl %ebp @@ -556,9 +556,9 @@ L_bn_mul_comba4_begin: movl (%esi),%eax xorl %ecx,%ecx movl (%edi),%edx - # ################## Calculate word 0 + # ################## Calculate word 0 xorl %ebp,%ebp - # mul a[0]*b[0] + # mul a[0]*b[0] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -567,17 +567,17 @@ L_bn_mul_comba4_begin: adcl $0,%ebp movl %ebx,(%eax) movl 4(%esi),%eax - # saved r[0] - # ################## Calculate word 1 + # saved r[0] + # ################## Calculate word 1 xorl %ebx,%ebx - # mul a[1]*b[0] + # mul a[1]*b[0] mull %edx addl %eax,%ecx movl (%esi),%eax adcl %edx,%ebp movl 4(%edi),%edx adcl $0,%ebx - # mul a[0]*b[1] + # mul a[0]*b[1] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -586,24 +586,24 @@ L_bn_mul_comba4_begin: adcl $0,%ebx movl %ecx,4(%eax) movl 8(%esi),%eax - # saved r[1] - # ################## Calculate word 2 + # saved r[1] + # ################## Calculate word 2 xorl %ecx,%ecx - # mul a[2]*b[0] + # mul a[2]*b[0] mull %edx addl %eax,%ebp movl 4(%esi),%eax adcl %edx,%ebx movl 4(%edi),%edx adcl $0,%ecx - # mul a[1]*b[1] + # mul a[1]*b[1] mull %edx addl %eax,%ebp movl (%esi),%eax adcl %edx,%ebx movl 8(%edi),%edx adcl $0,%ecx - # mul a[0]*b[2] + # mul a[0]*b[2] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -612,31 +612,31 @@ L_bn_mul_comba4_begin: adcl $0,%ecx movl %ebp,8(%eax) movl 12(%esi),%eax - # saved r[2] - # ################## Calculate word 3 + # saved r[2] + # ################## Calculate word 3 xorl %ebp,%ebp - # mul a[3]*b[0] + # mul a[3]*b[0] mull %edx addl %eax,%ebx movl 8(%esi),%eax adcl %edx,%ecx movl 4(%edi),%edx adcl $0,%ebp - # mul a[2]*b[1] + # mul a[2]*b[1] mull %edx addl %eax,%ebx movl 4(%esi),%eax adcl %edx,%ecx movl 8(%edi),%edx adcl $0,%ebp - # mul a[1]*b[2] + # mul a[1]*b[2] mull %edx addl %eax,%ebx movl (%esi),%eax adcl %edx,%ecx movl 12(%edi),%edx adcl $0,%ebp - # mul a[0]*b[3] + # mul a[0]*b[3] mull %edx addl %eax,%ebx movl 20(%esp),%eax @@ -645,24 +645,24 @@ L_bn_mul_comba4_begin: adcl $0,%ebp movl %ebx,12(%eax) movl 12(%esi),%eax - # saved r[3] - # ################## Calculate word 4 + # saved r[3] + # ################## Calculate word 4 xorl %ebx,%ebx - # mul a[3]*b[1] + # mul a[3]*b[1] mull %edx addl %eax,%ecx movl 8(%esi),%eax adcl %edx,%ebp movl 8(%edi),%edx adcl $0,%ebx - # mul a[2]*b[2] + # mul a[2]*b[2] mull %edx addl %eax,%ecx movl 4(%esi),%eax adcl %edx,%ebp movl 12(%edi),%edx adcl $0,%ebx - # mul a[1]*b[3] + # mul a[1]*b[3] mull %edx addl %eax,%ecx movl 20(%esp),%eax @@ -671,17 +671,17 @@ L_bn_mul_comba4_begin: adcl $0,%ebx movl %ecx,16(%eax) movl 12(%esi),%eax - # saved r[4] - # ################## Calculate word 5 + # saved r[4] + # ################## Calculate word 5 xorl %ecx,%ecx - # mul a[3]*b[2] + # mul a[3]*b[2] mull %edx addl %eax,%ebp movl 8(%esi),%eax adcl %edx,%ebx movl 12(%edi),%edx adcl $0,%ecx - # mul a[2]*b[3] + # mul a[2]*b[3] mull %edx addl %eax,%ebp movl 20(%esp),%eax @@ -690,18 +690,18 @@ L_bn_mul_comba4_begin: adcl $0,%ecx movl %ebp,20(%eax) movl 12(%esi),%eax - # saved r[5] - # ################## Calculate word 6 + # saved r[5] + # ################## Calculate word 6 xorl %ebp,%ebp - # mul a[3]*b[3] + # mul a[3]*b[3] mull %edx addl %eax,%ebx movl 20(%esp),%eax adcl %edx,%ecx adcl $0,%ebp movl %ebx,24(%eax) - # saved r[6] - # save r[7] + # saved r[6] + # save r[7] movl %ecx,28(%eax) popl %ebx popl %ebp @@ -721,9 +721,9 @@ L_bn_sqr_comba8_begin: xorl %ebx,%ebx xorl %ecx,%ecx movl (%esi),%eax - # ############### Calculate word 0 + # ############### Calculate word 0 xorl %ebp,%ebp - # sqr a[0]*a[0] + # sqr a[0]*a[0] mull %eax addl %eax,%ebx adcl %edx,%ecx @@ -731,10 +731,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebp movl %ebx,(%edi) movl 4(%esi),%eax - # saved r[0] - # ############### Calculate word 1 + # saved r[0] + # ############### Calculate word 1 xorl %ebx,%ebx - # sqr a[1]*a[0] + # sqr a[1]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -745,10 +745,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebx movl %ecx,4(%edi) movl (%esi),%edx - # saved r[1] - # ############### Calculate word 2 + # saved r[1] + # ############### Calculate word 2 xorl %ecx,%ecx - # sqr a[2]*a[0] + # sqr a[2]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -757,7 +757,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ebx movl 4(%esi),%eax adcl $0,%ecx - # sqr a[1]*a[1] + # sqr a[1]*a[1] mull %eax addl %eax,%ebp adcl %edx,%ebx @@ -765,10 +765,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ecx movl %ebp,8(%edi) movl 12(%esi),%eax - # saved r[2] - # ############### Calculate word 3 + # saved r[2] + # ############### Calculate word 3 xorl %ebp,%ebp - # sqr a[3]*a[0] + # sqr a[3]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -778,7 +778,7 @@ L_bn_sqr_comba8_begin: movl 8(%esi),%eax adcl $0,%ebp movl 4(%esi),%edx - # sqr a[2]*a[1] + # sqr a[2]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -789,10 +789,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebp movl %ebx,12(%edi) movl (%esi),%edx - # saved r[3] - # ############### Calculate word 4 + # saved r[3] + # ############### Calculate word 4 xorl %ebx,%ebx - # sqr a[4]*a[0] + # sqr a[4]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -802,7 +802,7 @@ L_bn_sqr_comba8_begin: movl 12(%esi),%eax adcl $0,%ebx movl 4(%esi),%edx - # sqr a[3]*a[1] + # sqr a[3]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -811,7 +811,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ebp movl 8(%esi),%eax adcl $0,%ebx - # sqr a[2]*a[2] + # sqr a[2]*a[2] mull %eax addl %eax,%ecx adcl %edx,%ebp @@ -819,10 +819,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebx movl %ecx,16(%edi) movl 20(%esi),%eax - # saved r[4] - # ############### Calculate word 5 + # saved r[4] + # ############### Calculate word 5 xorl %ecx,%ecx - # sqr a[5]*a[0] + # sqr a[5]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -832,7 +832,7 @@ L_bn_sqr_comba8_begin: movl 16(%esi),%eax adcl $0,%ecx movl 4(%esi),%edx - # sqr a[4]*a[1] + # sqr a[4]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -842,7 +842,7 @@ L_bn_sqr_comba8_begin: movl 12(%esi),%eax adcl $0,%ecx movl 8(%esi),%edx - # sqr a[3]*a[2] + # sqr a[3]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -853,10 +853,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ecx movl %ebp,20(%edi) movl (%esi),%edx - # saved r[5] - # ############### Calculate word 6 + # saved r[5] + # ############### Calculate word 6 xorl %ebp,%ebp - # sqr a[6]*a[0] + # sqr a[6]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -866,7 +866,7 @@ L_bn_sqr_comba8_begin: movl 20(%esi),%eax adcl $0,%ebp movl 4(%esi),%edx - # sqr a[5]*a[1] + # sqr a[5]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -876,7 +876,7 @@ L_bn_sqr_comba8_begin: movl 16(%esi),%eax adcl $0,%ebp movl 8(%esi),%edx - # sqr a[4]*a[2] + # sqr a[4]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -885,7 +885,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ecx movl 12(%esi),%eax adcl $0,%ebp - # sqr a[3]*a[3] + # sqr a[3]*a[3] mull %eax addl %eax,%ebx adcl %edx,%ecx @@ -893,10 +893,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebp movl %ebx,24(%edi) movl 28(%esi),%eax - # saved r[6] - # ############### Calculate word 7 + # saved r[6] + # ############### Calculate word 7 xorl %ebx,%ebx - # sqr a[7]*a[0] + # sqr a[7]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -906,7 +906,7 @@ L_bn_sqr_comba8_begin: movl 24(%esi),%eax adcl $0,%ebx movl 4(%esi),%edx - # sqr a[6]*a[1] + # sqr a[6]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -916,7 +916,7 @@ L_bn_sqr_comba8_begin: movl 20(%esi),%eax adcl $0,%ebx movl 8(%esi),%edx - # sqr a[5]*a[2] + # sqr a[5]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -926,7 +926,7 @@ L_bn_sqr_comba8_begin: movl 16(%esi),%eax adcl $0,%ebx movl 12(%esi),%edx - # sqr a[4]*a[3] + # sqr a[4]*a[3] mull %edx addl %eax,%eax adcl %edx,%edx @@ -937,10 +937,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebx movl %ecx,28(%edi) movl 4(%esi),%edx - # saved r[7] - # ############### Calculate word 8 + # saved r[7] + # ############### Calculate word 8 xorl %ecx,%ecx - # sqr a[7]*a[1] + # sqr a[7]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -950,7 +950,7 @@ L_bn_sqr_comba8_begin: movl 24(%esi),%eax adcl $0,%ecx movl 8(%esi),%edx - # sqr a[6]*a[2] + # sqr a[6]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -960,7 +960,7 @@ L_bn_sqr_comba8_begin: movl 20(%esi),%eax adcl $0,%ecx movl 12(%esi),%edx - # sqr a[5]*a[3] + # sqr a[5]*a[3] mull %edx addl %eax,%eax adcl %edx,%edx @@ -969,7 +969,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ebx movl 16(%esi),%eax adcl $0,%ecx - # sqr a[4]*a[4] + # sqr a[4]*a[4] mull %eax addl %eax,%ebp adcl %edx,%ebx @@ -977,10 +977,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ecx movl %ebp,32(%edi) movl 28(%esi),%eax - # saved r[8] - # ############### Calculate word 9 + # saved r[8] + # ############### Calculate word 9 xorl %ebp,%ebp - # sqr a[7]*a[2] + # sqr a[7]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -990,7 +990,7 @@ L_bn_sqr_comba8_begin: movl 24(%esi),%eax adcl $0,%ebp movl 12(%esi),%edx - # sqr a[6]*a[3] + # sqr a[6]*a[3] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1000,7 +1000,7 @@ L_bn_sqr_comba8_begin: movl 20(%esi),%eax adcl $0,%ebp movl 16(%esi),%edx - # sqr a[5]*a[4] + # sqr a[5]*a[4] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1011,10 +1011,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebp movl %ebx,36(%edi) movl 12(%esi),%edx - # saved r[9] - # ############### Calculate word 10 + # saved r[9] + # ############### Calculate word 10 xorl %ebx,%ebx - # sqr a[7]*a[3] + # sqr a[7]*a[3] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1024,7 +1024,7 @@ L_bn_sqr_comba8_begin: movl 24(%esi),%eax adcl $0,%ebx movl 16(%esi),%edx - # sqr a[6]*a[4] + # sqr a[6]*a[4] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1033,7 +1033,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ebp movl 20(%esi),%eax adcl $0,%ebx - # sqr a[5]*a[5] + # sqr a[5]*a[5] mull %eax addl %eax,%ecx adcl %edx,%ebp @@ -1041,10 +1041,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebx movl %ecx,40(%edi) movl 28(%esi),%eax - # saved r[10] - # ############### Calculate word 11 + # saved r[10] + # ############### Calculate word 11 xorl %ecx,%ecx - # sqr a[7]*a[4] + # sqr a[7]*a[4] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1054,7 +1054,7 @@ L_bn_sqr_comba8_begin: movl 24(%esi),%eax adcl $0,%ecx movl 20(%esi),%edx - # sqr a[6]*a[5] + # sqr a[6]*a[5] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1065,10 +1065,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ecx movl %ebp,44(%edi) movl 20(%esi),%edx - # saved r[11] - # ############### Calculate word 12 + # saved r[11] + # ############### Calculate word 12 xorl %ebp,%ebp - # sqr a[7]*a[5] + # sqr a[7]*a[5] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1077,7 +1077,7 @@ L_bn_sqr_comba8_begin: adcl %edx,%ecx movl 24(%esi),%eax adcl $0,%ebp - # sqr a[6]*a[6] + # sqr a[6]*a[6] mull %eax addl %eax,%ebx adcl %edx,%ecx @@ -1085,10 +1085,10 @@ L_bn_sqr_comba8_begin: adcl $0,%ebp movl %ebx,48(%edi) movl 28(%esi),%eax - # saved r[12] - # ############### Calculate word 13 + # saved r[12] + # ############### Calculate word 13 xorl %ebx,%ebx - # sqr a[7]*a[6] + # sqr a[7]*a[6] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1098,16 +1098,16 @@ L_bn_sqr_comba8_begin: movl 28(%esi),%eax adcl $0,%ebx movl %ecx,52(%edi) - # saved r[13] - # ############### Calculate word 14 + # saved r[13] + # ############### Calculate word 14 xorl %ecx,%ecx - # sqr a[7]*a[7] + # sqr a[7]*a[7] mull %eax addl %eax,%ebp adcl %edx,%ebx adcl $0,%ecx movl %ebp,56(%edi) - # saved r[14] + # saved r[14] movl %ebx,60(%edi) popl %ebx popl %ebp @@ -1127,9 +1127,9 @@ L_bn_sqr_comba4_begin: xorl %ebx,%ebx xorl %ecx,%ecx movl (%esi),%eax - # ############### Calculate word 0 + # ############### Calculate word 0 xorl %ebp,%ebp - # sqr a[0]*a[0] + # sqr a[0]*a[0] mull %eax addl %eax,%ebx adcl %edx,%ecx @@ -1137,10 +1137,10 @@ L_bn_sqr_comba4_begin: adcl $0,%ebp movl %ebx,(%edi) movl 4(%esi),%eax - # saved r[0] - # ############### Calculate word 1 + # saved r[0] + # ############### Calculate word 1 xorl %ebx,%ebx - # sqr a[1]*a[0] + # sqr a[1]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1151,10 +1151,10 @@ L_bn_sqr_comba4_begin: adcl $0,%ebx movl %ecx,4(%edi) movl (%esi),%edx - # saved r[1] - # ############### Calculate word 2 + # saved r[1] + # ############### Calculate word 2 xorl %ecx,%ecx - # sqr a[2]*a[0] + # sqr a[2]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1163,7 +1163,7 @@ L_bn_sqr_comba4_begin: adcl %edx,%ebx movl 4(%esi),%eax adcl $0,%ecx - # sqr a[1]*a[1] + # sqr a[1]*a[1] mull %eax addl %eax,%ebp adcl %edx,%ebx @@ -1171,10 +1171,10 @@ L_bn_sqr_comba4_begin: adcl $0,%ecx movl %ebp,8(%edi) movl 12(%esi),%eax - # saved r[2] - # ############### Calculate word 3 + # saved r[2] + # ############### Calculate word 3 xorl %ebp,%ebp - # sqr a[3]*a[0] + # sqr a[3]*a[0] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1184,7 +1184,7 @@ L_bn_sqr_comba4_begin: movl 8(%esi),%eax adcl $0,%ebp movl 4(%esi),%edx - # sqr a[2]*a[1] + # sqr a[2]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1195,10 +1195,10 @@ L_bn_sqr_comba4_begin: adcl $0,%ebp movl %ebx,12(%edi) movl 4(%esi),%edx - # saved r[3] - # ############### Calculate word 4 + # saved r[3] + # ############### Calculate word 4 xorl %ebx,%ebx - # sqr a[3]*a[1] + # sqr a[3]*a[1] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1207,7 +1207,7 @@ L_bn_sqr_comba4_begin: adcl %edx,%ebp movl 8(%esi),%eax adcl $0,%ebx - # sqr a[2]*a[2] + # sqr a[2]*a[2] mull %eax addl %eax,%ecx adcl %edx,%ebp @@ -1215,10 +1215,10 @@ L_bn_sqr_comba4_begin: adcl $0,%ebx movl %ecx,16(%edi) movl 12(%esi),%eax - # saved r[4] - # ############### Calculate word 5 + # saved r[4] + # ############### Calculate word 5 xorl %ecx,%ecx - # sqr a[3]*a[2] + # sqr a[3]*a[2] mull %edx addl %eax,%eax adcl %edx,%edx @@ -1228,16 +1228,16 @@ L_bn_sqr_comba4_begin: movl 12(%esi),%eax adcl $0,%ecx movl %ebp,20(%edi) - # saved r[5] - # ############### Calculate word 6 + # saved r[5] + # ############### Calculate word 6 xorl %ebp,%ebp - # sqr a[3]*a[3] + # sqr a[3]*a[3] mull %eax addl %eax,%ebx adcl %edx,%ecx adcl $0,%ebp movl %ebx,24(%edi) - # saved r[6] + # saved r[6] movl %ecx,28(%edi) popl %ebx popl %ebp diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/x86-mont.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/x86-mont.s index 35db106f8c1f..3183bbb65704 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/x86-mont.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/bn/x86-mont.s @@ -444,16 +444,18 @@ L017sub: leal 1(%edx),%edx jge L017sub sbbl $0,%eax - andl %eax,%esi - notl %eax - movl %edi,%ebp - andl %eax,%ebp - orl %ebp,%esi + movl $-1,%edx + xorl %eax,%edx + jmp L018copy .align 4,0x90 L018copy: - movl (%esi,%ebx,4),%eax - movl %eax,(%edi,%ebx,4) + movl 32(%esp,%ebx,4),%esi + movl (%edi,%ebx,4),%ebp movl %ecx,32(%esp,%ebx,4) + andl %eax,%esi + andl %edx,%ebp + orl %esi,%ebp + movl %ebp,(%edi,%ebx,4) decl %ebx jge L018copy movl 24(%esp),%esp diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h index 005ca0b70459..b89e43e6d576 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h @@ -37,4 +37,4 @@ static const char cflags[] = { ' ','\0' }; #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 3 00:38:21 2018" +#define DATE "built on: Tue Aug 14 23:13:09 2018" diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/crypt586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/crypt586.s index 1731c53faac0..9156a65a1e67 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/crypt586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/crypt586.s @@ -9,7 +9,7 @@ L_fcrypt_body_begin: pushl %esi pushl %edi - # Load the 2 words + # Load the 2 words xorl %edi,%edi xorl %esi,%esi call L000PIC_me_up @@ -21,7 +21,7 @@ L000PIC_me_up: pushl $25 L001start: - # Round 0 + # Round 0 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -71,7 +71,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 1 + # Round 1 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -121,7 +121,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 2 + # Round 2 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -171,7 +171,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 3 + # Round 3 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -221,7 +221,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 4 + # Round 4 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -271,7 +271,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 5 + # Round 5 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -321,7 +321,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 6 + # Round 6 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -371,7 +371,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 7 + # Round 7 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -421,7 +421,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 8 + # Round 8 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -471,7 +471,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 9 + # Round 9 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -521,7 +521,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 10 + # Round 10 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -571,7 +571,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 11 + # Round 11 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -621,7 +621,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 12 + # Round 12 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -671,7 +671,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 13 + # Round 13 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -721,7 +721,7 @@ L001start: xorl %ebx,%esi movl 32(%esp),%ebp - # Round 14 + # Round 14 movl 36(%esp),%eax movl %esi,%edx shrl $16,%edx @@ -771,7 +771,7 @@ L001start: xorl %ebx,%edi movl 32(%esp),%ebp - # Round 15 + # Round 15 movl 36(%esp),%eax movl %edi,%edx shrl $16,%edx @@ -828,7 +828,7 @@ L001start: movl %ebx,(%esp) jnz L001start - # FP + # FP movl 28(%esp),%edx rorl $1,%edi movl %esi,%eax diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/des-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/des-586.s index 43354871fcd4..d0c1a2e4866e 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/des-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/des/des-586.s @@ -4,7 +4,7 @@ .align 4 __x86_DES_encrypt: pushl %ecx - # Round 0 + # Round 0 movl (%ecx),%eax xorl %ebx,%ebx movl 4(%ecx),%edx @@ -33,7 +33,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 1 + # Round 1 movl 8(%ecx),%eax xorl %ebx,%ebx movl 12(%ecx),%edx @@ -62,7 +62,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 2 + # Round 2 movl 16(%ecx),%eax xorl %ebx,%ebx movl 20(%ecx),%edx @@ -91,7 +91,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 3 + # Round 3 movl 24(%ecx),%eax xorl %ebx,%ebx movl 28(%ecx),%edx @@ -120,7 +120,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 4 + # Round 4 movl 32(%ecx),%eax xorl %ebx,%ebx movl 36(%ecx),%edx @@ -149,7 +149,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 5 + # Round 5 movl 40(%ecx),%eax xorl %ebx,%ebx movl 44(%ecx),%edx @@ -178,7 +178,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 6 + # Round 6 movl 48(%ecx),%eax xorl %ebx,%ebx movl 52(%ecx),%edx @@ -207,7 +207,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 7 + # Round 7 movl 56(%ecx),%eax xorl %ebx,%ebx movl 60(%ecx),%edx @@ -236,7 +236,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 8 + # Round 8 movl 64(%ecx),%eax xorl %ebx,%ebx movl 68(%ecx),%edx @@ -265,7 +265,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 9 + # Round 9 movl 72(%ecx),%eax xorl %ebx,%ebx movl 76(%ecx),%edx @@ -294,7 +294,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 10 + # Round 10 movl 80(%ecx),%eax xorl %ebx,%ebx movl 84(%ecx),%edx @@ -323,7 +323,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 11 + # Round 11 movl 88(%ecx),%eax xorl %ebx,%ebx movl 92(%ecx),%edx @@ -352,7 +352,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 12 + # Round 12 movl 96(%ecx),%eax xorl %ebx,%ebx movl 100(%ecx),%edx @@ -381,7 +381,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 13 + # Round 13 movl 104(%ecx),%eax xorl %ebx,%ebx movl 108(%ecx),%edx @@ -410,7 +410,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 14 + # Round 14 movl 112(%ecx),%eax xorl %ebx,%ebx movl 116(%ecx),%edx @@ -439,7 +439,7 @@ __x86_DES_encrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 15 + # Round 15 movl 120(%ecx),%eax xorl %ebx,%ebx movl 124(%ecx),%edx @@ -473,7 +473,7 @@ __x86_DES_encrypt: .align 4 __x86_DES_decrypt: pushl %ecx - # Round 15 + # Round 15 movl 120(%ecx),%eax xorl %ebx,%ebx movl 124(%ecx),%edx @@ -502,7 +502,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 14 + # Round 14 movl 112(%ecx),%eax xorl %ebx,%ebx movl 116(%ecx),%edx @@ -531,7 +531,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 13 + # Round 13 movl 104(%ecx),%eax xorl %ebx,%ebx movl 108(%ecx),%edx @@ -560,7 +560,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 12 + # Round 12 movl 96(%ecx),%eax xorl %ebx,%ebx movl 100(%ecx),%edx @@ -589,7 +589,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 11 + # Round 11 movl 88(%ecx),%eax xorl %ebx,%ebx movl 92(%ecx),%edx @@ -618,7 +618,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 10 + # Round 10 movl 80(%ecx),%eax xorl %ebx,%ebx movl 84(%ecx),%edx @@ -647,7 +647,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 9 + # Round 9 movl 72(%ecx),%eax xorl %ebx,%ebx movl 76(%ecx),%edx @@ -676,7 +676,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 8 + # Round 8 movl 64(%ecx),%eax xorl %ebx,%ebx movl 68(%ecx),%edx @@ -705,7 +705,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 7 + # Round 7 movl 56(%ecx),%eax xorl %ebx,%ebx movl 60(%ecx),%edx @@ -734,7 +734,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 6 + # Round 6 movl 48(%ecx),%eax xorl %ebx,%ebx movl 52(%ecx),%edx @@ -763,7 +763,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 5 + # Round 5 movl 40(%ecx),%eax xorl %ebx,%ebx movl 44(%ecx),%edx @@ -792,7 +792,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 4 + # Round 4 movl 32(%ecx),%eax xorl %ebx,%ebx movl 36(%ecx),%edx @@ -821,7 +821,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 3 + # Round 3 movl 24(%ecx),%eax xorl %ebx,%ebx movl 28(%ecx),%edx @@ -850,7 +850,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 2 + # Round 2 movl 16(%ecx),%eax xorl %ebx,%ebx movl 20(%ecx),%edx @@ -879,7 +879,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%esi xorl 0x500(%ebp,%edx,1),%esi - # Round 1 + # Round 1 movl 8(%ecx),%eax xorl %ebx,%ebx movl 12(%ecx),%edx @@ -908,7 +908,7 @@ __x86_DES_decrypt: movl (%esp),%ecx xorl 0x400(%ebp,%eax,1),%edi xorl 0x500(%ebp,%edx,1),%edi - # Round 0 + # Round 0 movl (%ecx),%eax xorl %ebx,%ebx movl 4(%ecx),%edx @@ -946,7 +946,7 @@ L_DES_encrypt1_begin: pushl %esi pushl %edi - # Load the 2 words + # Load the 2 words movl 12(%esp),%esi xorl %ecx,%ecx pushl %ebx @@ -955,7 +955,7 @@ L_DES_encrypt1_begin: movl 28(%esp),%ebx movl 4(%esi),%edi - # IP + # IP roll $4,%eax movl %eax,%esi xorl %edi,%eax @@ -1005,7 +1005,7 @@ L001decrypt: call __x86_DES_decrypt L002done: - # FP + # FP movl 20(%esp),%edx rorl $1,%esi movl %edi,%eax @@ -1057,7 +1057,7 @@ L_DES_encrypt2_begin: pushl %esi pushl %edi - # Load the 2 words + # Load the 2 words movl 12(%esp),%eax xorl %ecx,%ecx pushl %ebx @@ -1080,7 +1080,7 @@ L004decrypt: call __x86_DES_decrypt L005done: - # Fixup + # Fixup rorl $3,%edi movl 20(%esp),%eax rorl $3,%esi @@ -1101,12 +1101,12 @@ L_DES_encrypt3_begin: pushl %esi pushl %edi - # Load the data words + # Load the data words movl (%ebx),%edi movl 4(%ebx),%esi subl $12,%esp - # IP + # IP roll $4,%edi movl %edi,%edx xorl %esi,%edi @@ -1165,7 +1165,7 @@ L_DES_encrypt3_begin: movl (%ebx),%edi movl 4(%ebx),%esi - # FP + # FP roll $2,%esi roll $3,%edi movl %edi,%eax @@ -1220,12 +1220,12 @@ L_DES_decrypt3_begin: pushl %esi pushl %edi - # Load the data words + # Load the data words movl (%ebx),%edi movl 4(%ebx),%esi subl $12,%esp - # IP + # IP roll $4,%edi movl %edi,%edx xorl %esi,%edi @@ -1284,7 +1284,7 @@ L_DES_decrypt3_begin: movl (%ebx),%edi movl 4(%ebx),%esi - # FP + # FP roll $2,%esi roll $3,%edi movl %edi,%eax @@ -1339,7 +1339,7 @@ L_DES_ncbc_encrypt_begin: pushl %esi pushl %edi movl 28(%esp),%ebp - # getting iv ptr from parameter 4 + # getting iv ptr from parameter 4 movl 36(%esp),%ebx movl (%ebx),%esi movl 4(%ebx),%edi @@ -1350,11 +1350,11 @@ L_DES_ncbc_encrypt_begin: movl %esp,%ebx movl 36(%esp),%esi movl 40(%esp),%edi - # getting encrypt flag from parameter 5 + # getting encrypt flag from parameter 5 movl 56(%esp),%ecx - # get and push parameter 5 + # get and push parameter 5 pushl %ecx - # get and push parameter 3 + # get and push parameter 3 movl 52(%esp),%eax pushl %eax pushl %ebx @@ -1517,7 +1517,7 @@ L_DES_ede3_cbc_encrypt_begin: pushl %esi pushl %edi movl 28(%esp),%ebp - # getting iv ptr from parameter 6 + # getting iv ptr from parameter 6 movl 44(%esp),%ebx movl (%ebx),%esi movl 4(%ebx),%edi @@ -1528,15 +1528,15 @@ L_DES_ede3_cbc_encrypt_begin: movl %esp,%ebx movl 36(%esp),%esi movl 40(%esp),%edi - # getting encrypt flag from parameter 7 + # getting encrypt flag from parameter 7 movl 64(%esp),%ecx - # get and push parameter 5 + # get and push parameter 5 movl 56(%esp),%eax pushl %eax - # get and push parameter 4 + # get and push parameter 4 movl 56(%esp),%eax pushl %eax - # get and push parameter 3 + # get and push parameter 3 movl 56(%esp),%eax pushl %eax pushl %ebx diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ec/ecp_nistz256-x86.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ec/ecp_nistz256-x86.s index f2163103ef61..fe6e89a4dba0 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ec/ecp_nistz256-x86.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ec/ecp_nistz256-x86.s @@ -3822,7 +3822,7 @@ L_ecp_nistz256_scatter_w7_begin: movl 20(%esp),%edi movl 24(%esp),%esi movl 28(%esp),%ebp - leal -1(%edi,%ebp,1),%edi + leal (%edi,%ebp,1),%edi movl $16,%ebp L007scatter_w7_loop: movl (%esi),%eax diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/md5/md5-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/md5/md5-586.s index 4e703510412d..93c6693b5a65 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/md5/md5-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/md5/md5-586.s @@ -21,10 +21,10 @@ L_md5_block_asm_data_order_begin: movl 12(%edi),%edx L000start: - # R0 section + # R0 section movl %ecx,%edi movl (%esi),%ebp - # R0 0 + # R0 0 xorl %edx,%edi andl %ebx,%edi leal 3614090360(%eax,%ebp,1),%eax @@ -34,7 +34,7 @@ L000start: roll $7,%eax movl %ebx,%edi addl %ebx,%eax - # R0 1 + # R0 1 xorl %ecx,%edi andl %eax,%edi leal 3905402710(%edx,%ebp,1),%edx @@ -44,7 +44,7 @@ L000start: roll $12,%edx movl %eax,%edi addl %eax,%edx - # R0 2 + # R0 2 xorl %ebx,%edi andl %edx,%edi leal 606105819(%ecx,%ebp,1),%ecx @@ -54,7 +54,7 @@ L000start: roll $17,%ecx movl %edx,%edi addl %edx,%ecx - # R0 3 + # R0 3 xorl %eax,%edi andl %ecx,%edi leal 3250441966(%ebx,%ebp,1),%ebx @@ -64,7 +64,7 @@ L000start: roll $22,%ebx movl %ecx,%edi addl %ecx,%ebx - # R0 4 + # R0 4 xorl %edx,%edi andl %ebx,%edi leal 4118548399(%eax,%ebp,1),%eax @@ -74,7 +74,7 @@ L000start: roll $7,%eax movl %ebx,%edi addl %ebx,%eax - # R0 5 + # R0 5 xorl %ecx,%edi andl %eax,%edi leal 1200080426(%edx,%ebp,1),%edx @@ -84,7 +84,7 @@ L000start: roll $12,%edx movl %eax,%edi addl %eax,%edx - # R0 6 + # R0 6 xorl %ebx,%edi andl %edx,%edi leal 2821735955(%ecx,%ebp,1),%ecx @@ -94,7 +94,7 @@ L000start: roll $17,%ecx movl %edx,%edi addl %edx,%ecx - # R0 7 + # R0 7 xorl %eax,%edi andl %ecx,%edi leal 4249261313(%ebx,%ebp,1),%ebx @@ -104,7 +104,7 @@ L000start: roll $22,%ebx movl %ecx,%edi addl %ecx,%ebx - # R0 8 + # R0 8 xorl %edx,%edi andl %ebx,%edi leal 1770035416(%eax,%ebp,1),%eax @@ -114,7 +114,7 @@ L000start: roll $7,%eax movl %ebx,%edi addl %ebx,%eax - # R0 9 + # R0 9 xorl %ecx,%edi andl %eax,%edi leal 2336552879(%edx,%ebp,1),%edx @@ -124,7 +124,7 @@ L000start: roll $12,%edx movl %eax,%edi addl %eax,%edx - # R0 10 + # R0 10 xorl %ebx,%edi andl %edx,%edi leal 4294925233(%ecx,%ebp,1),%ecx @@ -134,7 +134,7 @@ L000start: roll $17,%ecx movl %edx,%edi addl %edx,%ecx - # R0 11 + # R0 11 xorl %eax,%edi andl %ecx,%edi leal 2304563134(%ebx,%ebp,1),%ebx @@ -144,7 +144,7 @@ L000start: roll $22,%ebx movl %ecx,%edi addl %ecx,%ebx - # R0 12 + # R0 12 xorl %edx,%edi andl %ebx,%edi leal 1804603682(%eax,%ebp,1),%eax @@ -154,7 +154,7 @@ L000start: roll $7,%eax movl %ebx,%edi addl %ebx,%eax - # R0 13 + # R0 13 xorl %ecx,%edi andl %eax,%edi leal 4254626195(%edx,%ebp,1),%edx @@ -164,7 +164,7 @@ L000start: roll $12,%edx movl %eax,%edi addl %eax,%edx - # R0 14 + # R0 14 xorl %ebx,%edi andl %edx,%edi leal 2792965006(%ecx,%ebp,1),%ecx @@ -174,7 +174,7 @@ L000start: roll $17,%ecx movl %edx,%edi addl %edx,%ecx - # R0 15 + # R0 15 xorl %eax,%edi andl %ecx,%edi leal 1236535329(%ebx,%ebp,1),%ebx @@ -185,8 +185,8 @@ L000start: movl %ecx,%edi addl %ecx,%ebx - # R1 section - # R1 16 + # R1 section + # R1 16 xorl %ebx,%edi andl %edx,%edi leal 4129170786(%eax,%ebp,1),%eax @@ -196,7 +196,7 @@ L000start: movl %ebx,%edi roll $5,%eax addl %ebx,%eax - # R1 17 + # R1 17 xorl %eax,%edi andl %ecx,%edi leal 3225465664(%edx,%ebp,1),%edx @@ -206,7 +206,7 @@ L000start: movl %eax,%edi roll $9,%edx addl %eax,%edx - # R1 18 + # R1 18 xorl %edx,%edi andl %ebx,%edi leal 643717713(%ecx,%ebp,1),%ecx @@ -216,7 +216,7 @@ L000start: movl %edx,%edi roll $14,%ecx addl %edx,%ecx - # R1 19 + # R1 19 xorl %ecx,%edi andl %eax,%edi leal 3921069994(%ebx,%ebp,1),%ebx @@ -226,7 +226,7 @@ L000start: movl %ecx,%edi roll $20,%ebx addl %ecx,%ebx - # R1 20 + # R1 20 xorl %ebx,%edi andl %edx,%edi leal 3593408605(%eax,%ebp,1),%eax @@ -236,7 +236,7 @@ L000start: movl %ebx,%edi roll $5,%eax addl %ebx,%eax - # R1 21 + # R1 21 xorl %eax,%edi andl %ecx,%edi leal 38016083(%edx,%ebp,1),%edx @@ -246,7 +246,7 @@ L000start: movl %eax,%edi roll $9,%edx addl %eax,%edx - # R1 22 + # R1 22 xorl %edx,%edi andl %ebx,%edi leal 3634488961(%ecx,%ebp,1),%ecx @@ -256,7 +256,7 @@ L000start: movl %edx,%edi roll $14,%ecx addl %edx,%ecx - # R1 23 + # R1 23 xorl %ecx,%edi andl %eax,%edi leal 3889429448(%ebx,%ebp,1),%ebx @@ -266,7 +266,7 @@ L000start: movl %ecx,%edi roll $20,%ebx addl %ecx,%ebx - # R1 24 + # R1 24 xorl %ebx,%edi andl %edx,%edi leal 568446438(%eax,%ebp,1),%eax @@ -276,7 +276,7 @@ L000start: movl %ebx,%edi roll $5,%eax addl %ebx,%eax - # R1 25 + # R1 25 xorl %eax,%edi andl %ecx,%edi leal 3275163606(%edx,%ebp,1),%edx @@ -286,7 +286,7 @@ L000start: movl %eax,%edi roll $9,%edx addl %eax,%edx - # R1 26 + # R1 26 xorl %edx,%edi andl %ebx,%edi leal 4107603335(%ecx,%ebp,1),%ecx @@ -296,7 +296,7 @@ L000start: movl %edx,%edi roll $14,%ecx addl %edx,%ecx - # R1 27 + # R1 27 xorl %ecx,%edi andl %eax,%edi leal 1163531501(%ebx,%ebp,1),%ebx @@ -306,7 +306,7 @@ L000start: movl %ecx,%edi roll $20,%ebx addl %ecx,%ebx - # R1 28 + # R1 28 xorl %ebx,%edi andl %edx,%edi leal 2850285829(%eax,%ebp,1),%eax @@ -316,7 +316,7 @@ L000start: movl %ebx,%edi roll $5,%eax addl %ebx,%eax - # R1 29 + # R1 29 xorl %eax,%edi andl %ecx,%edi leal 4243563512(%edx,%ebp,1),%edx @@ -326,7 +326,7 @@ L000start: movl %eax,%edi roll $9,%edx addl %eax,%edx - # R1 30 + # R1 30 xorl %edx,%edi andl %ebx,%edi leal 1735328473(%ecx,%ebp,1),%ecx @@ -336,7 +336,7 @@ L000start: movl %edx,%edi roll $14,%ecx addl %edx,%ecx - # R1 31 + # R1 31 xorl %ecx,%edi andl %eax,%edi leal 2368359562(%ebx,%ebp,1),%ebx @@ -347,8 +347,8 @@ L000start: roll $20,%ebx addl %ecx,%ebx - # R2 section - # R2 32 + # R2 section + # R2 32 xorl %edx,%edi xorl %ebx,%edi leal 4294588738(%eax,%ebp,1),%eax @@ -356,7 +356,7 @@ L000start: movl 32(%esi),%ebp roll $4,%eax movl %ebx,%edi - # R2 33 + # R2 33 addl %ebx,%eax xorl %ecx,%edi leal 2272392833(%edx,%ebp,1),%edx @@ -366,7 +366,7 @@ L000start: movl %eax,%edi roll $11,%edx addl %eax,%edx - # R2 34 + # R2 34 xorl %ebx,%edi xorl %edx,%edi leal 1839030562(%ecx,%ebp,1),%ecx @@ -374,7 +374,7 @@ L000start: movl 56(%esi),%ebp roll $16,%ecx movl %edx,%edi - # R2 35 + # R2 35 addl %edx,%ecx xorl %eax,%edi leal 4259657740(%ebx,%ebp,1),%ebx @@ -384,7 +384,7 @@ L000start: movl %ecx,%edi roll $23,%ebx addl %ecx,%ebx - # R2 36 + # R2 36 xorl %edx,%edi xorl %ebx,%edi leal 2763975236(%eax,%ebp,1),%eax @@ -392,7 +392,7 @@ L000start: movl 16(%esi),%ebp roll $4,%eax movl %ebx,%edi - # R2 37 + # R2 37 addl %ebx,%eax xorl %ecx,%edi leal 1272893353(%edx,%ebp,1),%edx @@ -402,7 +402,7 @@ L000start: movl %eax,%edi roll $11,%edx addl %eax,%edx - # R2 38 + # R2 38 xorl %ebx,%edi xorl %edx,%edi leal 4139469664(%ecx,%ebp,1),%ecx @@ -410,7 +410,7 @@ L000start: movl 40(%esi),%ebp roll $16,%ecx movl %edx,%edi - # R2 39 + # R2 39 addl %edx,%ecx xorl %eax,%edi leal 3200236656(%ebx,%ebp,1),%ebx @@ -420,7 +420,7 @@ L000start: movl %ecx,%edi roll $23,%ebx addl %ecx,%ebx - # R2 40 + # R2 40 xorl %edx,%edi xorl %ebx,%edi leal 681279174(%eax,%ebp,1),%eax @@ -428,7 +428,7 @@ L000start: movl (%esi),%ebp roll $4,%eax movl %ebx,%edi - # R2 41 + # R2 41 addl %ebx,%eax xorl %ecx,%edi leal 3936430074(%edx,%ebp,1),%edx @@ -438,7 +438,7 @@ L000start: movl %eax,%edi roll $11,%edx addl %eax,%edx - # R2 42 + # R2 42 xorl %ebx,%edi xorl %edx,%edi leal 3572445317(%ecx,%ebp,1),%ecx @@ -446,7 +446,7 @@ L000start: movl 24(%esi),%ebp roll $16,%ecx movl %edx,%edi - # R2 43 + # R2 43 addl %edx,%ecx xorl %eax,%edi leal 76029189(%ebx,%ebp,1),%ebx @@ -456,7 +456,7 @@ L000start: movl %ecx,%edi roll $23,%ebx addl %ecx,%ebx - # R2 44 + # R2 44 xorl %edx,%edi xorl %ebx,%edi leal 3654602809(%eax,%ebp,1),%eax @@ -464,7 +464,7 @@ L000start: movl 48(%esi),%ebp roll $4,%eax movl %ebx,%edi - # R2 45 + # R2 45 addl %ebx,%eax xorl %ecx,%edi leal 3873151461(%edx,%ebp,1),%edx @@ -474,7 +474,7 @@ L000start: movl %eax,%edi roll $11,%edx addl %eax,%edx - # R2 46 + # R2 46 xorl %ebx,%edi xorl %edx,%edi leal 530742520(%ecx,%ebp,1),%ecx @@ -482,7 +482,7 @@ L000start: movl 8(%esi),%ebp roll $16,%ecx movl %edx,%edi - # R2 47 + # R2 47 addl %edx,%ecx xorl %eax,%edi leal 3299628645(%ebx,%ebp,1),%ebx @@ -493,8 +493,8 @@ L000start: roll $23,%ebx addl %ecx,%ebx - # R3 section - # R3 48 + # R3 section + # R3 48 xorl %edx,%edi orl %ebx,%edi leal 4096336452(%eax,%ebp,1),%eax @@ -505,7 +505,7 @@ L000start: roll $6,%eax xorl %ecx,%edi addl %ebx,%eax - # R3 49 + # R3 49 orl %eax,%edi leal 1126891415(%edx,%ebp,1),%edx xorl %ebx,%edi @@ -515,7 +515,7 @@ L000start: roll $10,%edx xorl %ebx,%edi addl %eax,%edx - # R3 50 + # R3 50 orl %edx,%edi leal 2878612391(%ecx,%ebp,1),%ecx xorl %eax,%edi @@ -525,7 +525,7 @@ L000start: roll $15,%ecx xorl %eax,%edi addl %edx,%ecx - # R3 51 + # R3 51 orl %ecx,%edi leal 4237533241(%ebx,%ebp,1),%ebx xorl %edx,%edi @@ -535,7 +535,7 @@ L000start: roll $21,%ebx xorl %edx,%edi addl %ecx,%ebx - # R3 52 + # R3 52 orl %ebx,%edi leal 1700485571(%eax,%ebp,1),%eax xorl %ecx,%edi @@ -545,7 +545,7 @@ L000start: roll $6,%eax xorl %ecx,%edi addl %ebx,%eax - # R3 53 + # R3 53 orl %eax,%edi leal 2399980690(%edx,%ebp,1),%edx xorl %ebx,%edi @@ -555,7 +555,7 @@ L000start: roll $10,%edx xorl %ebx,%edi addl %eax,%edx - # R3 54 + # R3 54 orl %edx,%edi leal 4293915773(%ecx,%ebp,1),%ecx xorl %eax,%edi @@ -565,7 +565,7 @@ L000start: roll $15,%ecx xorl %eax,%edi addl %edx,%ecx - # R3 55 + # R3 55 orl %ecx,%edi leal 2240044497(%ebx,%ebp,1),%ebx xorl %edx,%edi @@ -575,7 +575,7 @@ L000start: roll $21,%ebx xorl %edx,%edi addl %ecx,%ebx - # R3 56 + # R3 56 orl %ebx,%edi leal 1873313359(%eax,%ebp,1),%eax xorl %ecx,%edi @@ -585,7 +585,7 @@ L000start: roll $6,%eax xorl %ecx,%edi addl %ebx,%eax - # R3 57 + # R3 57 orl %eax,%edi leal 4264355552(%edx,%ebp,1),%edx xorl %ebx,%edi @@ -595,7 +595,7 @@ L000start: roll $10,%edx xorl %ebx,%edi addl %eax,%edx - # R3 58 + # R3 58 orl %edx,%edi leal 2734768916(%ecx,%ebp,1),%ecx xorl %eax,%edi @@ -605,7 +605,7 @@ L000start: roll $15,%ecx xorl %eax,%edi addl %edx,%ecx - # R3 59 + # R3 59 orl %ecx,%edi leal 1309151649(%ebx,%ebp,1),%ebx xorl %edx,%edi @@ -615,7 +615,7 @@ L000start: roll $21,%ebx xorl %edx,%edi addl %ecx,%ebx - # R3 60 + # R3 60 orl %ebx,%edi leal 4149444226(%eax,%ebp,1),%eax xorl %ecx,%edi @@ -625,7 +625,7 @@ L000start: roll $6,%eax xorl %ecx,%edi addl %ebx,%eax - # R3 61 + # R3 61 orl %eax,%edi leal 3174756917(%edx,%ebp,1),%edx xorl %ebx,%edi @@ -635,7 +635,7 @@ L000start: roll $10,%edx xorl %ebx,%edi addl %eax,%edx - # R3 62 + # R3 62 orl %edx,%edi leal 718787259(%ecx,%ebp,1),%ecx xorl %eax,%edi @@ -645,7 +645,7 @@ L000start: roll $15,%ecx xorl %eax,%edi addl %edx,%ecx - # R3 63 + # R3 63 orl %ecx,%edi leal 3951481745(%ebx,%ebp,1),%ebx xorl %edx,%edi diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ripemd/rmd-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ripemd/rmd-586.s index 15dd76c69a54..0a19b1429bd2 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ripemd/rmd-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/ripemd/rmd-586.s @@ -51,7 +51,7 @@ L000start: movl %edi,%eax movl 12(%edx),%ebx movl 16(%edx),%ebp - # 0 + # 0 xorl %ebx,%eax movl (%esp),%edx xorl %esi,%eax @@ -61,7 +61,7 @@ L000start: movl %esi,%eax roll $11,%ecx addl %ebp,%ecx - # 1 + # 1 xorl %edi,%eax movl 4(%esp),%edx xorl %ecx,%eax @@ -72,7 +72,7 @@ L000start: xorl %esi,%eax roll $14,%ebp addl %ebx,%ebp - # 2 + # 2 movl 8(%esp),%edx xorl %ebp,%eax addl %edx,%ebx @@ -81,7 +81,7 @@ L000start: movl %ebp,%eax roll $15,%ebx addl %edi,%ebx - # 3 + # 3 xorl %ecx,%eax movl 12(%esp),%edx xorl %ebx,%eax @@ -92,7 +92,7 @@ L000start: xorl %ebp,%eax roll $12,%edi addl %esi,%edi - # 4 + # 4 movl 16(%esp),%edx xorl %edi,%eax addl %edx,%esi @@ -101,7 +101,7 @@ L000start: movl %edi,%eax roll $5,%esi addl %ecx,%esi - # 5 + # 5 xorl %ebx,%eax movl 20(%esp),%edx xorl %esi,%eax @@ -112,7 +112,7 @@ L000start: xorl %edi,%eax roll $8,%ecx addl %ebp,%ecx - # 6 + # 6 movl 24(%esp),%edx xorl %ecx,%eax addl %edx,%ebp @@ -121,7 +121,7 @@ L000start: movl %ecx,%eax roll $7,%ebp addl %ebx,%ebp - # 7 + # 7 xorl %esi,%eax movl 28(%esp),%edx xorl %ebp,%eax @@ -132,7 +132,7 @@ L000start: xorl %ecx,%eax roll $9,%ebx addl %edi,%ebx - # 8 + # 8 movl 32(%esp),%edx xorl %ebx,%eax addl %edx,%edi @@ -141,7 +141,7 @@ L000start: movl %ebx,%eax roll $11,%edi addl %esi,%edi - # 9 + # 9 xorl %ebp,%eax movl 36(%esp),%edx xorl %edi,%eax @@ -152,7 +152,7 @@ L000start: xorl %ebx,%eax roll $13,%esi addl %ecx,%esi - # 10 + # 10 movl 40(%esp),%edx xorl %esi,%eax addl %edx,%ecx @@ -161,7 +161,7 @@ L000start: movl %esi,%eax roll $14,%ecx addl %ebp,%ecx - # 11 + # 11 xorl %edi,%eax movl 44(%esp),%edx xorl %ecx,%eax @@ -172,7 +172,7 @@ L000start: xorl %esi,%eax roll $15,%ebp addl %ebx,%ebp - # 12 + # 12 movl 48(%esp),%edx xorl %ebp,%eax addl %edx,%ebx @@ -181,7 +181,7 @@ L000start: movl %ebp,%eax roll $6,%ebx addl %edi,%ebx - # 13 + # 13 xorl %ecx,%eax movl 52(%esp),%edx xorl %ebx,%eax @@ -192,7 +192,7 @@ L000start: xorl %ebp,%eax roll $7,%edi addl %esi,%edi - # 14 + # 14 movl 56(%esp),%edx xorl %edi,%eax addl %edx,%esi @@ -201,7 +201,7 @@ L000start: movl %edi,%eax roll $9,%esi addl %ecx,%esi - # 15 + # 15 xorl %ebx,%eax movl 60(%esp),%edx xorl %esi,%eax @@ -212,7 +212,7 @@ L000start: movl 28(%esp),%edx roll $8,%ecx addl %ebp,%ecx - # 16 + # 16 addl %edx,%ebp movl %esi,%edx subl %ecx,%eax @@ -225,7 +225,7 @@ L000start: movl $-1,%edx roll $7,%ebp addl %ebx,%ebp - # 17 + # 17 addl %eax,%ebx movl %ecx,%eax subl %ebp,%edx @@ -238,7 +238,7 @@ L000start: movl $-1,%eax roll $6,%ebx addl %edi,%ebx - # 18 + # 18 addl %edx,%edi movl %ebp,%edx subl %ebx,%eax @@ -251,7 +251,7 @@ L000start: movl $-1,%edx roll $8,%edi addl %esi,%edi - # 19 + # 19 addl %eax,%esi movl %ebx,%eax subl %edi,%edx @@ -264,7 +264,7 @@ L000start: movl $-1,%eax roll $13,%esi addl %ecx,%esi - # 20 + # 20 addl %edx,%ecx movl %edi,%edx subl %esi,%eax @@ -277,7 +277,7 @@ L000start: movl $-1,%edx roll $11,%ecx addl %ebp,%ecx - # 21 + # 21 addl %eax,%ebp movl %esi,%eax subl %ecx,%edx @@ -290,7 +290,7 @@ L000start: movl $-1,%eax roll $9,%ebp addl %ebx,%ebp - # 22 + # 22 addl %edx,%ebx movl %ecx,%edx subl %ebp,%eax @@ -303,7 +303,7 @@ L000start: movl $-1,%edx roll $7,%ebx addl %edi,%ebx - # 23 + # 23 addl %eax,%edi movl %ebp,%eax subl %ebx,%edx @@ -316,7 +316,7 @@ L000start: movl $-1,%eax roll $15,%edi addl %esi,%edi - # 24 + # 24 addl %edx,%esi movl %ebx,%edx subl %edi,%eax @@ -329,7 +329,7 @@ L000start: movl $-1,%edx roll $7,%esi addl %ecx,%esi - # 25 + # 25 addl %eax,%ecx movl %edi,%eax subl %esi,%edx @@ -342,7 +342,7 @@ L000start: movl $-1,%eax roll $12,%ecx addl %ebp,%ecx - # 26 + # 26 addl %edx,%ebp movl %esi,%edx subl %ecx,%eax @@ -355,7 +355,7 @@ L000start: movl $-1,%edx roll $15,%ebp addl %ebx,%ebp - # 27 + # 27 addl %eax,%ebx movl %ecx,%eax subl %ebp,%edx @@ -368,7 +368,7 @@ L000start: movl $-1,%eax roll $9,%ebx addl %edi,%ebx - # 28 + # 28 addl %edx,%edi movl %ebp,%edx subl %ebx,%eax @@ -381,7 +381,7 @@ L000start: movl $-1,%edx roll $11,%edi addl %esi,%edi - # 29 + # 29 addl %eax,%esi movl %ebx,%eax subl %edi,%edx @@ -394,7 +394,7 @@ L000start: movl $-1,%eax roll $7,%esi addl %ecx,%esi - # 30 + # 30 addl %edx,%ecx movl %edi,%edx subl %esi,%eax @@ -407,7 +407,7 @@ L000start: movl $-1,%edx roll $13,%ecx addl %ebp,%ecx - # 31 + # 31 addl %eax,%ebp movl %esi,%eax subl %ecx,%edx @@ -420,7 +420,7 @@ L000start: subl %ecx,%edx roll $12,%ebp addl %ebx,%ebp - # 32 + # 32 movl 12(%esp),%eax orl %ebp,%edx addl %eax,%ebx @@ -431,7 +431,7 @@ L000start: subl %ebp,%eax roll $11,%ebx addl %edi,%ebx - # 33 + # 33 movl 40(%esp),%edx orl %ebx,%eax addl %edx,%edi @@ -442,7 +442,7 @@ L000start: subl %ebx,%edx roll $13,%edi addl %esi,%edi - # 34 + # 34 movl 56(%esp),%eax orl %edi,%edx addl %eax,%esi @@ -453,7 +453,7 @@ L000start: subl %edi,%eax roll $6,%esi addl %ecx,%esi - # 35 + # 35 movl 16(%esp),%edx orl %esi,%eax addl %edx,%ecx @@ -464,7 +464,7 @@ L000start: subl %esi,%edx roll $7,%ecx addl %ebp,%ecx - # 36 + # 36 movl 36(%esp),%eax orl %ecx,%edx addl %eax,%ebp @@ -475,7 +475,7 @@ L000start: subl %ecx,%eax roll $14,%ebp addl %ebx,%ebp - # 37 + # 37 movl 60(%esp),%edx orl %ebp,%eax addl %edx,%ebx @@ -486,7 +486,7 @@ L000start: subl %ebp,%edx roll $9,%ebx addl %edi,%ebx - # 38 + # 38 movl 32(%esp),%eax orl %ebx,%edx addl %eax,%edi @@ -497,7 +497,7 @@ L000start: subl %ebx,%eax roll $13,%edi addl %esi,%edi - # 39 + # 39 movl 4(%esp),%edx orl %edi,%eax addl %edx,%esi @@ -508,7 +508,7 @@ L000start: subl %edi,%edx roll $15,%esi addl %ecx,%esi - # 40 + # 40 movl 8(%esp),%eax orl %esi,%edx addl %eax,%ecx @@ -519,7 +519,7 @@ L000start: subl %esi,%eax roll $14,%ecx addl %ebp,%ecx - # 41 + # 41 movl 28(%esp),%edx orl %ecx,%eax addl %edx,%ebp @@ -530,7 +530,7 @@ L000start: subl %ecx,%edx roll $8,%ebp addl %ebx,%ebp - # 42 + # 42 movl (%esp),%eax orl %ebp,%edx addl %eax,%ebx @@ -541,7 +541,7 @@ L000start: subl %ebp,%eax roll $13,%ebx addl %edi,%ebx - # 43 + # 43 movl 24(%esp),%edx orl %ebx,%eax addl %edx,%edi @@ -552,7 +552,7 @@ L000start: subl %ebx,%edx roll $6,%edi addl %esi,%edi - # 44 + # 44 movl 52(%esp),%eax orl %edi,%edx addl %eax,%esi @@ -563,7 +563,7 @@ L000start: subl %edi,%eax roll $5,%esi addl %ecx,%esi - # 45 + # 45 movl 44(%esp),%edx orl %esi,%eax addl %edx,%ecx @@ -574,7 +574,7 @@ L000start: subl %esi,%edx roll $12,%ecx addl %ebp,%ecx - # 46 + # 46 movl 20(%esp),%eax orl %ecx,%edx addl %eax,%ebp @@ -585,7 +585,7 @@ L000start: subl %ecx,%eax roll $7,%ebp addl %ebx,%ebp - # 47 + # 47 movl 48(%esp),%edx orl %ebp,%eax addl %edx,%ebx @@ -596,7 +596,7 @@ L000start: movl %ecx,%eax roll $5,%ebx addl %edi,%ebx - # 48 + # 48 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -609,7 +609,7 @@ L000start: movl %ebp,%eax roll $11,%edi addl %esi,%edi - # 49 + # 49 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -622,7 +622,7 @@ L000start: movl %ebx,%eax roll $12,%esi addl %ecx,%esi - # 50 + # 50 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -635,7 +635,7 @@ L000start: movl %edi,%eax roll $14,%ecx addl %ebp,%ecx - # 51 + # 51 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -648,7 +648,7 @@ L000start: movl %esi,%eax roll $15,%ebp addl %ebx,%ebp - # 52 + # 52 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -661,7 +661,7 @@ L000start: movl %ecx,%eax roll $14,%ebx addl %edi,%ebx - # 53 + # 53 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -674,7 +674,7 @@ L000start: movl %ebp,%eax roll $15,%edi addl %esi,%edi - # 54 + # 54 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -687,7 +687,7 @@ L000start: movl %ebx,%eax roll $9,%esi addl %ecx,%esi - # 55 + # 55 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -700,7 +700,7 @@ L000start: movl %edi,%eax roll $8,%ecx addl %ebp,%ecx - # 56 + # 56 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -713,7 +713,7 @@ L000start: movl %esi,%eax roll $9,%ebp addl %ebx,%ebp - # 57 + # 57 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -726,7 +726,7 @@ L000start: movl %ecx,%eax roll $14,%ebx addl %edi,%ebx - # 58 + # 58 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -739,7 +739,7 @@ L000start: movl %ebp,%eax roll $5,%edi addl %esi,%edi - # 59 + # 59 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -752,7 +752,7 @@ L000start: movl %ebx,%eax roll $6,%esi addl %ecx,%esi - # 60 + # 60 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -765,7 +765,7 @@ L000start: movl %edi,%eax roll $8,%ecx addl %ebp,%ecx - # 61 + # 61 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -778,7 +778,7 @@ L000start: movl %esi,%eax roll $6,%ebp addl %ebx,%ebp - # 62 + # 62 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -791,7 +791,7 @@ L000start: movl %ecx,%eax roll $5,%ebx addl %edi,%ebx - # 63 + # 63 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -804,7 +804,7 @@ L000start: subl %ebp,%edx roll $12,%edi addl %esi,%edi - # 64 + # 64 movl 16(%esp),%eax orl %ebx,%edx addl %eax,%esi @@ -815,7 +815,7 @@ L000start: subl %ebx,%eax roll $9,%esi addl %ecx,%esi - # 65 + # 65 movl (%esp),%edx orl %edi,%eax addl %edx,%ecx @@ -826,7 +826,7 @@ L000start: subl %edi,%edx roll $15,%ecx addl %ebp,%ecx - # 66 + # 66 movl 20(%esp),%eax orl %esi,%edx addl %eax,%ebp @@ -837,7 +837,7 @@ L000start: subl %esi,%eax roll $5,%ebp addl %ebx,%ebp - # 67 + # 67 movl 36(%esp),%edx orl %ecx,%eax addl %edx,%ebx @@ -848,7 +848,7 @@ L000start: subl %ecx,%edx roll $11,%ebx addl %edi,%ebx - # 68 + # 68 movl 28(%esp),%eax orl %ebp,%edx addl %eax,%edi @@ -859,7 +859,7 @@ L000start: subl %ebp,%eax roll $6,%edi addl %esi,%edi - # 69 + # 69 movl 48(%esp),%edx orl %ebx,%eax addl %edx,%esi @@ -870,7 +870,7 @@ L000start: subl %ebx,%edx roll $8,%esi addl %ecx,%esi - # 70 + # 70 movl 8(%esp),%eax orl %edi,%edx addl %eax,%ecx @@ -881,7 +881,7 @@ L000start: subl %edi,%eax roll $13,%ecx addl %ebp,%ecx - # 71 + # 71 movl 40(%esp),%edx orl %esi,%eax addl %edx,%ebp @@ -892,7 +892,7 @@ L000start: subl %esi,%edx roll $12,%ebp addl %ebx,%ebp - # 72 + # 72 movl 56(%esp),%eax orl %ecx,%edx addl %eax,%ebx @@ -903,7 +903,7 @@ L000start: subl %ecx,%eax roll $5,%ebx addl %edi,%ebx - # 73 + # 73 movl 4(%esp),%edx orl %ebp,%eax addl %edx,%edi @@ -914,7 +914,7 @@ L000start: subl %ebp,%edx roll $12,%edi addl %esi,%edi - # 74 + # 74 movl 12(%esp),%eax orl %ebx,%edx addl %eax,%esi @@ -925,7 +925,7 @@ L000start: subl %ebx,%eax roll $13,%esi addl %ecx,%esi - # 75 + # 75 movl 32(%esp),%edx orl %edi,%eax addl %edx,%ecx @@ -936,7 +936,7 @@ L000start: subl %edi,%edx roll $14,%ecx addl %ebp,%ecx - # 76 + # 76 movl 44(%esp),%eax orl %esi,%edx addl %eax,%ebp @@ -947,7 +947,7 @@ L000start: subl %esi,%eax roll $11,%ebp addl %ebx,%ebp - # 77 + # 77 movl 24(%esp),%edx orl %ecx,%eax addl %edx,%ebx @@ -958,7 +958,7 @@ L000start: subl %ecx,%edx roll $8,%ebx addl %edi,%ebx - # 78 + # 78 movl 60(%esp),%eax orl %ebp,%edx addl %eax,%edi @@ -969,7 +969,7 @@ L000start: subl %ebp,%eax roll $5,%edi addl %esi,%edi - # 79 + # 79 movl 52(%esp),%edx orl %ebx,%eax addl %edx,%esi @@ -989,7 +989,7 @@ L000start: movl %ebp,80(%esp) movl 12(%edx),%ebx movl 16(%edx),%ebp - # 80 + # 80 movl $-1,%edx subl %ebx,%edx movl 20(%esp),%eax @@ -1002,7 +1002,7 @@ L000start: subl %edi,%eax roll $8,%ecx addl %ebp,%ecx - # 81 + # 81 movl 56(%esp),%edx orl %esi,%eax addl %edx,%ebp @@ -1013,7 +1013,7 @@ L000start: subl %esi,%edx roll $9,%ebp addl %ebx,%ebp - # 82 + # 82 movl 28(%esp),%eax orl %ecx,%edx addl %eax,%ebx @@ -1024,7 +1024,7 @@ L000start: subl %ecx,%eax roll $9,%ebx addl %edi,%ebx - # 83 + # 83 movl (%esp),%edx orl %ebp,%eax addl %edx,%edi @@ -1035,7 +1035,7 @@ L000start: subl %ebp,%edx roll $11,%edi addl %esi,%edi - # 84 + # 84 movl 36(%esp),%eax orl %ebx,%edx addl %eax,%esi @@ -1046,7 +1046,7 @@ L000start: subl %ebx,%eax roll $13,%esi addl %ecx,%esi - # 85 + # 85 movl 8(%esp),%edx orl %edi,%eax addl %edx,%ecx @@ -1057,7 +1057,7 @@ L000start: subl %edi,%edx roll $15,%ecx addl %ebp,%ecx - # 86 + # 86 movl 44(%esp),%eax orl %esi,%edx addl %eax,%ebp @@ -1068,7 +1068,7 @@ L000start: subl %esi,%eax roll $15,%ebp addl %ebx,%ebp - # 87 + # 87 movl 16(%esp),%edx orl %ecx,%eax addl %edx,%ebx @@ -1079,7 +1079,7 @@ L000start: subl %ecx,%edx roll $5,%ebx addl %edi,%ebx - # 88 + # 88 movl 52(%esp),%eax orl %ebp,%edx addl %eax,%edi @@ -1090,7 +1090,7 @@ L000start: subl %ebp,%eax roll $7,%edi addl %esi,%edi - # 89 + # 89 movl 24(%esp),%edx orl %ebx,%eax addl %edx,%esi @@ -1101,7 +1101,7 @@ L000start: subl %ebx,%edx roll $7,%esi addl %ecx,%esi - # 90 + # 90 movl 60(%esp),%eax orl %edi,%edx addl %eax,%ecx @@ -1112,7 +1112,7 @@ L000start: subl %edi,%eax roll $8,%ecx addl %ebp,%ecx - # 91 + # 91 movl 32(%esp),%edx orl %esi,%eax addl %edx,%ebp @@ -1123,7 +1123,7 @@ L000start: subl %esi,%edx roll $11,%ebp addl %ebx,%ebp - # 92 + # 92 movl 4(%esp),%eax orl %ecx,%edx addl %eax,%ebx @@ -1134,7 +1134,7 @@ L000start: subl %ecx,%eax roll $14,%ebx addl %edi,%ebx - # 93 + # 93 movl 40(%esp),%edx orl %ebp,%eax addl %edx,%edi @@ -1145,7 +1145,7 @@ L000start: subl %ebp,%edx roll $14,%edi addl %esi,%edi - # 94 + # 94 movl 12(%esp),%eax orl %ebx,%edx addl %eax,%esi @@ -1156,7 +1156,7 @@ L000start: subl %ebx,%eax roll $12,%esi addl %ecx,%esi - # 95 + # 95 movl 48(%esp),%edx orl %edi,%eax addl %edx,%ecx @@ -1167,7 +1167,7 @@ L000start: movl %edi,%eax roll $6,%ecx addl %ebp,%ecx - # 96 + # 96 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -1180,7 +1180,7 @@ L000start: movl %esi,%eax roll $9,%ebp addl %ebx,%ebp - # 97 + # 97 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -1193,7 +1193,7 @@ L000start: movl %ecx,%eax roll $13,%ebx addl %edi,%ebx - # 98 + # 98 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -1206,7 +1206,7 @@ L000start: movl %ebp,%eax roll $15,%edi addl %esi,%edi - # 99 + # 99 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -1219,7 +1219,7 @@ L000start: movl %ebx,%eax roll $7,%esi addl %ecx,%esi - # 100 + # 100 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -1232,7 +1232,7 @@ L000start: movl %edi,%eax roll $12,%ecx addl %ebp,%ecx - # 101 + # 101 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -1245,7 +1245,7 @@ L000start: movl %esi,%eax roll $8,%ebp addl %ebx,%ebp - # 102 + # 102 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -1258,7 +1258,7 @@ L000start: movl %ecx,%eax roll $9,%ebx addl %edi,%ebx - # 103 + # 103 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -1271,7 +1271,7 @@ L000start: movl %ebp,%eax roll $11,%edi addl %esi,%edi - # 104 + # 104 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -1284,7 +1284,7 @@ L000start: movl %ebx,%eax roll $7,%esi addl %ecx,%esi - # 105 + # 105 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -1297,7 +1297,7 @@ L000start: movl %edi,%eax roll $7,%ecx addl %ebp,%ecx - # 106 + # 106 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -1310,7 +1310,7 @@ L000start: movl %esi,%eax roll $12,%ebp addl %ebx,%ebp - # 107 + # 107 subl %esi,%edx andl %ebp,%eax andl %ecx,%edx @@ -1323,7 +1323,7 @@ L000start: movl %ecx,%eax roll $7,%ebx addl %edi,%ebx - # 108 + # 108 subl %ecx,%edx andl %ebx,%eax andl %ebp,%edx @@ -1336,7 +1336,7 @@ L000start: movl %ebp,%eax roll $6,%edi addl %esi,%edi - # 109 + # 109 subl %ebp,%edx andl %edi,%eax andl %ebx,%edx @@ -1349,7 +1349,7 @@ L000start: movl %ebx,%eax roll $15,%esi addl %ecx,%esi - # 110 + # 110 subl %ebx,%edx andl %esi,%eax andl %edi,%edx @@ -1362,7 +1362,7 @@ L000start: movl %edi,%eax roll $13,%ecx addl %ebp,%ecx - # 111 + # 111 subl %edi,%edx andl %ecx,%eax andl %esi,%edx @@ -1375,7 +1375,7 @@ L000start: subl %ecx,%edx roll $11,%ebp addl %ebx,%ebp - # 112 + # 112 movl 60(%esp),%eax orl %ebp,%edx addl %eax,%ebx @@ -1386,7 +1386,7 @@ L000start: subl %ebp,%eax roll $9,%ebx addl %edi,%ebx - # 113 + # 113 movl 20(%esp),%edx orl %ebx,%eax addl %edx,%edi @@ -1397,7 +1397,7 @@ L000start: subl %ebx,%edx roll $7,%edi addl %esi,%edi - # 114 + # 114 movl 4(%esp),%eax orl %edi,%edx addl %eax,%esi @@ -1408,7 +1408,7 @@ L000start: subl %edi,%eax roll $15,%esi addl %ecx,%esi - # 115 + # 115 movl 12(%esp),%edx orl %esi,%eax addl %edx,%ecx @@ -1419,7 +1419,7 @@ L000start: subl %esi,%edx roll $11,%ecx addl %ebp,%ecx - # 116 + # 116 movl 28(%esp),%eax orl %ecx,%edx addl %eax,%ebp @@ -1430,7 +1430,7 @@ L000start: subl %ecx,%eax roll $8,%ebp addl %ebx,%ebp - # 117 + # 117 movl 56(%esp),%edx orl %ebp,%eax addl %edx,%ebx @@ -1441,7 +1441,7 @@ L000start: subl %ebp,%edx roll $6,%ebx addl %edi,%ebx - # 118 + # 118 movl 24(%esp),%eax orl %ebx,%edx addl %eax,%edi @@ -1452,7 +1452,7 @@ L000start: subl %ebx,%eax roll $6,%edi addl %esi,%edi - # 119 + # 119 movl 36(%esp),%edx orl %edi,%eax addl %edx,%esi @@ -1463,7 +1463,7 @@ L000start: subl %edi,%edx roll $14,%esi addl %ecx,%esi - # 120 + # 120 movl 44(%esp),%eax orl %esi,%edx addl %eax,%ecx @@ -1474,7 +1474,7 @@ L000start: subl %esi,%eax roll $12,%ecx addl %ebp,%ecx - # 121 + # 121 movl 32(%esp),%edx orl %ecx,%eax addl %edx,%ebp @@ -1485,7 +1485,7 @@ L000start: subl %ecx,%edx roll $13,%ebp addl %ebx,%ebp - # 122 + # 122 movl 48(%esp),%eax orl %ebp,%edx addl %eax,%ebx @@ -1496,7 +1496,7 @@ L000start: subl %ebp,%eax roll $5,%ebx addl %edi,%ebx - # 123 + # 123 movl 8(%esp),%edx orl %ebx,%eax addl %edx,%edi @@ -1507,7 +1507,7 @@ L000start: subl %ebx,%edx roll $14,%edi addl %esi,%edi - # 124 + # 124 movl 40(%esp),%eax orl %edi,%edx addl %eax,%esi @@ -1518,7 +1518,7 @@ L000start: subl %edi,%eax roll $13,%esi addl %ecx,%esi - # 125 + # 125 movl (%esp),%edx orl %esi,%eax addl %edx,%ecx @@ -1529,7 +1529,7 @@ L000start: subl %esi,%edx roll $13,%ecx addl %ebp,%ecx - # 126 + # 126 movl 16(%esp),%eax orl %ecx,%edx addl %eax,%ebp @@ -1540,7 +1540,7 @@ L000start: subl %ecx,%eax roll $7,%ebp addl %ebx,%ebp - # 127 + # 127 movl 52(%esp),%edx orl %ebp,%eax addl %edx,%ebx @@ -1551,7 +1551,7 @@ L000start: movl $-1,%eax roll $5,%ebx addl %edi,%ebx - # 128 + # 128 addl %edx,%edi movl %ebp,%edx subl %ebx,%eax @@ -1564,7 +1564,7 @@ L000start: movl $-1,%edx roll $15,%edi addl %esi,%edi - # 129 + # 129 addl %eax,%esi movl %ebx,%eax subl %edi,%edx @@ -1577,7 +1577,7 @@ L000start: movl $-1,%eax roll $5,%esi addl %ecx,%esi - # 130 + # 130 addl %edx,%ecx movl %edi,%edx subl %esi,%eax @@ -1590,7 +1590,7 @@ L000start: movl $-1,%edx roll $8,%ecx addl %ebp,%ecx - # 131 + # 131 addl %eax,%ebp movl %esi,%eax subl %ecx,%edx @@ -1603,7 +1603,7 @@ L000start: movl $-1,%eax roll $11,%ebp addl %ebx,%ebp - # 132 + # 132 addl %edx,%ebx movl %ecx,%edx subl %ebp,%eax @@ -1616,7 +1616,7 @@ L000start: movl $-1,%edx roll $14,%ebx addl %edi,%ebx - # 133 + # 133 addl %eax,%edi movl %ebp,%eax subl %ebx,%edx @@ -1629,7 +1629,7 @@ L000start: movl $-1,%eax roll $14,%edi addl %esi,%edi - # 134 + # 134 addl %edx,%esi movl %ebx,%edx subl %edi,%eax @@ -1642,7 +1642,7 @@ L000start: movl $-1,%edx roll $6,%esi addl %ecx,%esi - # 135 + # 135 addl %eax,%ecx movl %edi,%eax subl %esi,%edx @@ -1655,7 +1655,7 @@ L000start: movl $-1,%eax roll $14,%ecx addl %ebp,%ecx - # 136 + # 136 addl %edx,%ebp movl %esi,%edx subl %ecx,%eax @@ -1668,7 +1668,7 @@ L000start: movl $-1,%edx roll $6,%ebp addl %ebx,%ebp - # 137 + # 137 addl %eax,%ebx movl %ecx,%eax subl %ebp,%edx @@ -1681,7 +1681,7 @@ L000start: movl $-1,%eax roll $9,%ebx addl %edi,%ebx - # 138 + # 138 addl %edx,%edi movl %ebp,%edx subl %ebx,%eax @@ -1694,7 +1694,7 @@ L000start: movl $-1,%edx roll $12,%edi addl %esi,%edi - # 139 + # 139 addl %eax,%esi movl %ebx,%eax subl %edi,%edx @@ -1707,7 +1707,7 @@ L000start: movl $-1,%eax roll $9,%esi addl %ecx,%esi - # 140 + # 140 addl %edx,%ecx movl %edi,%edx subl %esi,%eax @@ -1720,7 +1720,7 @@ L000start: movl $-1,%edx roll $12,%ecx addl %ebp,%ecx - # 141 + # 141 addl %eax,%ebp movl %esi,%eax subl %ecx,%edx @@ -1733,7 +1733,7 @@ L000start: movl $-1,%eax roll $5,%ebp addl %ebx,%ebp - # 142 + # 142 addl %edx,%ebx movl %ecx,%edx subl %ebp,%eax @@ -1746,7 +1746,7 @@ L000start: movl $-1,%edx roll $15,%ebx addl %edi,%ebx - # 143 + # 143 addl %eax,%edi movl %ebp,%eax subl %ebx,%edx @@ -1759,7 +1759,7 @@ L000start: xorl %ebp,%eax roll $8,%edi addl %esi,%edi - # 144 + # 144 movl 48(%esp),%edx xorl %edi,%eax addl %edx,%esi @@ -1768,7 +1768,7 @@ L000start: movl %edi,%eax roll $8,%esi addl %ecx,%esi - # 145 + # 145 xorl %ebx,%eax movl 60(%esp),%edx xorl %esi,%eax @@ -1779,7 +1779,7 @@ L000start: xorl %edi,%eax roll $5,%ecx addl %ebp,%ecx - # 146 + # 146 movl 40(%esp),%edx xorl %ecx,%eax addl %edx,%ebp @@ -1788,7 +1788,7 @@ L000start: movl %ecx,%eax roll $12,%ebp addl %ebx,%ebp - # 147 + # 147 xorl %esi,%eax movl 16(%esp),%edx xorl %ebp,%eax @@ -1799,7 +1799,7 @@ L000start: xorl %ecx,%eax roll $9,%ebx addl %edi,%ebx - # 148 + # 148 movl 4(%esp),%edx xorl %ebx,%eax addl %edx,%edi @@ -1808,7 +1808,7 @@ L000start: movl %ebx,%eax roll $12,%edi addl %esi,%edi - # 149 + # 149 xorl %ebp,%eax movl 20(%esp),%edx xorl %edi,%eax @@ -1819,7 +1819,7 @@ L000start: xorl %ebx,%eax roll $5,%esi addl %ecx,%esi - # 150 + # 150 movl 32(%esp),%edx xorl %esi,%eax addl %edx,%ecx @@ -1828,7 +1828,7 @@ L000start: movl %esi,%eax roll $14,%ecx addl %ebp,%ecx - # 151 + # 151 xorl %edi,%eax movl 28(%esp),%edx xorl %ecx,%eax @@ -1839,7 +1839,7 @@ L000start: xorl %esi,%eax roll $6,%ebp addl %ebx,%ebp - # 152 + # 152 movl 24(%esp),%edx xorl %ebp,%eax addl %edx,%ebx @@ -1848,7 +1848,7 @@ L000start: movl %ebp,%eax roll $8,%ebx addl %edi,%ebx - # 153 + # 153 xorl %ecx,%eax movl 8(%esp),%edx xorl %ebx,%eax @@ -1859,7 +1859,7 @@ L000start: xorl %ebp,%eax roll $13,%edi addl %esi,%edi - # 154 + # 154 movl 52(%esp),%edx xorl %edi,%eax addl %edx,%esi @@ -1868,7 +1868,7 @@ L000start: movl %edi,%eax roll $6,%esi addl %ecx,%esi - # 155 + # 155 xorl %ebx,%eax movl 56(%esp),%edx xorl %esi,%eax @@ -1879,7 +1879,7 @@ L000start: xorl %edi,%eax roll $5,%ecx addl %ebp,%ecx - # 156 + # 156 movl (%esp),%edx xorl %ecx,%eax addl %edx,%ebp @@ -1888,7 +1888,7 @@ L000start: movl %ecx,%eax roll $15,%ebp addl %ebx,%ebp - # 157 + # 157 xorl %esi,%eax movl 12(%esp),%edx xorl %ebp,%eax @@ -1899,7 +1899,7 @@ L000start: xorl %ecx,%eax roll $13,%ebx addl %edi,%ebx - # 158 + # 158 movl 36(%esp),%edx xorl %ebx,%eax addl %edx,%edi @@ -1908,7 +1908,7 @@ L000start: movl %ebx,%eax roll $11,%edi addl %esi,%edi - # 159 + # 159 xorl %ebp,%eax movl 44(%esp),%edx xorl %edi,%eax diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/sha/sha1-586.s b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/sha/sha1-586.s index d75e61693d5d..eea95f6cf2e0 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/sha/sha1-586.s +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/sha/sha1-586.s @@ -94,7 +94,7 @@ L002loop: movl 4(%ebp),%ebx movl 8(%ebp),%ecx movl 12(%ebp),%edx - # 00_15 0 + # 00_15 0 movl %ecx,%esi movl %eax,%ebp roll $5,%ebp @@ -106,7 +106,7 @@ L002loop: xorl %edx,%esi leal 1518500249(%ebp,%edi,1),%ebp addl %esi,%ebp - # 00_15 1 + # 00_15 1 movl %ebx,%edi movl %ebp,%esi roll $5,%ebp @@ -118,7 +118,7 @@ L002loop: xorl %ecx,%edi leal 1518500249(%ebp,%edx,1),%ebp addl %edi,%ebp - # 00_15 2 + # 00_15 2 movl %eax,%edx movl %ebp,%edi roll $5,%ebp @@ -130,7 +130,7 @@ L002loop: xorl %ebx,%edx leal 1518500249(%ebp,%ecx,1),%ebp addl %edx,%ebp - # 00_15 3 + # 00_15 3 movl %esi,%ecx movl %ebp,%edx roll $5,%ebp @@ -142,7 +142,7 @@ L002loop: xorl %eax,%ecx leal 1518500249(%ebp,%ebx,1),%ebp addl %ecx,%ebp - # 00_15 4 + # 00_15 4 movl %edi,%ebx movl %ebp,%ecx roll $5,%ebp @@ -154,7 +154,7 @@ L002loop: xorl %esi,%ebx leal 1518500249(%ebp,%eax,1),%ebp addl %ebx,%ebp - # 00_15 5 + # 00_15 5 movl %edx,%eax movl %ebp,%ebx roll $5,%ebp @@ -166,7 +166,7 @@ L002loop: xorl %edi,%eax leal 1518500249(%ebp,%esi,1),%ebp addl %eax,%ebp - # 00_15 6 + # 00_15 6 movl %ecx,%esi movl %ebp,%eax roll $5,%ebp @@ -178,7 +178,7 @@ L002loop: xorl %edx,%esi leal 1518500249(%ebp,%edi,1),%ebp addl %esi,%ebp - # 00_15 7 + # 00_15 7 movl %ebx,%edi movl %ebp,%esi roll $5,%ebp @@ -190,7 +190,7 @@ L002loop: xorl %ecx,%edi leal 1518500249(%ebp,%edx,1),%ebp addl %edi,%ebp - # 00_15 8 + # 00_15 8 movl %eax,%edx movl %ebp,%edi roll $5,%ebp @@ -202,7 +202,7 @@ L002loop: xorl %ebx,%edx leal 1518500249(%ebp,%ecx,1),%ebp addl %edx,%ebp - # 00_15 9 + # 00_15 9 movl %esi,%ecx movl %ebp,%edx roll $5,%ebp @@ -214,7 +214,7 @@ L002loop: xorl %eax,%ecx leal 1518500249(%ebp,%ebx,1),%ebp addl %ecx,%ebp - # 00_15 10 + # 00_15 10 movl %edi,%ebx movl %ebp,%ecx roll $5,%ebp @@ -226,7 +226,7 @@ L002loop: xorl %esi,%ebx leal 1518500249(%ebp,%eax,1),%ebp addl %ebx,%ebp - # 00_15 11 + # 00_15 11 movl %edx,%eax movl %ebp,%ebx roll $5,%ebp @@ -238,7 +238,7 @@ L002loop: xorl %edi,%eax leal 1518500249(%ebp,%esi,1),%ebp addl %eax,%ebp - # 00_15 12 + # 00_15 12 movl %ecx,%esi movl %ebp,%eax roll $5,%ebp @@ -250,7 +250,7 @@ L002loop: xorl %edx,%esi leal 1518500249(%ebp,%edi,1),%ebp addl %esi,%ebp - # 00_15 13 + # 00_15 13 movl %ebx,%edi movl %ebp,%esi roll $5,%ebp @@ -262,7 +262,7 @@ L002loop: xorl %ecx,%edi leal 1518500249(%ebp,%edx,1),%ebp addl %edi,%ebp - # 00_15 14 + # 00_15 14 movl %eax,%edx movl %ebp,%edi roll $5,%ebp @@ -274,7 +274,7 @@ L002loop: xorl %ebx,%edx leal 1518500249(%ebp,%ecx,1),%ebp addl %edx,%ebp - # 00_15 15 + # 00_15 15 movl %esi,%ecx movl %ebp,%edx roll $5,%ebp @@ -287,7 +287,7 @@ L002loop: leal 1518500249(%ebp,%ebx,1),%ebp movl (%esp),%ebx addl %ebp,%ecx - # 16_19 16 + # 16_19 16 movl %edi,%ebp xorl 8(%esp),%ebx xorl %esi,%ebp @@ -304,7 +304,7 @@ L002loop: leal 1518500249(%ebx,%eax,1),%ebx movl 4(%esp),%eax addl %ebp,%ebx - # 16_19 17 + # 16_19 17 movl %edx,%ebp xorl 12(%esp),%eax xorl %edi,%ebp @@ -321,7 +321,7 @@ L002loop: leal 1518500249(%eax,%esi,1),%eax movl 8(%esp),%esi addl %ebp,%eax - # 16_19 18 + # 16_19 18 movl %ecx,%ebp xorl 16(%esp),%esi xorl %edx,%ebp @@ -338,7 +338,7 @@ L002loop: leal 1518500249(%esi,%edi,1),%esi movl 12(%esp),%edi addl %ebp,%esi - # 16_19 19 + # 16_19 19 movl %ebx,%ebp xorl 20(%esp),%edi xorl %ecx,%ebp @@ -355,7 +355,7 @@ L002loop: leal 1518500249(%edi,%edx,1),%edi movl 16(%esp),%edx addl %ebp,%edi - # 20_39 20 + # 20_39 20 movl %esi,%ebp xorl 24(%esp),%edx xorl %eax,%ebp @@ -371,7 +371,7 @@ L002loop: leal 1859775393(%edx,%ecx,1),%edx movl 20(%esp),%ecx addl %ebp,%edx - # 20_39 21 + # 20_39 21 movl %edi,%ebp xorl 28(%esp),%ecx xorl %esi,%ebp @@ -387,7 +387,7 @@ L002loop: leal 1859775393(%ecx,%ebx,1),%ecx movl 24(%esp),%ebx addl %ebp,%ecx - # 20_39 22 + # 20_39 22 movl %edx,%ebp xorl 32(%esp),%ebx xorl %edi,%ebp @@ -403,7 +403,7 @@ L002loop: leal 1859775393(%ebx,%eax,1),%ebx movl 28(%esp),%eax addl %ebp,%ebx - # 20_39 23 + # 20_39 23 movl %ecx,%ebp xorl 36(%esp),%eax xorl %edx,%ebp @@ -419,7 +419,7 @@ L002loop: leal 1859775393(%eax,%esi,1),%eax movl 32(%esp),%esi addl %ebp,%eax - # 20_39 24 + # 20_39 24 movl %ebx,%ebp xorl 40(%esp),%esi xorl %ecx,%ebp @@ -435,7 +435,7 @@ L002loop: leal 1859775393(%esi,%edi,1),%esi movl 36(%esp),%edi addl %ebp,%esi - # 20_39 25 + # 20_39 25 movl %eax,%ebp xorl 44(%esp),%edi xorl %ebx,%ebp @@ -451,7 +451,7 @@ L002loop: leal 1859775393(%edi,%edx,1),%edi movl 40(%esp),%edx addl %ebp,%edi - # 20_39 26 + # 20_39 26 movl %esi,%ebp xorl 48(%esp),%edx xorl %eax,%ebp @@ -467,7 +467,7 @@ L002loop: leal 1859775393(%edx,%ecx,1),%edx movl 44(%esp),%ecx addl %ebp,%edx - # 20_39 27 + # 20_39 27 movl %edi,%ebp xorl 52(%esp),%ecx xorl %esi,%ebp @@ -483,7 +483,7 @@ L002loop: leal 1859775393(%ecx,%ebx,1),%ecx movl 48(%esp),%ebx addl %ebp,%ecx - # 20_39 28 + # 20_39 28 movl %edx,%ebp xorl 56(%esp),%ebx xorl %edi,%ebp @@ -499,7 +499,7 @@ L002loop: leal 1859775393(%ebx,%eax,1),%ebx movl 52(%esp),%eax addl %ebp,%ebx - # 20_39 29 + # 20_39 29 movl %ecx,%ebp xorl 60(%esp),%eax xorl %edx,%ebp @@ -515,7 +515,7 @@ L002loop: leal 1859775393(%eax,%esi,1),%eax movl 56(%esp),%esi addl %ebp,%eax - # 20_39 30 + # 20_39 30 movl %ebx,%ebp xorl (%esp),%esi xorl %ecx,%ebp @@ -531,7 +531,7 @@ L002loop: leal 1859775393(%esi,%edi,1),%esi movl 60(%esp),%edi addl %ebp,%esi - # 20_39 31 + # 20_39 31 movl %eax,%ebp xorl 4(%esp),%edi xorl %ebx,%ebp @@ -547,7 +547,7 @@ L002loop: leal 1859775393(%edi,%edx,1),%edi movl (%esp),%edx addl %ebp,%edi - # 20_39 32 + # 20_39 32 movl %esi,%ebp xorl 8(%esp),%edx xorl %eax,%ebp @@ -563,7 +563,7 @@ L002loop: leal 1859775393(%edx,%ecx,1),%edx movl 4(%esp),%ecx addl %ebp,%edx - # 20_39 33 + # 20_39 33 movl %edi,%ebp xorl 12(%esp),%ecx xorl %esi,%ebp @@ -579,7 +579,7 @@ L002loop: leal 1859775393(%ecx,%ebx,1),%ecx movl 8(%esp),%ebx addl %ebp,%ecx - # 20_39 34 + # 20_39 34 movl %edx,%ebp xorl 16(%esp),%ebx xorl %edi,%ebp @@ -595,7 +595,7 @@ L002loop: leal 1859775393(%ebx,%eax,1),%ebx movl 12(%esp),%eax addl %ebp,%ebx - # 20_39 35 + # 20_39 35 movl %ecx,%ebp xorl 20(%esp),%eax xorl %edx,%ebp @@ -611,7 +611,7 @@ L002loop: leal 1859775393(%eax,%esi,1),%eax movl 16(%esp),%esi addl %ebp,%eax - # 20_39 36 + # 20_39 36 movl %ebx,%ebp xorl 24(%esp),%esi xorl %ecx,%ebp @@ -627,7 +627,7 @@ L002loop: leal 1859775393(%esi,%edi,1),%esi movl 20(%esp),%edi addl %ebp,%esi - # 20_39 37 + # 20_39 37 movl %eax,%ebp xorl 28(%esp),%edi xorl %ebx,%ebp @@ -643,7 +643,7 @@ L002loop: leal 1859775393(%edi,%edx,1),%edi movl 24(%esp),%edx addl %ebp,%edi - # 20_39 38 + # 20_39 38 movl %esi,%ebp xorl 32(%esp),%edx xorl %eax,%ebp @@ -659,7 +659,7 @@ L002loop: leal 1859775393(%edx,%ecx,1),%edx movl 28(%esp),%ecx addl %ebp,%edx - # 20_39 39 + # 20_39 39 movl %edi,%ebp xorl 36(%esp),%ecx xorl %esi,%ebp @@ -675,7 +675,7 @@ L002loop: leal 1859775393(%ecx,%ebx,1),%ecx movl 32(%esp),%ebx addl %ebp,%ecx - # 40_59 40 + # 40_59 40 movl %edi,%ebp xorl 40(%esp),%ebx xorl %esi,%ebp @@ -694,7 +694,7 @@ L002loop: andl %esi,%ebp movl 36(%esp),%eax addl %ebp,%ebx - # 40_59 41 + # 40_59 41 movl %edx,%ebp xorl 44(%esp),%eax xorl %edi,%ebp @@ -713,7 +713,7 @@ L002loop: andl %edi,%ebp movl 40(%esp),%esi addl %ebp,%eax - # 40_59 42 + # 40_59 42 movl %ecx,%ebp xorl 48(%esp),%esi xorl %edx,%ebp @@ -732,7 +732,7 @@ L002loop: andl %edx,%ebp movl 44(%esp),%edi addl %ebp,%esi - # 40_59 43 + # 40_59 43 movl %ebx,%ebp xorl 52(%esp),%edi xorl %ecx,%ebp @@ -751,7 +751,7 @@ L002loop: andl %ecx,%ebp movl 48(%esp),%edx addl %ebp,%edi - # 40_59 44 + # 40_59 44 movl %eax,%ebp xorl 56(%esp),%edx xorl %ebx,%ebp @@ -770,7 +770,7 @@ L002loop: andl %ebx,%ebp movl 52(%esp),%ecx addl %ebp,%edx - # 40_59 45 + # 40_59 45 movl %esi,%ebp xorl 60(%esp),%ecx xorl %eax,%ebp @@ -789,7 +789,7 @@ L002loop: andl %eax,%ebp movl 56(%esp),%ebx addl %ebp,%ecx - # 40_59 46 + # 40_59 46 movl %edi,%ebp xorl (%esp),%ebx xorl %esi,%ebp @@ -808,7 +808,7 @@ L002loop: andl %esi,%ebp movl 60(%esp),%eax addl %ebp,%ebx - # 40_59 47 + # 40_59 47 movl %edx,%ebp xorl 4(%esp),%eax xorl %edi,%ebp @@ -827,7 +827,7 @@ L002loop: andl %edi,%ebp movl (%esp),%esi addl %ebp,%eax - # 40_59 48 + # 40_59 48 movl %ecx,%ebp xorl 8(%esp),%esi xorl %edx,%ebp @@ -846,7 +846,7 @@ L002loop: andl %edx,%ebp movl 4(%esp),%edi addl %ebp,%esi - # 40_59 49 + # 40_59 49 movl %ebx,%ebp xorl 12(%esp),%edi xorl %ecx,%ebp @@ -865,7 +865,7 @@ L002loop: andl %ecx,%ebp movl 8(%esp),%edx addl %ebp,%edi - # 40_59 50 + # 40_59 50 movl %eax,%ebp xorl 16(%esp),%edx xorl %ebx,%ebp @@ -884,7 +884,7 @@ L002loop: andl %ebx,%ebp movl 12(%esp),%ecx addl %ebp,%edx - # 40_59 51 + # 40_59 51 movl %esi,%ebp xorl 20(%esp),%ecx xorl %eax,%ebp @@ -903,7 +903,7 @@ L002loop: andl %eax,%ebp movl 16(%esp),%ebx addl %ebp,%ecx - # 40_59 52 + # 40_59 52 movl %edi,%ebp xorl 24(%esp),%ebx xorl %esi,%ebp @@ -922,7 +922,7 @@ L002loop: andl %esi,%ebp movl 20(%esp),%eax addl %ebp,%ebx - # 40_59 53 + # 40_59 53 movl %edx,%ebp xorl 28(%esp),%eax xorl %edi,%ebp @@ -941,7 +941,7 @@ L002loop: andl %edi,%ebp movl 24(%esp),%esi addl %ebp,%eax - # 40_59 54 + # 40_59 54 movl %ecx,%ebp xorl 32(%esp),%esi xorl %edx,%ebp @@ -960,7 +960,7 @@ L002loop: andl %edx,%ebp movl 28(%esp),%edi addl %ebp,%esi - # 40_59 55 + # 40_59 55 movl %ebx,%ebp xorl 36(%esp),%edi xorl %ecx,%ebp @@ -979,7 +979,7 @@ L002loop: andl %ecx,%ebp movl 32(%esp),%edx addl %ebp,%edi - # 40_59 56 + # 40_59 56 movl %eax,%ebp xorl 40(%esp),%edx xorl %ebx,%ebp @@ -998,7 +998,7 @@ L002loop: andl %ebx,%ebp movl 36(%esp),%ecx addl %ebp,%edx - # 40_59 57 + # 40_59 57 movl %esi,%ebp xorl 44(%esp),%ecx xorl %eax,%ebp @@ -1017,7 +1017,7 @@ L002loop: andl %eax,%ebp movl 40(%esp),%ebx addl %ebp,%ecx - # 40_59 58 + # 40_59 58 movl %edi,%ebp xorl 48(%esp),%ebx xorl %esi,%ebp @@ -1036,7 +1036,7 @@ L002loop: andl %esi,%ebp movl 44(%esp),%eax addl %ebp,%ebx - # 40_59 59 + # 40_59 59 movl %edx,%ebp xorl 52(%esp),%eax xorl %edi,%ebp @@ -1055,7 +1055,7 @@ L002loop: andl %edi,%ebp movl 48(%esp),%esi addl %ebp,%eax - # 20_39 60 + # 20_39 60 movl %ebx,%ebp xorl 56(%esp),%esi xorl %ecx,%ebp @@ -1071,7 +1071,7 @@ L002loop: leal 3395469782(%esi,%edi,1),%esi movl 52(%esp),%edi addl %ebp,%esi - # 20_39 61 + # 20_39 61 movl %eax,%ebp xorl 60(%esp),%edi xorl %ebx,%ebp @@ -1087,7 +1087,7 @@ L002loop: leal 3395469782(%edi,%edx,1),%edi movl 56(%esp),%edx addl %ebp,%edi - # 20_39 62 + # 20_39 62 movl %esi,%ebp xorl (%esp),%edx xorl %eax,%ebp @@ -1103,7 +1103,7 @@ L002loop: leal 3395469782(%edx,%ecx,1),%edx movl 60(%esp),%ecx addl %ebp,%edx - # 20_39 63 + # 20_39 63 movl %edi,%ebp xorl 4(%esp),%ecx xorl %esi,%ebp @@ -1119,7 +1119,7 @@ L002loop: leal 3395469782(%ecx,%ebx,1),%ecx movl (%esp),%ebx addl %ebp,%ecx - # 20_39 64 + # 20_39 64 movl %edx,%ebp xorl 8(%esp),%ebx xorl %edi,%ebp @@ -1135,7 +1135,7 @@ L002loop: leal 3395469782(%ebx,%eax,1),%ebx movl 4(%esp),%eax addl %ebp,%ebx - # 20_39 65 + # 20_39 65 movl %ecx,%ebp xorl 12(%esp),%eax xorl %edx,%ebp @@ -1151,7 +1151,7 @@ L002loop: leal 3395469782(%eax,%esi,1),%eax movl 8(%esp),%esi addl %ebp,%eax - # 20_39 66 + # 20_39 66 movl %ebx,%ebp xorl 16(%esp),%esi xorl %ecx,%ebp @@ -1167,7 +1167,7 @@ L002loop: leal 3395469782(%esi,%edi,1),%esi movl 12(%esp),%edi addl %ebp,%esi - # 20_39 67 + # 20_39 67 movl %eax,%ebp xorl 20(%esp),%edi xorl %ebx,%ebp @@ -1183,7 +1183,7 @@ L002loop: leal 3395469782(%edi,%edx,1),%edi movl 16(%esp),%edx addl %ebp,%edi - # 20_39 68 + # 20_39 68 movl %esi,%ebp xorl 24(%esp),%edx xorl %eax,%ebp @@ -1199,7 +1199,7 @@ L002loop: leal 3395469782(%edx,%ecx,1),%edx movl 20(%esp),%ecx addl %ebp,%edx - # 20_39 69 + # 20_39 69 movl %edi,%ebp xorl 28(%esp),%ecx xorl %esi,%ebp @@ -1215,7 +1215,7 @@ L002loop: leal 3395469782(%ecx,%ebx,1),%ecx movl 24(%esp),%ebx addl %ebp,%ecx - # 20_39 70 + # 20_39 70 movl %edx,%ebp xorl 32(%esp),%ebx xorl %edi,%ebp @@ -1231,7 +1231,7 @@ L002loop: leal 3395469782(%ebx,%eax,1),%ebx movl 28(%esp),%eax addl %ebp,%ebx - # 20_39 71 + # 20_39 71 movl %ecx,%ebp xorl 36(%esp),%eax xorl %edx,%ebp @@ -1247,7 +1247,7 @@ L002loop: leal 3395469782(%eax,%esi,1),%eax movl 32(%esp),%esi addl %ebp,%eax - # 20_39 72 + # 20_39 72 movl %ebx,%ebp xorl 40(%esp),%esi xorl %ecx,%ebp @@ -1263,7 +1263,7 @@ L002loop: leal 3395469782(%esi,%edi,1),%esi movl 36(%esp),%edi addl %ebp,%esi - # 20_39 73 + # 20_39 73 movl %eax,%ebp xorl 44(%esp),%edi xorl %ebx,%ebp @@ -1279,7 +1279,7 @@ L002loop: leal 3395469782(%edi,%edx,1),%edi movl 40(%esp),%edx addl %ebp,%edi - # 20_39 74 + # 20_39 74 movl %esi,%ebp xorl 48(%esp),%edx xorl %eax,%ebp @@ -1295,7 +1295,7 @@ L002loop: leal 3395469782(%edx,%ecx,1),%edx movl 44(%esp),%ecx addl %ebp,%edx - # 20_39 75 + # 20_39 75 movl %edi,%ebp xorl 52(%esp),%ecx xorl %esi,%ebp @@ -1311,7 +1311,7 @@ L002loop: leal 3395469782(%ecx,%ebx,1),%ecx movl 48(%esp),%ebx addl %ebp,%ecx - # 20_39 76 + # 20_39 76 movl %edx,%ebp xorl 56(%esp),%ebx xorl %edi,%ebp @@ -1327,7 +1327,7 @@ L002loop: leal 3395469782(%ebx,%eax,1),%ebx movl 52(%esp),%eax addl %ebp,%ebx - # 20_39 77 + # 20_39 77 movl %ecx,%ebp xorl 60(%esp),%eax xorl %edx,%ebp @@ -1342,7 +1342,7 @@ L002loop: leal 3395469782(%eax,%esi,1),%eax movl 56(%esp),%esi addl %ebp,%eax - # 20_39 78 + # 20_39 78 movl %ebx,%ebp xorl (%esp),%esi xorl %ecx,%ebp @@ -1357,7 +1357,7 @@ L002loop: leal 3395469782(%esi,%edi,1),%esi movl 60(%esp),%edi addl %ebp,%esi - # 20_39 79 + # 20_39 79 movl %eax,%ebp xorl 4(%esp),%edi xorl %ebx,%ebp diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h index f53c3d3eb7c9..cd3e29a4f3b7 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/openssl.gypi b/deps/openssl/config/archs/darwin-i386-cc/asm/openssl.gypi index 19ae424ab5cc..ba938fab35ce 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/openssl.gypi +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/openssl.gypi @@ -211,6 +211,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -567,6 +568,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm b/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm index 768c6baae012..5f428f66c0a2 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "darwin-i386-cc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h index 3f09529c5bec..6792fc6de47e 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 3 00:38:22 2018" +#define DATE "built on: Tue Aug 14 23:13:11 2018" diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h index af8c1f66f8ca..b2fe2bef12c9 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/openssl.gypi b/deps/openssl/config/archs/darwin-i386-cc/no-asm/openssl.gypi index c1d26d10f594..f9886736de27 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm index 9976ff77d5a5..ffeb14ad3376 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "darwin64-x86_64-cc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3994,6 +4010,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6332,6 +6354,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7331,6 +7359,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7503,8 +7535,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7525,10 +7557,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7684,6 +7729,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7724,7 +7770,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8106,6 +8155,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8226,9 +8278,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9257,6 +9318,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10737,6 +10802,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11274,6 +11343,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11644,6 +11714,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12649,6 +12720,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12998,6 +13078,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13006,6 +13094,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aes-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aes-x86_64.s index f28903cd57ec..9a337fb89743 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aes-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .p2align 4 _x86_64_AES_encrypt: diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-mb-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-mb-x86_64.s index f127e013ea6b..75ce16175c93 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-mb-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text @@ -1432,3 +1432,4 @@ L$dec8x_done: leaq (%rax),%rsp L$dec8x_epilogue: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha1-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha1-x86_64.s index cdce52cd0a23..b14cf7691a69 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _aesni_cbc_sha1_enc @@ -2982,3 +2982,4 @@ L$aesenclast14: movdqu %xmm8,(%r9) movd %xmm9,16(%r9) .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha256-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha256-x86_64.s index 40e75bfedb6d..08025a0baea2 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _aesni_cbc_sha256_enc @@ -4352,3 +4352,4 @@ L$aesenclast4: movdqu %xmm1,(%r9) movdqu %xmm2,16(%r9) .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-x86_64.s index 258ee335adbe..2c741239ef66 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/aesni-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _aesni_encrypt diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/bsaes-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/bsaes-x86_64.s index 52ae782e9a2e..da5d1b112257 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/bsaes-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/bsaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text @@ -2495,3 +2495,4 @@ L$63: .quad 0x6363636363636363, 0x6363636363636363 .byte 66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44,32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32,65,110,100,121,32,80,111,108,121,97,107,111,118,0 .p2align 6 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/vpaes-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/vpaes-x86_64.s index 2ffd0bc10075..bcd486565961 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/vpaes-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/aes/vpaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text @@ -824,3 +824,4 @@ L$k_dsbo: .quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 .p2align 6 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-avx2.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-avx2.s index f2bc63be34ee..785a35ac9176 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-avx2.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-avx2.s @@ -1,4 +1,4 @@ -.text +.text .globl _rsaz_1024_sqr_avx2 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-x86_64.s index 8a6e44932d99..7f4a01109e5e 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/rsaz-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-gf2m.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-gf2m.s index c0f0b4bd6878..af1ffdd59b6b 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-gf2m.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-gf2m.s @@ -1,4 +1,4 @@ -.text +.text .p2align 4 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont.s index a8b7f998a14d..dd43da0d8674 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont.s @@ -1,4 +1,4 @@ -.text +.text @@ -197,30 +197,30 @@ L$inner_enter: xorq %r14,%r14 movq (%rsp),%rax - leaq (%rsp),%rsi movq %r9,%r15 - jmp L$sub + .p2align 4 L$sub: sbbq (%rcx,%r14,8),%rax movq %rax,(%rdi,%r14,8) - movq 8(%rsi,%r14,8),%rax + movq 8(%rsp,%r14,8),%rax leaq 1(%r14),%r14 decq %r15 jnz L$sub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.p2align 4 + L$copy: - movq (%rsi,%r14,8),%rax - movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx + movq %r9,(%rsp,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz L$copy @@ -574,10 +574,10 @@ L$inner4x: cmpq %r9,%r14 jb L$outer4x movq 16(%rsp,%r9,8),%rdi + leaq -4(%r9),%r15 movq 0(%rsp),%rax - pxor %xmm0,%xmm0 movq 8(%rsp),%rdx - shrq $2,%r9 + shrq $2,%r15 leaq (%rsp),%rsi xorq %r14,%r14 @@ -585,9 +585,7 @@ L$inner4x: movq 16(%rsi),%rbx movq 24(%rsi),%rbp sbbq 8(%rcx),%rdx - leaq -1(%r9),%r15 - jmp L$sub4x -.p2align 4 + L$sub4x: movq %rax,0(%rdi,%r14,8) movq %rdx,8(%rdi,%r14,8) @@ -614,34 +612,35 @@ L$sub4x: sbbq $0,%rax movq %rbp,24(%rdi,%r14,8) - xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx - leaq -1(%r9),%r15 - orq %rcx,%rsi - - movdqu (%rsi),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,(%rdi) + pxor %xmm0,%xmm0 +.byte 102,72,15,110,224 + pcmpeqd %xmm5,%xmm5 + pshufd $0,%xmm4,%xmm4 + movq %r9,%r15 + pxor %xmm4,%xmm5 + shrq $2,%r15 + xorl %eax,%eax + jmp L$copy4x .p2align 4 L$copy4x: - movdqu 16(%rsi,%r14,1),%xmm2 - movdqu 32(%rsi,%r14,1),%xmm1 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) - movdqa %xmm0,32(%rsp,%r14,1) - movdqu %xmm1,32(%rdi,%r14,1) - leaq 32(%r14),%r14 + movdqa (%rsp,%rax,1),%xmm1 + movdqu (%rdi,%rax,1),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax,1),%xmm3 + movdqa %xmm0,(%rsp,%rax,1) + por %xmm2,%xmm1 + movdqu 16(%rdi,%rax,1),%xmm2 + movdqu %xmm1,(%rdi,%rax,1) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax,1) + por %xmm2,%xmm3 + movdqu %xmm3,16(%rdi,%rax,1) + leaq 32(%rax),%rax decq %r15 jnz L$copy4x - - shlq $2,%r9 - movdqu 16(%rsi,%r14,1),%xmm2 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont5.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont5.s index 2f6288947290..f415b8d80c79 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont5.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/bn/x86_64-mont5.s @@ -1,4 +1,4 @@ -.text +.text @@ -393,18 +393,19 @@ L$sub: sbbq (%rcx,%r14,8),%rax jnz L$sub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.p2align 4 + L$copy: - movq (%rsi,%r14,8),%rax + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz L$copy diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h index b72d49d68b5a..eb762c8ee606 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h @@ -35,4 +35,4 @@ static const char cflags[] = { 'n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 3 00:38:16 2018" +#define DATE "built on: Tue Aug 14 23:13:05 2018" diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/camellia/cmll-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/camellia/cmll-x86_64.s index 8025d088fdab..35a3ea550aa8 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/camellia/cmll-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/camellia/cmll-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _Camellia_EncryptBlock diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/chacha/chacha-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/chacha/chacha-x86_64.s index 58f4283a7962..afd47bdf68f2 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/chacha/chacha-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/chacha/chacha-x86_64.s @@ -1,4 +1,4 @@ -.text +.text @@ -1990,3 +1990,4 @@ L$done8x: vzeroall movq 640(%rsp),%rsp .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/ec/ecp_nistz256-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/ec/ecp_nistz256-x86_64.s index 37e6f155b63f..77102c6a41a0 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/ec/ecp_nistz256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _ecp_nistz256_precomputed .p2align 12 @@ -2372,7 +2372,7 @@ _ecp_nistz256_precomputed: .long 0x2a849870,0x4d33dd99,0x41576335,0xa716964b,0x179be0e5,0xff5e3a9b,0x83b13632,0x5b9d6b1b,0xa52f313b,0x3b8bd7d4,0x637a4660,0xc9dd95a0,0x0b3e218f,0x30035962,0xc7b28a3c,0xce1481a3 .long 0x43228d83,0xab41b43a,0x4ad63f99,0x24ae1c30,0x46a51229,0x8e525f1a,0xcd26d2b4,0x14af860f,0x3f714aa1,0xd6baef61,0xeb78795e,0xf51865ad,0xe6a9d694,0xd3e21fce,0x8a37b527,0x82ceb1dd -.text +.text @@ -5931,3 +5931,4 @@ L$point_add_affinex: popq %rbx popq %rbp .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/md5/md5-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/md5/md5-x86_64.s index 76a65a7ed8a7..f385ea2a3f53 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/md5/md5-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/md5/md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .p2align 4 .globl _md5_block_asm_data_order @@ -662,3 +662,4 @@ L$end: addq $40,%rsp L$epilogue: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/aesni-gcm-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/aesni-gcm-x86_64.s index af27718a59b1..f01a002363da 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/aesni-gcm-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .p2align 5 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/ghash-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/ghash-x86_64.s index 76f3b7cdfd15..502af78349e2 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/ghash-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/modes/ghash-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _gcm_gmult_4bit diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/poly1305/poly1305-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/poly1305/poly1305-x86_64.s index e4769a669c87..c68f5a6fbec1 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/poly1305/poly1305-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/poly1305/poly1305-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-md5-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-md5-x86_64.s index a9c582fdbbae..47dce361a6c1 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-md5-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .p2align 4 .globl _rc4_md5_enc @@ -1256,3 +1256,4 @@ L$oop: L$epilogue: L$abort: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-x86_64.s index b842ec60de4d..86ef4866621a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/rc4/rc4-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _RC4 @@ -612,3 +612,4 @@ L$opts: .byte 114,99,52,40,49,54,120,44,105,110,116,41,0 .byte 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .p2align 6 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-mb-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-mb-x86_64.s index ac6ad9bb8cbb..7026de0e7676 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-mb-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-x86_64.s index 1c52e05e399e..3e3633911f4d 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _sha1_block_data_order diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-mb-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-mb-x86_64.s index 897dacd5b408..95e0e774afd4 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-mb-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-x86_64.s index 3cbe0a170c6f..05e973612b31 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _sha256_block_data_order @@ -5355,3 +5355,4 @@ L$done_avx2: leaq 48(%rsi),%rsp L$epilogue_avx2: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha512-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha512-x86_64.s index 91821da1264e..234616bc3bb8 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha512-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/sha/sha512-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _sha512_block_data_order @@ -5362,3 +5362,4 @@ L$done_avx2: leaq 48(%rsi),%rsp L$epilogue_avx2: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/whrlpool/wp-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/whrlpool/wp-x86_64.s index ad43b5a1b351..4057ba32acfa 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/whrlpool/wp-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/whrlpool/wp-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _whirlpool_block diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/x86_64cpuid.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/x86_64cpuid.s index f9987b733af6..8f16835f716e 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/x86_64cpuid.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/x86_64cpuid.s @@ -7,7 +7,7 @@ .private_extern _OPENSSL_ia32cap_P .comm _OPENSSL_ia32cap_P,16,2 -.text +.text .globl _OPENSSL_atomic_add @@ -455,3 +455,4 @@ L$tail_rdseed_bytes: L$done_rdseed_bytes: .byte 0xf3,0xc3 + diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/engines/e_padlock-x86_64.s b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/engines/e_padlock-x86_64.s index 5121b7a05c1d..b2c06a991923 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/engines/e_padlock-x86_64.s +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/engines/e_padlock-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl _padlock_capability .p2align 4 @@ -1020,7 +1020,7 @@ L$ctr32_abort: .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .p2align 4 -.data +.data .p2align 3 L$padlock_saved_context: .quad 0 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h index f7d6eb81141d..dd9f0d18abf9 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/openssl.gypi b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/openssl.gypi index 20d6fbba6aea..b624f31aa0b6 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/openssl.gypi +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm index 5c67787780e3..c9c63f968020 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "darwin64-x86_64-cc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,8 +7402,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h index c390a3edf17d..fd5748f7c9b0 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 3 00:38:20 2018" +#define DATE "built on: Tue Aug 14 23:13:08 2018" diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h index 8ebbf0154777..77321f72a65f 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslconf.h @@ -108,12 +108,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/openssl.gypi b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/openssl.gypi index 3ec9ac0dd034..3562eebf0b91 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm b/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm index 954f89a92d7a..cc18467d56d0 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-aarch64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3954,6 +3970,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6250,6 +6272,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7237,6 +7265,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7431,10 +7463,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7590,6 +7635,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7630,7 +7676,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8012,6 +8061,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8132,9 +8184,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9143,6 +9204,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10607,6 +10672,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11131,6 +11200,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11497,6 +11567,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12500,6 +12571,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12849,6 +12929,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12857,6 +12945,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h index 8eff4c899cd3..1efa1d1710c0 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h @@ -27,4 +27,4 @@ static const char cflags[] = { '1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 3 00:38:23 2018" +#define DATE "built on: Tue Aug 14 23:13:11 2018" diff --git a/deps/openssl/config/archs/linux-aarch64/asm/crypto/ec/ecp_nistz256-armv8.S b/deps/openssl/config/archs/linux-aarch64/asm/crypto/ec/ecp_nistz256-armv8.S index d5b15399508c..85e76b825342 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/crypto/ec/ecp_nistz256-armv8.S +++ b/deps/openssl/config/archs/linux-aarch64/asm/crypto/ec/ecp_nistz256-armv8.S @@ -2765,7 +2765,7 @@ __ecp_nistz256_sqr_mont: // *| | | | | | | | 2| // +|a3*a3|a2*a2|a1*a1|a0*a0| // |--+--+--+--+--+--+--+--| - // |A7|A6|A5|A4|A3|A2|A1|A0|, where Ax is , i.e. follow + // |A7|A6|A5|A4|A3|A2|A1|A0|, where Ax is , i.e. follow // // "can't overflow" below mark carrying into high part of // multiplication result, which can't overflow, because it @@ -3752,21 +3752,21 @@ ecp_nistz256_scatter_w7: prfm pstl1strm,[x0,#4096+64*5] prfm pstl1strm,[x0,#4096+64*6] prfm pstl1strm,[x0,#4096+64*7] - strb w3,[x0,#64*0-1] + strb w3,[x0,#64*0] lsr x3,x3,#8 - strb w3,[x0,#64*1-1] + strb w3,[x0,#64*1] lsr x3,x3,#8 - strb w3,[x0,#64*2-1] + strb w3,[x0,#64*2] lsr x3,x3,#8 - strb w3,[x0,#64*3-1] + strb w3,[x0,#64*3] lsr x3,x3,#8 - strb w3,[x0,#64*4-1] + strb w3,[x0,#64*4] lsr x3,x3,#8 - strb w3,[x0,#64*5-1] + strb w3,[x0,#64*5] lsr x3,x3,#8 - strb w3,[x0,#64*6-1] + strb w3,[x0,#64*6] lsr x3,x3,#8 - strb w3,[x0,#64*7-1] + strb w3,[x0,#64*7] add x0,x0,#64*8 b.ne .Loop_scatter_w7 diff --git a/deps/openssl/config/archs/linux-aarch64/asm/crypto/modes/ghashv8-armx.S b/deps/openssl/config/archs/linux-aarch64/asm/crypto/modes/ghashv8-armx.S index 20d797bfa7c1..c3e7c97d09be 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/crypto/modes/ghashv8-armx.S +++ b/deps/openssl/config/archs/linux-aarch64/asm/crypto/modes/ghashv8-armx.S @@ -1,5 +1,6 @@ #include "arm_arch.h" +#if __ARM_MAX_ARCH__>=7 .text .arch armv8-a+crypto .globl gcm_init_v8 @@ -226,3 +227,4 @@ gcm_ghash_v8: .byte 71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 2 .align 2 +#endif diff --git a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslconf.h index 3976dadb19ca..8bd973e750d6 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-aarch64/asm/openssl.gypi b/deps/openssl/config/archs/linux-aarch64/asm/openssl.gypi index e0a7b4897094..216df5ffe56b 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-aarch64/asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm b/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm index 6c0451cfb7f1..59482bab95e3 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-aarch64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1076,6 +1076,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1242,10 +1246,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3932,6 +3948,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6210,6 +6232,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7197,6 +7225,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7369,9 +7401,9 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", "include", + "test", ".", ], "test/threadstest.o" => @@ -7391,10 +7423,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7550,6 +7595,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7590,7 +7636,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7972,6 +8021,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8092,9 +8144,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9083,6 +9144,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10523,6 +10588,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11042,6 +11111,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11402,6 +11472,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12405,6 +12476,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12754,6 +12834,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12762,6 +12850,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h index fbcadcd5ff27..53176610a1a0 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 3 00:38:24 2018" +#define DATE "built on: Tue Aug 14 23:13:13 2018" diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h index af3a003d5193..08bf3d43940b 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-aarch64/no-asm/openssl.gypi index 9d9b4c82f8dc..f05778a2c40f 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-armv4/asm/configdata.pm b/deps/openssl/config/archs/linux-armv4/asm/configdata.pm index cb318fa4a5d6..1b3e80fa901c 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-armv4/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-armv4", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3948,6 +3964,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6247,6 +6269,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7234,6 +7262,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7406,8 +7438,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7428,10 +7460,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7587,6 +7632,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7627,7 +7673,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8009,6 +8058,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8129,9 +8181,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9144,6 +9205,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10612,6 +10677,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11137,6 +11206,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11504,6 +11574,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12507,6 +12578,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12856,6 +12936,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12864,6 +12952,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/armv4cpuid.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/armv4cpuid.S index deb601673717..eae2d6ad259e 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/armv4cpuid.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/armv4cpuid.S @@ -104,7 +104,7 @@ CRYPTO_memcmp: ldmia sp!,{r4,r5} .Lno_data: - neg r0,ip + rsb r0,ip,#0 mov r0,r0,lsr#31 #if __ARM_ARCH__>=5 bx lr diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/bn/armv4-mont.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/bn/armv4-mont.S index bd5efa815645..9f6e7e0c7934 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/bn/armv4-mont.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/bn/armv4-mont.S @@ -165,14 +165,15 @@ bn_mul_mont: mov r4,sp @ "rewind" r4 sub r2,r2,r5 @ "rewind" r2 - and r1,r4,r14 - bic r3,r2,r14 - orr r1,r1,r3 @ ap=borrow?tp:rp - -.Lcopy: ldr r7,[r1],#4 @ copy or in-place refresh +.Lcopy: ldr r7,[r4] @ conditional copy + ldr r5,[r2] str sp,[r4],#4 @ zap tp - str r7,[r2],#4 - cmp r4,r0 +#ifdef __thumb2__ + it cc +#endif + movcc r5,r7 + str r5,[r2],#4 + teq r4,r0 @ preserve carry bne .Lcopy mov sp,r0 diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h index 6a7c2e2220c7..d930fb3ea664 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h @@ -30,4 +30,4 @@ static const char cflags[] = { '"','"',' ','\0' }; #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 3 00:38:25 2018" +#define DATE "built on: Tue Aug 14 23:13:13 2018" diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/ec/ecp_nistz256-armv4.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/ec/ecp_nistz256-armv4.S index 625e9506de5a..ee64a0b30bee 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/ec/ecp_nistz256-armv4.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/ec/ecp_nistz256-armv4.S @@ -3432,13 +3432,13 @@ ecp_nistz256_scatter_w7: .Loop_scatter_w7: ldr r3,[r1],#4 subs r2,r2,#1 - strb r3,[r0,#64*0-1] + strb r3,[r0,#64*0] mov r3,r3,lsr#8 - strb r3,[r0,#64*1-1] + strb r3,[r0,#64*1] mov r3,r3,lsr#8 - strb r3,[r0,#64*2-1] + strb r3,[r0,#64*2] mov r3,r3,lsr#8 - strb r3,[r0,#64*3-1] + strb r3,[r0,#64*3] add r0,r0,#64*4 bne .Loop_scatter_w7 @@ -4114,7 +4114,7 @@ ecp_nistz256_point_add: stmia r0!,{r4,r5} .Ladd_done: add sp,sp,#32*18+16+16 @ +16 means "skip even over saved r0-r3" -#if __ARM_ARCH__>=5 || defined(__thumb__) +#if __ARM_ARCH__>=5 || !defined(__thumb__) ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc} #else ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr} diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghash-armv4.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghash-armv4.S index 2134f9b647f4..e654d9480f4d 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghash-armv4.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghash-armv4.S @@ -3,6 +3,8 @@ .text #if defined(__thumb2__) || defined(__clang__) .syntax unified +#define ldrplb ldrbpl +#define ldrneb ldrbne #endif #if defined(__thumb2__) .thumb @@ -10,11 +12,6 @@ .code 32 #endif -#ifdef __clang__ -#define ldrplb ldrbpl -#define ldrneb ldrbne -#endif - .type rem_4bit,%object .align 5 rem_4bit: diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghashv8-armx.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghashv8-armx.S index f6fb3f1f7336..ceceb743ece0 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghashv8-armx.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/modes/ghashv8-armx.S @@ -1,5 +1,6 @@ #include "arm_arch.h" +#if __ARM_MAX_ARCH__>=7 .text .fpu neon .code 32 @@ -230,3 +231,4 @@ gcm_ghash_v8: .byte 71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 2 .align 2 +#endif diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/poly1305/poly1305-armv4.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/poly1305/poly1305-armv4.S index 7484c33b84a0..16b0eb0e9fd4 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/poly1305/poly1305-armv4.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/poly1305/poly1305-armv4.S @@ -132,6 +132,7 @@ poly1305_init: .type poly1305_blocks,%function .align 5 poly1305_blocks: +.Lpoly1305_blocks: stmdb sp!,{r3,r4,r5,r6,r7,r8,r9,r10,r11,lr} ands r2,r2,#-16 @@ -606,7 +607,7 @@ poly1305_blocks_neon: cmp r2,#64 bhs .Lenter_neon tst ip,ip @ is_base2_26? - beq poly1305_blocks + beq .Lpoly1305_blocks .Lenter_neon: stmdb sp!,{r4,r5,r6,r7} diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha256-armv4.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha256-armv4.S index 239e7504f102..3efcde6b6eb0 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha256-armv4.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha256-armv4.S @@ -1,4 +1,4 @@ -@ Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +@ Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. @ @ Licensed under the OpenSSL license (the "License"). You may not use @ this file except in compliance with the License. You can obtain a copy @@ -1831,7 +1831,7 @@ sha256_block_data_order: eor r12,r12,r6 @ Maj(a,b,c) add r4,r4,r0,ror#2 @ h+=Sigma0(a) @ add r4,r4,r12 @ h+=Maj(a,b,c) -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ ite eq @ Thumb2 thing, sanity check in ARM #endif ldreq r3,[sp,#16*4] @ pull ctx diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha512-armv4.S b/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha512-armv4.S index 14eb87e0ce5c..1e2fbf635016 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha512-armv4.S +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/sha/sha512-armv4.S @@ -1,4 +1,4 @@ -@ Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +@ Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. @ @ Licensed under the OpenSSL license (the "License"). You may not use @ this file except in compliance with the License. You can obtain a copy @@ -265,7 +265,7 @@ sha512_block_data_order: teq r9,#148 ldr r12,[sp,#16+0] @ c.lo -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ it eq @ Thumb2 thing, sanity check in ARM #endif orreq r14,r14,#1 @@ -405,7 +405,7 @@ sha512_block_data_order: teq r9,#23 ldr r12,[sp,#16+0] @ c.lo -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ it eq @ Thumb2 thing, sanity check in ARM #endif orreq r14,r14,#1 @@ -442,7 +442,7 @@ sha512_block_data_order: adc r6,r6,r4 @ h += T tst r14,#1 add r14,r14,#8 -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ ittt eq @ Thumb2 thing, sanity check in ARM #endif ldreq r9,[sp,#184+0] diff --git a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslconf.h index 2f9817e43b12..21dd8cc643b8 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-armv4/asm/openssl.gypi b/deps/openssl/config/archs/linux-armv4/asm/openssl.gypi index fcb454895670..7344b58fb907 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-armv4/asm/openssl.gypi @@ -218,6 +218,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -578,6 +579,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm b/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm index af91de539b24..6eb5d78ae80f 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-armv4", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1076,6 +1076,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1242,10 +1246,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3932,6 +3948,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6210,6 +6232,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7197,6 +7225,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7369,8 +7401,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7391,10 +7423,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7550,6 +7595,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7590,7 +7636,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7972,6 +8021,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8092,9 +8144,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9083,6 +9144,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10523,6 +10588,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11042,6 +11111,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11402,6 +11472,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12405,6 +12476,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12754,6 +12834,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12762,6 +12850,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h index edce6b669b2d..8bba39bbb837 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 3 00:38:26 2018" +#define DATE "built on: Tue Aug 14 23:13:15 2018" diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslconf.h index 1f0c62b3c912..5ba3b88d4e5f 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-armv4/no-asm/openssl.gypi index 9a109fd8745d..c20b80999fc4 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-armv4/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-elf/asm/configdata.pm b/deps/openssl/config/archs/linux-elf/asm/configdata.pm index e1c530bd8749..c2da301a2f47 100644 --- a/deps/openssl/config/archs/linux-elf/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-elf/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-elf", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3945,6 +3961,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6271,6 +6293,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7270,6 +7298,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7464,10 +7496,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7623,6 +7668,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7663,7 +7709,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8045,6 +8094,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8165,9 +8217,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9164,6 +9225,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10636,6 +10701,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11165,6 +11234,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11533,6 +11603,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12538,6 +12609,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12887,6 +12967,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12895,6 +12983,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-elf/asm/crypto/bn/x86-mont.s b/deps/openssl/config/archs/linux-elf/asm/crypto/bn/x86-mont.s index 945d9e58248a..8212ff0825f5 100644 --- a/deps/openssl/config/archs/linux-elf/asm/crypto/bn/x86-mont.s +++ b/deps/openssl/config/archs/linux-elf/asm/crypto/bn/x86-mont.s @@ -445,16 +445,18 @@ bn_mul_mont: leal 1(%edx),%edx jge .L017sub sbbl $0,%eax - andl %eax,%esi - notl %eax - movl %edi,%ebp - andl %eax,%ebp - orl %ebp,%esi + movl $-1,%edx + xorl %eax,%edx + jmp .L018copy .align 16 .L018copy: - movl (%esi,%ebx,4),%eax - movl %eax,(%edi,%ebx,4) + movl 32(%esp,%ebx,4),%esi + movl (%edi,%ebx,4),%ebp movl %ecx,32(%esp,%ebx,4) + andl %eax,%esi + andl %edx,%ebp + orl %esi,%ebp + movl %ebp,(%edi,%ebx,4) decl %ebx jge .L018copy movl 24(%esp),%esp diff --git a/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h index 8baf29639c3e..865759ecc45e 100644 --- a/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h @@ -37,4 +37,4 @@ static const char cflags[] = { '"',' ','\0' }; #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 3 00:38:27 2018" +#define DATE "built on: Tue Aug 14 23:13:15 2018" diff --git a/deps/openssl/config/archs/linux-elf/asm/crypto/ec/ecp_nistz256-x86.s b/deps/openssl/config/archs/linux-elf/asm/crypto/ec/ecp_nistz256-x86.s index cbccc5ebf7a2..9092d6632152 100644 --- a/deps/openssl/config/archs/linux-elf/asm/crypto/ec/ecp_nistz256-x86.s +++ b/deps/openssl/config/archs/linux-elf/asm/crypto/ec/ecp_nistz256-x86.s @@ -3857,7 +3857,7 @@ ecp_nistz256_scatter_w7: movl 20(%esp),%edi movl 24(%esp),%esi movl 28(%esp),%ebp - leal -1(%edi,%ebp,1),%edi + leal (%edi,%ebp,1),%edi movl $16,%ebp .L007scatter_w7_loop: movl (%esi),%eax diff --git a/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslconf.h index e819a68f0b6a..b9d6509c0b95 100644 --- a/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-elf/asm/openssl.gypi b/deps/openssl/config/archs/linux-elf/asm/openssl.gypi index bbc226b89b25..d5cde454dde2 100644 --- a/deps/openssl/config/archs/linux-elf/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-elf/asm/openssl.gypi @@ -211,6 +211,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -567,6 +568,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm b/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm index 59021fb1d453..31d78b0b3c6d 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-elf", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1075,6 +1075,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1241,10 +1245,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3931,6 +3947,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6209,6 +6231,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7196,6 +7224,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7368,8 +7400,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7390,10 +7422,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7549,6 +7594,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7589,7 +7635,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7971,6 +8020,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8091,9 +8143,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9082,6 +9143,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10522,6 +10587,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11041,6 +11110,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11401,6 +11471,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12404,6 +12475,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12753,6 +12833,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12761,6 +12849,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h index 606ace102eaf..23fa5b79945b 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 3 00:38:29 2018" +#define DATE "built on: Tue Aug 14 23:13:17 2018" diff --git a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslconf.h index b20dbd02123e..d0fb48f465fe 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi index b869b1a864cf..e4ce5e3b9276 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc/asm/configdata.pm b/deps/openssl/config/archs/linux-ppc/asm/configdata.pm index 5e487cc37444..63186d5ce0d1 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3963,6 +3979,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6295,6 +6317,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7282,6 +7310,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7454,8 +7486,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7476,10 +7508,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7635,6 +7680,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7675,7 +7721,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8057,6 +8106,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8177,9 +8229,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9188,6 +9249,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10664,6 +10729,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11188,6 +11257,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11557,6 +11627,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12560,6 +12631,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12909,6 +12989,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12917,6 +13005,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aes-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aes-ppc.s index d59a397c0d5b..7a2b6fce8322 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aes-ppc.s @@ -8,7 +8,7 @@ mflr 3 addi 3,3,120 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -18,7 +18,7 @@ mflr 3 addi 3,3,2360 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -740,7 +740,7 @@ AES_encrypt: lwz 31,124(1) mtlr 0 addi 1,1,128 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -820,7 +820,7 @@ AES_encrypt: bdnz .Lenc_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -885,7 +885,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1030,7 +1030,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_encrypt,.-AES_encrypt @@ -1175,7 +1175,7 @@ AES_decrypt: lwz 31,124(1) mtlr 0 addi 1,1,128 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1255,7 +1255,7 @@ AES_decrypt: bdnz .Ldec_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -1320,7 +1320,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1550,7 +1550,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_decrypt,.-AES_decrypt diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aesp8-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aesp8-ppc.s index 5eb788907d01..16ddeda37832 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aesp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/aesp8-ppc.s @@ -14,7 +14,7 @@ rcon: mflr 6 addi 6,6,-0x48 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 @@ -278,7 +278,7 @@ aes_p8_set_encrypt_key: .Lenc_key_abort: mr 3,6 - blr + blr .long 0 .byte 0,12,0x14,1,0,0,3,0 .long 0 @@ -327,7 +327,7 @@ aes_p8_set_decrypt_key: xor 3,3,3 .Ldec_key_abort: addi 1,1,32 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,3,0 .long 0 @@ -395,7 +395,7 @@ aes_p8_encrypt: stvx 0,7,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -463,7 +463,7 @@ aes_p8_decrypt: stvx 0,7,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -625,7 +625,7 @@ aes_p8_cbc_encrypt: stvx 2,10,7 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -915,8 +915,8 @@ _aesp8_cbc_decrypt8x: addic. 5,5,128 beq .Lcbc_dec8x_done - nop - nop + nop + nop .Loop_cbc_dec8x_tail: .long 0x11EFC548 @@ -1004,15 +1004,15 @@ _aesp8_cbc_decrypt8x: cmplwi 5,32 blt .Lcbc_dec8x_one - nop + nop beq .Lcbc_dec8x_two cmplwi 5,64 blt .Lcbc_dec8x_three - nop + nop beq .Lcbc_dec8x_four cmplwi 5,96 blt .Lcbc_dec8x_five - nop + nop beq .Lcbc_dec8x_six .Lcbc_dec8x_seven: @@ -1199,7 +1199,7 @@ _aesp8_cbc_decrypt8x: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1307,7 +1307,7 @@ aes_p8_ctr32_encrypt_blocks: stvx 2,0,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -1610,15 +1610,15 @@ _aesp8_ctr32_encrypt8x: .Lctr32_enc8x_break: cmpwi 5,-0x60 blt .Lctr32_enc8x_one - nop + nop beq .Lctr32_enc8x_two cmpwi 5,-0x40 blt .Lctr32_enc8x_three - nop + nop beq .Lctr32_enc8x_four cmpwi 5,-0x20 blt .Lctr32_enc8x_five - nop + nop beq .Lctr32_enc8x_six cmpwi 5,0x00 blt .Lctr32_enc8x_seven @@ -1827,7 +1827,7 @@ _aesp8_ctr32_encrypt8x: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1965,7 +1965,7 @@ aes_p8_xts_encrypt: .long 0x10620509 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2038,7 +2038,7 @@ aes_p8_xts_encrypt: .Lxts_enc_ret: mtspr 256,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2179,7 +2179,7 @@ aes_p8_xts_decrypt: .long 0x10620549 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2244,7 +2244,7 @@ aes_p8_xts_decrypt: .long 0x10620549 - nop + nop .long 0x7C602799 @@ -2295,7 +2295,7 @@ aes_p8_xts_decrypt: .Lxts_dec_ret: mtspr 256,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2626,11 +2626,11 @@ _aesp8_xts_encrypt6x: beq .Lxts_enc6x_zero cmpwi 5,0x20 blt .Lxts_enc6x_one - nop + nop beq .Lxts_enc6x_two cmpwi 5,0x40 blt .Lxts_enc6x_three - nop + nop beq .Lxts_enc6x_four .Lxts_enc6x_five: @@ -2727,7 +2727,7 @@ _aesp8_xts_encrypt6x: .align 4 .Lxts_enc6x_one: vxor 7,5,17 - nop + nop .Loop_xts_enc1x: .long 0x10E7C508 lvx 24,26,7 @@ -2863,7 +2863,7 @@ _aesp8_xts_encrypt6x: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -2948,7 +2948,7 @@ _aesp8_xts_enc5x: .long 0x11AD1509 .long 0x11CE1D09 .long 0x11EF2509 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -3276,11 +3276,11 @@ _aesp8_xts_decrypt6x: beq .Lxts_dec6x_zero cmpwi 5,0x20 blt .Lxts_dec6x_one - nop + nop beq .Lxts_dec6x_two cmpwi 5,0x40 blt .Lxts_dec6x_three - nop + nop beq .Lxts_dec6x_four .Lxts_dec6x_five: @@ -3381,7 +3381,7 @@ _aesp8_xts_decrypt6x: .align 4 .Lxts_dec6x_one: vxor 7,5,17 - nop + nop .Loop_xts_dec1x: .long 0x10E7C548 lvx 24,26,7 @@ -3551,7 +3551,7 @@ _aesp8_xts_decrypt6x: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3636,6 +3636,6 @@ _aesp8_xts_dec5x: .long 0x11CE1D49 .long 0x11EF2549 mtctr 9 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/vpaes-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/vpaes-ppc.s index babd699bf79f..12bc03a58838 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/vpaes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/aes/vpaes-ppc.s @@ -95,7 +95,7 @@ _vpaes_consts: mflr 12 addi 12,12,-0x308 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 @@ -135,7 +135,7 @@ _vpaes_encrypt_preheat: lvx 17, 12, 8 lvx 18, 12, 11 lvx 19, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -223,7 +223,7 @@ _vpaes_encrypt_core: vxor 4, 4, 5 vxor 0, 0, 4 vperm 0, 0, 7, 1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -319,7 +319,7 @@ vpaes_encrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -361,7 +361,7 @@ _vpaes_decrypt_preheat: lvx 21, 12, 8 lvx 22, 12, 11 lvx 23, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -456,7 +456,7 @@ _vpaes_decrypt_core: vxor 4, 4, 5 vxor 0, 1, 4 vperm 0, 0, 7, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -552,7 +552,7 @@ vpaes_decrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -780,7 +780,7 @@ vpaes_cbc_encrypt: lwz 31,236(1) mtlr 0 addi 1,1,240 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,2,6,0 .long 0 @@ -834,7 +834,7 @@ _vpaes_key_preheat: lvx 24, 12, 9 lvx 25, 0, 12 lvx 26, 12, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1080,7 +1080,7 @@ _vpaes_schedule_core: vxor 6, 6, 6 vxor 7, 7, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1108,7 +1108,7 @@ _vpaes_schedule_192_smear: vor 0, 6, 6 vsldoi 6, 6, 9, 8 vsldoi 6, 9, 6, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1174,7 +1174,7 @@ _vpaes_schedule_low_round: vxor 0, 1, 7 vxor 7, 1, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1196,7 +1196,7 @@ _vpaes_schedule_transform: vperm 2, 13, 13, 2 vxor 0, 0, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1248,7 +1248,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .align 4 .Lschedule_mangle_dec: @@ -1299,7 +1299,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1376,7 +1376,7 @@ vpaes_set_encrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -1460,7 +1460,7 @@ vpaes_set_decrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/bn-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/bn-ppc.s index 4745306e54ab..b029cc94b09f 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/bn-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/bn-ppc.s @@ -237,7 +237,7 @@ bn_sqr_comba4: stw 9,24(3) stw 10,28(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -665,7 +665,7 @@ bn_sqr_comba8: stw 9, 60(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -819,7 +819,7 @@ bn_mul_comba4: stw 10,24(3) stw 11,28(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1358,7 +1358,7 @@ bn_mul_comba8: adde 10,10,9 stw 12,56(3) stw 10,60(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1409,7 +1409,7 @@ bn_sub_words: .Lppcasm_sub_adios: subfze 3,0 andi. 3,3,1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1455,7 +1455,7 @@ bn_add_words: bdnz .Lppcasm_add_mainloop .Lppcasm_add_adios: addze 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1484,7 +1484,7 @@ bn_div_words: cmplwi 0,5,0 bne .Lppcasm_div1 li 3,-1 - blr + blr .Lppcasm_div1: xor 0,0,0 li 8,32 @@ -1571,7 +1571,7 @@ bn_div_words: b .Lppcasm_divouterloop .Lppcasm_div9: or 3,8,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1613,7 +1613,7 @@ bn_sqr_words: stwu 8,4(3) bdnz .Lppcasm_sqr_mainloop .Lppcasm_sqr_adios: - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1719,7 +1719,7 @@ bn_mul_words: .Lppcasm_mw_OVER: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1845,7 +1845,7 @@ bn_mul_add_words: .Lppcasm_maw_adios: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc-mont.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc-mont.s index aefd29c9d874..5bba1e47acc4 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc-mont.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc-mont.s @@ -10,7 +10,7 @@ bn_mul_mont_int: li 3,0 .long 0x4d800020 cmpwi 8,32 - bgelr + bgelr slwi 8,8,2 li 12,-4096 addi 3,8,256 @@ -183,15 +183,16 @@ bn_mul_mont_int: li 21,0 mtctr 8 subfe 3,21,3 - and 4,22,3 - andc 6,9,3 - or 4,4,6 .align 4 .Lcopy: - lwzx 12,4,21 - stwx 12,9,21 + lwzx 12,22,21 + lwzx 10,9,21 + and 12,12,3 + andc 10,10,3 stwx 21,22,21 + or 10,10,12 + stwx 10,9,21 addi 21,21,4 bdnz .Lcopy @@ -210,7 +211,7 @@ bn_mul_mont_int: lwz 30,-8(12) lwz 31,-4(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc64-mont.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc64-mont.s index 49c6e9c741aa..774b4c4dea1c 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc64-mont.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/bn/ppc64-mont.s @@ -889,11 +889,8 @@ bn_mul_mont_fpu64: li 12,0 subfe 3,12,3 - addi 10,1,196 + addi 4,1,196 subf 9,8,9 - and 4,10,3 - andc 6,9,3 - or 4,4,6 addi 10,1,192 mtctr 11 @@ -903,6 +900,10 @@ bn_mul_mont_fpu64: lwz 25,8(4) lwz 26,12(4) lwzu 27,16(4) + lwz 28,4(9) + lwz 29,8(9) + lwz 30,12(9) + lwz 31,16(9) std 12,8(22) std 12,16(22) std 12,24(22) @@ -911,6 +912,18 @@ bn_mul_mont_fpu64: std 12,48(22) std 12,56(22) stdu 12,64(22) + and 24,24,3 + and 25,25,3 + and 26,26,3 + and 27,27,3 + andc 28,28,3 + andc 29,29,3 + andc 30,30,3 + andc 31,31,3 + or 24,24,28 + or 25,25,29 + or 26,26,30 + or 27,27,31 stw 24,4(9) stw 25,8(9) stw 26,12(9) @@ -946,7 +959,7 @@ bn_mul_mont_fpu64: lfd 30,-16(12) lfd 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x8c,13,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc/asm/crypto/buildinf.h index 1a32730b388b..c0355572c41d 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/buildinf.h @@ -26,4 +26,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc" -#define DATE "built on: Tue Apr 3 00:38:38 2018" +#define DATE "built on: Tue Aug 14 23:13:27 2018" diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/chacha/chacha-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/chacha/chacha-ppc.s index e07f5837a02a..02f53619e508 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/chacha/chacha-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/chacha/chacha-ppc.s @@ -60,7 +60,7 @@ __ChaCha20_ctr32_int: lwz 31,156(1) mtlr 0 addi 1,1,160 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,5,0 .long 0 @@ -346,7 +346,7 @@ __ChaCha20_1x: bne .Loop_outer - blr + blr .align 4 .Ltail: @@ -397,7 +397,7 @@ __ChaCha20_1x: stw 1,80(1) stw 1,84(1) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -556,7 +556,7 @@ ChaCha20_ctr32_vmx: vspltisw 27,7 mtctr 0 - nop + nop .Loop_vmx: vadduwm 0,0,1 add 16,16,20 @@ -1049,7 +1049,7 @@ ChaCha20_ctr32_vmx: cmplwi 5,255 bgt .Loop_outer_vmx - nop + nop .Ldone_vmx: cmplwi 5,0 @@ -1102,7 +1102,7 @@ ChaCha20_ctr32_vmx: lwz 31,364(1) mtlr 0 addi 1,1,368 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,18,5,0 .long 0 @@ -1115,7 +1115,7 @@ ChaCha20_ctr32_vmx: mflr 12 addi 12,12,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/modes/ghashp8-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/modes/ghashp8-ppc.s index 28cbe1956ff0..a0e364910f15 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/modes/ghashp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/modes/ghashp8-ppc.s @@ -123,7 +123,7 @@ gcm_init_p8: .long 0x7E4A1F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -173,7 +173,7 @@ gcm_gmult_p8: .long 0x7C001F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -290,7 +290,7 @@ gcm_ghash_p8: .long 0x7C001F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -557,7 +557,7 @@ gcm_ghash_p8: lvx 30,10,1 lvx 31,11,1 addi 1,1,232 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppc.s index a03a08d66c69..940d4fa85340 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppc.s @@ -36,7 +36,7 @@ poly1305_init_int: .Lno_key: xor 3,3,3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .size poly1305_init_int,.-poly1305_init_int @@ -238,7 +238,7 @@ poly1305_blocks: lwz 31,92(1) addi 1,1,96 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,18,4,0 .size poly1305_blocks,.-poly1305_blocks @@ -303,7 +303,7 @@ poly1305_emit: lwz 30,88(1) lwz 31,92(1) addi 1,1,96 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 .size poly1305_emit,.-poly1305_emit diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppcfp.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppcfp.s index 519158eefd8e..ee69ce054ce5 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppcfp.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/poly1305/poly1305-ppcfp.s @@ -146,7 +146,7 @@ poly1305_init_fpu: .Lno_key: xor 3,3,3 addi 1,1,24 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,2,0 .size poly1305_init_fpu,.-poly1305_init_fpu @@ -462,7 +462,7 @@ poly1305_blocks_fpu: lfd 31,208(1) addi 1,1,216 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,0,4,0 .size poly1305_blocks_fpu,.-poly1305_blocks_fpu @@ -547,7 +547,7 @@ poly1305_emit_fpu: lwz 30,32(1) lwz 31,36(1) addi 1,1,40 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 .size poly1305_emit_fpu,.-poly1305_emit_fpu @@ -558,7 +558,7 @@ poly1305_emit_fpu: mflr 5 addi 5,5,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/ppccpuid.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/ppccpuid.s index 59359e7919ac..19fac1f319cf 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/ppccpuid.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/ppccpuid.s @@ -6,7 +6,7 @@ .align 4 OPENSSL_fpu_probe: fmr 0,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_fpu_probe,.-OPENSSL_fpu_probe @@ -16,7 +16,7 @@ OPENSSL_fpu_probe: OPENSSL_ppc64_probe: fcfid 1,1 rldicl 0,0,32,32 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_ppc64_probe,.-OPENSSL_ppc64_probe @@ -26,7 +26,7 @@ OPENSSL_ppc64_probe: .align 4 OPENSSL_altivec_probe: .long 0x10000484 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_altivec_probe,.-OPENSSL_altivec_probe @@ -37,7 +37,7 @@ OPENSSL_altivec_probe: OPENSSL_crypto207_probe: .long 0x7C000E99 .long 0x10000508 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_crypto207_probe,.-OPENSSL_crypto207_probe @@ -49,7 +49,7 @@ OPENSSL_madd300_probe: xor 0,0,0 .long 0x10600033 .long 0x10600031 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -82,7 +82,7 @@ OPENSSL_wipe_cpu: xor 12,12,12 fmr 12,31 fmr 13,31 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu @@ -96,7 +96,7 @@ OPENSSL_atomic_add: stwcx. 0,0,3 bne- .Ladd mr 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -112,7 +112,7 @@ OPENSSL_rdtsc: mftbu 4 .long 0x7c042840 bne .Loop_rdtsc - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_rdtsc,.-OPENSSL_rdtsc @@ -130,7 +130,7 @@ OPENSSL_cleanse: stb 0,0(3) addi 3,3,1 bdnz $-8 - blr + blr .Lot: andi. 5,3,3 beq .Laligned stb 0,0(3) @@ -145,7 +145,7 @@ OPENSSL_cleanse: bdnz $-8 andi. 4,4,3 bne .Little - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -172,7 +172,7 @@ CRYPTO_memcmp: li 3,0 sub 3,3,0 extrwi 3,3,1,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -204,7 +204,7 @@ OPENSSL_instrument_bus: bdnz .Loop mr 3,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -257,7 +257,7 @@ OPENSSL_instrument_bus2: .Ldone2: srwi 4,4,2 sub 3,0,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha1-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha1-ppc.s index 5f577714e5a6..ca8c279a2c44 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha1-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha1-ppc.s @@ -101,7 +101,7 @@ sha1_block_data_order: lwz 31,156(1) mtlr 0 addi 1,1,160 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1109,7 +1109,7 @@ sha1_block_data_order: mr 11,20 addi 4,4,64 bdnz .Lsha1_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha1_block_data_order,.-sha1_block_data_order diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256-ppc.s index 1e92cd5884da..83c86c17fa21 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256-ppc.s @@ -121,7 +121,7 @@ sha256_block_ppc: lwz 31,188(1) mtlr 0 addi 1,1,192 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1287,7 +1287,7 @@ sha256_block_ppc: .long 0x7c1f2840 stw 15,28(3) bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha256_block_ppc,.-sha256_block_ppc @@ -1298,7 +1298,7 @@ sha256_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256p8-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256p8-ppc.s index 888cef888efc..7c06a0bc05be 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha256p8-ppc.s @@ -773,7 +773,7 @@ sha256_block_p8: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -785,7 +785,7 @@ sha256_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512-ppc.s index 582aee7682c4..2ae1bd579f3d 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512-ppc.s @@ -128,7 +128,7 @@ sha512_block_ppc: lwz 31,252(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -2973,7 +2973,7 @@ sha512_block_ppc: stw 4,164(1) .long 0x7c042840 bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha512_block_ppc,.-sha512_block_ppc @@ -2984,7 +2984,7 @@ sha512_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512p8-ppc.s b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512p8-ppc.s index 00b9f36b42c5..fc14a5e50f8d 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc/asm/crypto/sha/sha512p8-ppc.s @@ -774,7 +774,7 @@ sha512_block_p8: lwz 30,384(1) lwz 31,388(1) addi 1,1,392 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -786,7 +786,7 @@ sha512_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc/asm/include/openssl/opensslconf.h index 2f9817e43b12..21dd8cc643b8 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc/asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc/asm/openssl.gypi index 046400b5d292..49a49d892d66 100644 --- a/deps/openssl/config/archs/linux-ppc/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc/asm/openssl.gypi @@ -217,6 +217,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -577,6 +578,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc/no-asm/configdata.pm b/deps/openssl/config/archs/linux-ppc/no-asm/configdata.pm index 2a36895668ac..e75bdf4223e4 100644 --- a/deps/openssl/config/archs/linux-ppc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1076,6 +1076,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1242,10 +1246,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3932,6 +3948,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6210,6 +6232,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7197,6 +7225,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7391,10 +7423,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7550,6 +7595,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7590,7 +7636,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7972,6 +8021,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8092,9 +8144,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9083,6 +9144,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10523,6 +10588,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11042,6 +11111,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11402,6 +11472,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12405,6 +12476,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12754,6 +12834,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12762,6 +12850,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc/no-asm/crypto/buildinf.h index fcfb67646e73..2e6e10b752c3 100644 --- a/deps/openssl/config/archs/linux-ppc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc" -#define DATE "built on: Tue Apr 3 00:38:40 2018" +#define DATE "built on: Tue Aug 14 23:13:28 2018" diff --git a/deps/openssl/config/archs/linux-ppc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc/no-asm/include/openssl/opensslconf.h index 1f0c62b3c912..5ba3b88d4e5f 100644 --- a/deps/openssl/config/archs/linux-ppc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc/no-asm/openssl.gypi index 08a06ab1d947..8d5be916d451 100644 --- a/deps/openssl/config/archs/linux-ppc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc64/asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64/asm/configdata.pm index 09ca2343e7bd..37f6baf4c662 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3964,6 +3980,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6296,6 +6318,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7283,6 +7311,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7455,8 +7487,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7477,10 +7509,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7636,6 +7681,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7676,7 +7722,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8058,6 +8107,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8178,9 +8230,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9189,6 +9250,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10665,6 +10730,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11189,6 +11258,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11558,6 +11628,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12561,6 +12632,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12910,6 +12990,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12918,6 +13006,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aes-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aes-ppc.s index b46c8c82a298..95c8377dc1fa 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aes-ppc.s @@ -8,7 +8,7 @@ mflr 3 addi 3,3,120 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -18,7 +18,7 @@ mflr 3 addi 3,3,2360 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -746,7 +746,7 @@ AES_encrypt: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -826,7 +826,7 @@ AES_encrypt: bdnz .Lenc_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -891,7 +891,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1036,7 +1036,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_encrypt,.-.AES_encrypt @@ -1188,7 +1188,7 @@ AES_decrypt: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1268,7 +1268,7 @@ AES_decrypt: bdnz .Ldec_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -1333,7 +1333,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1530,7 +1530,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_decrypt,.-.AES_decrypt diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aesp8-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aesp8-ppc.s index 36fa7e356d69..52a195558d2b 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aesp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/aesp8-ppc.s @@ -14,7 +14,7 @@ rcon: mflr 6 addi 6,6,-0x48 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 @@ -284,7 +284,7 @@ aes_p8_set_encrypt_key: .Lenc_key_abort: mr 3,6 - blr + blr .long 0 .byte 0,12,0x14,1,0,0,3,0 .long 0 @@ -340,7 +340,7 @@ aes_p8_set_decrypt_key: xor 3,3,3 .Ldec_key_abort: addi 1,1,64 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,3,0 .long 0 @@ -415,7 +415,7 @@ aes_p8_encrypt: stvx 0,7,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -490,7 +490,7 @@ aes_p8_decrypt: stvx 0,7,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -659,7 +659,7 @@ aes_p8_cbc_encrypt: stvx 2,10,7 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -949,8 +949,8 @@ _aesp8_cbc_decrypt8x: addic. 5,5,128 beq .Lcbc_dec8x_done - nop - nop + nop + nop .Loop_cbc_dec8x_tail: .long 0x11EFC548 @@ -1038,15 +1038,15 @@ _aesp8_cbc_decrypt8x: cmplwi 5,32 blt .Lcbc_dec8x_one - nop + nop beq .Lcbc_dec8x_two cmplwi 5,64 blt .Lcbc_dec8x_three - nop + nop beq .Lcbc_dec8x_four cmplwi 5,96 blt .Lcbc_dec8x_five - nop + nop beq .Lcbc_dec8x_six .Lcbc_dec8x_seven: @@ -1233,7 +1233,7 @@ _aesp8_cbc_decrypt8x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1348,7 +1348,7 @@ aes_p8_ctr32_encrypt_blocks: stvx 2,0,4 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -1651,15 +1651,15 @@ _aesp8_ctr32_encrypt8x: .Lctr32_enc8x_break: cmpwi 5,-0x60 blt .Lctr32_enc8x_one - nop + nop beq .Lctr32_enc8x_two cmpwi 5,-0x40 blt .Lctr32_enc8x_three - nop + nop beq .Lctr32_enc8x_four cmpwi 5,-0x20 blt .Lctr32_enc8x_five - nop + nop beq .Lctr32_enc8x_six cmpwi 5,0x00 blt .Lctr32_enc8x_seven @@ -1868,7 +1868,7 @@ _aesp8_ctr32_encrypt8x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2013,7 +2013,7 @@ aes_p8_xts_encrypt: .long 0x10620509 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2086,7 +2086,7 @@ aes_p8_xts_encrypt: .Lxts_enc_ret: mtspr 256,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2234,7 +2234,7 @@ aes_p8_xts_decrypt: .long 0x10620549 - nop + nop .long 0x7C602799 addi 4,4,16 @@ -2299,7 +2299,7 @@ aes_p8_xts_decrypt: .long 0x10620549 - nop + nop .long 0x7C602799 @@ -2350,7 +2350,7 @@ aes_p8_xts_decrypt: .Lxts_dec_ret: mtspr 256,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2682,11 +2682,11 @@ _aesp8_xts_encrypt6x: beq .Lxts_enc6x_zero cmpwi 5,0x20 blt .Lxts_enc6x_one - nop + nop beq .Lxts_enc6x_two cmpwi 5,0x40 blt .Lxts_enc6x_three - nop + nop beq .Lxts_enc6x_four .Lxts_enc6x_five: @@ -2783,7 +2783,7 @@ _aesp8_xts_encrypt6x: .align 4 .Lxts_enc6x_one: vxor 7,5,17 - nop + nop .Loop_xts_enc1x: .long 0x10E7C508 lvx 24,26,7 @@ -2919,7 +2919,7 @@ _aesp8_xts_encrypt6x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3004,7 +3004,7 @@ _aesp8_xts_enc5x: .long 0x11AD1509 .long 0x11CE1D09 .long 0x11EF2509 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -3332,11 +3332,11 @@ _aesp8_xts_decrypt6x: beq .Lxts_dec6x_zero cmpwi 5,0x20 blt .Lxts_dec6x_one - nop + nop beq .Lxts_dec6x_two cmpwi 5,0x40 blt .Lxts_dec6x_three - nop + nop beq .Lxts_dec6x_four .Lxts_dec6x_five: @@ -3437,7 +3437,7 @@ _aesp8_xts_decrypt6x: .align 4 .Lxts_dec6x_one: vxor 7,5,17 - nop + nop .Loop_xts_dec1x: .long 0x10E7C548 lvx 24,26,7 @@ -3607,7 +3607,7 @@ _aesp8_xts_decrypt6x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3692,6 +3692,6 @@ _aesp8_xts_dec5x: .long 0x11CE1D49 .long 0x11EF2549 mtctr 9 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/vpaes-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/vpaes-ppc.s index 1168f546f08f..c5f074f37f74 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/vpaes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/aes/vpaes-ppc.s @@ -95,7 +95,7 @@ _vpaes_consts: mflr 12 addi 12,12,-0x308 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 @@ -135,7 +135,7 @@ _vpaes_encrypt_preheat: lvx 17, 12, 8 lvx 18, 12, 11 lvx 19, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -223,7 +223,7 @@ _vpaes_encrypt_core: vxor 4, 4, 5 vxor 0, 0, 4 vperm 0, 0, 7, 1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -325,7 +325,7 @@ vpaes_encrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -368,7 +368,7 @@ _vpaes_decrypt_preheat: lvx 21, 12, 8 lvx 22, 12, 11 lvx 23, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -463,7 +463,7 @@ _vpaes_decrypt_core: vxor 4, 4, 5 vxor 0, 1, 4 vperm 0, 0, 7, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -565,7 +565,7 @@ vpaes_decrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -800,7 +800,7 @@ vpaes_cbc_encrypt: ld 31,264(1) mtlr 0 addi 1,1,272 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,2,6,0 .long 0 @@ -855,7 +855,7 @@ _vpaes_key_preheat: lvx 24, 12, 9 lvx 25, 0, 12 lvx 26, 12, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1101,7 +1101,7 @@ _vpaes_schedule_core: vxor 6, 6, 6 vxor 7, 7, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1129,7 +1129,7 @@ _vpaes_schedule_192_smear: vor 0, 6, 6 vsldoi 6, 6, 9, 8 vsldoi 6, 9, 6, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1195,7 +1195,7 @@ _vpaes_schedule_low_round: vxor 0, 1, 7 vxor 7, 1, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1217,7 +1217,7 @@ _vpaes_schedule_transform: vperm 2, 13, 13, 2 vxor 0, 0, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1269,7 +1269,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .align 4 .Lschedule_mangle_dec: @@ -1320,7 +1320,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1403,7 +1403,7 @@ vpaes_set_encrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -1494,7 +1494,7 @@ vpaes_set_decrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/bn-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/bn-ppc.s index 0a3a2a76f51d..60dd49f8635e 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/bn-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/bn-ppc.s @@ -297,7 +297,7 @@ bn_mul_add_words: std 9,48(3) std 10,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -726,7 +726,7 @@ bn_mul_add_words: std 9, 120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -881,7 +881,7 @@ bn_mul_add_words: std 10,48(3) std 11,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1421,7 +1421,7 @@ bn_mul_add_words: adde 10,10,9 std 12,112(3) std 10,120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1473,7 +1473,7 @@ bn_mul_add_words: .Lppcasm_sub_adios: subfze 3,0 andi. 3,3,1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1520,7 +1520,7 @@ bn_mul_add_words: bdnz .Lppcasm_add_mainloop .Lppcasm_add_adios: addze 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1550,7 +1550,7 @@ bn_mul_add_words: cmpldi 0,5,0 bne .Lppcasm_div1 li 3,-1 - blr + blr .Lppcasm_div1: xor 0,0,0 li 8,64 @@ -1637,7 +1637,7 @@ bn_mul_add_words: b .Lppcasm_divouterloop .Lppcasm_div9: or 3,8,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1680,7 +1680,7 @@ bn_mul_add_words: stdu 8,8(3) bdnz .Lppcasm_sqr_mainloop .Lppcasm_sqr_adios: - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1787,7 +1787,7 @@ bn_mul_add_words: .Lppcasm_mw_OVER: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1914,7 +1914,7 @@ bn_mul_add_words: .Lppcasm_maw_adios: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc-mont.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc-mont.s index ac8653f240de..353c4492446b 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc-mont.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc-mont.s @@ -187,15 +187,16 @@ bn_mul_mont_int: li 21,0 mtctr 8 subfe 3,21,3 - and 4,22,3 - andc 6,9,3 - or 4,4,6 .align 4 .Lcopy: - ldx 12,4,21 - stdx 12,9,21 + ldx 12,22,21 + ldx 10,9,21 + and 12,12,3 + andc 10,10,3 stdx 21,22,21 + or 10,10,12 + stdx 10,9,21 addi 21,21,8 bdnz .Lcopy @@ -214,7 +215,7 @@ bn_mul_mont_int: ld 30,-16(12) ld 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc64-mont.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc64-mont.s index 8450d9a93923..c8a045698b28 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc64-mont.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/bn/ppc64-mont.s @@ -686,16 +686,14 @@ bn_mul_mont_fpu64: li 12,0 subfe 3,12,3 - and 4,10,3 - andc 6,9,3 - or 4,4,6 - addi 31,4,8 mtctr 11 .align 4 .Lcopy: - ldx 24,4,12 - ldx 25,31,12 + ldx 24,10,12 + ldx 25,28,12 + ldx 26,9,12 + ldx 27,30,12 std 12,8(22) std 12,16(22) std 12,24(22) @@ -704,6 +702,12 @@ bn_mul_mont_fpu64: std 12,48(22) std 12,56(22) stdu 12,64(22) + and 24,24,3 + and 25,25,3 + andc 26,26,3 + andc 27,27,3 + or 24,24,26 + or 25,25,27 stdx 24,9,12 stdx 25,30,12 stdx 12,10,12 @@ -738,7 +742,7 @@ bn_mul_mont_fpu64: lfd 30,-16(12) lfd 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x8c,13,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64/asm/crypto/buildinf.h index 12830ce399ec..6c21f2f5e7aa 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/buildinf.h @@ -26,4 +26,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc64" -#define DATE "built on: Tue Apr 3 00:38:40 2018" +#define DATE "built on: Tue Aug 14 23:13:29 2018" diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/chacha/chacha-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/chacha/chacha-ppc.s index 93efe4d9b575..b69868c41f77 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/chacha/chacha-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/chacha/chacha-ppc.s @@ -66,7 +66,7 @@ __ChaCha20_ctr32_int: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,5,0 .long 0 @@ -353,7 +353,7 @@ __ChaCha20_1x: bne .Loop_outer - blr + blr .align 4 .Ltail: @@ -404,7 +404,7 @@ __ChaCha20_1x: stw 1,104(1) stw 1,108(1) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -569,7 +569,7 @@ ChaCha20_ctr32_vmx: vspltisw 27,7 mtctr 0 - nop + nop .Loop_vmx: vadduwm 0,0,1 add 16,16,20 @@ -1062,7 +1062,7 @@ ChaCha20_ctr32_vmx: cmpldi 5,255 bgt .Loop_outer_vmx - nop + nop .Ldone_vmx: cmpldi 5,0 @@ -1115,7 +1115,7 @@ ChaCha20_ctr32_vmx: ld 31,456(1) mtlr 0 addi 1,1,464 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,18,5,0 .long 0 @@ -1129,7 +1129,7 @@ ChaCha20_ctr32_vmx: mflr 12 addi 12,12,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/modes/ghashp8-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/modes/ghashp8-ppc.s index 5ca8640eda06..8294ab9b9585 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/modes/ghashp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/modes/ghashp8-ppc.s @@ -129,7 +129,7 @@ gcm_init_p8: .long 0x7E4A1F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -186,7 +186,7 @@ gcm_gmult_p8: .long 0x7C001F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -310,7 +310,7 @@ gcm_ghash_p8: .long 0x7C001F99 mtspr 256,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -577,7 +577,7 @@ gcm_ghash_p8: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppc.s index 0907f4ae2032..4006308ab247 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppc.s @@ -39,7 +39,7 @@ poly1305_init_int: .Lno_key: xor 3,3,3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .size poly1305_init_int,.-.poly1305_init_int @@ -141,7 +141,7 @@ poly1305_blocks: ld 31,184(1) addi 1,1,192 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,5,4,0 .size poly1305_blocks,.-.poly1305_blocks @@ -189,7 +189,7 @@ poly1305_emit: li 12,12 stwbrx 8,11,4 stwbrx 7,12,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .size poly1305_emit,.-.poly1305_emit diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppcfp.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppcfp.s index a26ff5adba79..a5a6dfd505bc 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppcfp.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/poly1305/poly1305-ppcfp.s @@ -152,7 +152,7 @@ poly1305_init_fpu: .Lno_key: xor 3,3,3 addi 1,1,48 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,2,0 .size poly1305_init_fpu,.-.poly1305_init_fpu @@ -475,7 +475,7 @@ poly1305_blocks_fpu: lfd 31,232(1) addi 1,1,240 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,0,4,0 .size poly1305_blocks_fpu,.-.poly1305_blocks_fpu @@ -570,7 +570,7 @@ poly1305_emit_fpu: ld 30,64(1) ld 31,72(1) addi 1,1,80 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 .size poly1305_emit_fpu,.-.poly1305_emit_fpu @@ -582,7 +582,7 @@ poly1305_emit_fpu: mflr 5 addi 5,5,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/ppccpuid.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/ppccpuid.s index adc9731bb69e..55fa667f641b 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/ppccpuid.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/ppccpuid.s @@ -12,7 +12,7 @@ OPENSSL_fpu_probe: .align 4 .OPENSSL_fpu_probe: fmr 0,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_fpu_probe,.-.OPENSSL_fpu_probe @@ -29,7 +29,7 @@ OPENSSL_ppc64_probe: .OPENSSL_ppc64_probe: fcfid 1,1 rldicl 0,0,32,32 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_ppc64_probe,.-.OPENSSL_ppc64_probe @@ -46,7 +46,7 @@ OPENSSL_altivec_probe: .align 4 .OPENSSL_altivec_probe: .long 0x10000484 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_altivec_probe,.-.OPENSSL_altivec_probe @@ -64,7 +64,7 @@ OPENSSL_crypto207_probe: .OPENSSL_crypto207_probe: .long 0x7C000E99 .long 0x10000508 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_crypto207_probe,.-.OPENSSL_crypto207_probe @@ -83,7 +83,7 @@ OPENSSL_madd300_probe: xor 0,0,0 .long 0x10600033 .long 0x10600031 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -122,7 +122,7 @@ OPENSSL_wipe_cpu: xor 12,12,12 fmr 12,31 fmr 13,31 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_wipe_cpu,.-.OPENSSL_wipe_cpu @@ -143,7 +143,7 @@ OPENSSL_atomic_add: stwcx. 0,0,3 bne- .Ladd extsw 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -161,7 +161,7 @@ OPENSSL_rdtsc: .align 4 .OPENSSL_rdtsc: mftb 3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_rdtsc,.-.OPENSSL_rdtsc @@ -186,7 +186,7 @@ OPENSSL_cleanse: stb 0,0(3) addi 3,3,1 bdnz $-8 - blr + blr .Lot: andi. 5,3,3 beq .Laligned stb 0,0(3) @@ -201,7 +201,7 @@ OPENSSL_cleanse: bdnz $-8 andi. 4,4,3 bne .Little - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -235,7 +235,7 @@ CRYPTO_memcmp: li 3,0 sub 3,3,0 extrwi 3,3,1,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -274,7 +274,7 @@ OPENSSL_instrument_bus: bdnz .Loop mr 3,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -334,7 +334,7 @@ OPENSSL_instrument_bus2: .Ldone2: srwi 4,4,2 sub 3,0,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha1-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha1-ppc.s index aa47944d3708..e332225e3bc2 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha1-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha1-ppc.s @@ -107,7 +107,7 @@ sha1_block_data_order: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1115,7 +1115,7 @@ sha1_block_data_order: mr 11,20 addi 4,4,64 bdnz .Lsha1_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha1_block_data_order,.-.sha1_block_data_order diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256-ppc.s index 8bc52879f48b..8a55a49ed37d 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256-ppc.s @@ -127,7 +127,7 @@ sha256_block_ppc: ld 31,312(1) mtlr 0 addi 1,1,320 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1293,7 +1293,7 @@ sha256_block_ppc: cmpld 31,5 stw 15,28(3) bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha256_block_ppc,.-.sha256_block_ppc @@ -1305,7 +1305,7 @@ sha256_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256p8-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256p8-ppc.s index cfa6282d6d6b..23db0265f530 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha256p8-ppc.s @@ -779,7 +779,7 @@ sha256_block_p8: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -792,7 +792,7 @@ sha256_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512-ppc.s index 9c699a4f32e8..775b64d0fbb7 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512-ppc.s @@ -127,7 +127,7 @@ sha512_block_ppc: ld 31,376(1) mtlr 0 addi 1,1,384 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1325,7 +1325,7 @@ sha512_block_ppc: cmpld 31,5 std 15,56(3) bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha512_block_ppc,.-.sha512_block_ppc @@ -1337,7 +1337,7 @@ sha512_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512p8-ppc.s b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512p8-ppc.s index 03c09abfe173..6526b53ff09c 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64/asm/crypto/sha/sha512p8-ppc.s @@ -780,7 +780,7 @@ sha512_block_p8: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -793,7 +793,7 @@ sha512_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc64/asm/include/openssl/opensslconf.h index 3976dadb19ca..8bd973e750d6 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc64/asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc64/asm/openssl.gypi index b99768aed035..840000dcbea1 100644 --- a/deps/openssl/config/archs/linux-ppc64/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc64/asm/openssl.gypi @@ -217,6 +217,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -577,6 +578,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc64/no-asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64/no-asm/configdata.pm index 3385fae2274e..1cd6924b6d24 100644 --- a/deps/openssl/config/archs/linux-ppc64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,8 +7402,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64/no-asm/crypto/buildinf.h index e00115c55c07..94576dcc4d27 100644 --- a/deps/openssl/config/archs/linux-ppc64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc64" -#define DATE "built on: Tue Apr 3 00:38:41 2018" +#define DATE "built on: Tue Aug 14 23:13:30 2018" diff --git a/deps/openssl/config/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h index af3a003d5193..08bf3d43940b 100644 --- a/deps/openssl/config/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc64/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc64/no-asm/openssl.gypi index e45227748ee5..5b40384e3d6b 100644 --- a/deps/openssl/config/archs/linux-ppc64/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc64/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm index f83a155f6632..bf4ab72fd1c4 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc64le", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3963,6 +3979,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6295,6 +6317,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7282,6 +7310,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7454,8 +7486,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7476,10 +7508,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7635,6 +7680,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7675,7 +7721,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8057,6 +8106,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8177,9 +8229,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9188,6 +9249,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10664,6 +10729,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11188,6 +11257,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11557,6 +11627,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12560,6 +12631,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12909,6 +12989,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12917,6 +13005,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aes-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aes-ppc.s index bbc4e95d5448..2aa99e753a97 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aes-ppc.s @@ -9,7 +9,7 @@ mflr 3 addi 3,3,120 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -19,7 +19,7 @@ mflr 3 addi 3,3,2360 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 @@ -766,7 +766,7 @@ AES_encrypt: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -846,7 +846,7 @@ AES_encrypt: bdnz .Lenc_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -911,7 +911,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1056,7 +1056,7 @@ AES_encrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_encrypt,.-AES_encrypt @@ -1226,7 +1226,7 @@ AES_decrypt: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1306,7 +1306,7 @@ AES_decrypt: bdnz .Ldec_loop addi 7,3,2048 - nop + nop lwz 12,0(5) rlwinm 16,8,8,24,31 lwz 0,4(5) @@ -1371,7 +1371,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1568,7 +1568,7 @@ AES_decrypt: xor 9,9,0 xor 10,10,14 xor 11,11,15 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size AES_decrypt,.-AES_decrypt diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aesp8-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aesp8-ppc.s index 54f61290bdd8..581d16e664af 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aesp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/aesp8-ppc.s @@ -15,7 +15,7 @@ rcon: mflr 6 addi 6,6,-0x48 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 @@ -280,7 +280,7 @@ aes_p8_set_encrypt_key: .Lenc_key_abort: mr 3,6 - blr + blr .long 0 .byte 0,12,0x14,1,0,0,3,0 .long 0 @@ -330,7 +330,7 @@ aes_p8_set_decrypt_key: xor 3,3,3 .Ldec_key_abort: addi 1,1,64 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,3,0 .long 0 @@ -399,7 +399,7 @@ aes_p8_encrypt: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -468,7 +468,7 @@ aes_p8_decrypt: stvx 0,7,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -631,7 +631,7 @@ aes_p8_cbc_encrypt: stvx 2,10,7 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -921,8 +921,8 @@ _aesp8_cbc_decrypt8x: addic. 5,5,128 beq .Lcbc_dec8x_done - nop - nop + nop + nop .Loop_cbc_dec8x_tail: .long 0x11EFC548 @@ -1010,15 +1010,15 @@ _aesp8_cbc_decrypt8x: cmplwi 5,32 blt .Lcbc_dec8x_one - nop + nop beq .Lcbc_dec8x_two cmplwi 5,64 blt .Lcbc_dec8x_three - nop + nop beq .Lcbc_dec8x_four cmplwi 5,96 blt .Lcbc_dec8x_five - nop + nop beq .Lcbc_dec8x_six .Lcbc_dec8x_seven: @@ -1205,7 +1205,7 @@ _aesp8_cbc_decrypt8x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -1314,7 +1314,7 @@ aes_p8_ctr32_encrypt_blocks: stvx 2,0,4 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,6,0 .long 0 @@ -1617,15 +1617,15 @@ _aesp8_ctr32_encrypt8x: .Lctr32_enc8x_break: cmpwi 5,-0x60 blt .Lctr32_enc8x_one - nop + nop beq .Lctr32_enc8x_two cmpwi 5,-0x40 blt .Lctr32_enc8x_three - nop + nop beq .Lctr32_enc8x_four cmpwi 5,-0x20 blt .Lctr32_enc8x_five - nop + nop beq .Lctr32_enc8x_six cmpwi 5,0x00 blt .Lctr32_enc8x_seven @@ -1834,7 +1834,7 @@ _aesp8_ctr32_encrypt8x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2046,7 +2046,7 @@ aes_p8_xts_encrypt: .Lxts_enc_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2304,7 +2304,7 @@ aes_p8_xts_decrypt: .Lxts_dec_ret: or 12,12,12 li 3,0 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,6,6,0 .long 0 @@ -2635,11 +2635,11 @@ _aesp8_xts_encrypt6x: beq .Lxts_enc6x_zero cmpwi 5,0x20 blt .Lxts_enc6x_one - nop + nop beq .Lxts_enc6x_two cmpwi 5,0x40 blt .Lxts_enc6x_three - nop + nop beq .Lxts_enc6x_four .Lxts_enc6x_five: @@ -2736,7 +2736,7 @@ _aesp8_xts_encrypt6x: .align 4 .Lxts_enc6x_one: vxor 7,5,17 - nop + nop .Loop_xts_enc1x: .long 0x10E7C508 lvx 24,26,7 @@ -2872,7 +2872,7 @@ _aesp8_xts_encrypt6x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -2957,7 +2957,7 @@ _aesp8_xts_enc5x: .long 0x11AD1509 .long 0x11CE1D09 .long 0x11EF2509 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -3285,11 +3285,11 @@ _aesp8_xts_decrypt6x: beq .Lxts_dec6x_zero cmpwi 5,0x20 blt .Lxts_dec6x_one - nop + nop beq .Lxts_dec6x_two cmpwi 5,0x40 blt .Lxts_dec6x_three - nop + nop beq .Lxts_dec6x_four .Lxts_dec6x_five: @@ -3390,7 +3390,7 @@ _aesp8_xts_decrypt6x: .align 4 .Lxts_dec6x_one: vxor 7,5,17 - nop + nop .Loop_xts_dec1x: .long 0x10E7C548 lvx 24,26,7 @@ -3560,7 +3560,7 @@ _aesp8_xts_decrypt6x: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,6,6,0 .long 0 @@ -3645,6 +3645,6 @@ _aesp8_xts_dec5x: .long 0x11CE1D49 .long 0x11EF2549 mtctr 9 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/vpaes-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/vpaes-ppc.s index abd30163841c..74d9d5f5cebc 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/vpaes-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/aes/vpaes-ppc.s @@ -96,7 +96,7 @@ _vpaes_consts: mflr 12 addi 12,12,-0x308 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 @@ -136,7 +136,7 @@ _vpaes_encrypt_preheat: lvx 17, 12, 8 lvx 18, 12, 11 lvx 19, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -224,7 +224,7 @@ _vpaes_encrypt_core: vxor 4, 4, 5 vxor 0, 0, 4 vperm 0, 0, 7, 1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -321,7 +321,7 @@ vpaes_encrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -363,7 +363,7 @@ _vpaes_decrypt_preheat: lvx 21, 12, 8 lvx 22, 12, 11 lvx 23, 12, 10 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -458,7 +458,7 @@ _vpaes_decrypt_core: vxor 4, 4, 5 vxor 0, 1, 4 vperm 0, 0, 7, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -555,7 +555,7 @@ vpaes_decrypt: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -784,7 +784,7 @@ vpaes_cbc_encrypt: ld 31,264(1) mtlr 0 addi 1,1,272 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,2,6,0 .long 0 @@ -838,7 +838,7 @@ _vpaes_key_preheat: lvx 24, 12, 9 lvx 25, 0, 12 lvx 26, 12, 8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1084,7 +1084,7 @@ _vpaes_schedule_core: vxor 6, 6, 6 vxor 7, 7, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1112,7 +1112,7 @@ _vpaes_schedule_192_smear: vor 0, 6, 6 vsldoi 6, 9, 6, 16-8 vsldoi 6, 6, 9, 16-8 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1178,7 +1178,7 @@ _vpaes_schedule_low_round: vxor 0, 1, 7 vxor 7, 1, 7 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1200,7 +1200,7 @@ _vpaes_schedule_transform: vperm 2, 13, 13, 2 vxor 0, 0, 2 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1252,7 +1252,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .align 4 .Lschedule_mangle_dec: @@ -1303,7 +1303,7 @@ _vpaes_schedule_mangle: vsel 2, 28, 1, 30 vor 28, 1, 1 stvx 2, 0, 5 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -1381,7 +1381,7 @@ vpaes_set_encrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 @@ -1466,7 +1466,7 @@ vpaes_set_decrypt_key: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/bn-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/bn-ppc.s index 146f9af69d66..c846a555af94 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/bn-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/bn-ppc.s @@ -238,7 +238,7 @@ bn_sqr_comba4: std 9,48(3) std 10,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -667,7 +667,7 @@ bn_sqr_comba8: std 9, 120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -822,7 +822,7 @@ bn_mul_comba4: std 10,48(3) std 11,56(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1362,7 +1362,7 @@ bn_mul_comba8: adde 10,10,9 std 12,112(3) std 10,120(3) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1414,7 +1414,7 @@ bn_sub_words: .Lppcasm_sub_adios: subfze 3,0 andi. 3,3,1 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1461,7 +1461,7 @@ bn_add_words: bdnz .Lppcasm_add_mainloop .Lppcasm_add_adios: addze 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1491,7 +1491,7 @@ bn_div_words: cmpldi 0,5,0 bne .Lppcasm_div1 li 3,-1 - blr + blr .Lppcasm_div1: xor 0,0,0 li 8,64 @@ -1578,7 +1578,7 @@ bn_div_words: b .Lppcasm_divouterloop .Lppcasm_div9: or 3,8,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1621,7 +1621,7 @@ bn_sqr_words: stdu 8,8(3) bdnz .Lppcasm_sqr_mainloop .Lppcasm_sqr_adios: - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -1728,7 +1728,7 @@ bn_mul_words: .Lppcasm_mw_OVER: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -1855,7 +1855,7 @@ bn_mul_add_words: .Lppcasm_maw_adios: addi 3,12,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc-mont.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc-mont.s index 83b5f96f136a..763ad1a55b67 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc-mont.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc-mont.s @@ -183,15 +183,16 @@ bn_mul_mont_int: li 21,0 mtctr 8 subfe 3,21,3 - and 4,22,3 - andc 6,9,3 - or 4,4,6 .align 4 .Lcopy: - ldx 12,4,21 - stdx 12,9,21 + ldx 12,22,21 + ldx 10,9,21 + and 12,12,3 + andc 10,10,3 stdx 21,22,21 + or 10,10,12 + stdx 10,9,21 addi 21,21,8 bdnz .Lcopy @@ -210,7 +211,7 @@ bn_mul_mont_int: ld 30,-16(12) ld 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x80,12,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc64-mont.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc64-mont.s index 520b8559912d..5bafae2b278d 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc64-mont.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/bn/ppc64-mont.s @@ -682,16 +682,14 @@ bn_mul_mont_fpu64: li 12,0 subfe 3,12,3 - and 4,10,3 - andc 6,9,3 - or 4,4,6 - addi 31,4,8 mtctr 11 .align 4 .Lcopy: - ldx 24,4,12 - ldx 25,31,12 + ldx 24,10,12 + ldx 25,28,12 + ldx 26,9,12 + ldx 27,30,12 std 12,8(22) std 12,16(22) std 12,24(22) @@ -700,6 +698,12 @@ bn_mul_mont_fpu64: std 12,48(22) std 12,56(22) stdu 12,64(22) + and 24,24,3 + and 25,25,3 + andc 26,26,3 + andc 27,27,3 + or 24,24,26 + or 25,25,27 stdx 24,9,12 stdx 25,30,12 stdx 12,10,12 @@ -734,7 +738,7 @@ bn_mul_mont_fpu64: lfd 30,-16(12) lfd 31,-8(12) mr 1,12 - blr + blr .long 0 .byte 0,12,4,0,0x8c,13,6,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h index db18e0e13696..9d82ff0db62f 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h @@ -26,4 +26,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 3 00:38:42 2018" +#define DATE "built on: Tue Aug 14 23:13:30 2018" diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/chacha/chacha-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/chacha/chacha-ppc.s index d5173a6b2be6..dafa6a1eb5df 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/chacha/chacha-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/chacha/chacha-ppc.s @@ -62,7 +62,7 @@ __ChaCha20_ctr32_int: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,5,0 .long 0 @@ -284,7 +284,7 @@ __ChaCha20_1x: bne .Loop_outer - blr + blr .align 4 .Ltail: @@ -335,7 +335,7 @@ __ChaCha20_1x: stw 1,104(1) stw 1,108(1) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -495,7 +495,7 @@ ChaCha20_ctr32_vmx: vspltisw 27,7 mtctr 0 - nop + nop .Loop_vmx: vadduwm 0,0,1 add 16,16,20 @@ -924,7 +924,7 @@ ChaCha20_ctr32_vmx: cmpldi 5,255 bgt .Loop_outer_vmx - nop + nop .Ldone_vmx: cmpldi 5,0 @@ -977,7 +977,7 @@ ChaCha20_ctr32_vmx: ld 31,456(1) mtlr 0 addi 1,1,464 - blr + blr .long 0 .byte 0,12,0x04,1,0x80,18,5,0 .long 0 @@ -990,7 +990,7 @@ ChaCha20_ctr32_vmx: mflr 12 addi 12,12,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/ghashp8-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/ghashp8-ppc.s index ec8ae8c05f18..c5ace016e1db 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/ghashp8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/ghashp8-ppc.s @@ -125,7 +125,7 @@ gcm_init_p8: .long 0x7E4A1F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -176,7 +176,7 @@ gcm_gmult_p8: .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -294,7 +294,7 @@ gcm_ghash_p8: .long 0x7C001F99 or 12,12,12 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,4,0 .long 0 @@ -561,7 +561,7 @@ gcm_ghash_p8: lvx 30,10,1 lvx 31,11,1 addi 1,1,256 - blr + blr .long 0 .byte 0,12,0x04,0,0x80,0,4,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppc.s index 247885f63102..de5c728fe1c4 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppc.s @@ -28,7 +28,7 @@ poly1305_init_int: .Lno_key: xor 3,3,3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .size poly1305_init_int,.-poly1305_init_int @@ -117,7 +117,7 @@ poly1305_blocks: ld 31,184(1) addi 1,1,192 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,5,4,0 .size poly1305_blocks,.-poly1305_blocks @@ -150,7 +150,7 @@ poly1305_emit: adde 8,8,5 std 7,0(4) std 8,8(4) - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .size poly1305_emit,.-poly1305_emit diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppcfp.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppcfp.s index 0ddf681308b3..bf94546c85e1 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppcfp.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/poly1305/poly1305-ppcfp.s @@ -148,7 +148,7 @@ poly1305_init_fpu: .Lno_key: xor 3,3,3 addi 1,1,48 - blr + blr .long 0 .byte 0,12,4,1,0x80,0,2,0 .size poly1305_init_fpu,.-poly1305_init_fpu @@ -465,7 +465,7 @@ poly1305_blocks_fpu: lfd 31,232(1) addi 1,1,240 .Labort: - blr + blr .long 0 .byte 0,12,4,1,0x80,0,4,0 .size poly1305_blocks_fpu,.-poly1305_blocks_fpu @@ -549,7 +549,7 @@ poly1305_emit_fpu: ld 30,64(1) ld 31,72(1) addi 1,1,80 - blr + blr .long 0 .byte 0,12,4,1,0x80,4,3,0 .size poly1305_emit_fpu,.-poly1305_emit_fpu @@ -560,7 +560,7 @@ poly1305_emit_fpu: mflr 5 addi 5,5,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/ppccpuid.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/ppccpuid.s index a2b975fbe2dd..6a859efc093b 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/ppccpuid.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/ppccpuid.s @@ -8,7 +8,7 @@ OPENSSL_fpu_probe: .localentry OPENSSL_fpu_probe,0 fmr 0,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_fpu_probe,.-OPENSSL_fpu_probe @@ -19,7 +19,7 @@ OPENSSL_ppc64_probe: .localentry OPENSSL_ppc64_probe,0 fcfid 1,1 rldicl 0,0,32,32 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_ppc64_probe,.-OPENSSL_ppc64_probe @@ -30,7 +30,7 @@ OPENSSL_ppc64_probe: OPENSSL_altivec_probe: .localentry OPENSSL_altivec_probe,0 .long 0x10000484 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_altivec_probe,.-OPENSSL_altivec_probe @@ -42,7 +42,7 @@ OPENSSL_crypto207_probe: .localentry OPENSSL_crypto207_probe,0 .long 0x7C000E99 .long 0x10000508 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_crypto207_probe,.-OPENSSL_crypto207_probe @@ -55,7 +55,7 @@ OPENSSL_madd300_probe: xor 0,0,0 .long 0x10600033 .long 0x10600031 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 @@ -89,7 +89,7 @@ OPENSSL_wipe_cpu: xor 12,12,12 fmr 12,31 fmr 13,31 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu @@ -104,7 +104,7 @@ OPENSSL_atomic_add: stwcx. 0,0,3 bne- .Ladd extsw 3,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -116,7 +116,7 @@ OPENSSL_atomic_add: OPENSSL_rdtsc: .localentry OPENSSL_rdtsc,0 mftb 3 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size OPENSSL_rdtsc,.-OPENSSL_rdtsc @@ -135,7 +135,7 @@ OPENSSL_cleanse: stb 0,0(3) addi 3,3,1 bdnz $-8 - blr + blr .Lot: andi. 5,3,3 beq .Laligned stb 0,0(3) @@ -150,7 +150,7 @@ OPENSSL_cleanse: bdnz $-8 andi. 4,4,3 bne .Little - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -178,7 +178,7 @@ CRYPTO_memcmp: li 3,0 sub 3,3,0 extrwi 3,3,1,0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 @@ -211,7 +211,7 @@ OPENSSL_instrument_bus: bdnz .Loop mr 3,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 @@ -265,7 +265,7 @@ OPENSSL_instrument_bus2: .Ldone2: srwi 4,4,2 sub 3,0,4 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,3,0 .long 0 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha1-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha1-ppc.s index 3b6f4a492c6d..ca4da783957c 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha1-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha1-ppc.s @@ -103,7 +103,7 @@ sha1_block_data_order: ld 31,248(1) mtlr 0 addi 1,1,256 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1159,7 +1159,7 @@ sha1_block_data_order: mr 11,20 addi 4,4,64 bdnz .Lsha1_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha1_block_data_order,.-sha1_block_data_order diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256-ppc.s index 0c1539013d96..2e0c25a0c72d 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256-ppc.s @@ -123,7 +123,7 @@ sha256_block_ppc: ld 31,312(1) mtlr 0 addi 1,1,320 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1337,7 +1337,7 @@ sha256_block_ppc: cmpld 31,5 stw 15,28(3) bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha256_block_ppc,.-sha256_block_ppc @@ -1348,7 +1348,7 @@ sha256_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256p8-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256p8-ppc.s index 8536cf5e9977..80d4942b942d 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha256p8-ppc.s @@ -783,7 +783,7 @@ sha256_block_p8: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -795,7 +795,7 @@ sha256_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512-ppc.s index 89d26735a525..9c40d44b0bdc 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512-ppc.s @@ -123,7 +123,7 @@ sha512_block_ppc: ld 31,376(1) mtlr 0 addi 1,1,384 - blr + blr .long 0 .byte 0,12,4,1,0x80,18,3,0 .long 0 @@ -1417,7 +1417,7 @@ sha512_block_ppc: cmpld 31,5 std 15,56(3) bne .Lsha2_block_private - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .size sha512_block_ppc,.-sha512_block_ppc @@ -1428,7 +1428,7 @@ sha512_block_ppc: mflr 7 addi 7,7,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512p8-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512p8-ppc.s index 2214209e7d75..408e974ea5dd 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512p8-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/sha/sha512p8-ppc.s @@ -788,7 +788,7 @@ sha512_block_p8: ld 30,432(1) ld 31,440(1) addi 1,1,448 - blr + blr .long 0 .byte 0,12,4,1,0x80,6,3,0 .long 0 @@ -800,7 +800,7 @@ sha512_block_p8: mflr 6 addi 6,6,56 mtlr 0 - blr + blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .space 28 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslconf.h index 3976dadb19ca..8bd973e750d6 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc64le/asm/openssl.gypi index c8d2c69df224..8cec102e4fbb 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc64le/asm/openssl.gypi @@ -217,6 +217,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -577,6 +578,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm index 00ea347e495d..8a3abfbc3972 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-ppc64le", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1076,6 +1076,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1242,10 +1246,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3932,6 +3948,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6210,6 +6232,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7197,6 +7225,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,8 +7402,8 @@ our %unified_info = ( "test/testutil.o" => [ "crypto/include", - "test", "include", + "test", ".", ], "test/threadstest.o" => @@ -7391,10 +7423,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7550,6 +7595,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7590,7 +7636,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7972,6 +8021,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8092,9 +8144,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9083,6 +9144,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10523,6 +10588,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11042,6 +11111,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11402,6 +11472,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12405,6 +12476,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12754,6 +12834,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12762,6 +12850,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h index 1a4d84b065ad..74db60cb552f 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 3 00:38:43 2018" +#define DATE "built on: Tue Aug 14 23:13:32 2018" diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h index af3a003d5193..08bf3d43940b 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-ppc64le/no-asm/openssl.gypi index 4f068803a3a2..ed5097611c13 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-x32/asm/configdata.pm b/deps/openssl/config/archs/linux-x32/asm/configdata.pm index 31589f228854..9b72950dfe6d 100644 --- a/deps/openssl/config/archs/linux-x32/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x32/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-x32", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3994,6 +4010,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6332,6 +6354,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7331,6 +7359,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7503,8 +7535,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7525,10 +7557,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7684,6 +7729,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7724,7 +7770,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8106,6 +8155,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8226,9 +8278,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9257,6 +9318,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10737,6 +10802,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11274,6 +11343,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11644,6 +11714,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12649,6 +12720,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12998,6 +13078,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13006,6 +13094,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aes-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aes-x86_64.s index aa7a1ea1cf9b..488ae6d781ac 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aes-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _x86_64_AES_encrypt,@function .align 16 _x86_64_AES_encrypt: diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-mb-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-mb-x86_64.s index d49379783298..3dcd55d3f59a 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha1-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha1-x86_64.s index c7c53e8771e1..ca193ddb9ea4 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha1_enc diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha256-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha256-x86_64.s index 70eed05b00c1..427a1c7d1232 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha256_enc diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-x86_64.s index cd8b00f25983..e18f87c4e60c 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/aesni-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_encrypt .type aesni_encrypt,@function diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/bsaes-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/bsaes-x86_64.s index 0fd201167f64..c76c5a8afb47 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/bsaes-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/bsaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/vpaes-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/vpaes-x86_64.s index bf7c2b0b6f6b..d19329894079 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/aes/vpaes-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/aes/vpaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-avx2.s b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-avx2.s index a2cccde63604..ee619092c9b7 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-avx2.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-avx2.s @@ -1,4 +1,4 @@ -.text +.text .globl rsaz_1024_sqr_avx2 .type rsaz_1024_sqr_avx2,@function diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-x86_64.s index b6797a68498e..795cebe1d743 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/rsaz-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-gf2m.s b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-gf2m.s index f4e5337565bb..a0b78a0565f7 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-gf2m.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-gf2m.s @@ -1,4 +1,4 @@ -.text +.text .type _mul_1x1,@function .align 16 diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont.s b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont.s index d19d4662b492..3a78cd844090 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont.s @@ -1,4 +1,4 @@ -.text +.text @@ -197,30 +197,30 @@ bn_mul_mont: xorq %r14,%r14 movq (%rsp),%rax - leaq (%rsp),%rsi movq %r9,%r15 - jmp .Lsub + .align 16 .Lsub: sbbq (%rcx,%r14,8),%rax movq %rax,(%rdi,%r14,8) - movq 8(%rsi,%r14,8),%rax + movq 8(%rsp,%r14,8),%rax leaq 1(%r14),%r14 decq %r15 jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax - movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx + movq %r9,(%rsp,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy @@ -574,10 +574,10 @@ bn_mul4x_mont: cmpq %r9,%r14 jb .Louter4x movq 16(%rsp,%r9,8),%rdi + leaq -4(%r9),%r15 movq 0(%rsp),%rax - pxor %xmm0,%xmm0 movq 8(%rsp),%rdx - shrq $2,%r9 + shrq $2,%r15 leaq (%rsp),%rsi xorq %r14,%r14 @@ -585,9 +585,7 @@ bn_mul4x_mont: movq 16(%rsi),%rbx movq 24(%rsi),%rbp sbbq 8(%rcx),%rdx - leaq -1(%r9),%r15 - jmp .Lsub4x -.align 16 + .Lsub4x: movq %rax,0(%rdi,%r14,8) movq %rdx,8(%rdi,%r14,8) @@ -614,34 +612,35 @@ bn_mul4x_mont: sbbq $0,%rax movq %rbp,24(%rdi,%r14,8) - xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx - leaq -1(%r9),%r15 - orq %rcx,%rsi - - movdqu (%rsi),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,(%rdi) + pxor %xmm0,%xmm0 +.byte 102,72,15,110,224 + pcmpeqd %xmm5,%xmm5 + pshufd $0,%xmm4,%xmm4 + movq %r9,%r15 + pxor %xmm4,%xmm5 + shrq $2,%r15 + xorl %eax,%eax + jmp .Lcopy4x .align 16 .Lcopy4x: - movdqu 16(%rsi,%r14,1),%xmm2 - movdqu 32(%rsi,%r14,1),%xmm1 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) - movdqa %xmm0,32(%rsp,%r14,1) - movdqu %xmm1,32(%rdi,%r14,1) - leaq 32(%r14),%r14 + movdqa (%rsp,%rax,1),%xmm1 + movdqu (%rdi,%rax,1),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax,1),%xmm3 + movdqa %xmm0,(%rsp,%rax,1) + por %xmm2,%xmm1 + movdqu 16(%rdi,%rax,1),%xmm2 + movdqu %xmm1,(%rdi,%rax,1) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax,1) + por %xmm2,%xmm3 + movdqu %xmm3,16(%rdi,%rax,1) + leaq 32(%rax),%rax decq %r15 jnz .Lcopy4x - - shlq $2,%r9 - movdqu 16(%rsi,%r14,1),%xmm2 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont5.s b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont5.s index a2fccf088e75..0dd53512f9c9 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont5.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/bn/x86_64-mont5.s @@ -1,4 +1,4 @@ -.text +.text @@ -393,18 +393,19 @@ bn_mul_mont_gather5: jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x32/asm/crypto/buildinf.h index 373b56f42350..96db051a9b7b 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/buildinf.h @@ -35,4 +35,4 @@ static const char cflags[] = { 'i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-x32" -#define DATE "built on: Tue Apr 3 00:38:29 2018" +#define DATE "built on: Tue Aug 14 23:13:18 2018" diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/camellia/cmll-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/camellia/cmll-x86_64.s index 1117381f316d..1dead91b1752 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/camellia/cmll-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/camellia/cmll-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl Camellia_EncryptBlock diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/chacha/chacha-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/chacha/chacha-x86_64.s index 044b8f031efa..a9fed05fd7e3 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/chacha/chacha-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/chacha/chacha-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/ec/ecp_nistz256-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/ec/ecp_nistz256-x86_64.s index ce86d5d969f7..62a7ac611f37 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/ec/ecp_nistz256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl ecp_nistz256_precomputed .type ecp_nistz256_precomputed,@object .align 4096 @@ -2372,7 +2372,7 @@ ecp_nistz256_precomputed: .long 0x2a849870,0x4d33dd99,0x41576335,0xa716964b,0x179be0e5,0xff5e3a9b,0x83b13632,0x5b9d6b1b,0xa52f313b,0x3b8bd7d4,0x637a4660,0xc9dd95a0,0x0b3e218f,0x30035962,0xc7b28a3c,0xce1481a3 .long 0x43228d83,0xab41b43a,0x4ad63f99,0x24ae1c30,0x46a51229,0x8e525f1a,0xcd26d2b4,0x14af860f,0x3f714aa1,0xd6baef61,0xeb78795e,0xf51865ad,0xe6a9d694,0xd3e21fce,0x8a37b527,0x82ceb1dd .size ecp_nistz256_precomputed,.-ecp_nistz256_precomputed -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/md5/md5-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/md5/md5-x86_64.s index 0aa90515d6c9..0defe666bb75 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/md5/md5-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/md5/md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl md5_block_asm_data_order diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/modes/aesni-gcm-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/modes/aesni-gcm-x86_64.s index d1a1c895a39b..21e49925f1ae 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/modes/aesni-gcm-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _aesni_ctr32_ghash_6x,@function .align 32 diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/modes/ghash-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/modes/ghash-x86_64.s index 10f5987415a1..0116ef1c94c4 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/modes/ghash-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/modes/ghash-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl gcm_gmult_4bit diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/poly1305/poly1305-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/poly1305/poly1305-x86_64.s index 0d401b7e47b4..5a05965c8092 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/poly1305/poly1305-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/poly1305/poly1305-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-md5-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-md5-x86_64.s index 9c7110f4ef09..aab3c6db13d9 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-md5-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl rc4_md5_enc diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-x86_64.s index bdd0da3bd138..781b48b9eb44 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/rc4/rc4-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl RC4 diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-mb-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-mb-x86_64.s index d2857f3288bf..d266d776ec66 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-x86_64.s index 195a148bb9b2..dbeebed9a0a8 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha1_block_data_order diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-mb-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-mb-x86_64.s index bd72a459ab24..f2896b4d6e33 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-x86_64.s index 23b932e1de4a..8264a7dbdf10 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha256_block_data_order diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha512-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha512-x86_64.s index a1021c17a966..6f8488a38a9b 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha512-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/sha/sha512-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha512_block_data_order diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/whrlpool/wp-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/crypto/whrlpool/wp-x86_64.s index f83130ea6863..a4d55b6afc34 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/whrlpool/wp-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/whrlpool/wp-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl whirlpool_block .type whirlpool_block,@function diff --git a/deps/openssl/config/archs/linux-x32/asm/crypto/x86_64cpuid.s b/deps/openssl/config/archs/linux-x32/asm/crypto/x86_64cpuid.s index 5a109c6fd915..7e1f5e27408c 100644 --- a/deps/openssl/config/archs/linux-x32/asm/crypto/x86_64cpuid.s +++ b/deps/openssl/config/archs/linux-x32/asm/crypto/x86_64cpuid.s @@ -6,7 +6,7 @@ .hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,16,4 -.text +.text .globl OPENSSL_atomic_add .type OPENSSL_atomic_add,@function diff --git a/deps/openssl/config/archs/linux-x32/asm/engines/e_padlock-x86_64.s b/deps/openssl/config/archs/linux-x32/asm/engines/e_padlock-x86_64.s index 3e5ab736fd86..38c02c188ee1 100644 --- a/deps/openssl/config/archs/linux-x32/asm/engines/e_padlock-x86_64.s +++ b/deps/openssl/config/archs/linux-x32/asm/engines/e_padlock-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl padlock_capability .type padlock_capability,@function .align 16 @@ -1020,7 +1020,7 @@ padlock_ctr32_encrypt: .size padlock_ctr32_encrypt,.-padlock_ctr32_encrypt .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 -.data +.data .align 8 .Lpadlock_saved_context: .quad 0 diff --git a/deps/openssl/config/archs/linux-x32/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-x32/asm/include/openssl/opensslconf.h index 510bac93aeb7..546f077108ba 100644 --- a/deps/openssl/config/archs/linux-x32/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-x32/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-x32/asm/openssl.gypi b/deps/openssl/config/archs/linux-x32/asm/openssl.gypi index 99963ad8f427..0f877e845856 100644 --- a/deps/openssl/config/archs/linux-x32/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-x32/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-x32/no-asm/configdata.pm b/deps/openssl/config/archs/linux-x32/no-asm/configdata.pm index e6503fe62cfc..2e6370ba083f 100644 --- a/deps/openssl/config/archs/linux-x32/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x32/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-x32", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,8 +7402,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-x32/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x32/no-asm/crypto/buildinf.h index c45d8db17e99..ebbfd1af5d3e 100644 --- a/deps/openssl/config/archs/linux-x32/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x32/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-x32" -#define DATE "built on: Tue Apr 3 00:38:33 2018" +#define DATE "built on: Tue Aug 14 23:13:21 2018" diff --git a/deps/openssl/config/archs/linux-x32/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-x32/no-asm/include/openssl/opensslconf.h index cbe32f64d863..954003278886 100644 --- a/deps/openssl/config/archs/linux-x32/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-x32/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-x32/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-x32/no-asm/openssl.gypi index 014e893b9503..cf044b5b7fee 100644 --- a/deps/openssl/config/archs/linux-x32/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-x32/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm b/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm index 9e9bd8b78710..d28e588e85b6 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-x86_64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3994,6 +4010,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6332,6 +6354,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7331,6 +7359,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7503,8 +7535,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7525,10 +7557,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7684,6 +7729,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7724,7 +7770,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8106,6 +8155,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8226,9 +8278,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9257,6 +9318,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10737,6 +10802,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11274,6 +11343,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11644,6 +11714,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12649,6 +12720,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12998,6 +13078,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13006,6 +13094,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aes-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aes-x86_64.s index aa7a1ea1cf9b..488ae6d781ac 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aes-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _x86_64_AES_encrypt,@function .align 16 _x86_64_AES_encrypt: diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-mb-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-mb-x86_64.s index d49379783298..3dcd55d3f59a 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s index c7c53e8771e1..ca193ddb9ea4 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha1_enc diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s index 70eed05b00c1..427a1c7d1232 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha256_enc diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-x86_64.s index cd8b00f25983..e18f87c4e60c 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/aesni-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_encrypt .type aesni_encrypt,@function diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/bsaes-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/bsaes-x86_64.s index 0fd201167f64..c76c5a8afb47 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/bsaes-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/bsaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/vpaes-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/vpaes-x86_64.s index bf7c2b0b6f6b..d19329894079 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/vpaes-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/aes/vpaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-avx2.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-avx2.s index a2cccde63604..ee619092c9b7 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-avx2.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-avx2.s @@ -1,4 +1,4 @@ -.text +.text .globl rsaz_1024_sqr_avx2 .type rsaz_1024_sqr_avx2,@function diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-x86_64.s index b6797a68498e..795cebe1d743 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/rsaz-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-gf2m.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-gf2m.s index f4e5337565bb..a0b78a0565f7 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-gf2m.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-gf2m.s @@ -1,4 +1,4 @@ -.text +.text .type _mul_1x1,@function .align 16 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont.s index d19d4662b492..3a78cd844090 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont.s @@ -1,4 +1,4 @@ -.text +.text @@ -197,30 +197,30 @@ bn_mul_mont: xorq %r14,%r14 movq (%rsp),%rax - leaq (%rsp),%rsi movq %r9,%r15 - jmp .Lsub + .align 16 .Lsub: sbbq (%rcx,%r14,8),%rax movq %rax,(%rdi,%r14,8) - movq 8(%rsi,%r14,8),%rax + movq 8(%rsp,%r14,8),%rax leaq 1(%r14),%r14 decq %r15 jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax - movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx + movq %r9,(%rsp,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy @@ -574,10 +574,10 @@ bn_mul4x_mont: cmpq %r9,%r14 jb .Louter4x movq 16(%rsp,%r9,8),%rdi + leaq -4(%r9),%r15 movq 0(%rsp),%rax - pxor %xmm0,%xmm0 movq 8(%rsp),%rdx - shrq $2,%r9 + shrq $2,%r15 leaq (%rsp),%rsi xorq %r14,%r14 @@ -585,9 +585,7 @@ bn_mul4x_mont: movq 16(%rsi),%rbx movq 24(%rsi),%rbp sbbq 8(%rcx),%rdx - leaq -1(%r9),%r15 - jmp .Lsub4x -.align 16 + .Lsub4x: movq %rax,0(%rdi,%r14,8) movq %rdx,8(%rdi,%r14,8) @@ -614,34 +612,35 @@ bn_mul4x_mont: sbbq $0,%rax movq %rbp,24(%rdi,%r14,8) - xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx - leaq -1(%r9),%r15 - orq %rcx,%rsi - - movdqu (%rsi),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,(%rdi) + pxor %xmm0,%xmm0 +.byte 102,72,15,110,224 + pcmpeqd %xmm5,%xmm5 + pshufd $0,%xmm4,%xmm4 + movq %r9,%r15 + pxor %xmm4,%xmm5 + shrq $2,%r15 + xorl %eax,%eax + jmp .Lcopy4x .align 16 .Lcopy4x: - movdqu 16(%rsi,%r14,1),%xmm2 - movdqu 32(%rsi,%r14,1),%xmm1 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) - movdqa %xmm0,32(%rsp,%r14,1) - movdqu %xmm1,32(%rdi,%r14,1) - leaq 32(%r14),%r14 + movdqa (%rsp,%rax,1),%xmm1 + movdqu (%rdi,%rax,1),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax,1),%xmm3 + movdqa %xmm0,(%rsp,%rax,1) + por %xmm2,%xmm1 + movdqu 16(%rdi,%rax,1),%xmm2 + movdqu %xmm1,(%rdi,%rax,1) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax,1) + por %xmm2,%xmm3 + movdqu %xmm3,16(%rdi,%rax,1) + leaq 32(%rax),%rax decq %r15 jnz .Lcopy4x - - shlq $2,%r9 - movdqu 16(%rsi,%r14,1),%xmm2 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont5.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont5.s index a2fccf088e75..0dd53512f9c9 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont5.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/bn/x86_64-mont5.s @@ -1,4 +1,4 @@ -.text +.text @@ -393,18 +393,19 @@ bn_mul_mont_gather5: jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h index 4e13db139d16..3adfc6b90d72 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h @@ -35,4 +35,4 @@ static const char cflags[] = { 'i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 3 00:38:34 2018" +#define DATE "built on: Tue Aug 14 23:13:22 2018" diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/camellia/cmll-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/camellia/cmll-x86_64.s index 1117381f316d..1dead91b1752 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/camellia/cmll-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/camellia/cmll-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl Camellia_EncryptBlock diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/chacha/chacha-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/chacha/chacha-x86_64.s index 044b8f031efa..a9fed05fd7e3 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/chacha/chacha-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/chacha/chacha-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s index ce86d5d969f7..62a7ac611f37 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/ec/ecp_nistz256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl ecp_nistz256_precomputed .type ecp_nistz256_precomputed,@object .align 4096 @@ -2372,7 +2372,7 @@ ecp_nistz256_precomputed: .long 0x2a849870,0x4d33dd99,0x41576335,0xa716964b,0x179be0e5,0xff5e3a9b,0x83b13632,0x5b9d6b1b,0xa52f313b,0x3b8bd7d4,0x637a4660,0xc9dd95a0,0x0b3e218f,0x30035962,0xc7b28a3c,0xce1481a3 .long 0x43228d83,0xab41b43a,0x4ad63f99,0x24ae1c30,0x46a51229,0x8e525f1a,0xcd26d2b4,0x14af860f,0x3f714aa1,0xd6baef61,0xeb78795e,0xf51865ad,0xe6a9d694,0xd3e21fce,0x8a37b527,0x82ceb1dd .size ecp_nistz256_precomputed,.-ecp_nistz256_precomputed -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/md5/md5-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/md5/md5-x86_64.s index 0aa90515d6c9..0defe666bb75 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/md5/md5-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/md5/md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl md5_block_asm_data_order diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s index d1a1c895a39b..21e49925f1ae 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/aesni-gcm-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _aesni_ctr32_ghash_6x,@function .align 32 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/ghash-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/ghash-x86_64.s index 10f5987415a1..0116ef1c94c4 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/ghash-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/modes/ghash-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl gcm_gmult_4bit diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/poly1305/poly1305-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/poly1305/poly1305-x86_64.s index 5662696481ed..8b2e361ea1cd 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/poly1305/poly1305-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/poly1305/poly1305-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s index 9c7110f4ef09..aab3c6db13d9 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl rc4_md5_enc diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-x86_64.s index bdd0da3bd138..781b48b9eb44 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/rc4/rc4-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl RC4 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-mb-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-mb-x86_64.s index d2857f3288bf..d266d776ec66 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-x86_64.s index 195a148bb9b2..dbeebed9a0a8 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha1_block_data_order diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-mb-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-mb-x86_64.s index bd72a459ab24..f2896b4d6e33 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-mb-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-x86_64.s index 23b932e1de4a..8264a7dbdf10 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha256_block_data_order diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha512-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha512-x86_64.s index a1021c17a966..6f8488a38a9b 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha512-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/sha/sha512-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha512_block_data_order diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/whrlpool/wp-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/whrlpool/wp-x86_64.s index f83130ea6863..a4d55b6afc34 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/whrlpool/wp-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/whrlpool/wp-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl whirlpool_block .type whirlpool_block,@function diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/x86_64cpuid.s b/deps/openssl/config/archs/linux-x86_64/asm/crypto/x86_64cpuid.s index 5a109c6fd915..7e1f5e27408c 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/x86_64cpuid.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/x86_64cpuid.s @@ -6,7 +6,7 @@ .hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,16,4 -.text +.text .globl OPENSSL_atomic_add .type OPENSSL_atomic_add,@function diff --git a/deps/openssl/config/archs/linux-x86_64/asm/engines/e_padlock-x86_64.s b/deps/openssl/config/archs/linux-x86_64/asm/engines/e_padlock-x86_64.s index 3e5ab736fd86..38c02c188ee1 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/engines/e_padlock-x86_64.s +++ b/deps/openssl/config/archs/linux-x86_64/asm/engines/e_padlock-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl padlock_capability .type padlock_capability,@function .align 16 @@ -1020,7 +1020,7 @@ padlock_ctr32_encrypt: .size padlock_ctr32_encrypt,.-padlock_ctr32_encrypt .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 -.data +.data .align 8 .Lpadlock_saved_context: .quad 0 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslconf.h index 9df0f86ed6ed..7dd2101053aa 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-x86_64/asm/openssl.gypi b/deps/openssl/config/archs/linux-x86_64/asm/openssl.gypi index 69169eaaeeff..25ff25754fe5 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-x86_64/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm b/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm index 2e79f043b3a2..769b53bc82cb 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux-x86_64", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,8 +7402,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h index 131636a64151..d3c92d276d20 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 3 00:38:38 2018" +#define DATE "built on: Tue Aug 14 23:13:26 2018" diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h index e20916814d70..7b122bd86ee5 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/openssl.gypi b/deps/openssl/config/archs/linux-x86_64/no-asm/openssl.gypi index 7232d4e55eab..62a7e2ade24d 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm b/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm index 47d017c24af8..24b9835113f3 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm +++ b/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux32-s390x", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3934,6 +3950,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6227,6 +6249,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7214,6 +7242,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7408,10 +7440,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7567,6 +7612,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7607,7 +7653,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7989,6 +8038,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8109,9 +8161,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9104,6 +9165,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10564,6 +10629,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11084,6 +11153,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11449,6 +11519,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12452,6 +12523,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12801,6 +12881,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12809,6 +12897,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/aes/aes-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/aes/aes-s390x.S index 71138f817600..541636080ca3 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/aes/aes-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/aes/aes-s390x.S @@ -458,7 +458,7 @@ _s390x_AES_encrypt: or %r9,%r1 or %r2,%r6 or %r3,%r7 - + srlg %r5,%r10,5 # i0 srlg %r6,%r10,13 # i1 nr %r5,%r0 @@ -511,7 +511,7 @@ _s390x_AES_encrypt: x %r10,24(%r4) x %r11,28(%r4) - br %r14 + br %r14 .size _s390x_AES_encrypt,.-_s390x_AES_encrypt .type AES_Td,@object .align 256 @@ -1015,7 +1015,7 @@ _s390x_AES_decrypt: x %r10,24(%r4) x %r11,28(%r4) - br %r14 + br %r14 .size _s390x_AES_decrypt,.-_s390x_AES_decrypt # void AES_set_encrypt_key(const unsigned char *in, int bits, # AES_KEY *key) { @@ -1496,7 +1496,7 @@ AES_cbc_encrypt: .Lcbc_enc_done: l %r6,6*4(%r15) st %r8,0(%r6) - st %r9,4(%r6) + st %r9,4(%r6) st %r10,8(%r6) st %r11,12(%r6) @@ -1744,7 +1744,7 @@ _s390x_xts_km: llgc %r3,2*4-1(%r15) nill %r3,0x0f # %r3%=16 br %r14 - + .align 16 .Lxts_km_vanilla: # prepare and allocate stack frame at the top of 4K page @@ -1961,7 +1961,7 @@ AES_xts_encrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,80+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 @@ -2012,7 +2012,7 @@ AES_xts_encrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,80+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 @@ -2190,7 +2190,7 @@ AES_xts_decrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,80+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/bn/s390x-mont.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/bn/s390x-mont.S index cb7743cfea47..0a6c67545a6e 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/bn/s390x-mont.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/bn/s390x-mont.S @@ -152,16 +152,16 @@ bn_mul_mont: brct %r14,.Lsub lghi %r8,0 slbgr %r12,%r8 # handle upmost carry - - ngr %r3,%r12 - lghi %r5,-1 - xgr %r5,%r12 - ngr %r5,%r2 - ogr %r3,%r5 # ap=borrow?tp:rp + lghi %r13,-1 + xgr %r13,%r12 la %r7,0(%r0) lgr %r14,%r1 -.Lcopy: lg %r9,0(%r7,%r3) # copy or in-place refresh +.Lcopy: lg %r8,96(%r7,%r15) # conditional copy + lg %r9,0(%r7,%r2) + ngr %r8,%r12 + ngr %r9,%r13 + ogr %r9,%r8 rllg %r9,%r9,32 stg %r7,96(%r7,%r15) # zap tp stg %r9,0(%r7,%r2) diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h index 64e7f072a3b2..a9705431d266 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h @@ -30,4 +30,4 @@ static const char cflags[] = { 'e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 3 00:38:44 2018" +#define DATE "built on: Tue Aug 14 23:13:32 2018" diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/modes/ghash-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/modes/ghash-s390x.S index 88c26122ccab..4a006d9c5d23 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/modes/ghash-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/modes/ghash-s390x.S @@ -41,7 +41,7 @@ gcm_ghash_4bit: lg %r0,0+1(%r2) lghi %r12,0 .Louter: - xg %r0,0(%r4) # Xi ^= inp + xg %r0,0(%r4) # Xi ^= inp xg %r1,8(%r4) xgr %r0,%r12 stg %r1,8+1(%r2) diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha256-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha256-s390x.S index cf1b7819a1fe..f02c83663390 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha256-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha256-s390x.S @@ -1234,7 +1234,7 @@ sha256_block_data_order: cl %r3,176(%r15) jne .Lloop - lm %r6,%r15,184(%r15) + lm %r6,%r15,184(%r15) br %r14 .size sha256_block_data_order,.-sha256_block_data_order .string "SHA256 block transform for s390x, CRYPTOGAMS by " diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha512-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha512-s390x.S index 6900891667c1..3d682e8658bc 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha512-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/sha512-s390x.S @@ -1258,7 +1258,7 @@ sha512_block_data_order: cl %r3,240(%r15) jne .Lloop - lm %r6,%r15,248(%r15) + lm %r6,%r15,248(%r15) br %r14 .size sha512_block_data_order,.-sha512_block_data_order .string "SHA512 block transform for s390x, CRYPTOGAMS by " diff --git a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslconf.h index 2f9817e43b12..21dd8cc643b8 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux32-s390x/asm/openssl.gypi b/deps/openssl/config/archs/linux32-s390x/asm/openssl.gypi index ffff267d09d0..4aa5f86c81d6 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux32-s390x/asm/openssl.gypi @@ -216,6 +216,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -575,6 +576,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm b/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm index 5d1929317bf8..9e1c171d287f 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux32-s390x", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3927,6 +3943,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6205,6 +6227,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7192,6 +7220,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7365,8 +7397,8 @@ our %unified_info = ( "test/testutil.o" => [ "crypto/include", - "test", "include", + "test", ".", ], "test/threadstest.o" => @@ -7386,10 +7418,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7545,6 +7590,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7585,7 +7631,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7967,6 +8016,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8087,9 +8139,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9074,6 +9135,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10514,6 +10579,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11032,6 +11101,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11392,6 +11462,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12395,6 +12466,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12744,6 +12824,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12752,6 +12840,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h index d79eb3ca2ac6..a54f16336785 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 3 00:38:45 2018" +#define DATE "built on: Tue Aug 14 23:13:33 2018" diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h index 1f0c62b3c912..5ba3b88d4e5f 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/openssl.gypi b/deps/openssl/config/archs/linux32-s390x/no-asm/openssl.gypi index d3be0776df61..606925668af0 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/openssl.gypi @@ -218,6 +218,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -578,6 +579,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm b/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm index ebdafeb184a6..3541bdd57268 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux64-s390x", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3934,6 +3950,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6227,6 +6249,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7214,6 +7242,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7386,8 +7418,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", + "test", "include", ".", ], @@ -7408,10 +7440,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7567,6 +7612,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7607,7 +7653,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7989,6 +8038,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8109,9 +8161,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9104,6 +9165,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10564,6 +10629,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11084,6 +11153,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11449,6 +11519,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12452,6 +12523,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12801,6 +12881,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12809,6 +12897,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/aes/aes-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/aes/aes-s390x.S index 1a1e4c224d13..a44e72d0475e 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/aes/aes-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/aes/aes-s390x.S @@ -458,7 +458,7 @@ _s390x_AES_encrypt: or %r9,%r1 or %r2,%r6 or %r3,%r7 - + srlg %r5,%r10,5 # i0 srlg %r6,%r10,13 # i1 nr %r5,%r0 @@ -511,7 +511,7 @@ _s390x_AES_encrypt: x %r10,24(%r4) x %r11,28(%r4) - br %r14 + br %r14 .size _s390x_AES_encrypt,.-_s390x_AES_encrypt .type AES_Td,@object .align 256 @@ -1015,7 +1015,7 @@ _s390x_AES_decrypt: x %r10,24(%r4) x %r11,28(%r4) - br %r14 + br %r14 .size _s390x_AES_decrypt,.-_s390x_AES_decrypt # void AES_set_encrypt_key(const unsigned char *in, int bits, # AES_KEY *key) { @@ -1496,7 +1496,7 @@ AES_cbc_encrypt: .Lcbc_enc_done: lg %r6,6*8(%r15) st %r8,0(%r6) - st %r9,4(%r6) + st %r9,4(%r6) st %r10,8(%r6) st %r11,12(%r6) @@ -1744,7 +1744,7 @@ _s390x_xts_km: llgc %r3,2*8-1(%r15) nill %r3,0x0f # %r3%=16 br %r14 - + .align 16 .Lxts_km_vanilla: # prepare and allocate stack frame at the top of 4K page @@ -1960,7 +1960,7 @@ AES_xts_encrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,144+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 @@ -2011,7 +2011,7 @@ AES_xts_encrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,144+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 @@ -2188,7 +2188,7 @@ AES_xts_decrypt: xgr %r9,%r1 lrvgr %r9,%r9 # flip byte order lrvgr %r11,%r11 - srlg %r8,%r9,32 # smash the tweak to 4x32-bits + srlg %r8,%r9,32 # smash the tweak to 4x32-bits stg %r9,144+0(%r15) # save the tweak llgfr %r9,%r9 srlg %r10,%r11,32 diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-gf2m.s b/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-gf2m.s index e0b0822cae59..1b9042665957 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-gf2m.s +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-gf2m.s @@ -206,7 +206,7 @@ bn_GF2m_mul_2x2: xgr %r4,%r7 xgr %r3,%r6 xgr %r4,%r8 - xgr %r3,%r9 + xgr %r3,%r9 xgr %r4,%r9 xgr %r3,%r4 stg %r4,16(%r2) diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-mont.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-mont.S index c4ee541906f9..b8dea0a66f38 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-mont.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/bn/s390x-mont.S @@ -26,12 +26,12 @@ bn_mul_mont: la %r4,0(%r7,%r4) # restore %r4 ahi %r1,-1 # adjust %r1 for inner loop lg %r6,0(%r6) # pull n0 - + lg %r2,0(%r4) - + lg %r9,0(%r3) - + mlgr %r8,%r2 # ap[0]*bp[0] lgr %r12,%r8 @@ -39,7 +39,7 @@ bn_mul_mont: msgr %r0,%r6 lg %r11,0(%r5) # - + mlgr %r10,%r0 # np[0]*m1 algr %r11,%r9 # +="tp[0]" lghi %r13,0 @@ -51,14 +51,14 @@ bn_mul_mont: .align 16 .L1st: lg %r9,0(%r7,%r3) - + mlgr %r8,%r2 # ap[j]*bp[0] algr %r9,%r12 lghi %r12,0 alcgr %r12,%r8 lg %r11,0(%r7,%r5) - + mlgr %r10,%r0 # np[j]*m1 algr %r11,%r13 lghi %r13,0 @@ -79,9 +79,9 @@ bn_mul_mont: .Louter: lg %r2,0(%r4) # bp[i] - + lg %r9,0(%r3) - + mlgr %r8,%r2 # ap[0]*bp[i] alg %r9,160(%r15) # +=tp[0] lghi %r12,0 @@ -91,7 +91,7 @@ bn_mul_mont: msgr %r0,%r6 # tp[0]*n0 lg %r11,0(%r5) # np[0] - + mlgr %r10,%r0 # np[0]*m1 algr %r11,%r9 # +="tp[0]" lghi %r13,0 @@ -103,7 +103,7 @@ bn_mul_mont: .align 16 .Linner: lg %r9,0(%r7,%r3) - + mlgr %r8,%r2 # ap[j]*bp[i] algr %r9,%r12 lghi %r12,0 @@ -112,7 +112,7 @@ bn_mul_mont: alcgr %r12,%r8 lg %r11,0(%r7,%r5) - + mlgr %r10,%r0 # np[j]*m1 algr %r11,%r13 lghi %r13,0 @@ -145,24 +145,24 @@ bn_mul_mont: lr %r14,%r1 .Lsub: lg %r9,0(%r7,%r3) lg %r11,0(%r7,%r5) - + slbgr %r9,%r11 stg %r9,0(%r7,%r2) la %r7,8(%r7) brct %r14,.Lsub lghi %r8,0 slbgr %r12,%r8 # handle upmost carry - - ngr %r3,%r12 - lghi %r5,-1 - xgr %r5,%r12 - ngr %r5,%r2 - ogr %r3,%r5 # ap=borrow?tp:rp + lghi %r13,-1 + xgr %r13,%r12 la %r7,0(%r0) lgr %r14,%r1 -.Lcopy: lg %r9,0(%r7,%r3) # copy or in-place refresh - +.Lcopy: lg %r8,160(%r7,%r15) # conditional copy + lg %r9,0(%r7,%r2) + ngr %r8,%r12 + ngr %r9,%r13 + ogr %r9,%r8 + stg %r7,160(%r7,%r15) # zap tp stg %r9,0(%r7,%r2) la %r7,8(%r7) diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h index 0539055a2cbc..6358018f989b 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h @@ -30,4 +30,4 @@ static const char cflags[] = { 'e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 3 00:38:46 2018" +#define DATE "built on: Tue Aug 14 23:13:34 2018" diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/modes/ghash-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/modes/ghash-s390x.S index a1c021759060..6dfaa76c3530 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/modes/ghash-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/modes/ghash-s390x.S @@ -40,7 +40,7 @@ gcm_ghash_4bit: lg %r0,0+1(%r2) lghi %r12,0 .Louter: - xg %r0,0(%r4) # Xi ^= inp + xg %r0,0(%r4) # Xi ^= inp xg %r1,8(%r4) xgr %r0,%r12 stg %r1,8+1(%r2) diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha256-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha256-s390x.S index 28cbb63752cf..e66c672764f6 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha256-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha256-s390x.S @@ -1234,7 +1234,7 @@ sha256_block_data_order: clg %r3,256(%r15) jne .Lloop - lmg %r6,%r15,272(%r15) + lmg %r6,%r15,272(%r15) br %r14 .size sha256_block_data_order,.-sha256_block_data_order .string "SHA256 block transform for s390x, CRYPTOGAMS by " diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha512-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha512-s390x.S index 77c99e416b16..5ff5c6bf9f00 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha512-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/sha512-s390x.S @@ -1258,7 +1258,7 @@ sha512_block_data_order: clg %r3,320(%r15) jne .Lloop - lmg %r6,%r15,336(%r15) + lmg %r6,%r15,336(%r15) br %r14 .size sha512_block_data_order,.-sha512_block_data_order .string "SHA512 block transform for s390x, CRYPTOGAMS by " diff --git a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslconf.h index 3976dadb19ca..8bd973e750d6 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux64-s390x/asm/openssl.gypi b/deps/openssl/config/archs/linux64-s390x/asm/openssl.gypi index 30272e9dbcf7..2841831fe7c6 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/openssl.gypi +++ b/deps/openssl/config/archs/linux64-s390x/asm/openssl.gypi @@ -216,6 +216,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -575,6 +576,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm b/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm index 5c9cbdcf00c6..c62c43c1dea0 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "linux64-s390x", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h index a52b3fe333d7..3295c8aa2b81 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 3 00:38:47 2018" +#define DATE "built on: Tue Aug 14 23:13:35 2018" diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h index af3a003d5193..08bf3d43940b 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/openssl.gypi b/deps/openssl/config/archs/linux64-s390x/no-asm/openssl.gypi index 37430ef795ae..aa52ca679b43 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm b/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm index bebfecbdced6..ae2f6b4ec751 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "solaris-x86-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3945,6 +3961,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6271,6 +6293,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7270,6 +7298,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7442,9 +7474,9 @@ our %unified_info = ( ], "test/testutil.o" => [ - "test", "crypto/include", "include", + "test", ".", ], "test/threadstest.o" => @@ -7464,10 +7496,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7623,6 +7668,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7663,7 +7709,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8045,6 +8094,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8165,9 +8217,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9164,6 +9225,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10636,6 +10701,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11165,6 +11234,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11533,6 +11603,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12538,6 +12609,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12887,6 +12967,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12895,6 +12983,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/bn/x86-mont.s b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/bn/x86-mont.s index 945d9e58248a..8212ff0825f5 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/bn/x86-mont.s +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/bn/x86-mont.s @@ -445,16 +445,18 @@ bn_mul_mont: leal 1(%edx),%edx jge .L017sub sbbl $0,%eax - andl %eax,%esi - notl %eax - movl %edi,%ebp - andl %eax,%ebp - orl %ebp,%esi + movl $-1,%edx + xorl %eax,%edx + jmp .L018copy .align 16 .L018copy: - movl (%esi,%ebx,4),%eax - movl %eax,(%edi,%ebx,4) + movl 32(%esp,%ebx,4),%esi + movl (%edi,%ebx,4),%ebp movl %ecx,32(%esp,%ebx,4) + andl %eax,%esi + andl %edx,%ebp + orl %esi,%ebp + movl %ebp,(%edi,%ebx,4) decl %ebx jge .L018copy movl 24(%esp),%esp diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h index 864103a8dc6d..f3e98cfc6cbc 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h @@ -37,4 +37,4 @@ static const char cflags[] = { '"',' ','\0' }; #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 3 00:38:47 2018" +#define DATE "built on: Tue Aug 14 23:13:35 2018" diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/ec/ecp_nistz256-x86.s b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/ec/ecp_nistz256-x86.s index cbccc5ebf7a2..9092d6632152 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/ec/ecp_nistz256-x86.s +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/ec/ecp_nistz256-x86.s @@ -3857,7 +3857,7 @@ ecp_nistz256_scatter_w7: movl 20(%esp),%edi movl 24(%esp),%esi movl 28(%esp),%ebp - leal -1(%edi,%ebp,1),%edi + leal (%edi,%ebp,1),%edi movl $16,%ebp .L007scatter_w7_loop: movl (%esi),%eax diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h index e819a68f0b6a..b9d6509c0b95 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/openssl.gypi b/deps/openssl/config/archs/solaris-x86-gcc/asm/openssl.gypi index af1d87642d06..7fb2ba08cdf9 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/openssl.gypi +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/openssl.gypi @@ -211,6 +211,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -567,6 +568,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm index f6f187ac6d24..85b7ff65f20a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "solaris-x86-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1075,6 +1075,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1241,10 +1245,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3931,6 +3947,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6209,6 +6231,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7196,6 +7224,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7390,10 +7422,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7549,6 +7594,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7589,7 +7635,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7971,6 +8020,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8091,9 +8143,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9082,6 +9143,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10522,6 +10587,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11041,6 +11110,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11401,6 +11471,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12404,6 +12475,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12753,6 +12833,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12761,6 +12849,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h index e3ba51d54c11..7b32dc7d3eae 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 3 00:38:49 2018" +#define DATE "built on: Tue Aug 14 23:13:37 2018" diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h index b20dbd02123e..d0fb48f465fe 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/openssl.gypi b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/openssl.gypi index 4d880dad4e24..3c8ab88f627b 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm index 4f080d801314..ed79783b33d2 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "solaris64-x86_64-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1078,6 +1078,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1244,10 +1248,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3994,6 +4010,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6332,6 +6354,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7331,6 +7359,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7503,8 +7535,8 @@ our %unified_info = ( ], "test/testutil.o" => [ - "crypto/include", "test", + "crypto/include", "include", ".", ], @@ -7525,10 +7557,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7684,6 +7729,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7724,7 +7770,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -8106,6 +8155,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8226,9 +8278,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9257,6 +9318,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10737,6 +10802,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11274,6 +11343,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11644,6 +11714,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12649,6 +12720,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12998,6 +13078,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -13006,6 +13094,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aes-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aes-x86_64.s index aa7a1ea1cf9b..488ae6d781ac 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aes-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _x86_64_AES_encrypt,@function .align 16 _x86_64_AES_encrypt: diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-mb-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-mb-x86_64.s index d49379783298..3dcd55d3f59a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-mb-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha1-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha1-x86_64.s index c7c53e8771e1..ca193ddb9ea4 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha1_enc diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha256-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha256-x86_64.s index 70eed05b00c1..427a1c7d1232 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_cbc_sha256_enc diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-x86_64.s index cd8b00f25983..e18f87c4e60c 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/aesni-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl aesni_encrypt .type aesni_encrypt,@function diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/bsaes-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/bsaes-x86_64.s index 0fd201167f64..c76c5a8afb47 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/bsaes-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/bsaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/vpaes-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/vpaes-x86_64.s index bf7c2b0b6f6b..d19329894079 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/vpaes-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/aes/vpaes-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-avx2.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-avx2.s index a2cccde63604..ee619092c9b7 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-avx2.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-avx2.s @@ -1,4 +1,4 @@ -.text +.text .globl rsaz_1024_sqr_avx2 .type rsaz_1024_sqr_avx2,@function diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-x86_64.s index b6797a68498e..795cebe1d743 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/rsaz-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-gf2m.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-gf2m.s index f4e5337565bb..a0b78a0565f7 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-gf2m.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-gf2m.s @@ -1,4 +1,4 @@ -.text +.text .type _mul_1x1,@function .align 16 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont.s index d19d4662b492..3a78cd844090 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont.s @@ -1,4 +1,4 @@ -.text +.text @@ -197,30 +197,30 @@ bn_mul_mont: xorq %r14,%r14 movq (%rsp),%rax - leaq (%rsp),%rsi movq %r9,%r15 - jmp .Lsub + .align 16 .Lsub: sbbq (%rcx,%r14,8),%rax movq %rax,(%rdi,%r14,8) - movq 8(%rsi,%r14,8),%rax + movq 8(%rsp,%r14,8),%rax leaq 1(%r14),%r14 decq %r15 jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax - movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx + movq %r9,(%rsp,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy @@ -574,10 +574,10 @@ bn_mul4x_mont: cmpq %r9,%r14 jb .Louter4x movq 16(%rsp,%r9,8),%rdi + leaq -4(%r9),%r15 movq 0(%rsp),%rax - pxor %xmm0,%xmm0 movq 8(%rsp),%rdx - shrq $2,%r9 + shrq $2,%r15 leaq (%rsp),%rsi xorq %r14,%r14 @@ -585,9 +585,7 @@ bn_mul4x_mont: movq 16(%rsi),%rbx movq 24(%rsi),%rbp sbbq 8(%rcx),%rdx - leaq -1(%r9),%r15 - jmp .Lsub4x -.align 16 + .Lsub4x: movq %rax,0(%rdi,%r14,8) movq %rdx,8(%rdi,%r14,8) @@ -614,34 +612,35 @@ bn_mul4x_mont: sbbq $0,%rax movq %rbp,24(%rdi,%r14,8) - xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx - leaq -1(%r9),%r15 - orq %rcx,%rsi - - movdqu (%rsi),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,(%rdi) + pxor %xmm0,%xmm0 +.byte 102,72,15,110,224 + pcmpeqd %xmm5,%xmm5 + pshufd $0,%xmm4,%xmm4 + movq %r9,%r15 + pxor %xmm4,%xmm5 + shrq $2,%r15 + xorl %eax,%eax + jmp .Lcopy4x .align 16 .Lcopy4x: - movdqu 16(%rsi,%r14,1),%xmm2 - movdqu 32(%rsi,%r14,1),%xmm1 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) - movdqa %xmm0,32(%rsp,%r14,1) - movdqu %xmm1,32(%rdi,%r14,1) - leaq 32(%r14),%r14 + movdqa (%rsp,%rax,1),%xmm1 + movdqu (%rdi,%rax,1),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax,1),%xmm3 + movdqa %xmm0,(%rsp,%rax,1) + por %xmm2,%xmm1 + movdqu 16(%rdi,%rax,1),%xmm2 + movdqu %xmm1,(%rdi,%rax,1) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax,1) + por %xmm2,%xmm3 + movdqu %xmm3,16(%rdi,%rax,1) + leaq 32(%rax),%rax decq %r15 jnz .Lcopy4x - - shlq $2,%r9 - movdqu 16(%rsi,%r14,1),%xmm2 - movdqa %xmm0,16(%rsp,%r14,1) - movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont5.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont5.s index a2fccf088e75..0dd53512f9c9 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont5.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/bn/x86_64-mont5.s @@ -1,4 +1,4 @@ -.text +.text @@ -393,18 +393,19 @@ bn_mul_mont_gather5: jnz .Lsub sbbq $0,%rax + movq $-1,%rbx + xorq %rax,%rbx xorq %r14,%r14 - andq %rax,%rsi - notq %rax - movq %rdi,%rcx - andq %rax,%rcx movq %r9,%r15 - orq %rcx,%rsi -.align 16 + .Lcopy: - movq (%rsi,%r14,8),%rax + movq (%rdi,%r14,8),%rcx + movq (%rsp,%r14,8),%rdx + andq %rbx,%rcx + andq %rax,%rdx movq %r14,(%rsp,%r14,8) - movq %rax,(%rdi,%r14,8) + orq %rcx,%rdx + movq %rdx,(%rdi,%r14,8) leaq 1(%r14),%r14 subq $1,%r15 jnz .Lcopy diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h index e1b87d9f50a3..357c109a63d2 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h @@ -35,4 +35,4 @@ static const char cflags[] = { 'i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 3 00:38:50 2018" +#define DATE "built on: Tue Aug 14 23:13:38 2018" diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/camellia/cmll-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/camellia/cmll-x86_64.s index 1117381f316d..1dead91b1752 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/camellia/cmll-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/camellia/cmll-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl Camellia_EncryptBlock diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/chacha/chacha-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/chacha/chacha-x86_64.s index 044b8f031efa..a9fed05fd7e3 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/chacha/chacha-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/chacha/chacha-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/ec/ecp_nistz256-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/ec/ecp_nistz256-x86_64.s index ce86d5d969f7..62a7ac611f37 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/ec/ecp_nistz256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl ecp_nistz256_precomputed .type ecp_nistz256_precomputed,@object .align 4096 @@ -2372,7 +2372,7 @@ ecp_nistz256_precomputed: .long 0x2a849870,0x4d33dd99,0x41576335,0xa716964b,0x179be0e5,0xff5e3a9b,0x83b13632,0x5b9d6b1b,0xa52f313b,0x3b8bd7d4,0x637a4660,0xc9dd95a0,0x0b3e218f,0x30035962,0xc7b28a3c,0xce1481a3 .long 0x43228d83,0xab41b43a,0x4ad63f99,0x24ae1c30,0x46a51229,0x8e525f1a,0xcd26d2b4,0x14af860f,0x3f714aa1,0xd6baef61,0xeb78795e,0xf51865ad,0xe6a9d694,0xd3e21fce,0x8a37b527,0x82ceb1dd .size ecp_nistz256_precomputed,.-ecp_nistz256_precomputed -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/md5/md5-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/md5/md5-x86_64.s index 0aa90515d6c9..0defe666bb75 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/md5/md5-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/md5/md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl md5_block_asm_data_order diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/aesni-gcm-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/aesni-gcm-x86_64.s index d1a1c895a39b..21e49925f1ae 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/aesni-gcm-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .type _aesni_ctr32_ghash_6x,@function .align 32 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/ghash-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/ghash-x86_64.s index 10f5987415a1..0116ef1c94c4 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/ghash-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/modes/ghash-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl gcm_gmult_4bit diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/poly1305/poly1305-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/poly1305/poly1305-x86_64.s index 5662696481ed..8b2e361ea1cd 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/poly1305/poly1305-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/poly1305/poly1305-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-md5-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-md5-x86_64.s index 9c7110f4ef09..aab3c6db13d9 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-md5-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-md5-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .align 16 .globl rc4_md5_enc diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-x86_64.s index bdd0da3bd138..781b48b9eb44 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/rc4/rc4-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl RC4 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-mb-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-mb-x86_64.s index d2857f3288bf..d266d776ec66 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-mb-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-x86_64.s index 195a148bb9b2..dbeebed9a0a8 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha1-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha1_block_data_order diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-mb-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-mb-x86_64.s index bd72a459ab24..f2896b4d6e33 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-mb-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-mb-x86_64.s @@ -1,4 +1,4 @@ -.text +.text diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-x86_64.s index 23b932e1de4a..8264a7dbdf10 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha256-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha256_block_data_order diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha512-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha512-x86_64.s index a1021c17a966..6f8488a38a9b 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha512-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/sha/sha512-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl sha512_block_data_order diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/whrlpool/wp-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/whrlpool/wp-x86_64.s index f83130ea6863..a4d55b6afc34 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/whrlpool/wp-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/whrlpool/wp-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl whirlpool_block .type whirlpool_block,@function diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/x86_64cpuid.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/x86_64cpuid.s index 5a109c6fd915..7e1f5e27408c 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/x86_64cpuid.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/x86_64cpuid.s @@ -6,7 +6,7 @@ .hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,16,4 -.text +.text .globl OPENSSL_atomic_add .type OPENSSL_atomic_add,@function diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/engines/e_padlock-x86_64.s b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/engines/e_padlock-x86_64.s index 3e5ab736fd86..38c02c188ee1 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/engines/e_padlock-x86_64.s +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/engines/e_padlock-x86_64.s @@ -1,4 +1,4 @@ -.text +.text .globl padlock_capability .type padlock_capability,@function .align 16 @@ -1020,7 +1020,7 @@ padlock_ctr32_encrypt: .size padlock_ctr32_encrypt,.-padlock_ctr32_encrypt .byte 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 -.data +.data .align 8 .Lpadlock_saved_context: .quad 0 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h index 9df0f86ed6ed..7dd2101053aa 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/openssl.gypi b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/openssl.gypi index 46a2ed34cff8..2557943ad5cd 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/openssl.gypi +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/openssl.gypi @@ -215,6 +215,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -572,6 +573,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm index f0d822aa7d0f..3c550047ab39 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm @@ -56,8 +56,8 @@ our %config = ( shlib_version_number => "1.1", sourcedir => ".", target => "solaris64-x86_64-gcc", - version => "1.1.0h", - version_num => "0x1010008fL", + version => "1.1.0i", + version_num => "0x1010009fL", ); our %target = ( @@ -1077,6 +1077,10 @@ our %unified_info = ( [ "libcrypto", ], + "test/errtest" => + [ + "libcrypto", + ], "test/evp_extra_test" => [ "libcrypto", @@ -1243,10 +1247,22 @@ our %unified_info = ( [ "libcrypto", ], + "test/versions" => + [ + "libcrypto", + ], "test/wp_test" => [ "libcrypto", ], + "test/x509_dup_cert_test" => + [ + "libcrypto", + ], + "test/x509_time_test" => + [ + "libcrypto", + ], "test/x509aux" => [ "libcrypto", @@ -3933,6 +3949,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/conf/conf_ssl.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/cpt_err.o" => [ ".", @@ -6211,6 +6233,12 @@ our %unified_info = ( "crypto/include", "include", ], + "crypto/x509/x509_meth.o" => + [ + ".", + "crypto/include", + "include", + ], "crypto/x509/x509_obj.o" => [ ".", @@ -7198,6 +7226,10 @@ our %unified_info = ( [ "include", ], + "test/errtest.o" => + [ + "include", + ], "test/evp_extra_test.o" => [ "include", @@ -7370,9 +7402,9 @@ our %unified_info = ( ], "test/testutil.o" => [ + "test", "crypto/include", "include", - "test", ".", ], "test/threadstest.o" => @@ -7392,10 +7424,23 @@ our %unified_info = ( [ "include", ], + "test/versions.o" => + [ + "include", + ], "test/wp_test.o" => [ "include", ], + "test/x509_dup_cert_test.o" => + [ + "include", + ], + "test/x509_time_test.o" => + [ + ".", + "include", + ], "test/x509aux.o" => [ "include", @@ -7551,6 +7596,7 @@ our %unified_info = ( "test/ecdsatest", "test/ectest", "test/enginetest", + "test/errtest", "test/evp_extra_test", "test/evp_test", "test/exdatatest", @@ -7591,7 +7637,10 @@ our %unified_info = ( "test/v3ext", "test/v3nametest", "test/verify_extra_test", + "test/versions", "test/wp_test", + "test/x509_dup_cert_test", + "test/x509_time_test", "test/x509aux", ], "rawlines" => @@ -7973,6 +8022,9 @@ our %unified_info = ( "test/enginetest" => [ ], + "test/errtest" => + [ + ], "test/evp_extra_test" => [ ], @@ -8093,9 +8145,18 @@ our %unified_info = ( "test/verify_extra_test" => [ ], + "test/versions" => + [ + ], "test/wp_test" => [ ], + "test/x509_dup_cert_test" => + [ + ], + "test/x509_time_test" => + [ + ], "test/x509aux" => [ ], @@ -9084,6 +9145,10 @@ our %unified_info = ( [ "crypto/conf/conf_sap.c", ], + "crypto/conf/conf_ssl.o" => + [ + "crypto/conf/conf_ssl.c", + ], "crypto/cpt_err.o" => [ "crypto/cpt_err.c", @@ -10524,6 +10589,10 @@ our %unified_info = ( [ "crypto/x509/x509_lu.c", ], + "crypto/x509/x509_meth.o" => + [ + "crypto/x509/x509_meth.c", + ], "crypto/x509/x509_obj.o" => [ "crypto/x509/x509_obj.c", @@ -11043,6 +11112,7 @@ our %unified_info = ( "crypto/conf/conf_mall.o", "crypto/conf/conf_mod.o", "crypto/conf/conf_sap.o", + "crypto/conf/conf_ssl.o", "crypto/cpt_err.o", "crypto/cryptlib.o", "crypto/ct/ct_b64.o", @@ -11403,6 +11473,7 @@ our %unified_info = ( "crypto/x509/x509_err.o", "crypto/x509/x509_ext.o", "crypto/x509/x509_lu.o", + "crypto/x509/x509_meth.o", "crypto/x509/x509_obj.o", "crypto/x509/x509_r2x.o", "crypto/x509/x509_req.o", @@ -12406,6 +12477,15 @@ our %unified_info = ( [ "test/enginetest.c", ], + "test/errtest" => + [ + "test/errtest.o", + "test/testutil.o", + ], + "test/errtest.o" => + [ + "test/errtest.c", + ], "test/evp_extra_test" => [ "test/evp_extra_test.o", @@ -12755,6 +12835,14 @@ our %unified_info = ( [ "test/verify_extra_test.c", ], + "test/versions" => + [ + "test/versions.o", + ], + "test/versions.o" => + [ + "test/versions.c", + ], "test/wp_test" => [ "test/wp_test.o", @@ -12763,6 +12851,23 @@ our %unified_info = ( [ "test/wp_test.c", ], + "test/x509_dup_cert_test" => + [ + "test/x509_dup_cert_test.o", + ], + "test/x509_dup_cert_test.o" => + [ + "test/x509_dup_cert_test.c", + ], + "test/x509_time_test" => + [ + "test/testutil.o", + "test/x509_time_test.o", + ], + "test/x509_time_test.o" => + [ + "test/x509_time_test.c", + ], "test/x509aux" => [ "test/x509aux.o", diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h index 506757d551ff..118391ea1d5e 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h @@ -20,4 +20,4 @@ static const char cflags[] = { 'n','g','i','n','e','s','-','1','.','1','\\','"','"',' ','\0' }; #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 3 00:38:53 2018" +#define DATE "built on: Tue Aug 14 23:13:42 2018" diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h index e20916814d70..7b122bd86ee5 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslconf.h @@ -105,12 +105,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/openssl.gypi b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/openssl.gypi index 55006d7fe982..1d596c5b2178 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/openssl.gypi +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/openssl.gypi @@ -219,6 +219,7 @@ 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', + 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', @@ -579,6 +580,7 @@ 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', + 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', diff --git a/deps/openssl/openssl/.travis.yml b/deps/openssl/openssl/.travis.yml index b5fc44318110..1c1db2b73dad 100644 --- a/deps/openssl/openssl/.travis.yml +++ b/deps/openssl/openssl/.travis.yml @@ -61,7 +61,7 @@ matrix: sources: - ubuntu-toolchain-r-test compiler: gcc-5 - env: CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 -DPEDANTIC" + env: UBUNTU_GCC_HACK="yes" CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 -DPEDANTIC" - os: linux addons: apt: @@ -69,7 +69,7 @@ matrix: - binutils-mingw-w64 - gcc-mingw-w64 compiler: i686-w64-mingw32-gcc - env: CONFIG_OPTS="no-pic" TESTS="-test_fuzz" + env: CONFIG_OPTS="no-pic" - os: linux addons: apt: @@ -85,7 +85,7 @@ matrix: - binutils-mingw-w64 - gcc-mingw-w64 compiler: x86_64-w64-mingw32-gcc - env: CONFIG_OPTS="no-pic" TESTS="-test_fuzz" + env: CONFIG_OPTS="no-pic" - os: linux addons: apt: @@ -112,6 +112,10 @@ before_script: srcdir=.; top=.; fi + - if [ -n "$UBUNTU_GCC_HACK" ]; then + $CC -dumpspecs | sed "s/--push-state//g; s/--pop-state/--as-needed/g" > gcc-specs.txt; + CC="$CC -specs=gcc-specs.txt"; + fi - if [ "$CC" == i686-w64-mingw32-gcc ]; then export CROSS_COMPILE=${CC%%gcc}; unset CC; $srcdir/Configure mingw $CONFIG_OPTS -Wno-pedantic-ms-format; @@ -186,7 +190,7 @@ script: fi - if [ -n "$DESTDIR" ]; then mkdir "../$DESTDIR"; - if $make install install_docs DESTDIR="../$DESTDIR"; then + if $make install DESTDIR="../$DESTDIR"; then echo -e '+\057\057\057\057\057 MAKE INSTALL_DOCS OK'; else echo -e '+\057\057\057\057\057 MAKE INSTALL_DOCS FAILED'; false; diff --git a/deps/openssl/openssl/CHANGES b/deps/openssl/openssl/CHANGES index 9d65bc3a7750..9f0b94743bff 100644 --- a/deps/openssl/openssl/CHANGES +++ b/deps/openssl/openssl/CHANGES @@ -7,6 +7,81 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.0h and 1.1.0i [14 Aug 2018] + + *) Client DoS due to large DH parameter + + During key agreement in a TLS handshake using a DH(E) based ciphersuite a + malicious server can send a very large prime value to the client. This will + cause the client to spend an unreasonably long period of time generating a + key for this prime resulting in a hang until the client has finished. This + could be exploited in a Denial Of Service attack. + + This issue was reported to OpenSSL on 5th June 2018 by Guido Vranken + (CVE-2018-0732) + [Guido Vranken] + + *) Cache timing vulnerability in RSA Key Generation + + The OpenSSL RSA Key generation algorithm has been shown to be vulnerable to + a cache timing side channel attack. An attacker with sufficient access to + mount cache timing attacks during the RSA key generation process could + recover the private key. + + This issue was reported to OpenSSL on 4th April 2018 by Alejandro Cabrera + Aldaya, Billy Brumley, Cesar Pereida Garcia and Luis Manuel Alvarez Tapia. + (CVE-2018-0737) + [Billy Brumley] + + *) Make EVP_PKEY_asn1_new() a bit stricter about its input. A NULL pem_str + parameter is no longer accepted, as it leads to a corrupt table. NULL + pem_str is reserved for alias entries only. + [Richard Levitte] + + *) Revert blinding in ECDSA sign and instead make problematic addition + length-invariant. Switch even to fixed-length Montgomery multiplication. + [Andy Polyakov] + + *) Change generating and checking of primes so that the error rate of not + being prime depends on the intended use based on the size of the input. + For larger primes this will result in more rounds of Miller-Rabin. + The maximal error rate for primes with more than 1080 bits is lowered + to 2^-128. + [Kurt Roeckx, Annie Yousar] + + *) Increase the number of Miller-Rabin rounds for DSA key generating to 64. + [Kurt Roeckx] + + *) Add blinding to ECDSA and DSA signatures to protect against side channel + attacks discovered by Keegan Ryan (NCC Group). + [Matt Caswell] + + *) When unlocking a pass phrase protected PEM file or PKCS#8 container, we + now allow empty (zero character) pass phrases. + [Richard Levitte] + + *) Certificate time validation (X509_cmp_time) enforces stricter + compliance with RFC 5280. Fractional seconds and timezone offsets + are no longer allowed. + [Emilia Käsper] + + *) Fixed a text canonicalisation bug in CMS + + Where a CMS detached signature is used with text content the text goes + through a canonicalisation process first prior to signing or verifying a + signature. This process strips trailing space at the end of lines, converts + line terminators to CRLF and removes additional trailing line terminators + at the end of a file. A bug in the canonicalisation process meant that + some characters, such as form-feed, were incorrectly treated as whitespace + and removed. This is contrary to the specification (RFC5485). This fix + could mean that detached text data signed with an earlier version of + OpenSSL 1.1.0 may fail to verify using the fixed version, or text data + signed with a fixed OpenSSL may fail to verify with an earlier version of + OpenSSL 1.1.0. A workaround is to only verify the canonicalised text data + and use the "-binary" flag (for the "cms" command line application) or set + the SMIME_BINARY/PKCS7_BINARY/CMS_BINARY flags (if using CMS_verify()). + [Matt Caswell] + Changes between 1.1.0g and 1.1.0h [27 Mar 2018] *) Constructed ASN.1 types with a recursive definition could exceed the stack @@ -1144,13 +1219,13 @@ [Steve Henson] *) Experimental encrypt-then-mac support. - + Experimental support for encrypt then mac from draft-gutmann-tls-encrypt-then-mac-02.txt To enable it set the appropriate extension number (0x42 for the test server) using e.g. -DTLSEXT_TYPE_encrypt_then_mac=0x42 - + For non-compliant peers (i.e. just about everything) this should have no effect. @@ -1201,7 +1276,7 @@ *) Use separate DRBG fields for internal and external flags. New function FIPS_drbg_health_check() to perform on demand health checking. Add - generation tests to fips_test_suite with reduced health check interval to + generation tests to fips_test_suite with reduced health check interval to demonstrate periodic health checking. Add "nodh" option to fips_test_suite to skip very slow DH test. [Steve Henson] @@ -1215,7 +1290,7 @@ combination: call this in fips_test_suite. [Steve Henson] - *) Add support for canonical generation of DSA parameter 'g'. See + *) Add support for canonical generation of DSA parameter 'g'. See FIPS 186-3 A.2.3. *) Add support for HMAC DRBG from SP800-90. Update DRBG algorithm test and @@ -1239,7 +1314,7 @@ requested amount of entropy. [Steve Henson] - *) Add PRNG security strength checks to RSA, DSA and ECDSA using + *) Add PRNG security strength checks to RSA, DSA and ECDSA using information in FIPS186-3, SP800-57 and SP800-131A. [Steve Henson] @@ -1331,7 +1406,7 @@ can be set or retrieved with a ctrl. The IV length is by default 12 bytes (96 bits) but can be set to an alternative value. If the IV length exceeds the maximum IV length (currently 16 bytes) it cannot be - set before the key. + set before the key. [Steve Henson] *) New flag in ciphers: EVP_CIPH_FLAG_CUSTOM_CIPHER. This means the @@ -1374,7 +1449,7 @@ Add CMAC pkey methods. [Steve Henson] - *) Experimental renegotiation in s_server -www mode. If the client + *) Experimental renegotiation in s_server -www mode. If the client browses /reneg connection is renegotiated. If /renegcert it is renegotiated requesting a certificate. [Steve Henson] @@ -1394,7 +1469,7 @@ *) New macro __owur for "OpenSSL Warn Unused Result". This makes use of a gcc attribute to warn if the result of a function is ignored. This is enable if DEBUG_UNUSED is set. Add to several functions in evp.h - whose return value is often ignored. + whose return value is often ignored. [Steve Henson] *) New -noct, -requestct, -requirect and -ctlogfile options for s_client. @@ -3628,7 +3703,7 @@ *) New option -sigopt to dgst utility. Update dgst to use EVP_Digest{Sign,Verify}*. These two changes make it possible to use - alternative signing parameters such as X9.31 or PSS in the dgst + alternative signing parameters such as X9.31 or PSS in the dgst utility. [Steve Henson] @@ -12379,7 +12454,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Fixed sk_insert which never worked properly. [Steve Henson] - *) Fix ASN1 macros so they can handle indefinite length constructed + *) Fix ASN1 macros so they can handle indefinite length constructed EXPLICIT tags. Some non standard certificates use these: they can now be read in. [Steve Henson] diff --git a/deps/openssl/openssl/CONTRIBUTING b/deps/openssl/openssl/CONTRIBUTING index 1eebaf37ec60..a6977b8117fe 100644 --- a/deps/openssl/openssl/CONTRIBUTING +++ b/deps/openssl/openssl/CONTRIBUTING @@ -1,26 +1,26 @@ -HOW TO CONTRIBUTE PATCHES TO OpenSSL ------------------------------------- +HOW TO CONTRIBUTE TO OpenSSL +---------------------------- (Please visit https://www.openssl.org/community/getting-started.html for other ideas about how to contribute.) -Development is coordinated on the openssl-dev mailing list (see the -above link or https://mta.openssl.org for information on subscribing). -If you are unsure as to whether a feature will be useful for the general -OpenSSL community you might want to discuss it on the openssl-dev mailing -list first. Someone may be already working on the same thing or there -may be a good reason as to why that feature isn't implemented. +Development is done on GitHub, https://github.com/openssl/openssl. -To submit a patch, make a pull request on GitHub. If you think the patch -could use feedback from the community, please start a thread on openssl-dev -to discuss it. +To request new features or report bugs, please open an issue on GitHub -Having addressed the following items before the PR will help make the -acceptance and review process faster: +To submit a patch, please open a pull request on GitHub. If you are thinking +of making a large contribution, open an issue for it before starting work, +to get comments from the community. Someone may be already working on +the same thing or there may be reasons why that feature isn't implemented. - 1. Anything other than trivial contributions will require a contributor - licensing agreement, giving us permission to use your code. See - https://www.openssl.org/policies/cla.html for details. +To make it easier to review and accept your pull request, please follow these +guidelines: + + 1. Anything other than a trivial contribution requires a Contributor + License Agreement (CLA), giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. If your + contribution is too small to require a CLA, put "CLA: trivial" on a + line by itself in your commit message body. 2. All source files should start with the following text (with appropriate comment characters at the start of each line and the @@ -34,21 +34,38 @@ acceptance and review process faster: https://www.openssl.org/source/license.html 3. Patches should be as current as possible; expect to have to rebase - often. We do not accept merge commits; You will be asked to remove - them before a patch is considered acceptable. + often. We do not accept merge commits, you will have to remove them + (usually by rebasing) before it will be acceptable. 4. Patches should follow our coding style (see - https://www.openssl.org/policies/codingstyle.html) and compile without - warnings. Where gcc or clang is available you should use the + https://www.openssl.org/policies/codingstyle.html) and compile + without warnings. Where gcc or clang is available you should use the --strict-warnings Configure option. OpenSSL compiles on many varied - platforms: try to ensure you only use portable features. - Clean builds via Travis and AppVeyor are expected, and done whenever - a PR is created or updated. + platforms: try to ensure you only use portable features. Clean builds + via Travis and AppVeyor are required, and they are started automatically + whenever a PR is created or updated. 5. When at all possible, patches should include tests. These can either be added to an existing test, or completely new. Please see test/README for information on the test framework. 6. New features or changed functionality must include - documentation. Please look at the "pod" files in doc/apps, doc/crypto - and doc/ssl for examples of our style. + documentation. Please look at the "pod" files in doc for + examples of our style. + + 7. For user visible changes (API changes, behaviour changes, ...), + consider adding a note in CHANGES. This could be a summarising + description of the change, and could explain the grander details. + Have a look through existing entries for inspiration. + Please note that this is NOT simply a copy of git-log oneliners. + Also note that security fixes get an entry in CHANGES. + This file helps users get more in depth information of what comes + with a specific release without having to sift through the higher + noise ratio in git-log. + + 8. For larger or more important user visible changes, as well as + security fixes, please add a line in NEWS. On exception, it might be + worth adding a multi-line entry (such as the entry that announces all + the types that became opaque with OpenSSL 1.1.0). + This file helps users get a very quick summary of what comes with a + specific release, to see if an upgrade is worth the effort. diff --git a/deps/openssl/openssl/Configurations/00-base-templates.conf b/deps/openssl/openssl/Configurations/00-base-templates.conf index a6b52de49852..3455b3ace8f5 100644 --- a/deps/openssl/openssl/Configurations/00-base-templates.conf +++ b/deps/openssl/openssl/Configurations/00-base-templates.conf @@ -247,7 +247,7 @@ sha1_asm_src => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S", modes_asm_src => "ghash-armv4.S ghashv8-armx.S", chacha_asm_src => "chacha-armv4.S", - poly1305_asm_src=> "poly1305-armv4.S", + poly1305_asm_src=> "poly1305-armv4.S", perlasm_scheme => "void" }, aarch64_asm => { diff --git a/deps/openssl/openssl/Configurations/10-main.conf b/deps/openssl/openssl/Configurations/10-main.conf index b49f04b5d7c5..6c05c2809f18 100644 --- a/deps/openssl/openssl/Configurations/10-main.conf +++ b/deps/openssl/openssl/Configurations/10-main.conf @@ -14,7 +14,7 @@ sub vc_win64a_info { asflags => "/c /Cp /Cx /Zi", asoutflag => "/Fo" }; } else { - $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n"); + $die->("NASM not found - make sure it's installed and available on %PATH%\n"); $vc_win64a_info = { as => "{unknown}", asflags => "", asoutflag => "" }; @@ -39,7 +39,7 @@ sub vc_win32_info { asoutflag => "/Fo", perlasm_scheme => "win32" }; } else { - $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n"); + $die->("NASM not found - make sure it's installed and available on %PATH%\n"); $vc_win32_info = { as => "{unknown}", asflags => "", asoutflag => "", @@ -428,8 +428,17 @@ sub vms_info { # even PA-RISC 2.0-specific code paths, which are chosen at run-time, # thus adequate performance is provided even with PA-RISC 1.1 build. # - "hpux-parisc-gcc" => { + "hpux-common" => { inherit_from => [ "BASE_unix" ], + template => 1, + defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED", + "_HPUX_ALT_XOPEN_SOCKET_API"), + thread_scheme => "pthreads", + dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds + shared_target => "hpux-shared", + }, + "hpux-parisc-gcc" => { + inherit_from => [ "hpux-common" ], cc => "gcc", cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W", debug => "-O0 -g", @@ -437,9 +446,7 @@ sub vms_info { threads("-pthread")), ex_libs => add("-Wl,+s -ldld", threads("-pthread")), bn_ops => "BN_LLONG", - thread_scheme => "pthreads", dso_scheme => "dl", - shared_target => "hpux-shared", shared_cflag => "-fPIC", shared_ldflag => "-shared", shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -449,7 +456,7 @@ sub vms_info { multilib => "/pa1.1", }, "hpux64-parisc2-gcc" => { - inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ], + inherit_from => [ "hpux-common", asm("parisc20_64_asm") ], cc => "gcc", cflags => combine(picker(default => "-DB_ENDIAN", debug => "-O0 -g", @@ -457,9 +464,6 @@ sub vms_info { threads("-D_REENTRANT")), ex_libs => add("-ldl"), bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "-fpic", shared_ldflag => "-shared", shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -471,7 +475,7 @@ sub vms_info { # Chris Ruemmler # Kevin Steves "hpux-parisc-cc" => { - inherit_from => [ "BASE_unix" ], + inherit_from => [ "hpux-common" ], cc => "cc", cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY", debug => "+O0 +d -g", @@ -479,9 +483,7 @@ sub vms_info { threads("-D_REENTRANT")), ex_libs => add("-Wl,+s -ldld",threads("-lpthread")), bn_ops => "RC4_CHAR", - thread_scheme => "pthreads", dso_scheme => "dl", - shared_target => "hpux-shared", shared_cflag => "+Z", shared_ldflag => "-b", shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -492,7 +494,7 @@ sub vms_info { multilib => "/pa1.1", }, "hpux64-parisc2-cc" => { - inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ], + inherit_from => [ "hpux-common", asm("parisc20_64_asm") ], cc => "cc", cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY", debug => "+O0 +d -g", @@ -500,9 +502,6 @@ sub vms_info { threads("-D_REENTRANT")), ex_libs => add("-ldl",threads("-lpthread")), bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "+Z", shared_ldflag => "+DD64 -b", shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -511,7 +510,7 @@ sub vms_info { # HP/UX IA-64 targets "hpux-ia64-cc" => { - inherit_from => [ "BASE_unix", asm("ia64_asm") ], + inherit_from => [ "hpux-common", asm("ia64_asm") ], cc => "cc", cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN", debug => "+O0 +d -g", @@ -519,9 +518,6 @@ sub vms_info { threads("-D_REENTRANT")), ex_libs => add("-ldl",threads("-lpthread")), bn_ops => "SIXTY_FOUR_BIT", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "+Z", shared_ldflag => "+DD32 -b", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -530,7 +526,7 @@ sub vms_info { # Frank Geurts has patiently assisted # with debugging of the following config. "hpux64-ia64-cc" => { - inherit_from => [ "BASE_unix", asm("ia64_asm") ], + inherit_from => [ "hpux-common", asm("ia64_asm") ], cc => "cc", cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN", debug => "+O0 +d -g", @@ -538,9 +534,6 @@ sub vms_info { threads("-D_REENTRANT")), ex_libs => add("-ldl", threads("-lpthread")), bn_ops => "SIXTY_FOUR_BIT_LONG", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "+Z", shared_ldflag => "+DD64 -b", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -548,7 +541,7 @@ sub vms_info { }, # GCC builds... "hpux-ia64-gcc" => { - inherit_from => [ "BASE_unix", asm("ia64_asm") ], + inherit_from => [ "hpux-common", asm("ia64_asm") ], cc => "gcc", cflags => combine(picker(default => "-DB_ENDIAN", debug => "-O0 -g", @@ -556,16 +549,13 @@ sub vms_info { threads("-pthread")), ex_libs => add("-ldl", threads("-pthread")), bn_ops => "SIXTY_FOUR_BIT", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "-fpic", shared_ldflag => "-shared", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", multilib => "/hpux32", }, "hpux64-ia64-gcc" => { - inherit_from => [ "BASE_unix", asm("ia64_asm") ], + inherit_from => [ "hpux-common", asm("ia64_asm") ], cc => "gcc", cflags => combine(picker(default => "-mlp64 -DB_ENDIAN", debug => "-O0 -g", @@ -573,9 +563,6 @@ sub vms_info { threads("-pthread")), ex_libs => add("-ldl", threads("-pthread")), bn_ops => "SIXTY_FOUR_BIT_LONG", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - shared_target => "hpux-shared", shared_cflag => "-fpic", shared_ldflag => "-mlp64 -shared", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -1223,6 +1210,7 @@ sub vms_info { perlasm_scheme => "aix32", dso_scheme => "dlfcn", shared_target => "aix-shared", + shared_cflag => "-qpic", shared_ldflag => "-q32 -G", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", arflags => "-X 32", @@ -1241,6 +1229,7 @@ sub vms_info { perlasm_scheme => "aix64", dso_scheme => "dlfcn", shared_target => "aix-shared", + shared_cflag => "-qpic", shared_ldflag => "-q64 -G", shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", arflags => "-X 64", diff --git a/deps/openssl/openssl/Configurations/90-team.conf b/deps/openssl/openssl/Configurations/90-team.conf deleted file mode 100644 index 0a83c22aaa1e..000000000000 --- a/deps/openssl/openssl/Configurations/90-team.conf +++ /dev/null @@ -1,112 +0,0 @@ -## -*- mode: perl; -*- -## Build configuration targets for openssl-team members - -%targets = ( - "purify" => { - cc => "purify gcc", - cflags => "-g -Wall", - thread_scheme => "(unknown)", - ex_libs => add(" ","-lsocket -lnsl"), - }, - "debug" => { - cc => "gcc", - cflags => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror", - thread_scheme => "(unknown)", - }, - "debug-erbridge" => { - inherit_from => [ "x86_64_asm" ], - cc => "gcc", - cflags => combine("$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -m64 -DL_ENDIAN -DTERMIO -g", - threads("-D_REENTRANT")), - ex_libs => add(" ","-ldl"), - bn_ops => "SIXTY_FOUR_BIT_LONG", - thread_scheme => "pthreads", - perlasm_scheme => "elf", - dso_scheme => "dlfcn", - shared_target => "linux-shared", - shared_cflag => "-fPIC", - shared_ldflag => "-m64", - shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - multilib => "64", - }, - "debug-linux-pentium" => { - inherit_from => [ "x86_elf_asm" ], - cc => "gcc", - cflags => combine("-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DL_ENDIAN -g -mcpu=pentium -Wall", - threads("-D_REENTRANT")), - ex_libs => add(" ","-ldl"), - bn_ops => "BN_LLONG", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - }, - "debug-linux-ppro" => { - inherit_from => [ "x86_elf_asm" ], - cc => "gcc", - cflags => combine("-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall", - threads("-D_REENTRANT")), - ex_libs => add(" ","-ldl"), - bn_ops => "BN_LLONG", - thread_scheme => "pthreads", - dso_scheme => "dlfcn", - }, - "debug-linux-ia32-aes" => { - cc => "gcc", - cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall", - threads("-D_REENTRANT")), - ex_libs => add(" ","-ldl"), - bn_ops => "BN_LLONG", - cpuid_asm_src => "x86cpuid.s", - bn_asm_src => "bn-586.s co-586.s x86-mont.s", - des_asm_src => "des-586.s crypt586.s", - aes_asm_src => "aes_x86core.s aes_cbc.s aesni-x86.s", - bf_asm_src => "bf-586.s", - md5_asm_src => "md5-586.s", - sha1_asm_src => "sha1-586.s sha256-586.s sha512-586.s", - cast_asm_src => "cast-586.s", - rc4_asm_src => "rc4-586.s", - rmd160_asm_src => "rmd-586.s", - rc5_asm_src => "rc5-586.s", - wp_asm_src => "wp_block.s wp-mmx.s", - modes_asm_src => "ghash-x86.s", - padlock_asm_src => "e_padlock-x86.s", - thread_scheme => "pthreads", - perlasm_scheme => "elf", - dso_scheme => "dlfcn", - shared_target => "linux-shared", - shared_cflag => "-fPIC", - shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - }, - "dist" => { - cc => "cc", - cflags => "-O", - thread_scheme => "(unknown)", - }, - "debug-test-64-clang" => { - inherit_from => [ "x86_64_asm" ], - cc => "clang", - cflags => combine("$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe", - threads("${BSDthreads}")), - bn_ops => "SIXTY_FOUR_BIT_LONG", - thread_scheme => "pthreads", - perlasm_scheme => "elf", - dso_scheme => "dlfcn", - shared_target => "bsd-gcc-shared", - shared_cflag => "-fPIC", - shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - }, - "darwin64-debug-test-64-clang" => { - inherit_from => [ "x86_64_asm" ], - cc => "clang", - cflags => combine("-arch x86_64 -DL_ENDIAN $gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe", - threads("${BSDthreads}")), - sys_id => "MACOSX", - bn_ops => "SIXTY_FOUR_BIT_LONG", - thread_scheme => "pthreads", - perlasm_scheme => "macosx", - dso_scheme => "dlfcn", - shared_target => "darwin-shared", - shared_cflag => "-fPIC -fno-common", - shared_ldflag => "-arch x86_64 -dynamiclib", - shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - }, -); diff --git a/deps/openssl/openssl/Configurations/INTERNALS.Configure b/deps/openssl/openssl/Configurations/INTERNALS.Configure index 6d148196ffb3..b28305deca4c 100644 --- a/deps/openssl/openssl/Configurations/INTERNALS.Configure +++ b/deps/openssl/openssl/Configurations/INTERNALS.Configure @@ -133,3 +133,4 @@ Example 4: | ENDIF | 1 | | | ... whatever ... | | this line is processed | | ENDIF | | | + diff --git a/deps/openssl/openssl/Configurations/README b/deps/openssl/openssl/Configurations/README index e85673c59144..6e13645491f7 100644 --- a/deps/openssl/openssl/Configurations/README +++ b/deps/openssl/openssl/Configurations/README @@ -81,7 +81,7 @@ In each table entry, the following keys are significant: ''. This is very rarely needed. shared_extension => File name extension used for shared - libraries. + libraries. obj_extension => File name extension used for object files. On unix, this defaults to ".o" (NOTE: this is here for future use, it's not @@ -471,11 +471,11 @@ clash with those generated by Configure, it's possible to tell it not to generate them with the use of OVERRIDES, for example: SOURCE[libfoo]=foo.c bar.c - + OVERRIDES=bar.o BEGINRAW[Makefile(unix)] bar.o: bar.c - $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $< + $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $< ENDRAW[Makefile(unix)] See the documentation further up for more information on configuration diff --git a/deps/openssl/openssl/Configurations/README.design b/deps/openssl/openssl/Configurations/README.design index 7179ec027fc1..bea9790afbd1 100644 --- a/deps/openssl/openssl/Configurations/README.design +++ b/deps/openssl/openssl/Configurations/README.design @@ -90,7 +90,7 @@ depends on the library 'libssl' to function properly. LIBS=../libcrypto SOURCE[../libcrypto]=aes.c evp.c cversion.c DEPEND[cversion.o]=buildinf.h - + GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" DEPEND[buildinf.h]=../Makefile DEPEND[../util/mkbuildinf.pl]=../util/Foo.pm @@ -105,7 +105,7 @@ show that duplicate information isn't an issue. This build.info file informs us that 'libcrypto' is built from a few source files, 'crypto/aes.c', 'crypto/evp.c' and 'crypto/cversion.c'. It also shows us that building the object file inferred from -'crypto/cversion.c' depends on 'crypto/buildinf.h'. Finally, it +'crypto/cversion.c' depends on 'crypto/buildinf.h'. Finally, it also shows the possibility to declare how some files are generated using some script, in this case a perl script, and how such scripts can be declared to depend on other files, in this case a perl module. @@ -157,7 +157,7 @@ information comes down to this: SOURCE[libssl]=ssl/tls.c INCLUDE[libssl]=include DEPEND[libssl]=libcrypto - + PROGRAMS=apps/openssl SOURCE[apps/openssl]=apps/openssl.c INCLUDE[apps/openssl]=. include @@ -172,7 +172,7 @@ information comes down to this: SOURCE[engines/ossltest]=engines/e_ossltest.c DEPEND[engines/ossltest]=libcrypto INCLUDE[engines/ossltest]=include - + GENERATE[crypto/buildinf.h]=util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" DEPEND[crypto/buildinf.h]=Makefile DEPEND[util/mkbuildinf.pl]=util/Foo.pm diff --git a/deps/openssl/openssl/Configurations/dist.conf b/deps/openssl/openssl/Configurations/dist.conf new file mode 100644 index 000000000000..4f58dad9141a --- /dev/null +++ b/deps/openssl/openssl/Configurations/dist.conf @@ -0,0 +1,12 @@ +## -*- mode: perl; -*- +## Build configuration targets for openssl-team members + +# This is to support 'make dist' +%targets = ( + "dist" => { + inherit_from => [ 'BASE_unix' ], + cc => "cc", + cflags => "-O", + thread_scheme => "(unknown)", + }, +); diff --git a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl index 40cf2c3df430..034d93e653d2 100644 --- a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl +++ b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl @@ -664,8 +664,10 @@ tar: DISTDIR=$(NAME); \ mkdir -p $$TMPDIR/$$DISTDIR; \ (cd $(SRCDIR); \ + excl_re="^(fuzz/corpora|Configurations/.*\.norelease\.conf)"; \ + echo "$$excl_re"; \ git ls-tree -r --name-only --full-tree HEAD \ - | grep -v '^fuzz/corpora' \ + | egrep -v "$$excl_re" \ | while read F; do \ mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \ cp $$F $$TMPDIR/$$DISTDIR/$$F; \ @@ -848,7 +850,7 @@ EOF $recipe .= <<"EOF"; $obj$objext: $deps ( trap "rm -f \$@.*" INT 0; \\ - \$(CPP) $incs \$(CFLAGS) $ecflags $srcs | \\ + \$(CC) $incs \$(CFLAGS) $ecflags -E $srcs | \\ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.s && \\ \$(CC) \$(CFLAGS) $ecflags -c -o \$\@ \$@.s ) EOF diff --git a/deps/openssl/openssl/Configurations/windows-checker.pm b/deps/openssl/openssl/Configurations/windows-checker.pm index de46fbc1dfc5..4b7105df33cb 100644 --- a/deps/openssl/openssl/Configurations/windows-checker.pm +++ b/deps/openssl/openssl/Configurations/windows-checker.pm @@ -6,7 +6,7 @@ use Config; # we expect for the platform use File::Spec::Functions qw(:DEFAULT rel2abs); -if (rel2abs('.') !~ m|\\|) { +if (!$ENV{CONFIGURE_INSIST} && rel2abs('.') !~ m|\\|) { die <{libraries}}) -} -INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -} -INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{install}->{libraries}}) -} -INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -} -INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{install}->{engines}}) -} -INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} -INSTALL_PROGRAMPDBS={- join(" ", map { $_.".pdb" } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} +INSTALL_LIBS={- join(" ", map { quotify1($_.$libext) } @{$unified_info{install}->{libraries}}) -} +INSTALL_SHLIBS={- join(" ", map { quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -} +INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -} +INSTALL_ENGINES={- join(" ", map { quotify1(dso($_)) } @{$unified_info{install}->{engines}}) -} +INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; quotify1(dso($_)) } @{$unified_info{install}->{engines}}) -} +INSTALL_PROGRAMS={- join(" ", map { quotify1($_.$exeext) } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} +INSTALL_PROGRAMPDBS={- join(" ", map { quotify1($_.".pdb") } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} {- output_off() if $disabled{apps}; "" -} -BIN_SCRIPTS=$(BLDDIR)\tools\c_rehash.pl -MISC_SCRIPTS=$(BLDDIR)\apps\CA.pl $(BLDDIR)\apps\tsget.pl +BIN_SCRIPTS="$(BLDDIR)\tools\c_rehash.pl" +MISC_SCRIPTS="$(BLDDIR)\apps\CA.pl" "$(BLDDIR)\apps\tsget.pl" {- output_on() if $disabled{apps}; "" -} APPS_OPENSSL={- use File::Spec::Functions; - catfile("apps","openssl") -} + "\"".catfile("apps","openssl")."\"" -} # Do not edit these manually. Use Configure with --prefix or --openssldir # to change this! Short explanation in the top comment in Configure @@ -182,6 +182,9 @@ MTOUTFLAG={- $target{mtoutflag} || "-outputresource:" -}$(OSSL_EMPTY) AS={- $target{as} -} ASFLAGS={- $target{asflags} -} ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY) + +ECHO="$(PERL)" "$(SRCDIR)\util\echo.pl" + PERLASM_SCHEME= {- $target{perlasm_scheme} -} PROCESSOR= {- $config{processor} -} @@ -207,7 +210,7 @@ build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) test: tests {- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep - @rem {- output_off() if $disabled{tests}; "" -} + @{- output_off() if $disabled{tests}; "" -} -mkdir $(BLDDIR)\test\test-runs set SRCTOP=$(SRCDIR) set BLDTOP=$(BLDDIR) @@ -216,17 +219,17 @@ test: tests set OPENSSL_ENGINES=$(MAKEDIR)\engines set OPENSSL_DEBUG_MEMORY=on "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS) - @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} - @echo "Tests are not supported with your chosen Configure options" - @rem {- output_on() if !$disabled{tests}; "" -} + @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} + @$(ECHO) "Tests are not supported with your chosen Configure options" + @{- output_on() if !$disabled{tests}; "" -} list-tests: - @rem {- output_off() if $disabled{tests}; "" -} + @{- output_off() if $disabled{tests}; "" -} @set SRCTOP=$(SRCDIR) @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list - @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} - @echo "Tests are not supported with your chosen Configure options" - @rem {- output_on() if !$disabled{tests}; "" -} + @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} + @$(ECHO) "Tests are not supported with your chosen Configure options" + @{- output_on() if !$disabled{tests}; "" -} install: install_sw install_ssldirs install_docs @@ -285,16 +288,17 @@ install_ssldirs: "$(OPENSSLDIR)\misc" install_dev: - @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 ) - @echo *** Installing development files + @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 ) + @$(ECHO) "*** Installing development files" @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl" - @rem {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -} + @{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -} @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \ "$(INSTALLTOP)\include\openssl" - @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -} - @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \ + @{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -} + @"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \ + "$(SRCDIR)\include\openssl\*.h" \ "$(INSTALLTOP)\include\openssl" - @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \ + @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(BLDDIR)\include\openssl\*.h" \ "$(INSTALLTOP)\include\openssl" @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\$(LIBDIR)" @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) \ @@ -306,8 +310,8 @@ install_dev: uninstall_dev: install_engines: - @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 ) - @echo *** Installing engines + @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 ) + @$(ECHO) "*** Installing engines" @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)" @if not "$(ENGINES)"=="" \ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)" @@ -317,8 +321,8 @@ install_engines: uninstall_engines: install_runtime: - @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 ) - @echo *** Installing runtime files + @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 ) + @$(ECHO) "*** Installing runtime files" @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin" @if not "$(SHLIBS)"=="" \ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin" @@ -343,14 +347,14 @@ uninstall_html_docs: # Building targets ################################################### configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -} - @echo "Detected changed: $?" - @echo "Reconfiguring..." + @$(ECHO) "Detected changed: $?" + @$(ECHO) "Reconfiguring..." "$(PERL)" "$(SRCDIR)\Configure" reconf - @echo "**************************************************" - @echo "*** ***" - @echo "*** Please run the same make command again ***" - @echo "*** ***" - @echo "**************************************************" + @$(ECHO) "**************************************************" + @$(ECHO) "*** ***" + @$(ECHO) "*** Please run the same make command again ***" + @$(ECHO) "*** ***" + @$(ECHO) "**************************************************" @exit 1 {- @@ -604,8 +608,6 @@ EOF foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) { if (dirname($prod) eq $dir) { push @deps, $prod.$extinfo{$type}; - } else { - push @actions, "\t@rem No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}}); } } } diff --git a/deps/openssl/openssl/Configure b/deps/openssl/openssl/Configure index c0033643c61d..d85ff6aa4da9 100755 --- a/deps/openssl/openssl/Configure +++ b/deps/openssl/openssl/Configure @@ -20,6 +20,9 @@ use OpenSSL::Glob; # see INSTALL for instructions. +my $orig_death_handler = $SIG{__DIE__}; +$SIG{__DIE__} = \&death_handler; + my $usage="Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; # Options: @@ -756,21 +759,21 @@ while (@argvcopy) else { $config{options} .= " ".$_; } } + } - if (defined($config{api}) && !exists $apitable->{$config{api}}) { - die "***** Unsupported api compatibility level: $config{api}\n", - } +if (defined($config{api}) && !exists $apitable->{$config{api}}) { + die "***** Unsupported api compatibility level: $config{api}\n", +} - if (keys %deprecated_options) - { - warn "***** Deprecated options: ", - join(", ", keys %deprecated_options), "\n"; - } - if (keys %unsupported_options) - { - die "***** Unsupported options: ", - join(", ", keys %unsupported_options), "\n"; - } +if (keys %deprecated_options) + { + warn "***** Deprecated options: ", + join(", ", keys %deprecated_options), "\n"; + } +if (keys %unsupported_options) + { + die "***** Unsupported options: ", + join(", ", keys %unsupported_options), "\n"; } if ($libs =~ /(^|\s)-Wl,-rpath,/ @@ -908,11 +911,12 @@ if ($d) { $target = $t; } } + +&usage if !$table{$target} || $table{$target}->{template}; + $config{target} = $target; my %target = resolve_config($target); -&usage if (!%target || $target{template}); - my %conf_files = map { $_ => 1 } (@{$target{_conf_fname_int}}); $config{conf_files} = [ sort keys %conf_files ]; %target = ( %{$table{DEFAULTS}}, %target ); @@ -1215,8 +1219,10 @@ if ($^O ne "VMS") { if (!$disabled{makedepend}) { # We know that GNU C version 3 and up as well as all clang - # versions support dependency generation - if ($predefined{__GNUC__} >= 3) { + # versions support dependency generation, but Xcode did not + # handle $cc -M before clang support (but claims __GNUC__ = 3) + if (($predefined{__GNUC__} // -1) >= 3 + && !($predefined{__APPLE_CC__} && !$predefined{__clang__})) { $config{makedepprog} = $cc; } else { $config{makedepprog} = which('makedepend'); @@ -2125,6 +2131,8 @@ my %builders = ( $builders{$builder}->($builder_platform, @builder_opts); +$SIG{__DIE__} = $orig_death_handler; + print <<"EOF"; Configured for $target. @@ -2153,6 +2161,24 @@ exit(0); # Helpers and utility functions # +# Death handler, to print a helpful message in case of failure ####### +# +sub death_handler { + die @_ if $^S; # To prevent the added message in eval blocks + my $build_file = $target{build_file} // "build file"; + my @message = ( <<"_____", @_ ); + +Failure! $build_file wasn't produced. +Please read INSTALL and associated NOTES files. You may also have to look over +your available compiler tool chain or change your configuration. + +_____ + + # Dying is terminal, so it's ok to reset the signal handler here. + $SIG{__DIE__} = $orig_death_handler; + die @message; +} + # Configuration file reading ######################################### # Note: All of the helper functions are for lazy evaluation. They all diff --git a/deps/openssl/openssl/INSTALL b/deps/openssl/openssl/INSTALL index e9b33a5336b1..5a98d1da83fb 100644 --- a/deps/openssl/openssl/INSTALL +++ b/deps/openssl/openssl/INSTALL @@ -3,7 +3,8 @@ -------------------- This document describes installation on all supported operating - systems (the Linux/Unix family, OpenVMS and Windows) + systems (the Unix/Linux family (which includes Mac OS/X), OpenVMS, + and Windows). To install OpenSSL, you will need: @@ -76,7 +77,7 @@ If you want to just get on with it, do: - on Unix: + on Unix (again, this includes Mac OS/X): $ ./config $ make @@ -208,7 +209,7 @@ without a path). This flag must be provided if the zlib-dynamic option is not also used. If zlib-dynamic is used then this flag is optional and a default value ("ZLIB1") is - used if not provided. + used if not provided. On VMS: this is the filename of the zlib library (with or without a path). This flag is optional and if not provided then "GNV$LIBZSHR", "GNV$LIBZSHR32" or "GNV$LIBZSHR64" is @@ -663,7 +664,7 @@ $ nmake TESTS='test_rsa test_dsa' test # Windows And of course, you can combine (Unix example shown): - + $ make VERBOSE=1 TESTS='test_rsa test_dsa' test You can find the list of available tests like this: @@ -733,7 +734,7 @@ command symbols. [.SYSTEST] Contains the installation verification procedure. [.HTML] Contains the HTML rendition of the manual pages. - + Additionally, install will add the following directories under OPENSSLDIR (the directory given with --openssldir or its default) diff --git a/deps/openssl/openssl/NEWS b/deps/openssl/openssl/NEWS index 8744fe68ec5a..b6cf1f21ac24 100644 --- a/deps/openssl/openssl/NEWS +++ b/deps/openssl/openssl/NEWS @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.0h and OpenSSL 1.1.0i [14 Aug 2018] + + o Client DoS due to large DH parameter (CVE-2018-0732) + o Cache timing vulnerability in RSA Key Generation (CVE-2018-0737) + Major changes between OpenSSL 1.1.0g and OpenSSL 1.1.0h [27 Mar 2018] o Constructed ASN.1 types with a recursive definition could exceed the diff --git a/deps/openssl/openssl/NOTES.DJGPP b/deps/openssl/openssl/NOTES.DJGPP index d43d4e86de4e..bbe63dc15438 100644 --- a/deps/openssl/openssl/NOTES.DJGPP +++ b/deps/openssl/openssl/NOTES.DJGPP @@ -1,5 +1,5 @@ - + INSTALLATION ON THE DOS PLATFORM WITH DJGPP ------------------------------------------- @@ -29,7 +29,7 @@ running "./Configure" with appropriate arguments: ./Configure no-threads --prefix=/dev/env/DJDIR DJGPP - + And finally fire up "make". You may run out of DPMI selectors when running in a DOS box under Windows. If so, just close the BASH shell, go back to Windows, and restart BASH. Then run "make" again. diff --git a/deps/openssl/openssl/NOTES.VMS b/deps/openssl/openssl/NOTES.VMS index 7d74f0dbdd1f..3e9a57e8052b 100644 --- a/deps/openssl/openssl/NOTES.VMS +++ b/deps/openssl/openssl/NOTES.VMS @@ -42,7 +42,7 @@ for now is to rename the OpenSSL source directory, as follows (please adjust for the actual source directory name you have): - $ rename openssl-1^.1^.0.DIR openssl-1_1_0.DIR + $ rename openssl-1^.1^.0.DIR openssl-1_1_0.DIR About MMS and DCL diff --git a/deps/openssl/openssl/README b/deps/openssl/openssl/README index 3491280ead13..76888cbb09e3 100644 --- a/deps/openssl/openssl/README +++ b/deps/openssl/openssl/README @@ -1,7 +1,7 @@ - OpenSSL 1.1.0h 27 Mar 2018 + OpenSSL 1.1.0i 14 Aug 2018 - Copyright (c) 1998-2016 The OpenSSL Project + Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. diff --git a/deps/openssl/openssl/README.ECC b/deps/openssl/openssl/README.ECC index 86f5b23070c1..fa3cad7aa7f0 100644 --- a/deps/openssl/openssl/README.ECC +++ b/deps/openssl/openssl/README.ECC @@ -5,56 +5,57 @@ Center (NCSC) dated 2010-11-04. That agreement permits implementation and distribution of software containing features covered by any or all of the following patents: -1.) U.S. Pat. No. 5,761,305 entitled "Key Agreement and Transport Protocol +1.) U.S. Pat. No. 5,761,305 entitled "Key Agreement and Transport Protocol with Implicit Signatures" issued on June 2, 1998; -2.) Can. Pat. Appl. Ser. No. 2176972 entitled "Key Agreement and Transport - Protocol with Implicit Signature and Reduced Bandwidth" filed on May +2.) Can. Pat. Appl. Ser. No. 2176972 entitled "Key Agreement and Transport + Protocol with Implicit Signature and Reduced Bandwidth" filed on May 16, 1996; -3.) U.S. Pat. No. 5,889,865 entitled "Key Agreement and Transport Protocol +3.) U.S. Pat. No. 5,889,865 entitled "Key Agreement and Transport Protocol with Implicit Signatures" issued on March 30, 1999; -4.) U.S. Pat. No. 5,896,455 entitled "Key Agreement and Transport Protocol +4.) U.S. Pat. No. 5,896,455 entitled "Key Agreement and Transport Protocol with Implicit Signatures" issued on April 20, 1999; -5.) U.S. Pat. No. 5,933,504 entitled "Strengthened Public Key Protocol" +5.) U.S. Pat. No. 5,933,504 entitled "Strengthened Public Key Protocol" issued on August 3, 1999; -6.) Can. Pat. Appl. Ser. No. 2176866 entitled "Strengthened Public Key +6.) Can. Pat. Appl. Ser. No. 2176866 entitled "Strengthened Public Key Protocol" filed on May 17, 1996; -7.) E.P. Pat. Appl. Ser. No. 96201322.3 entitled "Strengthened Public Key +7.) E.P. Pat. Appl. Ser. No. 96201322.3 entitled "Strengthened Public Key Protocol" filed on May 17, 1996; -8.) U.S. Pat. No. 5,999,626 entitled "Digital Signatures on a Smartcard" +8.) U.S. Pat. No. 5,999,626 entitled "Digital Signatures on a Smartcard" issued on December 7, 1999; -9.) Can. Pat. Appl. Ser. No. 2202566 entitled "Digital Signatures on a +9.) Can. Pat. Appl. Ser. No. 2202566 entitled "Digital Signatures on a Smartcard" filed on April 14, 1997; -10.) E.P. Pat. Appl. No. 97106114.8 entitled "Digital Signatures on a +10.) E.P. Pat. Appl. No. 97106114.8 entitled "Digital Signatures on a Smartcard" filed on April 15, 1997; -11.) U.S Pat. No. 6,122,736 entitled "Key Agreement and Transport Protocol +11.) U.S Pat. No. 6,122,736 entitled "Key Agreement and Transport Protocol with Implicit Signatures" issued on September 19, 2000; -12.) Can. Pat. Appl. Ser. No. 2174261 entitled "Key Agreement and Transport +12.) Can. Pat. Appl. Ser. No. 2174261 entitled "Key Agreement and Transport Protocol with Implicit Signatures" filed on April 16, 1996; -13.) E.P. Pat. Appl. Ser. No. 96105920.1 entitled "Key Agreement and +13.) E.P. Pat. Appl. Ser. No. 96105920.1 entitled "Key Agreement and Transport Protocol with Implicit Signatures" filed on April 16, 1996; -14.) U.S. Pat. No. 6,141,420 entitled "Elliptic Curve Encryption Systems" +14.) U.S. Pat. No. 6,141,420 entitled "Elliptic Curve Encryption Systems" issued on October 31, 2000; -15.) Can. Pat. Appl. Ser. No. 2155038 entitled "Elliptic Curve Encryption +15.) Can. Pat. Appl. Ser. No. 2155038 entitled "Elliptic Curve Encryption Systems" filed on July 31, 1995; -16.) E.P. Pat. Appl. Ser. No. 95926348.4 entitled "Elliptic Curve Encryption +16.) E.P. Pat. Appl. Ser. No. 95926348.4 entitled "Elliptic Curve Encryption Systems" filed on July 31, 1995; -17.) U.S. Pat. No. 6,336,188 entitled "Authenticated Key Agreement" issued +17.) U.S. Pat. No. 6,336,188 entitled "Authenticated Key Agreement" issued on January 1, 2002; -18.) U.S. Pat. No. 6,487,661 entitled "Key Agreement and Transport Protocol" +18.) U.S. Pat. No. 6,487,661 entitled "Key Agreement and Transport Protocol" issued on November 26, 2002; -19.) Can. Pat. Appl. Ser. No. 2174260 entitled "Key Agreement and Transport +19.) Can. Pat. Appl. Ser. No. 2174260 entitled "Key Agreement and Transport Protocol" filed on April 16, 1996; -20.) E.P. Pat. Appl. Ser. No. 96105921.9 entitled "Key Agreement and +20.) E.P. Pat. Appl. Ser. No. 96105921.9 entitled "Key Agreement and Transport Protocol" filed on April 21, 1996; -21.) U.S. Pat. No. 6,563,928 entitled "Strengthened Public Key Protocol" +21.) U.S. Pat. No. 6,563,928 entitled "Strengthened Public Key Protocol" issued on May 13, 2003; -22.) U.S. Pat. No. 6,618,483 entitled "Elliptic Curve Encryption Systems" +22.) U.S. Pat. No. 6,618,483 entitled "Elliptic Curve Encryption Systems" issued September 9, 2003; -23.) U.S. Pat. Appl. Ser. No. 09/434,247 entitled "Digital Signatures on a +23.) U.S. Pat. Appl. Ser. No. 09/434,247 entitled "Digital Signatures on a Smartcard" filed on November 5, 1999; -24.) U.S. Pat. Appl. Ser. No. 09/558,256 entitled "Key Agreement and +24.) U.S. Pat. Appl. Ser. No. 09/558,256 entitled "Key Agreement and Transport Protocol with Implicit Signatures" filed on April 25, 2000; -25.) U.S. Pat. Appl. Ser. No. 09/942,492 entitled "Digital Signatures on a +25.) U.S. Pat. Appl. Ser. No. 09/942,492 entitled "Digital Signatures on a Smartcard" filed on August 29, 2001 and published on July 18, 2002; and, -26.) U.S. Pat. Appl. Ser. No. 10/185,735 entitled "Strengthened Public Key +26.) U.S. Pat. Appl. Ser. No. 10/185,735 entitled "Strengthened Public Key Protocol" filed on July 1, 2000. + diff --git a/deps/openssl/openssl/VMS/openssl_ivp.com.in b/deps/openssl/openssl/VMS/openssl_ivp.com.in index e888b528793a..825a699c4f7e 100644 --- a/deps/openssl/openssl/VMS/openssl_ivp.com.in +++ b/deps/openssl/openssl/VMS/openssl_ivp.com.in @@ -16,7 +16,7 @@ $ OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") - $ $ v := {- sprintf "%02d%02d", split(/\./, $config{version}) -} $ pz := {- $config{pointer_size} -} -$ +$ $ @'INSTALLTOP_'SYS$STARTUP]openssl_startup'v' $ @'INSTALLTOP_'SYS$STARTUP]openssl_utils'v' $ diff --git a/deps/openssl/openssl/apps/apps.c b/deps/openssl/openssl/apps/apps.c index 8703d0cc31ee..d52201f1f389 100644 --- a/deps/openssl/openssl/apps/apps.c +++ b/deps/openssl/openssl/apps/apps.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1012,7 +1012,8 @@ int set_name_ex(unsigned long *flags, const char *arg) }; if (set_multi_opts(flags, arg, ex_tbl) == 0) return 0; - if ((*flags & XN_FLAG_SEP_MASK) == 0) + if (*flags != XN_FLAG_COMPAT + && (*flags & XN_FLAG_SEP_MASK) == 0) *flags |= XN_FLAG_SEP_CPLUS_SPC; return 1; } diff --git a/deps/openssl/openssl/apps/asn1pars.c b/deps/openssl/openssl/apps/asn1pars.c index 1ac261c7629e..008a6797d045 100644 --- a/deps/openssl/openssl/apps/asn1pars.c +++ b/deps/openssl/openssl/apps/asn1pars.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -41,7 +41,7 @@ OPTIONS asn1parse_options[] = { {"dump", OPT_DUMP, 0, "unknown data in hex form"}, {"dlimit", OPT_DLIMIT, 'p', "dump the first arg bytes of unknown data in hex form"}, - {"strparse", OPT_STRPARSE, 's', + {"strparse", OPT_STRPARSE, 'p', "offset; a series of these can be used to 'dig'"}, {OPT_MORE_STR, 0, 0, "into multiple ASN1 blob wrappings"}, {"genstr", OPT_GENSTR, 's', "string to generate ASN1 structure from"}, @@ -113,13 +113,13 @@ int asn1parse_main(int argc, char **argv) offset = strtol(opt_arg(), NULL, 0); break; case OPT_LENGTH: - length = atoi(opt_arg()); + length = strtol(opt_arg(), NULL, 0); break; case OPT_DUMP: dump = -1; break; case OPT_DLIMIT: - dump = atoi(opt_arg()); + dump = strtol(opt_arg(), NULL, 0); break; case OPT_STRPARSE: sk_OPENSSL_STRING_push(osk, opt_arg()); @@ -191,7 +191,7 @@ int asn1parse_main(int argc, char **argv) num = 0; for (;;) { - if (!BUF_MEM_grow(buf, (int)num + BUFSIZ)) + if (!BUF_MEM_grow(buf, num + BUFSIZ)) goto end; i = BIO_read(in, &(buf->data[num]), BUFSIZ); if (i <= 0) @@ -211,9 +211,9 @@ int asn1parse_main(int argc, char **argv) for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) { ASN1_TYPE *atmp; int typ; - j = atoi(sk_OPENSSL_STRING_value(osk, i)); - if (j == 0) { - BIO_printf(bio_err, "'%s' is an invalid number\n", + j = strtol(sk_OPENSSL_STRING_value(osk, i), NULL, 0); + if (j <= 0 || j >= tmplen) { + BIO_printf(bio_err, "'%s' is out of range\n", sk_OPENSSL_STRING_value(osk, i)); continue; } @@ -244,14 +244,14 @@ int asn1parse_main(int argc, char **argv) num = tmplen; } - if (offset >= num) { - BIO_printf(bio_err, "Error: offset too large\n"); + if (offset < 0 || offset >= num) { + BIO_printf(bio_err, "Error: offset out of range\n"); goto end; } num -= offset; - if ((length == 0) || ((long)length > num)) + if (length == 0 || length > (unsigned int)num) length = (unsigned int)num; if (derout) { if (BIO_write(derout, str + offset, length) != (int)length) { diff --git a/deps/openssl/openssl/apps/ca.c b/deps/openssl/openssl/apps/ca.c index d474a2b69a64..c69a2b5cdd9f 100644 --- a/deps/openssl/openssl/apps/ca.c +++ b/deps/openssl/openssl/apps/ca.c @@ -725,10 +725,10 @@ int ca_main(int argc, char **argv) /*****************************************************************/ if (req || gencrl) { - /* FIXME: Is it really always text? */ - Sout = bio_open_default(outfile, 'w', FORMAT_TEXT); - if (Sout == NULL) - goto end; + if (spkac_file != NULL) { + output_der = 1; + batch = 1; + } } if (md == NULL @@ -872,10 +872,6 @@ int ca_main(int argc, char **argv) BIO_printf(bio_err, "Memory allocation failure\n"); goto end; } - if (outfile) { - output_der = 1; - batch = 1; - } } } if (ss_cert_file != NULL) { @@ -929,10 +925,13 @@ int ca_main(int argc, char **argv) if (j > 0) { total_done++; BIO_printf(bio_err, "\n"); - if (!BN_add_word(serial, 1)) + if (!BN_add_word(serial, 1)) { + X509_free(x); goto end; + } if (!sk_X509_push(cert_sk, x)) { BIO_printf(bio_err, "Memory allocation failure\n"); + X509_free(x); goto end; } } @@ -1017,6 +1016,11 @@ int ca_main(int argc, char **argv) if (verbose) BIO_printf(bio_err, "writing %s\n", buf[2]); + Sout = bio_open_default(outfile, 'w', + output_der ? FORMAT_ASN1 : FORMAT_TEXT); + if (Sout == NULL) + goto end; + Cout = BIO_new_file(buf[2], "w"); if (Cout == NULL) { perror(buf[2]); @@ -1025,6 +1029,8 @@ int ca_main(int argc, char **argv) write_new_certificate(Cout, xi, 0, notext); write_new_certificate(Sout, xi, output_der, notext); BIO_free_all(Cout); + BIO_free_all(Sout); + Sout = NULL; } if (sk_X509_num(cert_sk)) { @@ -1173,6 +1179,11 @@ int ca_main(int argc, char **argv) if (!do_X509_CRL_sign(crl, pkey, dgst, sigopts)) goto end; + Sout = bio_open_default(outfile, 'w', + output_der ? FORMAT_ASN1 : FORMAT_TEXT); + if (Sout == NULL) + goto end; + PEM_write_bio_X509_CRL(Sout, crl); if (crlnumberfile != NULL) /* Rename the crlnumber file */ diff --git a/deps/openssl/openssl/apps/cms.c b/deps/openssl/openssl/apps/cms.c index b999c70c959d..640f92eb1b37 100644 --- a/deps/openssl/openssl/apps/cms.c +++ b/deps/openssl/openssl/apps/cms.c @@ -146,7 +146,7 @@ OPTIONS cms_options[] = { "Do not load certificates from the default certificates directory"}, {"content", OPT_CONTENT, '<', "Supply or override content for detached signature"}, - {"print", OPT_PRINT, '-', + {"print", OPT_PRINT, '-', "For the -cmsout operation print out all fields of the CMS structure"}, {"secretkey", OPT_SECRETKEY, 's'}, {"secretkeyid", OPT_SECRETKEYID, 's'}, diff --git a/deps/openssl/openssl/apps/ct_log_list.cnf b/deps/openssl/openssl/apps/ct_log_list.cnf index a637b477af48..243487453c64 100644 --- a/deps/openssl/openssl/apps/ct_log_list.cnf +++ b/deps/openssl/openssl/apps/ct_log_list.cnf @@ -31,3 +31,4 @@ key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEluqsHEYMG1XcDfy1lCdGV0JwOmkY4r87xNuroP [venafi] description = Venafi log key = MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAolpIHxdSlTXLo1s6H1OCdpSj/4DyHDc8wLG9wVmLqy1lk9fz4ATVmm+/1iN2Nk8jmctUKK2MFUtlWXZBSpym97M7frGlSaQXUWyA3CqQUEuIJOmlEjKTBEiQAvpfDjCHjlV2Be4qTM6jamkJbiWtgnYPhJL6ONaGTiSPm7Byy57iaz/hbckldSOIoRhYBiMzeNoA0DiRZ9KmfSeXZ1rB8y8X5urSW+iBzf2SaOfzBvDpcoTuAaWx2DPazoOl28fP1hZ+kHUYvxbcMjttjauCFx+JII0dmuZNIwjfeG/GBb9frpSX219k1O4Wi6OEbHEr8at/XQ0y7gTikOxBn/s5wQIDAQAB + diff --git a/deps/openssl/openssl/apps/dh1024.pem b/deps/openssl/openssl/apps/dh1024.pem index 813e8a4a4822..f1a5e180aa95 100644 --- a/deps/openssl/openssl/apps/dh1024.pem +++ b/deps/openssl/openssl/apps/dh1024.pem @@ -4,7 +4,7 @@ Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL /1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC -----END DH PARAMETERS----- -These are the 1024-bit DH parameters from "Internet Key Exchange +These are the 1024-bit DH parameters from "Internet Key Exchange Protocol Version 2 (IKEv2)": https://tools.ietf.org/html/rfc5996 See https://tools.ietf.org/html/rfc2412 for how they were generated. diff --git a/deps/openssl/openssl/apps/dh2048.pem b/deps/openssl/openssl/apps/dh2048.pem index 288a20997e5a..e899f2e0296d 100644 --- a/deps/openssl/openssl/apps/dh2048.pem +++ b/deps/openssl/openssl/apps/dh2048.pem @@ -7,8 +7,8 @@ fDKQXkYuNs474553LBgOhgObJ4Oi7Aeij7XFXfBvTFLJ3ivL9pVYFxg5lUl86pVq 5RXSJhiY+gUQFXKOWoqsqmj//////////wIBAg== -----END DH PARAMETERS----- -These are the 2048-bit DH parameters from "More Modular Exponential -(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": +These are the 2048-bit DH parameters from "More Modular Exponential +(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": https://tools.ietf.org/html/rfc3526 See https://tools.ietf.org/html/rfc2412 for how they were generated. diff --git a/deps/openssl/openssl/apps/dh4096.pem b/deps/openssl/openssl/apps/dh4096.pem index 08560e1284e2..adada2b55815 100644 --- a/deps/openssl/openssl/apps/dh4096.pem +++ b/deps/openssl/openssl/apps/dh4096.pem @@ -12,8 +12,8 @@ ARpyPBKnh+bXiHGaEL26WyaZwycYavTiPBqUaDS2FQvaJYPpyirUTOjbu8LbBN6O HNAGkSfVsFqpk7TqmI2P3cGG/7fckKbAj030Nck0BjGZ//////////8CAQI= -----END DH PARAMETERS----- -These are the 4096-bit DH parameters from "More Modular Exponential -(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": +These are the 4096-bit DH parameters from "More Modular Exponential +(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": https://tools.ietf.org/html/rfc3526 See https://tools.ietf.org/html/rfc2412 for how they were generated. diff --git a/deps/openssl/openssl/apps/dhparam.c b/deps/openssl/openssl/apps/dhparam.c index 94322e37def4..8a28414562ba 100644 --- a/deps/openssl/openssl/apps/dhparam.c +++ b/deps/openssl/openssl/apps/dhparam.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -151,6 +151,11 @@ int dhparam_main(int argc, char **argv) goto end; } # endif + + out = bio_open_default(outfile, 'w', outformat); + if (out == NULL) + goto end; + /* DH parameters */ if (num && !g) g = 2; @@ -266,10 +271,6 @@ int dhparam_main(int argc, char **argv) /* dh != NULL */ } - out = bio_open_default(outfile, 'w', outformat); - if (out == NULL) - goto end; - if (text) { DHparams_print(out, dh); } diff --git a/deps/openssl/openssl/apps/dsaparam.c b/deps/openssl/openssl/apps/dsaparam.c index 5c3c8f80893e..20891cf3ddbc 100644 --- a/deps/openssl/openssl/apps/dsaparam.c +++ b/deps/openssl/openssl/apps/dsaparam.c @@ -226,25 +226,28 @@ int dsaparam_main(int argc, char **argv) data = app_malloc(len + 20, "BN space"); - BIO_printf(bio_out, "DSA *get_dsa%d()\n{\n", bits_p); - print_bignum_var(bio_out, p, "dsap", len, data); - print_bignum_var(bio_out, q, "dsaq", len, data); - print_bignum_var(bio_out, g, "dsag", len, data); + BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p); + print_bignum_var(bio_out, p, "dsap", bits_p, data); + print_bignum_var(bio_out, q, "dsaq", bits_p, data); + print_bignum_var(bio_out, g, "dsag", bits_p, data); BIO_printf(bio_out, " DSA *dsa = DSA_new();\n" + " BIGNUM *p, *q, *g;\n" "\n"); BIO_printf(bio_out, " if (dsa == NULL)\n" " return NULL;\n"); - BIO_printf(bio_out, " dsa->p = BN_bin2bn(dsap_%d, sizeof(dsap_%d), NULL);\n", - bits_p, bits_p); - BIO_printf(bio_out, " dsa->q = BN_bin2bn(dsaq_%d, sizeof(dsaq_%d), NULL);\n", - bits_p, bits_p); - BIO_printf(bio_out, " dsa->g = BN_bin2bn(dsag_%d, sizeof(dsag_%d), NULL);\n", - bits_p, bits_p); - BIO_printf(bio_out, " if (!dsa->p || !dsa->q || !dsa->g) {\n" - " DSA_free(dsa);\n" + BIO_printf(bio_out, " if (!DSA_set0_pqg(dsa, p = BN_bin2bn(dsap_%d, sizeof(dsap_%d), NULL),\n", + bits_p, bits_p); + BIO_printf(bio_out, " q = BN_bin2bn(dsaq_%d, sizeof(dsaq_%d), NULL),\n", + bits_p, bits_p); + BIO_printf(bio_out, " g = BN_bin2bn(dsag_%d, sizeof(dsag_%d), NULL))) {\n", + bits_p, bits_p); + BIO_printf(bio_out, " DSA_free(dsa);\n" + " BN_free(p);\n" + " BN_free(q);\n" + " BN_free(g);\n" " return NULL;\n" " }\n" - " return(dsa);\n}\n"); + " return dsa;\n}\n"); OPENSSL_free(data); } diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c index 4b533348b43b..0c15f5114d23 100644 --- a/deps/openssl/openssl/apps/ocsp.c +++ b/deps/openssl/openssl/apps/ocsp.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -639,7 +639,6 @@ int ocsp_main(int argc, char **argv) OCSP_response_status_str(i), i); if (ignore_err) goto redo_accept; - ret = 0; goto end; } diff --git a/deps/openssl/openssl/apps/rehash.c b/deps/openssl/openssl/apps/rehash.c index 273ad749692b..aa3f8643a5af 100644 --- a/deps/openssl/openssl/apps/rehash.c +++ b/deps/openssl/openssl/apps/rehash.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -130,9 +130,10 @@ static int add_entry(enum Type type, unsigned int hash, const char *filename, for (ep = bp->first_entry; ep; ep = ep->next) { if (digest && memcmp(digest, ep->digest, evpmdsize) == 0) { BIO_printf(bio_err, - "%s: skipping duplicate %s in %s\n", opt_getprog(), + "%s: warning: skipping duplicate %s in %s\n", + opt_getprog(), type == TYPE_CERT ? "certificate" : "CRL", filename); - return 1; + return 0; } if (strcmp(filename, ep->filename) == 0) { found = ep; @@ -144,7 +145,7 @@ static int add_entry(enum Type type, unsigned int hash, const char *filename, if (ep == NULL) { if (bp->num_needed >= MAX_COLLISIONS) { BIO_printf(bio_err, - "%s: hash table overflow for %s\n", + "%s: error: hash table overflow for %s\n", opt_getprog(), filename); return 1; } @@ -235,7 +236,7 @@ static int do_file(const char *filename, const char *fullpath, enum Hash h) /* Does it have X.509 data in it? */ if ((b = BIO_new_file(fullpath, "r")) == NULL) { - BIO_printf(bio_err, "%s: skipping %s, cannot open file\n", + BIO_printf(bio_err, "%s: error: skipping %s, cannot open file\n", opt_getprog(), filename); errs++; goto end; @@ -247,7 +248,7 @@ static int do_file(const char *filename, const char *fullpath, enum Hash h) if (sk_X509_INFO_num(inf) != 1) { BIO_printf(bio_err, - "%s: skipping %s," + "%s: warning: skipping %s," "it does not contain exactly one certificate or CRL\n", opt_getprog(), filename); /* This is not an error. */ @@ -502,13 +503,14 @@ int rehash_main(int argc, char **argv) if (*argv) { while (*argv) errs += do_dir(*argv++, h); - } else if ((env = getenv("SSL_CERT_DIR")) != NULL) { + } else if ((env = getenv(X509_get_default_cert_dir_env())) != NULL) { + char lsc[2] = { LIST_SEPARATOR_CHAR, '\0' }; m = OPENSSL_strdup(env); - for (e = strtok(m, ":"); e != NULL; e = strtok(NULL, ":")) + for (e = strtok(m, lsc); e != NULL; e = strtok(NULL, lsc)) errs += do_dir(e, h); OPENSSL_free(m); } else { - errs += do_dir("/etc/ssl/certs", h); + errs += do_dir(X509_get_default_cert_dir(), h); } end: diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index fb89f0cd6131..3c0c73e8516c 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -593,7 +593,8 @@ OPTIONS s_client_options[] = { "Disable name checks when matching DANE-EE(3) TLSA records"}, {"reconnect", OPT_RECONNECT, '-', "Drop and re-make the connection with the same Session-ID"}, - {"showcerts", OPT_SHOWCERTS, '-', "Show all certificates in the chain"}, + {"showcerts", OPT_SHOWCERTS, '-', + "Show all certificates sent by the server"}, {"debug", OPT_DEBUG, '-', "Extra output"}, {"msg", OPT_MSG, '-', "Show protocol messages"}, {"msgfile", OPT_MSGFILE, '>', @@ -2114,8 +2115,7 @@ int s_client_main(int argc, char **argv) FD_ZERO(&readfds); FD_ZERO(&writefds); - if ((SSL_version(con) == DTLS1_VERSION) && - DTLSv1_get_timeout(con, &timeout)) + if (SSL_is_dtls(con) && DTLSv1_get_timeout(con, &timeout)) timeoutp = &timeout; else timeoutp = NULL; @@ -2235,10 +2235,8 @@ int s_client_main(int argc, char **argv) } } - if ((SSL_version(con) == DTLS1_VERSION) - && DTLSv1_handle_timeout(con) > 0) { + if (SSL_is_dtls(con) && DTLSv1_handle_timeout(con) > 0) BIO_printf(bio_err, "TIMEOUT occurred\n"); - } if (!ssl_pending && FD_ISSET(SSL_get_fd(con), &writefds)) { k = SSL_write(con, &(cbuf[cbuf_off]), (unsigned int)cbuf_len); diff --git a/deps/openssl/openssl/apps/s_server.c b/deps/openssl/openssl/apps/s_server.c index 31c90fdd0e64..e8aa323a4f9e 100644 --- a/deps/openssl/openssl/apps/s_server.c +++ b/deps/openssl/openssl/apps/s_server.c @@ -2012,9 +2012,7 @@ static int sv_body(int s, int stype, unsigned char *context) SSL *con = NULL; BIO *sbio; struct timeval timeout; -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) - struct timeval tv; -#else +#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)) struct timeval *timeoutp; #endif @@ -2149,26 +2147,23 @@ static int sv_body(int s, int stype, unsigned char *context) * second and check for any keypress. In a proper Windows * application we wouldn't do this because it is inefficient. */ - tv.tv_sec = 1; - tv.tv_usec = 0; - i = select(width, (void *)&readfds, NULL, NULL, &tv); + timeout.tv_sec = 1; + timeout.tv_usec = 0; + i = select(width, (void *)&readfds, NULL, NULL, &timeout); if (has_stdin_waiting()) read_from_terminal = 1; if ((i < 0) || (!i && !read_from_terminal)) continue; #else - if ((SSL_version(con) == DTLS1_VERSION) && - DTLSv1_get_timeout(con, &timeout)) + if (SSL_is_dtls(con) && DTLSv1_get_timeout(con, &timeout)) timeoutp = &timeout; else timeoutp = NULL; i = select(width, (void *)&readfds, NULL, NULL, timeoutp); - if ((SSL_version(con) == DTLS1_VERSION) - && DTLSv1_handle_timeout(con) > 0) { + if ((SSL_is_dtls(con)) && DTLSv1_handle_timeout(con) > 0) BIO_printf(bio_err, "TIMEOUT occurred\n"); - } if (i <= 0) continue; diff --git a/deps/openssl/openssl/apps/smime.c b/deps/openssl/openssl/apps/smime.c index 8edb1ed994be..e18d7de75fce 100644 --- a/deps/openssl/openssl/apps/smime.c +++ b/deps/openssl/openssl/apps/smime.c @@ -89,7 +89,7 @@ OPTIONS smime_options[] = { {"no-CApath", OPT_NOCAPATH, '-', "Do not load certificates from the default certificates directory"}, {"resign", OPT_RESIGN, '-', "Resign a signed message"}, - {"nochain", OPT_NOCHAIN, '-', + {"nochain", OPT_NOCHAIN, '-', "set PKCS7_NOCHAIN so certificates contained in the message are not used as untrusted CAs" }, {"nosmimecap", OPT_NOSMIMECAP, '-', "Omit the SMIMECapabilities attribute"}, {"stream", OPT_STREAM, '-', "Enable CMS streaming" }, diff --git a/deps/openssl/openssl/apps/speed.c b/deps/openssl/openssl/apps/speed.c index f388a9852d3b..3ef37b78a658 100644 --- a/deps/openssl/openssl/apps/speed.c +++ b/deps/openssl/openssl/apps/speed.c @@ -129,13 +129,6 @@ #define BUFSIZE (1024*16+1) #define MAX_MISALIGNMENT 63 -#define ALGOR_NUM 30 -#define SIZE_NUM 6 -#define PRIME_NUM 3 -#define RSA_NUM 7 -#define DSA_NUM 3 - -#define EC_NUM 17 #define MAX_ECDH_SIZE 256 #define MISALIGN 64 @@ -144,37 +137,6 @@ static volatile int run = 0; static int mr = 0; static int usertime = 1; -typedef void *(*kdf_fn) ( - const void *in, size_t inlen, void *out, size_t *xoutlen); - -typedef struct loopargs_st { - ASYNC_JOB *inprogress_job; - ASYNC_WAIT_CTX *wait_ctx; - unsigned char *buf; - unsigned char *buf2; - unsigned char *buf_malloc; - unsigned char *buf2_malloc; - unsigned int siglen; -#ifndef OPENSSL_NO_RSA - RSA *rsa_key[RSA_NUM]; -#endif -#ifndef OPENSSL_NO_DSA - DSA *dsa_key[DSA_NUM]; -#endif -#ifndef OPENSSL_NO_EC - EC_KEY *ecdsa[EC_NUM]; - EC_KEY *ecdh_a[EC_NUM]; - EC_KEY *ecdh_b[EC_NUM]; - unsigned char *secret_a; - unsigned char *secret_b; - size_t outlen; - kdf_fn kdf; -#endif - EVP_CIPHER_CTX *ctx; - HMAC_CTX *hctx; - GCM128_CONTEXT *gcm_ctx; -} loopargs_t; - #ifndef OPENSSL_NO_MD2 static int EVP_Digest_MD2_loop(void *args); #endif @@ -227,7 +189,6 @@ static int ECDSA_sign_loop(void *args); static int ECDSA_verify_loop(void *args); static int ECDH_compute_key_loop(void *args); #endif -static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_t *loopargs); static double Time_F(int s); static void print_message(const char *s, long num, int length); @@ -238,32 +199,10 @@ static void print_result(int alg, int run_no, int count, double time_used); static int do_multi(int multi); #endif -static const char *names[ALGOR_NUM] = { - "md2", "mdc2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", "rc4", - "des cbc", "des ede3", "idea cbc", "seed cbc", - "rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc", - "aes-128 cbc", "aes-192 cbc", "aes-256 cbc", - "camellia-128 cbc", "camellia-192 cbc", "camellia-256 cbc", - "evp", "sha256", "sha512", "whirlpool", - "aes-128 ige", "aes-192 ige", "aes-256 ige", "ghash" -}; - -static double results[ALGOR_NUM][SIZE_NUM]; - -static const int lengths[SIZE_NUM] = { +static const int lengths[] = { 16, 64, 256, 1024, 8 * 1024, 16 * 1024 }; - -#ifndef OPENSSL_NO_RSA -static double rsa_results[RSA_NUM][2]; -#endif -#ifndef OPENSSL_NO_DSA -static double dsa_results[DSA_NUM][2]; -#endif -#ifndef OPENSSL_NO_EC -static double ecdsa_results[EC_NUM][2]; -static double ecdh_results[EC_NUM][1]; -#endif +#define SIZE_NUM OSSL_NELEM(lengths) #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_EC) static const char rnd_seed[] = @@ -348,9 +287,14 @@ static double Time_F(int s) static void multiblock_speed(const EVP_CIPHER *evp_cipher); -static int found(const char *name, const OPT_PAIR *pairs, int *result) +#define found(value, pairs, result)\ + opt_found(value, result, pairs, OSSL_NELEM(pairs)) +static int opt_found(const char *name, unsigned int *result, + const OPT_PAIR pairs[], unsigned int nbelem) { - for (; pairs->name; pairs++) + unsigned int idx; + + for (idx = 0; idx < nbelem; ++idx, pairs++) if (strcmp(name, pairs->name) == 0) { *result = pairs->retval; return 1; @@ -387,7 +331,7 @@ OPTIONS speed_options[] = { #ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, #endif - {NULL}, + {NULL} }; #define D_MD2 0 @@ -420,7 +364,19 @@ OPTIONS speed_options[] = { #define D_IGE_192_AES 27 #define D_IGE_256_AES 28 #define D_GHASH 29 -static OPT_PAIR doit_choices[] = { +/* name of algorithms to test */ +static const char *names[] = { + "md2", "mdc2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", "rc4", + "des cbc", "des ede3", "idea cbc", "seed cbc", + "rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc", + "aes-128 cbc", "aes-192 cbc", "aes-256 cbc", + "camellia-128 cbc", "camellia-192 cbc", "camellia-256 cbc", + "evp", "sha256", "sha512", "whirlpool", + "aes-128 ige", "aes-192 ige", "aes-256 ige", "ghash" +}; +#define ALGOR_NUM OSSL_NELEM(names) +/* list of configured algorithm (remaining) */ +static const OPT_PAIR doit_choices[] = { #ifndef OPENSSL_NO_MD2 {"md2", D_MD2}, #endif @@ -484,21 +440,24 @@ static OPT_PAIR doit_choices[] = { {"cast", D_CBC_CAST}, {"cast5", D_CBC_CAST}, #endif - {"ghash", D_GHASH}, - {NULL} + {"ghash", D_GHASH} }; +static double results[ALGOR_NUM][SIZE_NUM]; + #ifndef OPENSSL_NO_DSA # define R_DSA_512 0 # define R_DSA_1024 1 # define R_DSA_2048 2 -static OPT_PAIR dsa_choices[] = { +static const OPT_PAIR dsa_choices[] = { {"dsa512", R_DSA_512}, {"dsa1024", R_DSA_1024}, - {"dsa2048", R_DSA_2048}, - {NULL}, + {"dsa2048", R_DSA_2048} }; -#endif +# define DSA_NUM OSSL_NELEM(dsa_choices) + +static double dsa_results[DSA_NUM][2]; /* 2 ops: sign then verify */ +#endif /* OPENSSL_NO_DSA */ #define R_RSA_512 0 #define R_RSA_1024 1 @@ -507,16 +466,18 @@ static OPT_PAIR dsa_choices[] = { #define R_RSA_4096 4 #define R_RSA_7680 5 #define R_RSA_15360 6 -static OPT_PAIR rsa_choices[] = { +static const OPT_PAIR rsa_choices[] = { {"rsa512", R_RSA_512}, {"rsa1024", R_RSA_1024}, {"rsa2048", R_RSA_2048}, {"rsa3072", R_RSA_3072}, {"rsa4096", R_RSA_4096}, {"rsa7680", R_RSA_7680}, - {"rsa15360", R_RSA_15360}, - {NULL} + {"rsa15360", R_RSA_15360} }; +# define RSA_NUM OSSL_NELEM(rsa_choices) + +static double rsa_results[RSA_NUM][2]; /* 2 ops: sign then verify */ #define R_EC_P160 0 #define R_EC_P192 1 @@ -536,7 +497,7 @@ static OPT_PAIR rsa_choices[] = { #define R_EC_B571 15 #define R_EC_X25519 16 #ifndef OPENSSL_NO_EC -static OPT_PAIR ecdsa_choices[] = { +static const OPT_PAIR ecdsa_choices[] = { {"ecdsap160", R_EC_P160}, {"ecdsap192", R_EC_P192}, {"ecdsap224", R_EC_P224}, @@ -552,11 +513,13 @@ static OPT_PAIR ecdsa_choices[] = { {"ecdsab233", R_EC_B233}, {"ecdsab283", R_EC_B283}, {"ecdsab409", R_EC_B409}, - {"ecdsab571", R_EC_B571}, - {NULL} + {"ecdsab571", R_EC_B571} }; +# define ECDSA_NUM OSSL_NELEM(ecdsa_choices) + +static double ecdsa_results[ECDSA_NUM][2]; /* 2 ops: sign then verify */ -static OPT_PAIR ecdh_choices[] = { +static const OPT_PAIR ecdh_choices[] = { {"ecdhp160", R_EC_P160}, {"ecdhp192", R_EC_P192}, {"ecdhp224", R_EC_P224}, @@ -576,7 +539,10 @@ static OPT_PAIR ecdh_choices[] = { {"ecdhx25519", R_EC_X25519}, {NULL} }; -#endif +# define EC_NUM OSSL_NELEM(ecdh_choices) + +static double ecdh_results[EC_NUM][1]; /* 1 op: derivation */ +#endif /* OPENSSL_NO_EC */ #ifndef SIGALRM # define COND(d) (count < (d)) @@ -586,7 +552,40 @@ static OPT_PAIR ecdh_choices[] = { # define COUNT(d) (count) #endif /* SIGALRM */ -static int testnum; +static unsigned int testnum; +typedef void *(*kdf_fn) (const void *in, size_t inlen, void *out, + size_t *xoutlen); + +typedef struct loopargs_st { + ASYNC_JOB *inprogress_job; + ASYNC_WAIT_CTX *wait_ctx; + unsigned char *buf; + unsigned char *buf2; + unsigned char *buf_malloc; + unsigned char *buf2_malloc; + unsigned int siglen; +#ifndef OPENSSL_NO_RSA + RSA *rsa_key[RSA_NUM]; +#endif +#ifndef OPENSSL_NO_DSA + DSA *dsa_key[DSA_NUM]; +#endif +#ifndef OPENSSL_NO_EC + EC_KEY *ecdsa[ECDSA_NUM]; + EC_KEY *ecdh_a[EC_NUM]; + EC_KEY *ecdh_b[EC_NUM]; + unsigned char *secret_a; + unsigned char *secret_b; + size_t outlen; + kdf_fn kdf; +#endif + EVP_CIPHER_CTX *ctx; + HMAC_CTX *hctx; + GCM128_CONTEXT *gcm_ctx; +} loopargs_t; + +static int run_benchmark(int async_jobs, int (*loop_function) (void *), + loopargs_t * loopargs); /* Nb of iterations to do per algorithm and key-size */ static long c[ALGOR_NUM][SIZE_NUM]; @@ -995,7 +994,7 @@ static int DSA_verify_loop(void *args) #endif #ifndef OPENSSL_NO_EC -static long ecdsa_c[EC_NUM][2]; +static long ecdsa_c[ECDSA_NUM][2]; static int ECDSA_sign_loop(void *args) { loopargs_t *tempargs = *(loopargs_t **)args; @@ -1188,8 +1187,8 @@ static int run_benchmark(int async_jobs, continue; #endif - ret = ASYNC_start_job(&loopargs[i].inprogress_job, - loopargs[i].wait_ctx, &job_op_count, loop_function, + ret = ASYNC_start_job(&loopargs[i].inprogress_job, + loopargs[i].wait_ctx, &job_op_count, loop_function, (void *)(loopargs + i), sizeof(loopargs_t)); switch (ret) { case ASYNC_PAUSE: @@ -1222,26 +1221,23 @@ int speed_main(int argc, char **argv) { ENGINE *e = NULL; loopargs_t *loopargs = NULL; - int async_init = 0; - int loopargs_len = 0; - char *prog; + const char *prog; const char *engine_id = NULL; const EVP_CIPHER *evp_cipher = NULL; double d = 0.0; OPTION_CHOICE o; - int multiblock = 0, pr_header = 0; + int async_init = 0, multiblock = 0, pr_header = 0; int doit[ALGOR_NUM] = { 0 }; - int ret = 1, i, k, misalign = 0; + int ret = 1, misalign = 0; long count = 0; + unsigned int i, k, loop, loopargs_len = 0, async_jobs = 0; #ifndef NO_FORK int multi = 0; #endif - unsigned int async_jobs = 0; #if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) \ || !defined(OPENSSL_NO_EC) long rsa_count = 1; #endif - size_t loop; /* What follows are the buffers and key material. */ #ifndef OPENSSL_NO_RC5 @@ -1325,7 +1321,7 @@ int speed_main(int argc, char **argv) /* * We only test over the following curves as they are representative, To * add tests over more curves, simply add the curve NID and curve name to - * the following arrays and increase the EC_NUM value accordingly. + * the following arrays and increase the |ecdh_choices| list accordingly. */ static const unsigned int test_curves[EC_NUM] = { /* Prime Curves */ @@ -1360,7 +1356,7 @@ int speed_main(int argc, char **argv) 571, 253 /* X25519 */ }; - int ecdsa_doit[EC_NUM] = { 0 }; + int ecdsa_doit[ECDSA_NUM] = { 0 }; int ecdh_doit[EC_NUM] = { 0 }; #endif /* ndef OPENSSL_NO_EC */ @@ -1418,9 +1414,7 @@ int speed_main(int argc, char **argv) goto opterr; } if (async_jobs > 99999) { - BIO_printf(bio_err, - "%s: too many async_jobs\n", - prog); + BIO_printf(bio_err, "%s: too many async_jobs\n", prog); goto opterr; } #endif @@ -1471,10 +1465,8 @@ int speed_main(int argc, char **argv) if (strcmp(*argv, "openssl") == 0) continue; if (strcmp(*argv, "rsa") == 0) { - rsa_doit[R_RSA_512] = rsa_doit[R_RSA_1024] = - rsa_doit[R_RSA_2048] = rsa_doit[R_RSA_3072] = - rsa_doit[R_RSA_4096] = rsa_doit[R_RSA_7680] = - rsa_doit[R_RSA_15360] = 1; + for (loop = 0; loop < OSSL_NELEM(rsa_doit); loop++) + rsa_doit[loop] = 1; continue; } if (found(*argv, rsa_choices, &i)) { @@ -1507,8 +1499,8 @@ int speed_main(int argc, char **argv) #endif #ifndef OPENSSL_NO_EC if (strcmp(*argv, "ecdsa") == 0) { - for (loop = 0; loop < OSSL_NELEM(ecdsa_choices); loop++) - ecdsa_doit[ecdsa_choices[loop].retval] = 1; + for (loop = 0; loop < OSSL_NELEM(ecdsa_doit); loop++) + ecdsa_doit[loop] = 1; continue; } if (found(*argv, ecdsa_choices, &i)) { @@ -1516,8 +1508,8 @@ int speed_main(int argc, char **argv) continue; } if (strcmp(*argv, "ecdh") == 0) { - for (loop = 0; loop < OSSL_NELEM(ecdh_choices); loop++) - ecdh_doit[ecdh_choices[loop].retval] = 1; + for (loop = 0; loop < OSSL_NELEM(ecdh_doit); loop++) + ecdh_doit[loop] = 1; continue; } if (found(*argv, ecdh_choices, &i)) { @@ -1584,10 +1576,10 @@ int speed_main(int argc, char **argv) dsa_doit[i] = 1; #endif #ifndef OPENSSL_NO_EC - for (loop = 0; loop < OSSL_NELEM(ecdsa_choices); loop++) - ecdsa_doit[ecdsa_choices[loop].retval] = 1; - for (loop = 0; loop < OSSL_NELEM(ecdh_choices); loop++) - ecdh_doit[ecdh_choices[loop].retval] = 1; + for (loop = 0; loop < OSSL_NELEM(ecdsa_doit); loop++) + ecdsa_doit[loop] = 1; + for (loop = 0; loop < OSSL_NELEM(ecdh_doit); loop++) + ecdh_doit[loop] = 1; #endif } for (i = 0; i < ALGOR_NUM; i++) @@ -1850,6 +1842,8 @@ int speed_main(int argc, char **argv) } } } + /* default iteration count for the last EC Curve */ + ecdh_c[R_EC_X25519][0] = count / 1800; # endif # else @@ -2472,7 +2466,7 @@ int speed_main(int argc, char **argv) if (RAND_status() != 1) { RAND_seed(rnd_seed, sizeof(rnd_seed)); } - for (testnum = 0; testnum < EC_NUM; testnum++) { + for (testnum = 0; testnum < ECDSA_NUM; testnum++) { int st = 1; if (!ecdsa_doit[testnum]) @@ -2584,7 +2578,7 @@ int speed_main(int argc, char **argv) ecdh_checks = 0; rsa_count = 1; } else { - int secret_size_a, secret_size_b; + int secret_size_a, secret_size_b, j; /* * If field size is not more than 24 octets, then use SHA-1 * hash of result; otherwise, use result (see section 4.8 of @@ -2613,8 +2607,8 @@ int speed_main(int argc, char **argv) else ecdh_checks = 1; - for (k = 0; k < secret_size_a && ecdh_checks == 1; k++) { - if (loopargs[i].secret_a[k] != loopargs[i].secret_b[k]) + for (j = 0; j < secret_size_a && ecdh_checks == 1; j++) { + if (loopargs[i].secret_a[j] != loopargs[i].secret_b[j]) ecdh_checks = 0; } @@ -2644,7 +2638,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < OSSL_NELEM(ecdh_doit); testnum++) ecdh_doit[testnum] = 0; } } @@ -2693,7 +2687,7 @@ int speed_main(int argc, char **argv) if (!doit[k]) continue; if (mr) - printf("+F:%d:%s", k, names[k]); + printf("+F:%u:%s", k, names[k]); else printf("%-13s", names[k]); for (testnum = 0; testnum < SIZE_NUM; testnum++) { @@ -2742,7 +2736,7 @@ int speed_main(int argc, char **argv) #endif #ifndef OPENSSL_NO_EC testnum = 1; - for (k = 0; k < EC_NUM; k++) { + for (k = 0; k < OSSL_NELEM(ecdsa_doit); k++) { if (!ecdsa_doit[k]) continue; if (testnum && !mr) { @@ -2800,8 +2794,9 @@ int speed_main(int argc, char **argv) DSA_free(loopargs[i].dsa_key[k]); #endif #ifndef OPENSSL_NO_EC - for (k = 0; k < EC_NUM; k++) { + for (k = 0; k < ECDSA_NUM; k++) EC_KEY_free(loopargs[i].ecdsa[k]); + for (k = 0; k < EC_NUM; k++) { EC_KEY_free(loopargs[i].ecdh_a[k]); EC_KEY_free(loopargs[i].ecdh_b[k]); } @@ -2950,7 +2945,7 @@ static int do_multi(int multi) printf("Got: %s from %d\n", buf, n); if (strncmp(buf, "+F:", 3) == 0) { int alg; - int j; + unsigned int j; p = buf + 3; alg = atoi(sstrsep(&p, sep)); diff --git a/deps/openssl/openssl/apps/verify.c b/deps/openssl/openssl/apps/verify.c index 0925ee627fd2..8bcbff61774a 100644 --- a/deps/openssl/openssl/apps/verify.c +++ b/deps/openssl/openssl/apps/verify.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -219,6 +219,7 @@ static int check(X509_STORE *ctx, const char *file, X509_STORE_set_flags(ctx, vflags); if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) { + X509_STORE_CTX_free(csc); printf("error %s: X.509 store context initialization failed\n", (file == NULL) ? "stdin" : file); goto end; diff --git a/deps/openssl/openssl/appveyor.yml b/deps/openssl/openssl/appveyor.yml index 8dd6cb6fb0af..ba291fdd174b 100644 --- a/deps/openssl/openssl/appveyor.yml +++ b/deps/openssl/openssl/appveyor.yml @@ -41,5 +41,5 @@ test_script: - cd _build - nmake test - mkdir ..\_install - - nmake install install_docs DESTDIR=..\_install + - nmake install DESTDIR=..\_install - cd .. diff --git a/deps/openssl/openssl/config b/deps/openssl/openssl/config index 6331d905b410..35e849a9585b 100755 --- a/deps/openssl/openssl/config +++ b/deps/openssl/openssl/config @@ -923,7 +923,7 @@ if [ $? = "0" ]; then if [ "$VERBOSE" = "true" ]; then echo $PERL $THERE/Configure $OUT $options - fi + fi if [ "$DRYRUN" = "false" ]; then $PERL $THERE/Configure $OUT $options fi diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl index 2e704a21246a..d6b5f561c4cf 100755 --- a/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl +++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl @@ -769,7 +769,7 @@ ld1 {v0.16b}, [$inp] // vmovdqu 16(%rdi),%xmm0 # load key part 2 (unaligned) bl _vpaes_schedule_transform // input transform mov $inp, #7 // mov \$7, %esi - + .Loop_schedule_256: sub $inp, $inp, #1 // dec %esi bl _vpaes_schedule_mangle // output low result @@ -778,7 +778,7 @@ // high round bl _vpaes_schedule_round cbz $inp, .Lschedule_mangle_last - bl _vpaes_schedule_mangle + bl _vpaes_schedule_mangle // low round. swap xmm7 and xmm6 dup v0.4s, v0.s[3] // vpshufd \$0xFF, %xmm0, %xmm0 @@ -787,7 +787,7 @@ mov v7.16b, v6.16b // vmovdqa %xmm6, %xmm7 bl _vpaes_schedule_low_round mov v7.16b, v5.16b // vmovdqa %xmm5, %xmm7 - + b .Loop_schedule_256 ## @@ -814,7 +814,7 @@ .Lschedule_mangle_last_dec: ld1 {v20.2d-v21.2d}, [x11] // reload constants - sub $out, $out, #16 // add \$-16, %rdx + sub $out, $out, #16 // add \$-16, %rdx eor v0.16b, v0.16b, v16.16b // vpxor .Lk_s63(%rip), %xmm0, %xmm0 bl _vpaes_schedule_transform // output transform st1 {v0.2d}, [$out] // vmovdqu %xmm0, (%rdx) # save last key diff --git a/deps/openssl/openssl/crypto/arm_arch.h b/deps/openssl/openssl/crypto/arm_arch.h index 3fc9e69b1c0a..25419e0df17d 100644 --- a/deps/openssl/openssl/crypto/arm_arch.h +++ b/deps/openssl/openssl/crypto/arm_arch.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -69,7 +69,7 @@ # endif # endif -# if !__ASSEMBLER__ +# ifndef __ASSEMBLER__ extern unsigned int OPENSSL_armcap_P; # endif diff --git a/deps/openssl/openssl/crypto/armcap.c b/deps/openssl/openssl/crypto/armcap.c index 432a06c0c126..28e97c8c4a04 100644 --- a/deps/openssl/openssl/crypto/armcap.c +++ b/deps/openssl/openssl/crypto/armcap.c @@ -1,5 +1,5 @@ /* - * Copyright 2011-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,6 +13,7 @@ #include #include #include +#include #include "arm_arch.h" diff --git a/deps/openssl/openssl/crypto/armv4cpuid.pl b/deps/openssl/openssl/crypto/armv4cpuid.pl index f7d31a698ae7..ab007c19c3cd 100644 --- a/deps/openssl/openssl/crypto/armv4cpuid.pl +++ b/deps/openssl/openssl/crypto/armv4cpuid.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -125,7 +125,7 @@ ldmia sp!,{r4,r5} .Lno_data: - neg r0,ip + rsb r0,ip,#0 mov r0,r0,lsr#31 #if __ARM_ARCH__>=5 bx lr diff --git a/deps/openssl/openssl/crypto/asn1/a_object.c b/deps/openssl/openssl/crypto/asn1/a_object.c index 1ec7a7e15f4f..7d332ec2f6e1 100644 --- a/deps/openssl/openssl/crypto/asn1/a_object.c +++ b/deps/openssl/openssl/crypto/asn1/a_object.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -19,7 +19,7 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -29,13 +29,24 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp) if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) diff --git a/deps/openssl/openssl/crypto/asn1/a_strex.c b/deps/openssl/openssl/crypto/asn1/a_strex.c index b91266b3c52f..207190c52b22 100644 --- a/deps/openssl/openssl/crypto/asn1/a_strex.c +++ b/deps/openssl/openssl/crypto/asn1/a_strex.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -139,7 +139,7 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned short flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned short orflags; unsigned char *p, *q; unsigned long c; @@ -147,12 +147,32 @@ static int do_buf(unsigned char *buf, int buflen, p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); + return -1; + } + break; + case 2: + if (buflen & 1) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_BMPSTRING_LENGTH); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + + switch (charwidth) { case 4: c = ((unsigned long)*p++) << 24; c |= ((unsigned long)*p++) << 16; @@ -173,6 +193,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: @@ -592,53 +613,3 @@ int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in) *out = stmp.data; return stmp.length; } - -/* Return 1 if host is a valid hostname and 0 otherwise */ -int asn1_valid_host(const ASN1_STRING *host) -{ - int hostlen = host->length; - const unsigned char *hostptr = host->data; - int type = host->type; - int i; - signed char width = -1; - unsigned short chflags = 0, prevchflags; - - if (type > 0 && type < 31) - width = tag2nbyte[type]; - if (width == -1 || hostlen == 0) - return 0; - /* Treat UTF8String as width 1 as any MSB set is invalid */ - if (width == 0) - width = 1; - for (i = 0 ; i < hostlen; i+= width) { - prevchflags = chflags; - /* Value must be <= 0x7F: check upper bytes are all zeroes */ - if (width == 4) { - if (*hostptr++ != 0 || *hostptr++ != 0 || *hostptr++ != 0) - return 0; - } else if (width == 2) { - if (*hostptr++ != 0) - return 0; - } - if (*hostptr > 0x7f) - return 0; - chflags = char_type[*hostptr++]; - if (!(chflags & (CHARTYPE_HOST_ANY | CHARTYPE_HOST_WILD))) { - /* Nothing else allowed at start or end of string */ - if (i == 0 || i == hostlen - 1) - return 0; - /* Otherwise invalid if not dot or hyphen */ - if (!(chflags & (CHARTYPE_HOST_DOT | CHARTYPE_HOST_HYPHEN))) - return 0; - /* - * If previous is dot or hyphen then illegal unless both - * are hyphens: as .- -. .. are all illegal - */ - if (prevchflags & (CHARTYPE_HOST_DOT | CHARTYPE_HOST_HYPHEN) - && ((prevchflags & CHARTYPE_HOST_DOT) - || (chflags & CHARTYPE_HOST_DOT))) - return 0; - } - } - return 1; -} diff --git a/deps/openssl/openssl/crypto/asn1/ameth_lib.c b/deps/openssl/openssl/crypto/asn1/ameth_lib.c index b8ba06787763..9b0a2ccb20b7 100644 --- a/deps/openssl/openssl/crypto/asn1/ameth_lib.c +++ b/deps/openssl/openssl/crypto/asn1/ameth_lib.c @@ -255,6 +255,18 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, goto err; } + /* + * One of the following must be true: + * + * pem_str == NULL AND ASN1_PKEY_ALIAS is set + * pem_str != NULL AND ASN1_PKEY_ALIAS is clear + * + * Anything else is an error and may lead to a corrupt ASN1 method table + */ + if (!((pem_str == NULL && (flags & ASN1_PKEY_ALIAS) != 0) + || (pem_str != NULL && (flags & ASN1_PKEY_ALIAS) == 0))) + goto err; + if (pem_str) { ameth->pem_str = OPENSSL_strdup(pem_str); if (!ameth->pem_str) diff --git a/deps/openssl/openssl/crypto/asn1/asn1_err.c b/deps/openssl/openssl/crypto/asn1/asn1_err.c index 8602c408d962..5d895d30095d 100644 --- a/deps/openssl/openssl/crypto/asn1/asn1_err.c +++ b/deps/openssl/openssl/crypto/asn1/asn1_err.c @@ -92,8 +92,10 @@ static ERR_STRING_DATA ASN1_str_functs[] = { {ERR_FUNC(ASN1_F_D2I_AUTOPRIVATEKEY), "d2i_AutoPrivateKey"}, {ERR_FUNC(ASN1_F_D2I_PRIVATEKEY), "d2i_PrivateKey"}, {ERR_FUNC(ASN1_F_D2I_PUBLICKEY), "d2i_PublicKey"}, + {ERR_FUNC(ASN1_F_DO_BUF), "do_buf"}, {ERR_FUNC(ASN1_F_DO_TCREATE), "do_tcreate"}, {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"}, {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"}, {ERR_FUNC(ASN1_F_I2D_EC_PUBKEY), "i2d_EC_PUBKEY"}, {ERR_FUNC(ASN1_F_I2D_PRIVATEKEY), "i2d_PrivateKey"}, diff --git a/deps/openssl/openssl/crypto/asn1/asn_mime.c b/deps/openssl/openssl/crypto/asn1/asn_mime.c index 84475e9470d9..da0085f680cd 100644 --- a/deps/openssl/openssl/crypto/asn1/asn_mime.c +++ b/deps/openssl/openssl/crypto/asn1/asn_mime.c @@ -969,12 +969,14 @@ static int strip_eol(char *linebuf, int *plen, int flags) p = linebuf + len - 1; for (p = linebuf + len - 1; len > 0; len--, p--) { c = *p; - if (c == '\n') + if (c == '\n') { is_eol = 1; - else if (is_eol && flags & SMIME_ASCIICRLF && c < 33) + } else if (is_eol && flags & SMIME_ASCIICRLF && c == 32) { + /* Strip trailing space on a line; 32 == ASCII for ' ' */ continue; - else if (c != '\r') + } else if (c != '\r') { break; + } } *plen = len; return is_eol; diff --git a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c index 4cb783749881..10a736023351 100644 --- a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c +++ b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -91,7 +91,7 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, if (EVP_CIPHER_iv_length(cipher)) { if (aiv) memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); - else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) + else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0) goto err; } diff --git a/deps/openssl/openssl/crypto/asn1/tasn_enc.c b/deps/openssl/openssl/crypto/asn1/tasn_enc.c index caa48696da4e..3b723a1845db 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_enc.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_enc.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -528,6 +528,8 @@ static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: diff --git a/deps/openssl/openssl/crypto/asn1/tasn_utl.c b/deps/openssl/openssl/crypto/asn1/tasn_utl.c index f79d7d6b447c..832603b1dbcd 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_utl.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_utl.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -76,7 +76,7 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) } return 1; } - if (CRYPTO_atomic_add(lck, op, &ret, *lock) < 0) + if (!CRYPTO_atomic_add(lck, op, &ret, *lock)) return -1; /* failed */ #ifdef REF_PRINT fprintf(stderr, "%p:%4d:%s\n", it, *lck, it->sname); diff --git a/deps/openssl/openssl/crypto/asn1/x_int64.c b/deps/openssl/openssl/crypto/asn1/x_int64.c index cbfa78736267..4433167a442c 100644 --- a/deps/openssl/openssl/crypto/asn1/x_int64.c +++ b/deps/openssl/openssl/crypto/asn1/x_int64.c @@ -262,3 +262,4 @@ ASN1_ITEM_start(ZUINT64) ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf, INTxx_FLAG_ZERO_DEFAULT, "ZUINT64" ASN1_ITEM_end(ZUINT64) + diff --git a/deps/openssl/openssl/crypto/async/arch/async_null.c b/deps/openssl/openssl/crypto/async/arch/async_null.c index da23c532b4c8..3eaf170f2e50 100644 --- a/deps/openssl/openssl/crypto/async/arch/async_null.c +++ b/deps/openssl/openssl/crypto/async/arch/async_null.c @@ -20,3 +20,4 @@ void async_local_cleanup(void) { } #endif + diff --git a/deps/openssl/openssl/crypto/async/async.c b/deps/openssl/openssl/crypto/async/async.c index 9a4e6b26574f..0862cca21ae2 100644 --- a/deps/openssl/openssl/crypto/async/async.c +++ b/deps/openssl/openssl/crypto/async/async.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -30,11 +30,12 @@ static CRYPTO_THREAD_LOCAL ctxkey; static CRYPTO_THREAD_LOCAL poolkey; -static void async_free_pool_internal(async_pool *pool); - static async_ctx *async_ctx_new(void) { - async_ctx *nctx = NULL; + async_ctx *nctx; + + if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) + return NULL; nctx = OPENSSL_malloc(sizeof(async_ctx)); if (nctx == NULL) { @@ -57,9 +58,6 @@ static async_ctx *async_ctx_new(void) async_ctx *async_get_ctx(void) { - if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) - return NULL; - return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey); } @@ -169,16 +167,19 @@ void async_start_func(void) int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, int (*func)(void *), void *args, size_t size) { - async_ctx *ctx = async_get_ctx(); + async_ctx *ctx; + + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) + return ASYNC_ERR; + + ctx = async_get_ctx(); if (ctx == NULL) ctx = async_ctx_new(); - if (ctx == NULL) { + if (ctx == NULL) return ASYNC_ERR; - } - if (*job) { + if (*job) ctx->currjob = *job; - } for (;;) { if (ctx->currjob != NULL) { @@ -219,9 +220,8 @@ int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, } /* Start a new job */ - if ((ctx->currjob = async_get_pool_job()) == NULL) { + if ((ctx->currjob = async_get_pool_job()) == NULL) return ASYNC_NO_JOBS; - } if (args != NULL) { ctx->currjob->funcargs = OPENSSL_malloc(size); @@ -323,12 +323,11 @@ int ASYNC_init_thread(size_t max_size, size_t init_size) return 0; } - if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) { + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) return 0; - } - if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) { + + if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) return 0; - } pool = OPENSSL_zalloc(sizeof(*pool)); if (pool == NULL) { @@ -369,32 +368,41 @@ int ASYNC_init_thread(size_t max_size, size_t init_size) return 1; err: - async_free_pool_internal(pool); + async_empty_pool(pool); + sk_ASYNC_JOB_free(pool->jobs); + OPENSSL_free(pool); return 0; } -static void async_free_pool_internal(async_pool *pool) +void async_delete_thread_state(void) { - if (pool == NULL) - return; + async_pool *pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey); - async_empty_pool(pool); - sk_ASYNC_JOB_free(pool->jobs); - OPENSSL_free(pool); - CRYPTO_THREAD_set_local(&poolkey, NULL); + if (pool != NULL) { + async_empty_pool(pool); + sk_ASYNC_JOB_free(pool->jobs); + OPENSSL_free(pool); + CRYPTO_THREAD_set_local(&poolkey, NULL); + } async_local_cleanup(); async_ctx_free(); } void ASYNC_cleanup_thread(void) { - async_free_pool_internal((async_pool *)CRYPTO_THREAD_get_local(&poolkey)); + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) + return; + + async_delete_thread_state(); } ASYNC_JOB *ASYNC_get_current_job(void) { async_ctx *ctx; + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) + return NULL; + ctx = async_get_ctx(); if (ctx == NULL) return NULL; @@ -409,7 +417,12 @@ ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job) void ASYNC_block_pause(void) { - async_ctx *ctx = async_get_ctx(); + async_ctx *ctx; + + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) + return; + + ctx = async_get_ctx(); if (ctx == NULL || ctx->currjob == NULL) { /* * We're not in a job anyway so ignore this @@ -421,7 +434,12 @@ void ASYNC_block_pause(void) void ASYNC_unblock_pause(void) { - async_ctx *ctx = async_get_ctx(); + async_ctx *ctx; + + if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) + return; + + ctx = async_get_ctx(); if (ctx == NULL || ctx->currjob == NULL) { /* * We're not in a job anyway so ignore this diff --git a/deps/openssl/openssl/crypto/async/async_locl.h b/deps/openssl/openssl/crypto/async/async_locl.h index 0fe302a4cebe..f0ac05a3db75 100644 --- a/deps/openssl/openssl/crypto/async/async_locl.h +++ b/deps/openssl/openssl/crypto/async/async_locl.h @@ -74,3 +74,4 @@ void async_start_func(void); async_ctx *async_get_ctx(void); void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx); + diff --git a/deps/openssl/openssl/crypto/bio/b_addr.c b/deps/openssl/openssl/crypto/bio/b_addr.c index aea843a7b942..6ed1652c8a86 100644 --- a/deps/openssl/openssl/crypto/bio/b_addr.c +++ b/deps/openssl/openssl/crypto/bio/b_addr.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -66,18 +66,18 @@ void BIO_ADDR_clear(BIO_ADDR *ap) int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa) { if (sa->sa_family == AF_INET) { - ap->s_in = *(const struct sockaddr_in *)sa; + memcpy(&(ap->s_in), sa, sizeof(struct sockaddr_in)); return 1; } #ifdef AF_INET6 if (sa->sa_family == AF_INET6) { - ap->s_in6 = *(const struct sockaddr_in6 *)sa; + memcpy(&(ap->s_in6), sa, sizeof(struct sockaddr_in6)); return 1; } #endif #ifdef AF_UNIX if (sa->sa_family == AF_UNIX) { - ap->s_un = *(const struct sockaddr_un *)sa; + memcpy(&(ap->s_un), sa, sizeof(struct sockaddr_un)); return 1; } #endif @@ -604,7 +604,8 @@ static int addrinfo_wrap(int family, int socktype, DEFINE_RUN_ONCE_STATIC(do_bio_lookup_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; bio_lookup_lock = CRYPTO_THREAD_lock_new(); return bio_lookup_lock != NULL; } diff --git a/deps/openssl/openssl/crypto/bio/b_sock.c b/deps/openssl/openssl/crypto/bio/b_sock.c index 97dcc7005efe..fac1432787dc 100644 --- a/deps/openssl/openssl/crypto/bio/b_sock.c +++ b/deps/openssl/openssl/crypto/bio/b_sock.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -317,7 +317,7 @@ int BIO_socket_nbio(int s, int mode) l = fcntl(s, F_GETFL, 0); if (l == -1) { - SYSerr(SYS_F_FCNTL, get_last_rtl_error()); + SYSerr(SYS_F_FCNTL, get_last_sys_error()); ret = -1; } else { # if defined(O_NONBLOCK) @@ -335,7 +335,7 @@ int BIO_socket_nbio(int s, int mode) ret = fcntl(s, F_SETFL, l); if (ret < 0) { - SYSerr(SYS_F_FCNTL, get_last_rtl_error()); + SYSerr(SYS_F_FCNTL, get_last_sys_error()); } } # else diff --git a/deps/openssl/openssl/crypto/bio/bio_lcl.h b/deps/openssl/openssl/crypto/bio/bio_lcl.h index 5f4b94f40bf6..39178cf50a24 100644 --- a/deps/openssl/openssl/crypto/bio/bio_lcl.h +++ b/deps/openssl/openssl/crypto/bio/bio_lcl.h @@ -185,3 +185,4 @@ void bio_sock_cleanup_int(void); # endif #endif + diff --git a/deps/openssl/openssl/crypto/bio/bio_meth.c b/deps/openssl/openssl/crypto/bio/bio_meth.c index 1e785d348f11..63a7cccc827f 100644 --- a/deps/openssl/openssl/crypto/bio/bio_meth.c +++ b/deps/openssl/openssl/crypto/bio/bio_meth.c @@ -43,6 +43,7 @@ BIO_METHOD *BIO_meth_new(int type, const char *name) BIOerr(BIO_F_BIO_METH_NEW, ERR_R_MALLOC_FAILURE); return NULL; } + biom->type = type; return biom; } @@ -54,7 +55,7 @@ void BIO_meth_free(BIO_METHOD *biom) } } -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int) +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int) { return biom->bwrite; } @@ -66,7 +67,7 @@ int BIO_meth_set_write(BIO_METHOD *biom, return 1; } -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int) +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int) { return biom->bread; } @@ -78,7 +79,7 @@ int BIO_meth_set_read(BIO_METHOD *biom, return 1; } -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *) +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *) { return biom->bputs; } @@ -90,7 +91,7 @@ int BIO_meth_set_puts(BIO_METHOD *biom, return 1; } -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int) +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int) { return biom->bgets; } @@ -102,7 +103,7 @@ int BIO_meth_set_gets(BIO_METHOD *biom, return 1; } -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *) +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *) { return biom->ctrl; } @@ -114,7 +115,7 @@ int BIO_meth_set_ctrl(BIO_METHOD *biom, return 1; } -int (*BIO_meth_get_create(BIO_METHOD *biom)) (BIO *) +int (*BIO_meth_get_create(const BIO_METHOD *biom)) (BIO *) { return biom->create; } @@ -125,7 +126,7 @@ int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)) return 1; } -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *) +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *) { return biom->destroy; } @@ -136,7 +137,7 @@ int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)) return 1; } -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) (BIO *, int, BIO_info_cb *) +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) (BIO *, int, BIO_info_cb *) { return biom->callback_ctrl; } diff --git a/deps/openssl/openssl/crypto/bio/bss_log.c b/deps/openssl/openssl/crypto/bio/bss_log.c index 5221acc2e3bc..4719a5e66a68 100644 --- a/deps/openssl/openssl/crypto/bio/bss_log.c +++ b/deps/openssl/openssl/crypto/bio/bss_log.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -196,7 +196,7 @@ static int slg_write(BIO *b, const char *in, int inl) if ((buf = OPENSSL_malloc(inl + 1)) == NULL) { return (0); } - strncpy(buf, in, inl); + memcpy(buf, in, inl); buf[inl] = '\0'; i = 0; diff --git a/deps/openssl/openssl/crypto/bio/bss_mem.c b/deps/openssl/openssl/crypto/bio/bss_mem.c index ff9a3ebb413f..4c0e4d7412df 100644 --- a/deps/openssl/openssl/crypto/bio/bss_mem.c +++ b/deps/openssl/openssl/crypto/bio/bss_mem.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -212,6 +212,8 @@ static int mem_write(BIO *b, const char *in, int inl) goto end; } BIO_clear_retry_flags(b); + if (inl == 0) + return 0; blen = bbm->readp->length; mem_buf_sync(b); if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0) diff --git a/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl b/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl index 1d68d6d07215..96321330904d 100644 --- a/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -297,15 +297,12 @@ mov sp,$tp mov $bp,$rp # restore rp - and sp,$hi0,$ap - bic $bp,$hi0,$bp - bis $bp,$ap,$ap # ap=borrow?tp:rp - .align 4 -.Lcopy: ldq $aj,0($ap) # copy or in-place refresh +.Lcopy: ldq $aj,0($tp) # conditional copy + ldq $nj,0($rp) lda $tp,8($tp) lda $rp,8($rp) - lda $ap,8($ap) + cmoveq $hi0,$nj,$aj stq zero,-8($tp) # zap tp cmpult $tp,$tj,AT stq $aj,-8($rp) diff --git a/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl b/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl index 0dc4fe95e439..ddee8b7fa14e 100644 --- a/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -262,14 +262,15 @@ mov $tp,sp @ "rewind" $tp sub $rp,$rp,$aj @ "rewind" $rp - and $ap,$tp,$nhi - bic $np,$rp,$nhi - orr $ap,$ap,$np @ ap=borrow?tp:rp - -.Lcopy: ldr $tj,[$ap],#4 @ copy or in-place refresh +.Lcopy: ldr $tj,[$tp] @ conditional copy + ldr $aj,[$rp] str sp,[$tp],#4 @ zap tp - str $tj,[$rp],#4 - cmp $tp,$num +#ifdef __thumb2__ + it cc +#endif + movcc $aj,$tj + str $aj,[$rp],#4 + teq $tp,$num @ preserve carry bne .Lcopy mov sp,$num diff --git a/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl index 5cc5c599f9de..0df1fad115bc 100644 --- a/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -341,19 +341,19 @@ { .mmb; sub rptr=rptr,len // rewind sub tptr=tptr,len clrrrb.pr };; -{ .mmi; and aptr=tptr,topbit - andcm bptr=rptr,topbit +{ .mmi; mov aptr=rptr + mov bptr=tptr mov pr.rot=1<<16 };; -{ .mii; or nptr=aptr,bptr +{ .mii; cmp.eq p0,p6=topbit,r0 mov ar.lc=lc - mov ar.ec=3 };; + mov ar.ec=2 };; .Lcopy_ctop: -{ .mmb; (p16) ld8 n[0]=[nptr],8 - (p18) st8 [tptr]=r0,8 - (p16) nop.b 0 } -{ .mmb; (p16) nop.m 0 - (p18) st8 [rptr]=n[2],8 +{ .mmi; (p16) ld8 a[0]=[aptr],8 + (p16) ld8 t[0]=[bptr],8 + (p6) mov a[1]=t[1] };; // (p17) +{ .mmb; (p17) st8 [rptr]=a[1],8 + (p17) st8 [tptr]=r0,8 br.ctop.sptk .Lcopy_ctop };; .Lcopy_cend: diff --git a/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl b/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl index a907571bec3f..e141e1a92524 100644 --- a/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -384,15 +384,13 @@ $PTR_SUB $rp,$num # restore rp not $hi1,$hi0 - and $ap,$hi0,$sp - and $bp,$hi1,$rp - or $ap,$ap,$bp # ap=borrow?tp:rp - -.align 4 -.Lcopy: $LD $aj,($ap) - $PTR_ADD $ap,$BNSZ +.Lcopy: $LD $nj,($tp) # conditional move + $LD $aj,($rp) $ST $zero,($tp) $PTR_ADD $tp,$BNSZ + and $nj,$hi0 + and $aj,$hi1 + or $aj,$nj sltu $at,$tp,$tj $ST $aj,($rp) bnez $at,.Lcopy diff --git a/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl b/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl index 8aa94e8511c9..cd9926a25f8a 100644 --- a/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -517,7 +517,6 @@ stws,ma $hi1,4($rp) subb $ti0,%r0,$hi1 - ldo -4($tp),$tp ___ $code.=<<___ if ($BN_SZ==8); ldd,ma 8($tp),$ti0 @@ -532,21 +531,19 @@ extrd,u $ti0,31,32,$ti0 ; carry in flipped word order sub,db $ti0,%r0,$hi1 - ldo -8($tp),$tp ___ $code.=<<___; - and $tp,$hi1,$ap - andcm $rp,$hi1,$bp - or $ap,$bp,$np - + ldo `$LOCALS+32`($fp),$tp sub $rp,$arrsz,$rp ; rewind rp subi 0,$arrsz,$idx - ldo `$LOCALS+32`($fp),$tp L\$copy - ldd $idx($np),$hi0 + ldd 0($tp),$ti0 + ldd 0($rp),$hi0 std,ma %r0,8($tp) - addib,<> 8,$idx,.-8 ; L\$copy - std,ma $hi0,8($rp) + comiclr,= 0,$hi1,%r0 + copy $ti0,$hi0 + addib,<> 8,$idx,L\$copy + std,ma $hi0,8($rp) ___ if ($BN_SZ==4) { # PA-RISC 1.1 code-path @@ -856,17 +853,16 @@ stws,ma $hi1,4($rp) subb $ti0,%r0,$hi1 - ldo -4($tp),$tp - and $tp,$hi1,$ap - andcm $rp,$hi1,$bp - or $ap,$bp,$np + ldo `$LOCALS+32`($fp),$tp sub $rp,$arrsz,$rp ; rewind rp subi 0,$arrsz,$idx - ldo `$LOCALS+32`($fp),$tp L\$copy_pa11 - ldwx $idx($np),$hi0 + ldw 0($tp),$ti0 + ldw 0($rp),$hi0 stws,ma %r0,4($tp) + comiclr,= 0,$hi1,%r0 + copy $ti0,$hi0 addib,<> 4,$idx,L\$copy_pa11 stws,ma $hi0,4($rp) diff --git a/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl index 5802260ca680..9d14a121565a 100644 --- a/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -301,15 +301,16 @@ li $j,0 mtctr $num subfe $ovf,$j,$ovf ; handle upmost overflow bit - and $ap,$tp,$ovf - andc $np,$rp,$ovf - or $ap,$ap,$np ; ap=borrow?tp:rp .align 4 -Lcopy: ; copy or in-place refresh - $LDX $tj,$ap,$j - $STX $tj,$rp,$j +Lcopy: ; conditional copy + $LDX $tj,$tp,$j + $LDX $aj,$rp,$j + and $tj,$tj,$ovf + andc $aj,$aj,$ovf $STX $j,$tp,$j ; zap at once + or $aj,$aj,$tj + $STX $aj,$rp,$j addi $j,$j,$BNSZ bdnz Lcopy diff --git a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl index 1e19c958a16f..5d9f43aa5dbe 100644 --- a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -1501,16 +1501,14 @@ li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit - and $ap,$tp,$ovf - andc $np,$rp,$ovf - or $ap,$ap,$np ; ap=borrow?tp:rp - addi $t7,$ap,8 mtctr $j .align 4 -Lcopy: ; copy or in-place refresh - ldx $t0,$ap,$i - ldx $t1,$t7,$i +Lcopy: ; conditional copy + ldx $t0,$tp,$i + ldx $t1,$t4,$i + ldx $t2,$rp,$i + ldx $t3,$t6,$i std $i,8($nap_d) ; zap nap_d std $i,16($nap_d) std $i,24($nap_d) @@ -1519,6 +1517,12 @@ std $i,48($nap_d) std $i,56($nap_d) stdu $i,64($nap_d) + and $t0,$t0,$ovf + and $t1,$t1,$ovf + andc $t2,$t2,$ovf + andc $t3,$t3,$ovf + or $t0,$t0,$t2 + or $t1,$t1,$t3 stdx $t0,$rp,$i stdx $t1,$t6,$i stdx $i,$tp,$i ; zap tp at once @@ -1561,20 +1565,21 @@ li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit - addi $tp,$sp,`$FRAME+$TRANSFER+4` + addi $ap,$sp,`$FRAME+$TRANSFER+4` subf $rp,$num,$rp ; rewind rp - and $ap,$tp,$ovf - andc $np,$rp,$ovf - or $ap,$ap,$np ; ap=borrow?tp:rp addi $tp,$sp,`$FRAME+$TRANSFER` mtctr $j .align 4 -Lcopy: ; copy or in-place refresh +Lcopy: ; conditional copy lwz $t0,4($ap) lwz $t1,8($ap) lwz $t2,12($ap) lwzu $t3,16($ap) + lwz $t4,4($rp) + lwz $t5,8($rp) + lwz $t6,12($rp) + lwz $t7,16($rp) std $i,8($nap_d) ; zap nap_d std $i,16($nap_d) std $i,24($nap_d) @@ -1583,6 +1588,18 @@ std $i,48($nap_d) std $i,56($nap_d) stdu $i,64($nap_d) + and $t0,$t0,$ovf + and $t1,$t1,$ovf + and $t2,$t2,$ovf + and $t3,$t3,$ovf + andc $t4,$t4,$ovf + andc $t5,$t5,$ovf + andc $t6,$t6,$ovf + andc $t7,$t7,$ovf + or $t0,$t0,$t4 + or $t1,$t1,$t5 + or $t2,$t2,$t6 + or $t3,$t3,$t7 stw $t0,4($rp) stw $t1,8($rp) stw $t2,12($rp) diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl index 46d746b7d0e7..0466e11a2518 100755 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -104,7 +104,7 @@ $addx = ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); diff --git a/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl b/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl index 2205bc2ca043..66780cdf80bc 100644 --- a/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -252,16 +252,16 @@ brct $count,.Lsub lghi $ahi,0 slbgr $AHI,$ahi # handle upmost carry - - ngr $ap,$AHI - lghi $np,-1 - xgr $np,$AHI - ngr $np,$rp - ogr $ap,$np # ap=borrow?tp:rp + lghi $NHI,-1 + xgr $NHI,$AHI la $j,0(%r0) lgr $count,$num -.Lcopy: lg $alo,0($j,$ap) # copy or in-place refresh +.Lcopy: lg $ahi,$stdframe($j,$sp) # conditional copy + lg $alo,0($j,$rp) + ngr $ahi,$AHI + ngr $alo,$NHI + ogr $alo,$ahi _dswap $alo stg $j,$stdframe($j,$sp) # zap tp stg $alo,0($j,$rp) diff --git a/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl index 4faf66f10a52..4f339b22796e 100755 --- a/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -888,19 +888,17 @@ () sub $tp, $num, $tp sub $rp, $num, $rp - subc $ovf, %g0, $ovf ! handle upmost overflow bit - and $tp, $ovf, $ap - andn $rp, $ovf, $np - or $np, $ap, $ap ! ap=borrow?tp:rp + subccc $ovf, %g0, $ovf ! handle upmost overflow bit ba .Lcopy sub $num, 8, $cnt .align 16 -.Lcopy: ! copy or in-place refresh - ldx [$ap+0], $t2 - add $ap, 8, $ap +.Lcopy: ! conditional copy + ldx [$tp], $tj + ldx [$rp+0], $t2 stx %g0, [$tp] ! zap add $tp, 8, $tp + movcs %icc, $tj, $t2 stx $t2, [$rp+0] add $rp, 8, $rp brnz $cnt, .Lcopy @@ -1136,19 +1134,17 @@ () sub $tp, $num, $tp sub $rp, $num, $rp - subc $ovf, %g0, $ovf ! handle upmost overflow bit - and $tp, $ovf, $ap - andn $rp, $ovf, $np - or $np, $ap, $ap ! ap=borrow?tp:rp + subccc $ovf, %g0, $ovf ! handle upmost overflow bit ba .Lcopy_g5 sub $num, 8, $cnt .align 16 -.Lcopy_g5: ! copy or in-place refresh - ldx [$ap+0], $t2 - add $ap, 8, $ap +.Lcopy_g5: ! conditional copy + ldx [$tp], $tj + ldx [$rp+0], $t2 stx %g0, [$tp] ! zap add $tp, 8, $tp + movcs %icc, $tj, $t2 stx $t2, [$rp+0] add $rp, 8, $rp brnz $cnt, .Lcopy_g5 diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl index 6807c8b6e0b9..074f9df14bc2 100644 --- a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -265,7 +265,6 @@ .Ltail: add $np,$num,$np add $rp,$num,$rp - mov $tp,$ap sub %g0,$num,%o7 ! k=-num ba .Lsub subcc %g0,%g0,%g0 ! clear %icc.c @@ -278,15 +277,14 @@ add %o7,4,%o7 brnz %o7,.Lsub st %o1,[$i] - subc $car2,0,$car2 ! handle upmost overflow bit - and $tp,$car2,$ap - andn $rp,$car2,$np - or $ap,$np,$ap + subccc $car2,0,$car2 ! handle upmost overflow bit sub %g0,$num,%o7 .Lcopy: - ld [$ap+%o7],%o0 ! copy or in-place refresh + ld [$tp+%o7],%o1 ! conditional copy + ld [$rp+%o7],%o0 st %g0,[$tp+%o7] ! zap tp + movcs %icc,%o1,%o0 st %o0,[$rp+%o7] add %o7,4,%o7 brnz %o7,.Lcopy @@ -495,6 +493,9 @@ mulx $npj,$mul1,$acc1 add $tpj,$car1,$car1 ld [$np+$j],$npj ! np[j] + srlx $car1,32,$tmp0 + and $car1,$mask,$car1 + add $tmp0,$sbit,$sbit add $acc0,$car1,$car1 ld [$tp+8],$tpj ! tp[j] add $acc1,$car1,$car1 diff --git a/deps/openssl/openssl/crypto/bn/asm/via-mont.pl b/deps/openssl/openssl/crypto/bn/asm/via-mont.pl index 9f81bc822e8a..9d65a146a280 100644 --- a/deps/openssl/openssl/crypto/bn/asm/via-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/via-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -213,18 +213,15 @@ &mov ("eax",&DWP(0,"esi","edx",4)); # upmost overflow bit &sbb ("eax",0); - &and ("esi","eax"); - ¬ ("eax"); - &mov ("ebp","edi"); - &and ("ebp","eax"); - &or ("esi","ebp"); # tp=carry?tp:rp &mov ("ecx","edx"); # num - &xor ("edx","edx"); # i=0 + &mov ("edx",0); # i=0 &set_label("copy",8); - &mov ("eax",&DWP(0,"esi","edx",4)); - &mov (&DWP(64,"esp","edx",4),"ecx"); # zap tp + &mov ("ebx",&DWP(0,"esi","edx",4)); + &mov ("eax",&DWP(0,"edi","edx",4)); + &mov (&DWP(0,"esi","edx",4),"ecx"); # zap tp + &cmovc ("eax","ebx"); &mov (&DWP(0,"edi","edx",4),"eax"); &lea ("edx",&DWP(1,"edx")); # i++ &loop (&label("copy")); diff --git a/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl b/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl index 64dba4480fbe..ba34b36a81ec 100644 --- a/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -310,23 +310,23 @@ sub $anp, $num, $anp sub $rp, $num, $rp - subc $ovf, %g0, $ovf ! handle upmost overflow bit - and $tp, $ovf, $ap - andn $rp, $ovf, $np - or $np, $ap, $ap ! ap=borrow?tp:rp + subccc $ovf, %g0, $ovf ! handle upmost overflow bit ba .Lcopy sub $num, 8, $cnt .align 16 -.Lcopy: ! copy or in-place refresh - ld [$ap+0], $t2 - ld [$ap+4], $t3 - add $ap, 8, $ap +.Lcopy: ! conditional copy + ld [$tp+0], $t0 + ld [$tp+4], $t1 + ld [$rp+0], $t2 + ld [$rp+4], $t3 stx %g0, [$tp] ! zap add $tp, 8, $tp stx %g0, [$anp] ! zap stx %g0, [$anp+8] add $anp, 16, $anp + movcs %icc, $t0, $t2 + movcs %icc, $t1, $t3 st $t3, [$rp+0] ! flip order st $t2, [$rp+4] add $rp, 8, $rp diff --git a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl index a8b402d59b34..f1abcc5b4c4b 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -39,7 +39,7 @@ $output = pop; open STDOUT,">$output"; - + &asm_init($ARGV[0],$0); $sse2=0; @@ -604,16 +604,18 @@ &jge (&label("sub")); &sbb ("eax",0); # handle upmost overflow bit - &and ($tp,"eax"); - ¬ ("eax"); - &mov ($np,$rp); - &and ($np,"eax"); - &or ($tp,$np); # tp=carry?tp:rp - -&set_label("copy",16); # copy or in-place refresh - &mov ("eax",&DWP(0,$tp,$num,4)); - &mov (&DWP(0,$rp,$num,4),"eax"); # rp[i]=tp[i] + &mov ("edx",-1); + &xor ("edx","eax"); + &jmp (&label("copy")); + +&set_label("copy",16); # conditional copy + &mov ($tp,&DWP($frame,"esp",$num,4)); + &mov ($np,&DWP(0,$rp,$num,4)); &mov (&DWP($frame,"esp",$num,4),$j); # zap temporary vector + &and ($tp,"eax"); + &and ($np,"edx"); + &or ($np,$tp); + &mov (&DWP(0,$rp,$num,4),$np); &dec ($num); &jge (&label("copy")); diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl index df4cca5bfebf..8d2fb2cebb89 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -302,30 +302,30 @@ xor $i,$i # i=0 and clear CF! mov (%rsp),%rax # tp[0] - lea (%rsp),$ap # borrow ap for tp mov $num,$j # j=num - jmp .Lsub + .align 16 .Lsub: sbb ($np,$i,8),%rax mov %rax,($rp,$i,8) # rp[i]=tp[i]-np[i] - mov 8($ap,$i,8),%rax # tp[i+1] + mov 8(%rsp,$i,8),%rax # tp[i+1] lea 1($i),$i # i++ dec $j # doesnn't affect CF! jnz .Lsub sbb \$0,%rax # handle upmost overflow bit + mov \$-1,%rbx + xor %rax,%rbx # not %rax xor $i,$i - and %rax,$ap - not %rax - mov $rp,$np - and %rax,$np mov $num,$j # j=num - or $np,$ap # ap=borrow?tp:rp -.align 16 -.Lcopy: # copy or in-place refresh - mov ($ap,$i,8),%rax - mov $i,(%rsp,$i,8) # zap temporary vector - mov %rax,($rp,$i,8) # rp[i]=tp[i] + +.Lcopy: # conditional copy + mov ($rp,$i,8),%rcx + mov (%rsp,$i,8),%rdx + and %rbx,%rcx + and %rax,%rdx + mov $num,(%rsp,$i,8) # zap temporary vector + or %rcx,%rdx + mov %rdx,($rp,$i,8) # rp[i]=tp[i] lea 1($i),$i sub \$1,$j jnz .Lcopy @@ -695,10 +695,10 @@ my @ri=("%rax","%rdx",$m0,$m1); $code.=<<___; mov 16(%rsp,$num,8),$rp # restore $rp + lea -4($num),$j mov 0(%rsp),@ri[0] # tp[0] - pxor %xmm0,%xmm0 mov 8(%rsp),@ri[1] # tp[1] - shr \$2,$num # num/=4 + shr \$2,$j # j=num/4-1 lea (%rsp),$ap # borrow ap for tp xor $i,$i # i=0 and clear CF! @@ -706,9 +706,7 @@ mov 16($ap),@ri[2] # tp[2] mov 24($ap),@ri[3] # tp[3] sbb 8($np),@ri[1] - lea -1($num),$j # j=num/4-1 - jmp .Lsub4x -.align 16 + .Lsub4x: mov @ri[0],0($rp,$i,8) # rp[i]=tp[i]-np[i] mov @ri[1],8($rp,$i,8) # rp[i]=tp[i]-np[i] @@ -735,34 +733,35 @@ sbb \$0,@ri[0] # handle upmost overflow bit mov @ri[3],24($rp,$i,8) # rp[i]=tp[i]-np[i] - xor $i,$i # i=0 - and @ri[0],$ap - not @ri[0] - mov $rp,$np - and @ri[0],$np - lea -1($num),$j - or $np,$ap # ap=borrow?tp:rp - - movdqu ($ap),%xmm1 - movdqa %xmm0,(%rsp) - movdqu %xmm1,($rp) + pxor %xmm0,%xmm0 + movq @ri[0],%xmm4 + pcmpeqd %xmm5,%xmm5 + pshufd \$0,%xmm4,%xmm4 + mov $num,$j + pxor %xmm4,%xmm5 + shr \$2,$j # j=num/4 + xor %eax,%eax # i=0 + jmp .Lcopy4x .align 16 -.Lcopy4x: # copy or in-place refresh - movdqu 16($ap,$i),%xmm2 - movdqu 32($ap,$i),%xmm1 - movdqa %xmm0,16(%rsp,$i) - movdqu %xmm2,16($rp,$i) - movdqa %xmm0,32(%rsp,$i) - movdqu %xmm1,32($rp,$i) - lea 32($i),$i +.Lcopy4x: # conditional copy + movdqa (%rsp,%rax),%xmm1 + movdqu ($rp,%rax),%xmm2 + pand %xmm4,%xmm1 + pand %xmm5,%xmm2 + movdqa 16(%rsp,%rax),%xmm3 + movdqa %xmm0,(%rsp,%rax) + por %xmm2,%xmm1 + movdqu 16($rp,%rax),%xmm2 + movdqu %xmm1,($rp,%rax) + pand %xmm4,%xmm3 + pand %xmm5,%xmm2 + movdqa %xmm0,16(%rsp,%rax) + por %xmm2,%xmm3 + movdqu %xmm3,16($rp,%rax) + lea 32(%rax),%rax dec $j jnz .Lcopy4x - - shl \$2,$num - movdqu 16($ap,$i),%xmm2 - movdqa %xmm0,16(%rsp,$i) - movdqu %xmm2,16($rp,$i) ___ } $code.=<<___; diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl index 5779059ea268..97d8eee700b6 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -414,18 +414,19 @@ jnz .Lsub sbb \$0,%rax # handle upmost overflow bit + mov \$-1,%rbx + xor %rax,%rbx xor $i,$i - and %rax,$ap - not %rax - mov $rp,$np - and %rax,$np mov $num,$j # j=num - or $np,$ap # ap=borrow?tp:rp -.align 16 -.Lcopy: # copy or in-place refresh - mov ($ap,$i,8),%rax + +.Lcopy: # conditional copy + mov ($rp,$i,8),%rcx + mov (%rsp,$i,8),%rdx + and %rbx,%rcx + and %rax,%rdx mov $i,(%rsp,$i,8) # zap temporary vector - mov %rax,($rp,$i,8) # rp[i]=tp[i] + or %rcx,%rdx + mov %rdx,($rp,$i,8) # rp[i]=tp[i] lea 1($i),$i sub \$1,$j jnz .Lcopy diff --git a/deps/openssl/openssl/crypto/bn/bn_div.c b/deps/openssl/openssl/crypto/bn/bn_div.c index 5e620b2096ca..884ff2991702 100644 --- a/deps/openssl/openssl/crypto/bn/bn_div.c +++ b/deps/openssl/openssl/crypto/bn/bn_div.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -240,6 +240,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, wnum.neg = 0; wnum.d = &(snum->d[loop]); wnum.top = div_n; + wnum.flags = BN_FLG_STATIC_DATA; /* * only needed when BN_ucmp messes up the values between top and max */ diff --git a/deps/openssl/openssl/crypto/bn/bn_exp.c b/deps/openssl/openssl/crypto/bn/bn_exp.c index 0d2d1eca6bb2..a6ad475a0b26 100644 --- a/deps/openssl/openssl/crypto/bn/bn_exp.c +++ b/deps/openssl/openssl/crypto/bn/bn_exp.c @@ -188,8 +188,8 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, bits = BN_num_bits(p); if (bits == 0) { - /* x**0 mod 1 is still zero. */ - if (BN_is_one(m)) { + /* x**0 mod 1, or x**0 mod -1 is still zero. */ + if (BN_abs_is_word(m, 1)) { ret = 1; BN_zero(r); } else { @@ -330,8 +330,8 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } bits = BN_num_bits(p); if (bits == 0) { - /* x**0 mod 1 is still zero. */ - if (BN_is_one(m)) { + /* x**0 mod 1, or x**0 mod -1 is still zero. */ + if (BN_abs_is_word(m, 1)) { ret = 1; BN_zero(rr); } else { @@ -371,17 +371,17 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, ret = 1; goto err; } - if (!BN_to_montgomery(val[0], aa, mont, ctx)) + if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx)) goto err; /* 1 */ window = BN_window_bits_for_exponent_size(bits); if (window > 1) { - if (!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) + if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx)) goto err; /* 2 */ j = 1 << (window - 1); for (i = 1; i < j; i++) { if (((val[i] = BN_CTX_get(ctx)) == NULL) || - !BN_mod_mul_montgomery(val[i], val[i - 1], d, mont, ctx)) + !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx)) goto err; } } @@ -403,19 +403,15 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, for (i = 1; i < j; i++) r->d[i] = (~m->d[i]) & BN_MASK2; r->top = j; - /* - * Upper words will be zero if the corresponding words of 'm' were - * 0xfff[...], so decrement r->top accordingly. - */ - bn_correct_top(r); + r->flags |= BN_FLG_FIXED_TOP; } else #endif - if (!BN_to_montgomery(r, BN_value_one(), mont, ctx)) + if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx)) goto err; for (;;) { if (BN_is_bit_set(p, wstart) == 0) { if (!start) { - if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) + if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) goto err; } if (wstart == 0) @@ -446,12 +442,12 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, /* add the 'bytes above' */ if (!start) for (i = 0; i < j; i++) { - if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) + if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx)) goto err; } /* wvalue will be an odd number < 2^window */ - if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) + if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx)) goto err; /* move the 'window' down further */ @@ -461,6 +457,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, if (wstart < 0) break; } + /* + * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery + * removes padding [if any] and makes return value suitable for public + * API consumer. + */ #if defined(SPARC_T4_MONT) if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) { j = mont->N.top; /* borrow j */ @@ -587,7 +588,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, } b->top = top; - bn_correct_top(b); + b->flags |= BN_FLG_FIXED_TOP; return 1; } @@ -639,8 +640,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, */ bits = p->top * BN_BITS2; if (bits == 0) { - /* x**0 mod 1 is still zero. */ - if (BN_is_one(m)) { + /* x**0 mod 1, or x**0 mod -1 is still zero. */ + if (BN_abs_is_word(m, 1)) { ret = 1; BN_zero(rr); } else { @@ -757,16 +758,16 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, tmp.top = top; } else #endif - if (!BN_to_montgomery(&tmp, BN_value_one(), mont, ctx)) + if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx)) goto err; /* prepare a^1 in Montgomery domain */ if (a->neg || BN_ucmp(a, m) >= 0) { if (!BN_mod(&am, a, m, ctx)) goto err; - if (!BN_to_montgomery(&am, &am, mont, ctx)) + if (!bn_to_mont_fixed_top(&am, &am, mont, ctx)) goto err; - } else if (!BN_to_montgomery(&am, a, mont, ctx)) + } else if (!bn_to_mont_fixed_top(&am, a, mont, ctx)) goto err; #if defined(SPARC_T4_MONT) @@ -1033,14 +1034,14 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, * performance advantage of sqr over mul). */ if (window > 1) { - if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx)) + if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx)) goto err; if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2, window)) goto err; for (i = 3; i < numPowers; i++) { /* Calculate a^i = a^(i-1) * a */ - if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx)) + if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx)) goto err; if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i, window)) @@ -1064,7 +1065,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, /* Scan the window, squaring the result as we go */ for (i = 0; i < window; i++, bits--) { - if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) + if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx)) goto err; wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); } @@ -1077,12 +1078,16 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, goto err; /* Multiply the result into the intermediate result */ - if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx)) + if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx)) goto err; } } - /* Convert the final result from montgomery to standard format */ + /* + * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery + * removes padding [if any] and makes return value suitable for public + * API consumer. + */ #if defined(SPARC_T4_MONT) if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) { am.d[0] = 1; /* borrow am */ @@ -1151,8 +1156,8 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, bits = BN_num_bits(p); if (bits == 0) { - /* x**0 mod 1 is still zero. */ - if (BN_is_one(m)) { + /* x**0 mod 1, or x**0 mod -1 is still zero. */ + if (BN_abs_is_word(m, 1)) { ret = 1; BN_zero(rr); } else { @@ -1273,9 +1278,9 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, } bits = BN_num_bits(p); - if (bits == 0) { - /* x**0 mod 1 is still zero. */ - if (BN_is_one(m)) { + if (bits == 0) { + /* x**0 mod 1, or x**0 mod -1 is still zero. */ + if (BN_abs_is_word(m, 1)) { ret = 1; BN_zero(r); } else { diff --git a/deps/openssl/openssl/crypto/bn/bn_gcd.c b/deps/openssl/openssl/crypto/bn/bn_gcd.c index 067642644ec1..bed231c8fa66 100644 --- a/deps/openssl/openssl/crypto/bn/bn_gcd.c +++ b/deps/openssl/openssl/crypto/bn/bn_gcd.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -140,7 +140,14 @@ BIGNUM *int_bn_mod_inverse(BIGNUM *in, BIGNUM *ret = NULL; int sign; - if (pnoinv) + /* This is invalid input so we don't worry about constant time here */ + if (BN_abs_is_word(n, 1) || BN_is_zero(n)) { + if (pnoinv != NULL) + *pnoinv = 1; + return NULL; + } + + if (pnoinv != NULL) *pnoinv = 0; if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) diff --git a/deps/openssl/openssl/crypto/bn/bn_gf2m.c b/deps/openssl/openssl/crypto/bn/bn_gf2m.c index b1987f55dd2f..d80f3ec94027 100644 --- a/deps/openssl/openssl/crypto/bn/bn_gf2m.c +++ b/deps/openssl/openssl/crypto/bn/bn_gf2m.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -32,30 +32,32 @@ */ # define MAX_ITERATIONS 50 -static const BN_ULONG SQR_tb[16] = { 0, 1, 4, 5, 16, 17, 20, 21, - 64, 65, 68, 69, 80, 81, 84, 85 -}; +# define SQR_nibble(w) ((((w) & 8) << 3) \ + | (((w) & 4) << 2) \ + | (((w) & 2) << 1) \ + | ((w) & 1)) + /* Platform-specific macros to accelerate squaring. */ # if defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) # define SQR1(w) \ - SQR_tb[(w) >> 60 & 0xF] << 56 | SQR_tb[(w) >> 56 & 0xF] << 48 | \ - SQR_tb[(w) >> 52 & 0xF] << 40 | SQR_tb[(w) >> 48 & 0xF] << 32 | \ - SQR_tb[(w) >> 44 & 0xF] << 24 | SQR_tb[(w) >> 40 & 0xF] << 16 | \ - SQR_tb[(w) >> 36 & 0xF] << 8 | SQR_tb[(w) >> 32 & 0xF] + SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \ + SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \ + SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \ + SQR_nibble((w) >> 36) << 8 | SQR_nibble((w) >> 32) # define SQR0(w) \ - SQR_tb[(w) >> 28 & 0xF] << 56 | SQR_tb[(w) >> 24 & 0xF] << 48 | \ - SQR_tb[(w) >> 20 & 0xF] << 40 | SQR_tb[(w) >> 16 & 0xF] << 32 | \ - SQR_tb[(w) >> 12 & 0xF] << 24 | SQR_tb[(w) >> 8 & 0xF] << 16 | \ - SQR_tb[(w) >> 4 & 0xF] << 8 | SQR_tb[(w) & 0xF] + SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \ + SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \ + SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >> 8) << 16 | \ + SQR_nibble((w) >> 4) << 8 | SQR_nibble((w) ) # endif # ifdef THIRTY_TWO_BIT # define SQR1(w) \ - SQR_tb[(w) >> 28 & 0xF] << 24 | SQR_tb[(w) >> 24 & 0xF] << 16 | \ - SQR_tb[(w) >> 20 & 0xF] << 8 | SQR_tb[(w) >> 16 & 0xF] + SQR_nibble((w) >> 28) << 24 | SQR_nibble((w) >> 24) << 16 | \ + SQR_nibble((w) >> 20) << 8 | SQR_nibble((w) >> 16) # define SQR0(w) \ - SQR_tb[(w) >> 12 & 0xF] << 24 | SQR_tb[(w) >> 8 & 0xF] << 16 | \ - SQR_tb[(w) >> 4 & 0xF] << 8 | SQR_tb[(w) & 0xF] + SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >> 8) << 16 | \ + SQR_nibble((w) >> 4) << 8 | SQR_nibble((w) ) # endif # if !defined(OPENSSL_BN_ASM_GF2m) diff --git a/deps/openssl/openssl/crypto/bn/bn_intern.c b/deps/openssl/openssl/crypto/bn/bn_intern.c index 2c970647defd..7b25927f9bca 100644 --- a/deps/openssl/openssl/crypto/bn/bn_intern.c +++ b/deps/openssl/openssl/crypto/bn/bn_intern.c @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -177,16 +177,20 @@ BN_ULONG *bn_get_words(const BIGNUM *a) return a->d; } -void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size) +void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size) { - a->d = words; + /* + * |const| qualifier omission is compensated by BN_FLG_STATIC_DATA + * flag, which effectively means "read-only data". + */ + a->d = (BN_ULONG *)words; a->dmax = a->top = size; a->neg = 0; a->flags |= BN_FLG_STATIC_DATA; bn_correct_top(a); } -int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words) +int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words) { if (bn_wexpand(a, num_words) == NULL) { BNerr(BN_F_BN_SET_WORDS, ERR_R_MALLOC_FAILURE); diff --git a/deps/openssl/openssl/crypto/bn/bn_lcl.h b/deps/openssl/openssl/crypto/bn/bn_lcl.h index 5fb3814554c3..4d9808f5b8d1 100644 --- a/deps/openssl/openssl/crypto/bn/bn_lcl.h +++ b/deps/openssl/openssl/crypto/bn/bn_lcl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -145,7 +145,16 @@ extern "C" { */ # ifdef BN_DEBUG - +/* + * The new BN_FLG_FIXED_TOP flag marks vectors that were not treated with + * bn_correct_top, in other words such vectors are permitted to have zeros + * in most significant limbs. Such vectors are used internally to achieve + * execution time invariance for critical operations with private keys. + * It's BN_DEBUG-only flag, because user application is not supposed to + * observe it anyway. Moreover, optimizing compiler would actually remove + * all operations manipulating the bit in question in non-BN_DEBUG build. + */ +# define BN_FLG_FIXED_TOP 0x10000 # ifdef BN_DEBUG_RAND /* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ # ifndef RAND_bytes @@ -177,8 +186,10 @@ int RAND_bytes(unsigned char *buf, int num); do { \ const BIGNUM *_bnum2 = (a); \ if (_bnum2 != NULL) { \ - OPENSSL_assert(((_bnum2->top == 0) && !_bnum2->neg) || \ - (_bnum2->top && (_bnum2->d[_bnum2->top - 1] != 0))); \ + int _top = _bnum2->top; \ + OPENSSL_assert((_top == 0 && !_bnum2->neg) || \ + (_top && ((_bnum2->flags & BN_FLG_FIXED_TOP) \ + || _bnum2->d[_top - 1] != 0))); \ bn_pollute(_bnum2); \ } \ } while(0) @@ -197,6 +208,7 @@ int RAND_bytes(unsigned char *buf, int num); # else /* !BN_DEBUG */ +# define BN_FLG_FIXED_TOP 0 # define bn_pollute(a) # define bn_check_top(a) # define bn_fix_top(a) bn_correct_top(a) @@ -228,7 +240,8 @@ struct bignum_st { /* Used for montgomery multiplication */ struct bn_mont_ctx_st { int ri; /* number of bits in R */ - BIGNUM RR; /* used to convert to montgomery form */ + BIGNUM RR; /* used to convert to montgomery form, + possibly zero-padded */ BIGNUM N; /* The modulus */ BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only * stored for bignum algorithm) */ diff --git a/deps/openssl/openssl/crypto/bn/bn_lib.c b/deps/openssl/openssl/crypto/bn/bn_lib.c index 705849409292..25eac396e094 100644 --- a/deps/openssl/openssl/crypto/bn/bn_lib.c +++ b/deps/openssl/openssl/crypto/bn/bn_lib.c @@ -12,6 +12,7 @@ #include "internal/cryptlib.h" #include "bn_lcl.h" #include +#include "internal/constant_time_locl.h" /* This stuff appears to be completely unused, so is deprecated */ #if OPENSSL_API_COMPAT < 0x00908000L @@ -222,8 +223,6 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) const BN_ULONG *B; int i; - bn_check_top(b); - if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; @@ -298,8 +297,6 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) BIGNUM *bn_expand2(BIGNUM *b, int words) { - bn_check_top(b); - if (words > b->dmax) { BN_ULONG *a = bn_expand_internal(b, words); if (!a) @@ -312,7 +309,6 @@ BIGNUM *bn_expand2(BIGNUM *b, int words) b->dmax = words; } - bn_check_top(b); return b; } @@ -379,12 +375,19 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); #endif - a->top = b->top; a->neg = b->neg; + a->top = b->top; + a->flags |= b->flags & BN_FLG_FIXED_TOP; bn_check_top(a); return (a); } +#define FLAGS_DATA(flags) ((flags) & (BN_FLG_STATIC_DATA \ + | BN_FLG_CONSTTIME \ + | BN_FLG_SECURE \ + | BN_FLG_FIXED_TOP)) +#define FLAGS_STRUCT(flags) ((flags) & (BN_FLG_MALLOCED)) + void BN_swap(BIGNUM *a, BIGNUM *b) { int flags_old_a, flags_old_b; @@ -412,10 +415,8 @@ void BN_swap(BIGNUM *a, BIGNUM *b) b->dmax = tmp_dmax; b->neg = tmp_neg; - a->flags = - (flags_old_a & BN_FLG_MALLOCED) | (flags_old_b & BN_FLG_STATIC_DATA); - b->flags = - (flags_old_b & BN_FLG_MALLOCED) | (flags_old_a & BN_FLG_STATIC_DATA); + a->flags = FLAGS_STRUCT(flags_old_a) | FLAGS_DATA(flags_old_b); + b->flags = FLAGS_STRUCT(flags_old_b) | FLAGS_DATA(flags_old_a); bn_check_top(a); bn_check_top(b); } @@ -425,8 +426,9 @@ void BN_clear(BIGNUM *a) bn_check_top(a); if (a->d != NULL) OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax); - a->top = 0; a->neg = 0; + a->top = 0; + a->flags &= ~BN_FLG_FIXED_TOP; } BN_ULONG BN_get_word(const BIGNUM *a) @@ -447,6 +449,7 @@ int BN_set_word(BIGNUM *a, BN_ULONG w) a->neg = 0; a->d[0] = w; a->top = (w ? 1 : 0); + a->flags &= ~BN_FLG_FIXED_TOP; bn_check_top(a); return (1); } @@ -499,24 +502,29 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) /* ignore negative */ static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) { - int i; + int n; + size_t i, inc, lasti, j; BN_ULONG l; - bn_check_top(a); - i = BN_num_bytes(a); + n = BN_num_bytes(a); if (tolen == -1) - tolen = i; - else if (tolen < i) + tolen = n; + else if (tolen < n) return -1; - /* Add leading zeroes if necessary */ - if (tolen > i) { - memset(to, 0, tolen - i); - to += tolen - i; + + if (n == 0) { + OPENSSL_cleanse(to, tolen); + return tolen; } - while (i--) { + + lasti = n - 1; + for (i = 0, inc = 1, j = tolen; j > 0;) { l = a->d[i / BN_BYTES]; - *(to++) = (unsigned char)(l >> (8 * (i % BN_BYTES))) & 0xff; + to[--j] = (unsigned char)(l >> (8 * (i % BN_BYTES)) & (0 - inc)); + inc = (i - lasti) >> (8 * sizeof(i) - 1); + i += inc; /* stay on top limb */ } + return tolen; } @@ -683,6 +691,7 @@ int BN_set_bit(BIGNUM *a, int n) for (k = a->top; k < i + 1; k++) a->d[k] = 0; a->top = i + 1; + a->flags &= ~BN_FLG_FIXED_TOP; } a->d[i] |= (((BN_ULONG)1) << j); @@ -824,6 +833,34 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords) a->top ^= t; b->top ^= t; + t = (a->neg ^ b->neg) & condition; + a->neg ^= t; + b->neg ^= t; + + /*- + * Idea behind BN_FLG_STATIC_DATA is actually to + * indicate that data may not be written to. + * Intention is actually to treat it as it's + * read-only data, and some (if not most) of it does + * reside in read-only segment. In other words + * observation of BN_FLG_STATIC_DATA in + * BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or + * effectively cause data corruption. + * BN_FLG_MALLOCED refers to BN structure itself, + * and hence must be preserved. Remaining flags are + * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be + * preserved, because it determines how x->d was + * allocated and hence how to free it. This leaves + * BN_FLG_CONSTTIME that one can do something about. + * To summarize it's sufficient to mask and swap + * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should + * be treated as fatal. + */ + t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + a->flags ^= t; + b->flags ^= t; + #define BN_CONSTTIME_SWAP(ind) \ do { \ t = (a->d[ind] ^ b->d[ind]) & condition; \ @@ -887,8 +924,9 @@ int BN_security_bits(int L, int N) void BN_zero_ex(BIGNUM *a) { - a->top = 0; a->neg = 0; + a->top = 0; + a->flags &= ~BN_FLG_FIXED_TOP; } int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) @@ -1012,5 +1050,6 @@ void bn_correct_top(BIGNUM *a) } if (a->top == 0) a->neg = 0; + a->flags &= ~BN_FLG_FIXED_TOP; bn_pollute(a); } diff --git a/deps/openssl/openssl/crypto/bn/bn_mod.c b/deps/openssl/openssl/crypto/bn/bn_mod.c index 13b583f76c9f..2361094ee4f6 100644 --- a/deps/openssl/openssl/crypto/bn/bn_mod.c +++ b/deps/openssl/openssl/crypto/bn/bn_mod.c @@ -1,5 +1,5 @@ /* - * Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -35,18 +35,73 @@ int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, /* * BN_mod_add variant that may be used if both a and b are non-negative and - * less than m + * less than m. The original algorithm was + * + * if (!BN_uadd(r, a, b)) + * return 0; + * if (BN_ucmp(r, m) >= 0) + * return BN_usub(r, r, m); + * + * which is replaced with addition, subtracting modulus, and conditional + * move depending on whether or not subtraction borrowed. */ -int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m) +int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) { - if (!BN_uadd(r, a, b)) + size_t i, ai, bi, mtop = m->top; + BN_ULONG storage[1024 / BN_BITS2]; + BN_ULONG carry, temp, mask, *rp, *tp = storage; + const BN_ULONG *ap, *bp; + + if (bn_wexpand(r, mtop) == NULL) return 0; - if (BN_ucmp(r, m) >= 0) - return BN_usub(r, r, m); + + if (mtop > sizeof(storage) / sizeof(storage[0]) + && (tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG))) == NULL) + return 0; + + ap = a->d != NULL ? a->d : tp; + bp = b->d != NULL ? b->d : tp; + + for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) { + mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)); + temp = ((ap[ai] & mask) + carry) & BN_MASK2; + carry = (temp < carry); + + mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1)); + tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2; + carry += (tp[i] < temp); + + i++; + ai += (i - a->dmax) >> (8 * sizeof(i) - 1); + bi += (i - b->dmax) >> (8 * sizeof(i) - 1); + } + rp = r->d; + carry -= bn_sub_words(rp, tp, m->d, mtop); + for (i = 0; i < mtop; i++) { + rp[i] = (carry & tp[i]) | (~carry & rp[i]); + ((volatile BN_ULONG *)tp)[i] = 0; + } + r->top = mtop; + r->neg = 0; + + if (tp != storage) + OPENSSL_free(tp); + return 1; } +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) +{ + int ret = bn_mod_add_fixed_top(r, a, b, m); + + if (ret) + bn_correct_top(r); + + return ret; +} + int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx) { diff --git a/deps/openssl/openssl/crypto/bn/bn_mont.c b/deps/openssl/openssl/crypto/bn/bn_mont.c index faef5815717d..3ccf8eaf3713 100644 --- a/deps/openssl/openssl/crypto/bn/bn_mont.c +++ b/deps/openssl/openssl/crypto/bn/bn_mont.c @@ -20,29 +20,43 @@ #define MONT_WORD /* use the faster word-based algorithm */ #ifdef MONT_WORD -static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); +static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); #endif int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx) +{ + int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); + + bn_correct_top(r); + bn_check_top(r); + + return ret; +} + +int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_MONT_CTX *mont, BN_CTX *ctx) { BIGNUM *tmp; int ret = 0; -#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD) int num = mont->N.top; +#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD) if (num > 1 && a->top == num && b->top == num) { if (bn_wexpand(r, num) == NULL) return (0); if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { r->neg = a->neg ^ b->neg; r->top = num; - bn_correct_top(r); + r->flags |= BN_FLG_FIXED_TOP; return (1); } } #endif + if ((a->top + b->top) > 2 * num) + return 0; + BN_CTX_start(ctx); tmp = BN_CTX_get(ctx); if (tmp == NULL) @@ -58,13 +72,12 @@ int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, } /* reduce from aRR to aR */ #ifdef MONT_WORD - if (!BN_from_montgomery_word(r, tmp, mont)) + if (!bn_from_montgomery_word(r, tmp, mont)) goto err; #else if (!BN_from_montgomery(r, tmp, mont, ctx)) goto err; #endif - bn_check_top(r); ret = 1; err: BN_CTX_end(ctx); @@ -72,7 +85,7 @@ int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, } #ifdef MONT_WORD -static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) +static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) { BIGNUM *n; BN_ULONG *ap, *np, *rp, n0, v, carry; @@ -99,6 +112,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) memset(&rp[r->top], 0, sizeof(*rp) * i); r->top = max; + r->flags |= BN_FLG_FIXED_TOP; n0 = mont->n0[0]; /* @@ -117,6 +131,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) if (bn_wexpand(ret, nl) == NULL) return (0); ret->top = nl; + ret->flags |= BN_FLG_FIXED_TOP; ret->neg = r->neg; rp = ret->d; @@ -127,20 +142,16 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) */ ap = &(r->d[nl]); + carry -= bn_sub_words(rp, ap, np, nl); /* - * |v| is one if |ap| - |np| underflowed or zero if it did not. Note |v| - * cannot be -1. That would imply the subtraction did not fit in |nl| words, - * and we know at most one subtraction is needed. + * |carry| is -1 if |ap| - |np| underflowed or zero if it did not. Note + * |carry| cannot be 1. That would imply the subtraction did not fit in + * |nl| words, and we know at most one subtraction is needed. */ - v = bn_sub_words(rp, ap, np, nl) - carry; - v = 0 - v; for (i = 0; i < nl; i++) { - rp[i] = (v & ap[i]) | (~v & rp[i]); + rp[i] = (carry & ap[i]) | (~carry & rp[i]); ap[i] = 0; } - bn_correct_top(r); - bn_correct_top(ret); - bn_check_top(ret); return (1); } @@ -154,8 +165,11 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BIGNUM *t; BN_CTX_start(ctx); - if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) - retn = BN_from_montgomery_word(ret, t, mont); + if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { + retn = bn_from_montgomery_word(ret, t, mont); + bn_correct_top(ret); + bn_check_top(ret); + } BN_CTX_end(ctx); #else /* !MONT_WORD */ BIGNUM *t1, *t2; @@ -193,6 +207,12 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, return (retn); } +int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx) +{ + return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx); +} + BN_MONT_CTX *BN_MONT_CTX_new(void) { BN_MONT_CTX *ret; @@ -229,7 +249,7 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont) int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { - int ret = 0; + int i, ret = 0; BIGNUM *Ri, *R; if (BN_is_zero(mod)) @@ -278,7 +298,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) if ((buf[1] = mod->top > 1 ? mod->d[1] : 0)) tmod.top = 2; - if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) + if (BN_is_one(&tmod)) + BN_zero(Ri); + else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) goto err; if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) goto err; /* R*Ri */ @@ -311,7 +333,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) buf[1] = 0; tmod.top = buf[0] != 0 ? 1 : 0; /* Ri = R^-1 mod N */ - if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) + if (BN_is_one(&tmod)) + BN_zero(Ri); + else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) goto err; if (!BN_lshift(Ri, Ri, BN_BITS2)) goto err; /* R*Ri */ @@ -360,6 +384,11 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx)) goto err; + for (i = mont->RR.top, ret = mont->N.top; i < ret; i++) + mont->RR.d[i] = 0; + mont->RR.top = ret; + mont->RR.flags |= BN_FLG_FIXED_TOP; + ret = 1; err: BN_CTX_end(ctx); diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.h b/deps/openssl/openssl/crypto/bn/bn_prime.h index 5f5cc4f58009..41440fa4e19c 100644 --- a/deps/openssl/openssl/crypto/bn/bn_prime.h +++ b/deps/openssl/openssl/crypto/bn/bn_prime.h @@ -15,260 +15,260 @@ typedef unsigned short prime_t; static const prime_t primes[2048] = { - 2, 3, 5, 7, 11, 13, 17, 19, - 23, 29, 31, 37, 41, 43, 47, 53, - 59, 61, 67, 71, 73, 79, 83, 89, - 97, 101, 103, 107, 109, 113, 127, 131, - 137, 139, 149, 151, 157, 163, 167, 173, - 179, 181, 191, 193, 197, 199, 211, 223, - 227, 229, 233, 239, 241, 251, 257, 263, - 269, 271, 277, 281, 283, 293, 307, 311, - 313, 317, 331, 337, 347, 349, 353, 359, - 367, 373, 379, 383, 389, 397, 401, 409, - 419, 421, 431, 433, 439, 443, 449, 457, - 461, 463, 467, 479, 487, 491, 499, 503, - 509, 521, 523, 541, 547, 557, 563, 569, - 571, 577, 587, 593, 599, 601, 607, 613, - 617, 619, 631, 641, 643, 647, 653, 659, - 661, 673, 677, 683, 691, 701, 709, 719, - 727, 733, 739, 743, 751, 757, 761, 769, - 773, 787, 797, 809, 811, 821, 823, 827, - 829, 839, 853, 857, 859, 863, 877, 881, - 883, 887, 907, 911, 919, 929, 937, 941, - 947, 953, 967, 971, 977, 983, 991, 997, - 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, - 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, - 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, - 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, - 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, - 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, - 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, - 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, - 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, - 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, - 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, - 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, - 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, - 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, - 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, - 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, - 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, - 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, - 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, - 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, - 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, - 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, - 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, - 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, - 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, - 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, - 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, - 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, - 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, - 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, - 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, - 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, - 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, - 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, - 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, - 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, - 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, - 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, - 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, - 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, - 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, - 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, - 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, - 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, - 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, - 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, - 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, - 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, - 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, - 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, - 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, - 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, - 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, - 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, - 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, - 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, - 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, - 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, - 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, - 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, - 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, - 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, - 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, - 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, - 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, - 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, - 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, - 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, - 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, - 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, - 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, - 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, - 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, - 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, - 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, - 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, - 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, - 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, - 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, - 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, - 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, - 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, - 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, - 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, - 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, - 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, - 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, - 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, - 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, - 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, - 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, - 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, - 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, - 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, - 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, - 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, - 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, - 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, - 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, - 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, - 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, - 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, - 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, - 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, - 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, - 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, - 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, - 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, - 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, - 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, - 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, - 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, - 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, - 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, - 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, - 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, - 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, - 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, - 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, - 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, - 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, - 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, - 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, - 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, - 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, - 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, - 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, - 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, - 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, - 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, - 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, - 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, - 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, - 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, - 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, - 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, - 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, - 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, - 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, - 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, - 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, - 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, - 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, - 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, - 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, - 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, - 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, - 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, - 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, - 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, - 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, - 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, - 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, - 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, - 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, - 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, - 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, - 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, - 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, - 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, - 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, - 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, - 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, - 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, - 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, - 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, - 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, - 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, - 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, - 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, - 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, - 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, - 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, - 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, - 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, - 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, - 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, - 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, - 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, - 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, - 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, - 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, - 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, - 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, - 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, - 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, - 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, - 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, - 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, - 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, - 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, - 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, - 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, - 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, - 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, - 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, - 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, - 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, - 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, - 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, - 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, - 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, - 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, - 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, - 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, - 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, - 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, - 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, - 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, - 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, - 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, - 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, - 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, - 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, - 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, - 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, - 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, - 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, - 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, - 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, - 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, - 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, - 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, - 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, - 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, - 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, - 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, - 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, - 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, - 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, - 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, - 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, - 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, - 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, - 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, + 2, 3, 5, 7, 11, 13, 17, 19, + 23, 29, 31, 37, 41, 43, 47, 53, + 59, 61, 67, 71, 73, 79, 83, 89, + 97, 101, 103, 107, 109, 113, 127, 131, + 137, 139, 149, 151, 157, 163, 167, 173, + 179, 181, 191, 193, 197, 199, 211, 223, + 227, 229, 233, 239, 241, 251, 257, 263, + 269, 271, 277, 281, 283, 293, 307, 311, + 313, 317, 331, 337, 347, 349, 353, 359, + 367, 373, 379, 383, 389, 397, 401, 409, + 419, 421, 431, 433, 439, 443, 449, 457, + 461, 463, 467, 479, 487, 491, 499, 503, + 509, 521, 523, 541, 547, 557, 563, 569, + 571, 577, 587, 593, 599, 601, 607, 613, + 617, 619, 631, 641, 643, 647, 653, 659, + 661, 673, 677, 683, 691, 701, 709, 719, + 727, 733, 739, 743, 751, 757, 761, 769, + 773, 787, 797, 809, 811, 821, 823, 827, + 829, 839, 853, 857, 859, 863, 877, 881, + 883, 887, 907, 911, 919, 929, 937, 941, + 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, + 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, + 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, + 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, + 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, + 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, + 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, + 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, + 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, + 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, + 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, + 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, + 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, + 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, + 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, + 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, + 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, + 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, + 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, + 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, + 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, + 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, + 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, + 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, + 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, + 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, + 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, + 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, + 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, + 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, + 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, + 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, + 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, + 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, + 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, + 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, + 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, + 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, + 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, + 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, + 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, + 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, + 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, + 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, + 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, + 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, + 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, + 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, + 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, + 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, + 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, + 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, + 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, + 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, + 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, + 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, + 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, + 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, + 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, + 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, + 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, + 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, + 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, + 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, + 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, + 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, + 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, + 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, + 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, + 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, + 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, + 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, + 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, + 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, + 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, + 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, + 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, + 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, + 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, + 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, + 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, + 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, + 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, + 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, + 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, + 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, + 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, + 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, + 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, + 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, + 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, + 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, + 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, + 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, + 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, + 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, + 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, + 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, + 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, + 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, + 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, + 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, + 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, + 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, + 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, + 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, + 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, + 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, + 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, + 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, + 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, + 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, + 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, + 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, + 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, + 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, + 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, + 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, + 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, + 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, + 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, + 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, + 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, + 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, + 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, + 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, + 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, + 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, + 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, + 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, + 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, + 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, + 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, + 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, + 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, + 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, + 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, + 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, + 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, + 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, + 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, + 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, + 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, + 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, + 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, + 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, + 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, + 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, + 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, + 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, + 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, + 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, + 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, + 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, + 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, + 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, + 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, + 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, + 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, + 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, + 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, + 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, + 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, + 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, + 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, + 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, + 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, + 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, + 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, + 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, + 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, + 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, + 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, + 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, + 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, + 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, + 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, + 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, + 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, + 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, + 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, + 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, + 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, + 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, + 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, + 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, + 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, + 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, + 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, + 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, + 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, + 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, + 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, + 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, + 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, + 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, + 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, + 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, + 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, + 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, + 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, + 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, + 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, + 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, + 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, + 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, + 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, + 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, + 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, + 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, + 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, + 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, + 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, + 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, + 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, + 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, + 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, + 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, + 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, + 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, + 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, + 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, + 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, + 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, + 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, + 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, + 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, + 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, + 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, + 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, + 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, + 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, + 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, + 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, + 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, }; diff --git a/deps/openssl/openssl/crypto/bn/bn_sqr.c b/deps/openssl/openssl/crypto/bn/bn_sqr.c index 44e7332acf1a..1f12a14e4423 100644 --- a/deps/openssl/openssl/crypto/bn/bn_sqr.c +++ b/deps/openssl/openssl/crypto/bn/bn_sqr.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -82,14 +82,8 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) } rr->neg = 0; - /* - * If the most-significant half of the top word of 'a' is zero, then the - * square of 'a' will max-1 words. - */ - if (a->d[al - 1] == (a->d[al - 1] & BN_MASK2l)) - rr->top = max - 1; - else - rr->top = max; + rr->top = max; + bn_correct_top(rr); if (r != rr && BN_copy(r, rr) == NULL) goto err; diff --git a/deps/openssl/openssl/crypto/build.info b/deps/openssl/openssl/crypto/build.info index 916d24f66ed5..e693ebadcd32 100644 --- a/deps/openssl/openssl/crypto/build.info +++ b/deps/openssl/openssl/crypto/build.info @@ -1,4 +1,3 @@ -{- use File::Spec::Functions qw/catdir catfile/; -} LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ diff --git a/deps/openssl/openssl/crypto/cast/asm/cast-586.pl b/deps/openssl/openssl/crypto/cast/asm/cast-586.pl index 9024b67e32fd..6beb9c5f2550 100644 --- a/deps/openssl/openssl/crypto/cast/asm/cast-586.pl +++ b/deps/openssl/openssl/crypto/cast/asm/cast-586.pl @@ -7,7 +7,7 @@ # https://www.openssl.org/source/license.html -# This flag makes the inner loop one cycle longer, but generates +# This flag makes the inner loop one cycle longer, but generates # code that runs %30 faster on the pentium pro/II, 44% faster # of PIII, while only %7 slower on the pentium. # By default, this flag is on. diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl index c90306e45c93..b5e21e4938e0 100755 --- a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl +++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl @@ -15,7 +15,7 @@ # ==================================================================== # # December 2014 -# +# # ChaCha20 for ARMv4. # # Performance in cycles per byte out of large buffer. @@ -720,7 +720,7 @@ sub NEONROUND { vadd.i32 $d2,$d1,$t0 @ counter+2 str @t[3], [sp,#4*(16+15)] mov @t[3],#10 - add @x[12],@x[12],#3 @ counter+3 + add @x[12],@x[12],#3 @ counter+3 b .Loop_neon .align 4 diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl index db3776a2fc17..f7e107471450 100755 --- a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl +++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl @@ -15,7 +15,7 @@ # ==================================================================== # # June 2015 -# +# # ChaCha20 for ARMv8. # # Performance in cycles per byte out of large buffer. @@ -201,7 +201,7 @@ sub ROUND { mov $ctr,#10 subs $len,$len,#64 .Loop: - sub $ctr,$ctr,#1 + sub $ctr,$ctr,#1 ___ foreach (&ROUND(0, 4, 8,12)) { eval; } foreach (&ROUND(0, 5,10,15)) { eval; } diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl index f972ee471a65..181decdad9d2 100755 --- a/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl +++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl @@ -15,7 +15,7 @@ # ==================================================================== # # October 2015 -# +# # ChaCha20 for PowerPC/AltiVec. # # Performance in cycles per byte out of large buffer. @@ -525,7 +525,7 @@ sub VMXROUND { lwz @d[3],12($ctr) vadduwm @K[5],@K[4],@K[5] - vspltisw $twenty,-12 # synthesize constants + vspltisw $twenty,-12 # synthesize constants vspltisw $twelve,12 vspltisw $twenty5,-7 #vspltisw $seven,7 # synthesized in the loop diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl index 61b328612b7c..932dec67e43c 100755 --- a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl +++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -61,7 +61,7 @@ $1>=10); # first version supporting AVX $ymm=1 if ($xmm && !$ymm && - `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && + `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); # first version supporting AVX $a="eax"; diff --git a/deps/openssl/openssl/crypto/cms/cms_env.c b/deps/openssl/openssl/crypto/cms/cms_env.c index 8d4594353084..fe5076ec02dd 100644 --- a/deps/openssl/openssl/crypto/cms/cms_env.c +++ b/deps/openssl/openssl/crypto/cms/cms_env.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -282,6 +282,7 @@ int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey) CMSerr(CMS_F_CMS_RECIPIENTINFO_SET0_PKEY, CMS_R_NOT_KEY_TRANSPORT); return 0; } + EVP_PKEY_free(ri->d.ktri->pkey); ri->d.ktri->pkey = pkey; return 1; } diff --git a/deps/openssl/openssl/crypto/cms/cms_smime.c b/deps/openssl/openssl/crypto/cms/cms_smime.c index 7e7b6e5d4f79..5dcf803f4bd3 100644 --- a/deps/openssl/openssl/crypto/cms/cms_smime.c +++ b/deps/openssl/openssl/crypto/cms/cms_smime.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -631,6 +631,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert) * all. */ else if (!cert || !CMS_RecipientInfo_ktri_cert_cmp(ri, cert)) { + EVP_PKEY_up_ref(pk); CMS_RecipientInfo_set0_pkey(ri, pk); r = CMS_RecipientInfo_decrypt(cms, ri); CMS_RecipientInfo_set0_pkey(ri, NULL); diff --git a/deps/openssl/openssl/crypto/conf/build.info b/deps/openssl/openssl/crypto/conf/build.info index 4438eb42620f..ff367994ea09 100644 --- a/deps/openssl/openssl/crypto/conf/build.info +++ b/deps/openssl/openssl/crypto/conf/build.info @@ -1,4 +1,4 @@ LIBS=../../libcrypto SOURCE[../../libcrypto]= \ conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \ - conf_mall.c conf_sap.c + conf_mall.c conf_sap.c conf_ssl.c diff --git a/deps/openssl/openssl/crypto/conf/conf_api.c b/deps/openssl/openssl/crypto/conf/conf_api.c index 5535416ab3bf..79e682a84748 100644 --- a/deps/openssl/openssl/crypto/conf/conf_api.c +++ b/deps/openssl/openssl/crypto/conf/conf_api.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -205,10 +205,14 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section) vv = lh_CONF_VALUE_insert(conf->data, v); OPENSSL_assert(vv == NULL); + if (lh_CONF_VALUE_error(conf->data) > 0) + goto err; return v; err: sk_CONF_VALUE_free(sk); + if (v != NULL) + OPENSSL_free(v->section); OPENSSL_free(v); return NULL; } diff --git a/deps/openssl/openssl/crypto/conf/conf_err.c b/deps/openssl/openssl/crypto/conf/conf_err.c index 0863bc4d3616..19f480d5b32b 100644 --- a/deps/openssl/openssl/crypto/conf/conf_err.c +++ b/deps/openssl/openssl/crypto/conf/conf_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ static ERR_STRING_DATA CONF_str_functs[] = { {ERR_FUNC(CONF_F_NCONF_LOAD_BIO), "NCONF_load_bio"}, {ERR_FUNC(CONF_F_NCONF_LOAD_FP), "NCONF_load_fp"}, {ERR_FUNC(CONF_F_NCONF_NEW), "NCONF_new"}, + {ERR_FUNC(CONF_F_SSL_MODULE_INIT), "ssl_module_init"}, {ERR_FUNC(CONF_F_STR_COPY), "str_copy"}, {0, NULL} }; @@ -57,6 +58,12 @@ static ERR_STRING_DATA CONF_str_reasons[] = { {ERR_REASON(CONF_R_NO_SECTION), "no section"}, {ERR_REASON(CONF_R_NO_SUCH_FILE), "no such file"}, {ERR_REASON(CONF_R_NO_VALUE), "no value"}, + {ERR_REASON(CONF_R_SSL_COMMAND_SECTION_EMPTY), + "ssl command section empty"}, + {ERR_REASON(CONF_R_SSL_COMMAND_SECTION_NOT_FOUND), + "ssl command section not found"}, + {ERR_REASON(CONF_R_SSL_SECTION_EMPTY), "ssl section empty"}, + {ERR_REASON(CONF_R_SSL_SECTION_NOT_FOUND), "ssl section not found"}, {ERR_REASON(CONF_R_UNABLE_TO_CREATE_NEW_SECTION), "unable to create new section"}, {ERR_REASON(CONF_R_UNKNOWN_MODULE_NAME), "unknown module name"}, diff --git a/deps/openssl/openssl/crypto/conf/conf_lcl.h b/deps/openssl/openssl/crypto/conf/conf_lcl.h new file mode 100644 index 000000000000..6e1f7fe00d70 --- /dev/null +++ b/deps/openssl/openssl/crypto/conf/conf_lcl.h @@ -0,0 +1,11 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +void conf_add_ssl_module(void); + diff --git a/deps/openssl/openssl/crypto/conf/conf_mall.c b/deps/openssl/openssl/crypto/conf/conf_mall.c index 4e7a434e0e4d..7e86948e89e9 100644 --- a/deps/openssl/openssl/crypto/conf/conf_mall.c +++ b/deps/openssl/openssl/crypto/conf/conf_mall.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -14,6 +14,7 @@ #include #include #include +#include "conf_lcl.h" /* Load all OpenSSL builtin modules */ @@ -26,4 +27,5 @@ void OPENSSL_load_builtin_modules(void) ENGINE_add_conf_module(); #endif EVP_add_alg_module(); + conf_add_ssl_module(); } diff --git a/deps/openssl/openssl/crypto/conf/conf_ssl.c b/deps/openssl/openssl/crypto/conf/conf_ssl.c new file mode 100644 index 000000000000..015c46c6da52 --- /dev/null +++ b/deps/openssl/openssl/crypto/conf/conf_ssl.c @@ -0,0 +1,178 @@ +/* + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include +#include "internal/sslconf.h" +#include "conf_lcl.h" + +/* + * SSL library configuration module placeholder. We load it here but defer + * all decisions about its contents to libssl. + */ + +struct ssl_conf_name_st { + /* Name of this set of commands */ + char *name; + /* List of commands */ + SSL_CONF_CMD *cmds; + /* Number of commands */ + size_t cmd_count; +}; + +struct ssl_conf_cmd_st { + /* Command */ + char *cmd; + /* Argument */ + char *arg; +}; + +static struct ssl_conf_name_st *ssl_names; +static size_t ssl_names_count; + +static void ssl_module_free(CONF_IMODULE *md) +{ + size_t i, j; + if (ssl_names == NULL) + return; + for (i = 0; i < ssl_names_count; i++) { + struct ssl_conf_name_st *tname = ssl_names + i; + + OPENSSL_free(tname->name); + for (j = 0; j < tname->cmd_count; j++) { + OPENSSL_free(tname->cmds[j].cmd); + OPENSSL_free(tname->cmds[j].arg); + } + OPENSSL_free(tname->cmds); + } + OPENSSL_free(ssl_names); + ssl_names = NULL; + ssl_names_count = 0; +} + +static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf) +{ + size_t i, j, cnt; + int rv = 0; + const char *ssl_conf_section; + STACK_OF(CONF_VALUE) *cmd_lists; + + ssl_conf_section = CONF_imodule_get_value(md); + cmd_lists = NCONF_get_section(cnf, ssl_conf_section); + if (sk_CONF_VALUE_num(cmd_lists) <= 0) { + if (cmd_lists == NULL) + CONFerr(CONF_F_SSL_MODULE_INIT, CONF_R_SSL_SECTION_NOT_FOUND); + else + CONFerr(CONF_F_SSL_MODULE_INIT, CONF_R_SSL_SECTION_EMPTY); + ERR_add_error_data(2, "section=", ssl_conf_section); + goto err; + } + cnt = sk_CONF_VALUE_num(cmd_lists); + ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt); + ssl_names_count = cnt; + for (i = 0; i < ssl_names_count; i++) { + struct ssl_conf_name_st *ssl_name = ssl_names + i; + CONF_VALUE *sect = sk_CONF_VALUE_value(cmd_lists, (int)i); + STACK_OF(CONF_VALUE) *cmds = NCONF_get_section(cnf, sect->value); + + if (sk_CONF_VALUE_num(cmds) <= 0) { + if (cmds == NULL) + CONFerr(CONF_F_SSL_MODULE_INIT, + CONF_R_SSL_COMMAND_SECTION_NOT_FOUND); + else + CONFerr(CONF_F_SSL_MODULE_INIT, + CONF_R_SSL_COMMAND_SECTION_EMPTY); + ERR_add_error_data(4, "name=", sect->name, ", value=", sect->value); + goto err; + } + ssl_name->name = OPENSSL_strdup(sect->name); + if (ssl_name->name == NULL) + goto err; + cnt = sk_CONF_VALUE_num(cmds); + ssl_name->cmds = OPENSSL_zalloc(cnt * sizeof(struct ssl_conf_cmd_st)); + if (ssl_name->cmds == NULL) + goto err; + ssl_name->cmd_count = cnt; + for (j = 0; j < cnt; j++) { + const char *name; + CONF_VALUE *cmd_conf = sk_CONF_VALUE_value(cmds, (int)j); + struct ssl_conf_cmd_st *cmd = ssl_name->cmds + j; + + /* Skip any initial dot in name */ + name = strchr(cmd_conf->name, '.'); + if (name != NULL) + name++; + else + name = cmd_conf->name; + cmd->cmd = OPENSSL_strdup(name); + cmd->arg = OPENSSL_strdup(cmd_conf->value); + if (cmd->cmd == NULL || cmd->arg == NULL) + goto err; + } + + } + rv = 1; + err: + if (rv == 0) + ssl_module_free(md); + return rv; +} + +/* + * Returns the set of commands with index |idx| previously searched for via + * conf_ssl_name_find. Also stores the name of the set of commands in |*name| + * and the number of commands in the set in |*cnt|. + */ +const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt) +{ + *name = ssl_names[idx].name; + *cnt = ssl_names[idx].cmd_count; + return ssl_names[idx].cmds; +} + +/* + * Search for the named set of commands given in |name|. On success return the + * index for the command set in |*idx|. + * Returns 1 on success or 0 on failure. + */ +int conf_ssl_name_find(const char *name, size_t *idx) +{ + size_t i; + const struct ssl_conf_name_st *nm; + + if (name == NULL) + return 0; + for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) { + if (strcmp(nm->name, name) == 0) { + *idx = i; + return 1; + } + } + return 0; +} + +/* + * Given a command set |cmd|, return details on the command at index |idx| which + * must be less than the number of commands in the set (as returned by + * conf_ssl_get). The name of the command will be returned in |*cmdstr| and the + * argument is returned in |*arg|. + */ +void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr, + char **arg) +{ + *cmdstr = cmd[idx].cmd; + *arg = cmd[idx].arg; +} + +void conf_add_ssl_module(void) +{ + CONF_module_add("ssl_conf", ssl_module_init, ssl_module_free); +} diff --git a/deps/openssl/openssl/crypto/cryptlib.c b/deps/openssl/openssl/crypto/cryptlib.c index d93bcd357b63..3b878cd0c20e 100644 --- a/deps/openssl/openssl/crypto/cryptlib.c +++ b/deps/openssl/openssl/crypto/cryptlib.c @@ -23,29 +23,97 @@ extern unsigned int OPENSSL_ia32cap_P[4]; # if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) -#include + +/* + * Purpose of these minimalistic and character-type-agnostic subroutines + * is to break dependency on MSVCRT (on Windows) and locale. This makes + * OPENSSL_cpuid_setup safe to use as "constructor". "Character-type- + * agnostic" means that they work with either wide or 8-bit characters, + * exploiting the fact that first 127 characters can be simply casted + * between the sets, while the rest would be simply rejected by ossl_is* + * subroutines. + */ +# ifdef _WIN32 +typedef WCHAR variant_char; + +static variant_char *ossl_getenv(const char *name) +{ + /* + * Since we pull only one environment variable, it's simpler to + * to just ignore |name| and use equivalent wide-char L-literal. + * As well as to ignore excessively long values... + */ + static WCHAR value[48]; + DWORD len = GetEnvironmentVariableW(L"OPENSSL_ia32cap", value, 48); + + return (len > 0 && len < 48) ? value : NULL; +} +# else +typedef char variant_char; +# define ossl_getenv getenv +# endif + +static int todigit(variant_char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + else if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + else if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + + /* return largest base value to make caller terminate the loop */ + return 16; +} + +static uint64_t ossl_strtouint64(const variant_char *str) +{ + uint64_t ret = 0; + unsigned int digit, base = 10; + + if (*str == '0') { + base = 8, str++; + if (*str == 'x' || *str == 'X') + base = 16, str++; + } + + while((digit = todigit(*str++)) < base) + ret = ret * base + digit; + + return ret; +} + +static variant_char *ossl_strchr(const variant_char *str, char srch) +{ variant_char c; + + while((c = *str)) { + if (c == srch) + return (variant_char *)str; + str++; + } + + return NULL; +} + # define OPENSSL_CPUID_SETUP typedef uint64_t IA32CAP; + void OPENSSL_cpuid_setup(void) { static int trigger = 0; IA32CAP OPENSSL_ia32_cpuid(unsigned int *); IA32CAP vec; - char *env; + const variant_char *env; if (trigger) return; trigger = 1; - if ((env = getenv("OPENSSL_ia32cap"))) { + if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) { int off = (env[0] == '~') ? 1 : 0; -# if defined(_WIN32) - if (!sscanf(env + off, "%I64i", &vec)) - vec = strtoul(env + off, NULL, 0); -# else - if (!sscanf(env + off, "%lli", (long long *)&vec)) - vec = strtoul(env + off, NULL, 0); -# endif + + vec = ossl_strtouint64(env + off); + if (off) { IA32CAP mask = vec; vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask; @@ -64,15 +132,17 @@ void OPENSSL_cpuid_setup(void) vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P); } - if ((env = strchr(env, ':'))) { - unsigned int vecx; + if ((env = ossl_strchr(env, ':')) != NULL) { + IA32CAP vecx; + env++; off = (env[0] == '~') ? 1 : 0; - vecx = strtoul(env + off, NULL, 0); - if (off) - OPENSSL_ia32cap_P[2] &= ~vecx; - else - OPENSSL_ia32cap_P[2] = vecx; + vecx = ossl_strtouint64(env + off); + if (off) { + OPENSSL_ia32cap_P[2] &= ~(unsigned int)vecx; + } else { + OPENSSL_ia32cap_P[2] = (unsigned int)vecx; + } } else { OPENSSL_ia32cap_P[2] = 0; } @@ -128,10 +198,14 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); + FARPROC f; + if (mod != NULL) - _OPENSSL_isservice.f = GetProcAddress(mod, "_OPENSSL_isservice"); - if (_OPENSSL_isservice.p == NULL) + f = GetProcAddress(mod, "_OPENSSL_isservice"); + if (f == NULL) _OPENSSL_isservice.p = (void *)-1; + else + _OPENSSL_isservice.f = f; } if (_OPENSSL_isservice.p != (void *)-1) diff --git a/deps/openssl/openssl/crypto/dh/dh_key.c b/deps/openssl/openssl/crypto/dh/dh_key.c index 58003d708781..b53a0632445b 100644 --- a/deps/openssl/openssl/crypto/dh/dh_key.c +++ b/deps/openssl/openssl/crypto/dh/dh_key.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/crypto/dh/dh_meth.c b/deps/openssl/openssl/crypto/dh/dh_meth.c index ce6114c1335f..59c4d7e96782 100644 --- a/deps/openssl/openssl/crypto/dh/dh_meth.c +++ b/deps/openssl/openssl/crypto/dh/dh_meth.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -75,7 +75,7 @@ int DH_meth_set1_name(DH_METHOD *dhm, const char *name) return 1; } -int DH_meth_get_flags(DH_METHOD *dhm) +int DH_meth_get_flags(const DH_METHOD *dhm) { return dhm->flags; } diff --git a/deps/openssl/openssl/crypto/dllmain.c b/deps/openssl/openssl/crypto/dllmain.c index 2d9678702508..91904aad983b 100644 --- a/deps/openssl/openssl/crypto/dllmain.c +++ b/deps/openssl/openssl/crypto/dllmain.c @@ -57,3 +57,4 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return (TRUE); } #endif + diff --git a/deps/openssl/openssl/crypto/dsa/dsa_err.c b/deps/openssl/openssl/crypto/dsa/dsa_err.c index b8f0af4662e6..132008803e5e 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_err.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -40,6 +40,7 @@ static ERR_STRING_DATA DSA_str_functs[] = { {ERR_FUNC(DSA_F_DSA_SIG_NEW), "DSA_SIG_new"}, {ERR_FUNC(DSA_F_OLD_DSA_PRIV_DECODE), "old_dsa_priv_decode"}, {ERR_FUNC(DSA_F_PKEY_DSA_CTRL), "pkey_dsa_ctrl"}, + {ERR_FUNC(DSA_F_PKEY_DSA_CTRL_STR), "pkey_dsa_ctrl_str"}, {ERR_FUNC(DSA_F_PKEY_DSA_KEYGEN), "pkey_dsa_keygen"}, {0, NULL} }; diff --git a/deps/openssl/openssl/crypto/dsa/dsa_gen.c b/deps/openssl/openssl/crypto/dsa/dsa_gen.c index e58ad8d70d31..46f4f01ee0e4 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_gen.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -64,9 +64,16 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, /* invalid q size */ return 0; - if (evpmd == NULL) - /* use SHA1 as default */ - evpmd = EVP_sha1(); + if (evpmd == NULL) { + if (qsize == SHA_DIGEST_LENGTH) + evpmd = EVP_sha1(); + else if (qsize == SHA224_DIGEST_LENGTH) + evpmd = EVP_sha224(); + else + evpmd = EVP_sha256(); + } else { + qsize = EVP_MD_size(evpmd); + } if (bits < 512) bits = 512; diff --git a/deps/openssl/openssl/crypto/dsa/dsa_meth.c b/deps/openssl/openssl/crypto/dsa/dsa_meth.c index f0188f2007df..04203780c42b 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_meth.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_meth.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -83,7 +83,7 @@ int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name) return 1; } -int DSA_meth_get_flags(DSA_METHOD *dsam) +int DSA_meth_get_flags(const DSA_METHOD *dsam) { return dsam->flags; } diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c index 7f48cf2e3326..4aa49f554af3 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -61,19 +61,13 @@ const DSA_METHOD *DSA_OpenSSL(void) static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { BIGNUM *kinv = NULL; - BIGNUM *m; - BIGNUM *xr; + BIGNUM *m, *blind, *blindm, *tmp; BN_CTX *ctx = NULL; int reason = ERR_R_BN_LIB; DSA_SIG *ret = NULL; int rv = 0; - m = BN_new(); - xr = BN_new(); - if (m == NULL || xr == NULL) - goto err; - - if (!dsa->p || !dsa->q || !dsa->g) { + if (dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) { reason = DSA_R_MISSING_PARAMETERS; goto err; } @@ -89,6 +83,13 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) ctx = BN_CTX_new(); if (ctx == NULL) goto err; + m = BN_CTX_get(ctx); + blind = BN_CTX_get(ctx); + blindm = BN_CTX_get(ctx); + tmp = BN_CTX_get(ctx); + if (tmp == NULL) + goto err; + redo: if (!dsa_sign_setup(dsa, ctx, &kinv, &ret->r, dgst, dlen)) goto err; @@ -103,17 +104,50 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) if (BN_bin2bn(dgst, dlen, m) == NULL) goto err; - /* Compute s = inv(k) (m + xr) mod q */ - if (!BN_mod_mul(xr, dsa->priv_key, ret->r, dsa->q, ctx)) - goto err; /* s = xr */ - if (!BN_add(ret->s, xr, m)) - goto err; /* s = m + xr */ - if (BN_cmp(ret->s, dsa->q) > 0) - if (!BN_sub(ret->s, ret->s, dsa->q)) + /* + * The normal signature calculation is: + * + * s := k^-1 * (m + r * priv_key) mod q + * + * We will blind this to protect against side channel attacks + * + * s := blind^-1 * k^-1 * (blind * m + blind * r * priv_key) mod q + */ + + /* Generate a blinding value */ + do { + if (!BN_rand(blind, BN_num_bits(dsa->q) - 1, BN_RAND_TOP_ANY, + BN_RAND_BOTTOM_ANY)) goto err; + } while (BN_is_zero(blind)); + BN_set_flags(blind, BN_FLG_CONSTTIME); + BN_set_flags(blindm, BN_FLG_CONSTTIME); + BN_set_flags(tmp, BN_FLG_CONSTTIME); + + /* tmp := blind * priv_key * r mod q */ + if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->q, ctx)) + goto err; + if (!BN_mod_mul(tmp, tmp, ret->r, dsa->q, ctx)) + goto err; + + /* blindm := blind * m mod q */ + if (!BN_mod_mul(blindm, blind, m, dsa->q, ctx)) + goto err; + + /* s : = (blind * priv_key * r) + (blind * m) mod q */ + if (!BN_mod_add_quick(ret->s, tmp, blindm, dsa->q)) + goto err; + + /* s := s * k^-1 mod q */ if (!BN_mod_mul(ret->s, ret->s, kinv, dsa->q, ctx)) goto err; + /* s:= s * blind^-1 mod q */ + if (BN_mod_inverse(blind, blind, dsa->q, ctx) == NULL) + goto err; + if (!BN_mod_mul(ret->s, ret->s, blind, dsa->q, ctx)) + goto err; + /* * Redo if r or s is zero as required by FIPS 186-3: this is very * unlikely. @@ -130,8 +164,6 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) ret = NULL; } BN_CTX_free(ctx); - BN_clear_free(m); - BN_clear_free(xr); BN_clear_free(kinv); return ret; } diff --git a/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c b/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c index 95f088a5ec25..d60631695482 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -76,13 +76,8 @@ static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, DSA_PKEY_CTX *dctx = ctx->data; DSA *dsa = ctx->pkey->pkey.dsa; - if (dctx->md) { - if (tbslen != (size_t)EVP_MD_size(dctx->md)) - return 0; - } else { - if (tbslen != SHA_DIGEST_LENGTH) - return 0; - } + if (dctx->md != NULL && tbslen != (size_t)EVP_MD_size(dctx->md)) + return 0; ret = DSA_sign(0, tbs, tbslen, sig, &sltmp, dsa); @@ -100,13 +95,8 @@ static int pkey_dsa_verify(EVP_PKEY_CTX *ctx, DSA_PKEY_CTX *dctx = ctx->data; DSA *dsa = ctx->pkey->pkey.dsa; - if (dctx->md) { - if (tbslen != (size_t)EVP_MD_size(dctx->md)) - return 0; - } else { - if (tbslen != SHA_DIGEST_LENGTH) - return 0; - } + if (dctx->md != NULL && tbslen != (size_t)EVP_MD_size(dctx->md)) + return 0; ret = DSA_verify(0, tbs, tbslen, sig, siglen, dsa); @@ -187,9 +177,15 @@ static int pkey_dsa_ctrl_str(EVP_PKEY_CTX *ctx, NULL); } if (strcmp(type, "dsa_paramgen_md") == 0) { + const EVP_MD *md = EVP_get_digestbyname(value); + + if (md == NULL) { + DSAerr(DSA_F_PKEY_DSA_CTRL_STR, DSA_R_INVALID_DIGEST_TYPE); + return 0; + } return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0, - (void *)EVP_get_digestbyname(value)); + (void *)md); } return -2; } diff --git a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c index a4b0cdd95b5d..e01425bc75e8 100644 --- a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c +++ b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ # endif # include # define HAVE_DLINFO 1 -# if defined(_AIX) || defined(__CYGWIN__) || \ +# if defined(__CYGWIN__) || \ defined(__SCO_VERSION__) || defined(_SCO_ELF) || \ (defined(__osf__) && !defined(RTLD_NEXT)) || \ (defined(__OpenBSD__) && !defined(RTLD_SELF)) || \ @@ -308,6 +308,76 @@ static int dladdr(void *address, Dl_info *dl) } # endif /* __sgi */ +# ifdef _AIX +/*- + * See IBM's AIX Version 7.2, Technical Reference: + * Base Operating System and Extensions, Volume 1 and 2 + * https://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.base/technicalreferences.htm + */ +# include +# include +/* ~ 64 * (sizeof(struct ld_info) + _XOPEN_PATH_MAX + _XOPEN_NAME_MAX) */ +# define DLFCN_LDINFO_SIZE 86976 +typedef struct Dl_info { + const char *dli_fname; +} Dl_info; +/* + * This dladdr()-implementation will also find the ptrgl (Pointer Glue) virtual + * address of a function, which is just located in the DATA segment instead of + * the TEXT segment. + */ +static int dladdr(void *ptr, Dl_info *dl) +{ + uintptr_t addr = (uintptr_t)ptr; + unsigned int found = 0; + struct ld_info *ldinfos, *next_ldi, *this_ldi; + + if ((ldinfos = (struct ld_info *)OPENSSL_malloc(DLFCN_LDINFO_SIZE)) == NULL) { + errno = ENOMEM; + dl->dli_fname = NULL; + return 0; + } + + if ((loadquery(L_GETINFO, (void *)ldinfos, DLFCN_LDINFO_SIZE)) < 0) { + /*- + * Error handling is done through errno and dlerror() reading errno: + * ENOMEM (ldinfos buffer is too small), + * EINVAL (invalid flags), + * EFAULT (invalid ldinfos ptr) + */ + OPENSSL_free((void *)ldinfos); + dl->dli_fname = NULL; + return 0; + } + next_ldi = ldinfos; + + do { + this_ldi = next_ldi; + if (((addr >= (uintptr_t)this_ldi->ldinfo_textorg) + && (addr < ((uintptr_t)this_ldi->ldinfo_textorg + + this_ldi->ldinfo_textsize))) + || ((addr >= (uintptr_t)this_ldi->ldinfo_dataorg) + && (addr < ((uintptr_t)this_ldi->ldinfo_dataorg + + this_ldi->ldinfo_datasize)))) { + found = 1; + /* + * Ignoring the possibility of a member name and just returning + * the path name. See docs: sys/ldr.h, loadquery() and + * dlopen()/RTLD_MEMBER. + */ + if ((dl->dli_fname = + OPENSSL_strdup(this_ldi->ldinfo_filename)) == NULL) + errno = ENOMEM; + } else { + next_ldi = + (struct ld_info *)((uintptr_t)this_ldi + this_ldi->ldinfo_next); + } + } while (this_ldi->ldinfo_next && !found); + OPENSSL_free((void *)ldinfos); + return (found && dl->dli_fname != NULL); +} +# endif /* _AIX */ + static int dlfcn_pathbyaddr(void *addr, char *path, int sz) { # ifdef HAVE_DLINFO @@ -326,12 +396,19 @@ static int dlfcn_pathbyaddr(void *addr, char *path, int sz) if (dladdr(addr, &dli)) { len = (int)strlen(dli.dli_fname); - if (sz <= 0) + if (sz <= 0) { +# ifdef _AIX + OPENSSL_free((void *)dli.dli_fname); +# endif return len + 1; + } if (len >= sz) len = sz - 1; memcpy(path, dli.dli_fname, len); path[len++] = 0; +# ifdef _AIX + OPENSSL_free((void *)dli.dli_fname); +# endif return len; } diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl index 2314b7524421..4eb4c68977e4 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -894,13 +894,13 @@ .Loop_scatter_w7: ldr $mask,[$inp],#4 subs $index,$index,#1 - strb $mask,[$out,#64*0-1] + strb $mask,[$out,#64*0] mov $mask,$mask,lsr#8 - strb $mask,[$out,#64*1-1] + strb $mask,[$out,#64*1] mov $mask,$mask,lsr#8 - strb $mask,[$out,#64*2-1] + strb $mask,[$out,#64*2] mov $mask,$mask,lsr#8 - strb $mask,[$out,#64*3-1] + strb $mask,[$out,#64*3] add $out,$out,#64*4 bne .Loop_scatter_w7 @@ -1633,7 +1633,7 @@ $code.=<<___; .Ladd_done: add sp,sp,#32*18+16+16 @ +16 means "skip even over saved r0-r3" -#if __ARM_ARCH__>=5 || defined(__thumb__) +#if __ARM_ARCH__>=5 || !defined(__thumb__) ldmia sp!,{r4-r12,pc} #else ldmia sp!,{r4-r12,lr} diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl index d93c4fe9575d..2a39675bfd10 100644 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -660,7 +660,7 @@ adc $ap,xzr,xzr // zap $ap tst $acc0,#1 // is a even? - csel $acc0,$acc0,$t0,eq // ret = even ? a : a+modulus + csel $acc0,$acc0,$t0,eq // ret = even ? a : a+modulus csel $acc1,$acc1,$t1,eq csel $acc2,$acc2,$t2,eq csel $acc3,$acc3,$t3,eq @@ -1477,21 +1477,21 @@ prfm pstl1strm,[$out,#4096+64*5] prfm pstl1strm,[$out,#4096+64*6] prfm pstl1strm,[$out,#4096+64*7] - strb w3,[$out,#64*0-1] + strb w3,[$out,#64*0] lsr x3,x3,#8 - strb w3,[$out,#64*1-1] + strb w3,[$out,#64*1] lsr x3,x3,#8 - strb w3,[$out,#64*2-1] + strb w3,[$out,#64*2] lsr x3,x3,#8 - strb w3,[$out,#64*3-1] + strb w3,[$out,#64*3] lsr x3,x3,#8 - strb w3,[$out,#64*4-1] + strb w3,[$out,#64*4] lsr x3,x3,#8 - strb w3,[$out,#64*5-1] + strb w3,[$out,#64*5] lsr x3,x3,#8 - strb w3,[$out,#64*6-1] + strb w3,[$out,#64*6] lsr x3,x3,#8 - strb w3,[$out,#64*7-1] + strb w3,[$out,#64*7] add $out,$out,#64*8 b.ne .Loop_scatter_w7 diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl index 3bdd2cf13f01..edd7d01281ca 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,7 @@ $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl index ee110694590c..0c1af95b134b 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -1531,13 +1531,13 @@ ld [$inp],%l0 add $inp,4,$inp subcc $index,1,$index - stb %l0,[$out+64*0-1] + stb %l0,[$out+64*0] srl %l0,8,%l1 - stb %l1,[$out+64*1-1] + stb %l1,[$out+64*1] srl %l0,16,%l2 - stb %l2,[$out+64*2-1] + stb %l2,[$out+64*2] srl %l0,24,%l3 - stb %l3,[$out+64*3-1] + stb %l3,[$out+64*3] bne .Loop_scatter_w7 add $out,64*4,$out @@ -1874,7 +1874,7 @@ ldx [$bp+8*($i+1)],$bi ! bp[$i+1] ___ $code.=<<___; - addcc $acc1,$t0,$acc1 ! accumulate high parts of multiplication + addcc $acc1,$t0,$acc1 ! accumulate high parts of multiplication sllx $acc0,32,$t0 addxccc $acc2,$t1,$acc2 srlx $acc0,32,$t1 diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl index f637c844c4ef..b3bec23228f3 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -443,7 +443,7 @@ &mov (&DWP(20,"esp"),"eax"); &mov (&DWP(24,"esp"),"eax"); &mov (&DWP(28,"esp"),"eax"); - + &call ("_ecp_nistz256_sub"); &stack_pop(8); @@ -1179,7 +1179,7 @@ &mov ("esi",&wparam(1)); &mov ("ebp",&wparam(2)); - &lea ("edi",&DWP(-1,"edi","ebp")); + &lea ("edi",&DWP(0,"edi","ebp")); &mov ("ebp",64/4); &set_label("scatter_w7_loop"); &mov ("eax",&DWP(0,"esi")); diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl index 183137e5f0a8..714e852a1826 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl @@ -3051,8 +3051,8 @@ () ######################################################################## # Convert ecp_nistz256_table.c to layout expected by ecp_nistz_gather_w7 # -open TABLE,"Z, src->Z)) return 0; dest->Z_is_one = src->Z_is_one; + dest->curve_name = src->curve_name; return 1; } diff --git a/deps/openssl/openssl/crypto/ec/ec_ameth.c b/deps/openssl/openssl/crypto/ec/ec_ameth.c index b66adf2bbc24..f8f1e2c842ce 100644 --- a/deps/openssl/openssl/crypto/ec/ec_ameth.c +++ b/deps/openssl/openssl/crypto/ec/ec_ameth.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,19 +92,19 @@ static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) static EC_KEY *eckey_type2param(int ptype, const void *pval) { EC_KEY *eckey = NULL; + EC_GROUP *group = NULL; + if (ptype == V_ASN1_SEQUENCE) { const ASN1_STRING *pstr = pval; - const unsigned char *pm = NULL; - int pmlen; - pm = pstr->data; - pmlen = pstr->length; + const unsigned char *pm = pstr->data; + int pmlen = pstr->length; + if ((eckey = d2i_ECParameters(NULL, &pm, pmlen)) == NULL) { ECerr(EC_F_ECKEY_TYPE2PARAM, EC_R_DECODE_ERROR); goto ecerr; } } else if (ptype == V_ASN1_OBJECT) { const ASN1_OBJECT *poid = pval; - EC_GROUP *group; /* * type == V_ASN1_OBJECT => the parameters are given by an asn1 OID @@ -129,6 +129,7 @@ static EC_KEY *eckey_type2param(int ptype, const void *pval) ecerr: EC_KEY_free(eckey); + EC_GROUP_free(group); return NULL; } diff --git a/deps/openssl/openssl/crypto/ec/ec_curve.c b/deps/openssl/openssl/crypto/ec/ec_curve.c index f8a3846fd566..b022528be2fd 100644 --- a/deps/openssl/openssl/crypto/ec/ec_curve.c +++ b/deps/openssl/openssl/crypto/ec/ec_curve.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -3036,6 +3036,8 @@ static EC_GROUP *ec_group_new_from_data(const ec_list_element curve) } #endif + EC_GROUP_set_curve_name(group, curve.nid); + if ((P = EC_POINT_new(group)) == NULL) { ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB); goto err; @@ -3101,8 +3103,6 @@ EC_GROUP *EC_GROUP_new_by_curve_name(int nid) return NULL; } - EC_GROUP_set_curve_name(ret, nid); - return ret; } diff --git a/deps/openssl/openssl/crypto/ec/ec_lcl.h b/deps/openssl/openssl/crypto/ec/ec_lcl.h index ded35a72a014..d8141704cfb1 100644 --- a/deps/openssl/openssl/crypto/ec/ec_lcl.h +++ b/deps/openssl/openssl/crypto/ec/ec_lcl.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -269,6 +269,8 @@ struct ec_key_st { struct ec_point_st { const EC_METHOD *meth; + /* NID for the curve if known */ + int curve_name; /* * All members except 'meth' are handled by the method functions, even if * they appear generic @@ -281,6 +283,20 @@ struct ec_point_st { * special case */ }; + +static ossl_inline int ec_point_is_compat(const EC_POINT *point, + const EC_GROUP *group) +{ + if (group->meth != point->meth + || (group->curve_name != 0 + && point->curve_name != 0 + && group->curve_name != point->curve_name)) + return 0; + + return 1; +} + + NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *); NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *); NISTP521_PRE_COMP *EC_nistp521_pre_comp_dup(NISTP521_PRE_COMP *); diff --git a/deps/openssl/openssl/crypto/ec/ec_lib.c b/deps/openssl/openssl/crypto/ec/ec_lib.c index 7cb4bfee2844..e256e4e51180 100644 --- a/deps/openssl/openssl/crypto/ec/ec_lib.c +++ b/deps/openssl/openssl/crypto/ec/ec_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -140,6 +140,8 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) if (dest == src) return 1; + dest->curve_name = src->curve_name; + /* Copy precomputed */ dest->pre_comp_type = src->pre_comp_type; switch (src->pre_comp_type) { @@ -202,7 +204,6 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) return 0; } - dest->curve_name = src->curve_name; dest->asn1_flag = src->asn1_flag; dest->asn1_form = src->asn1_form; @@ -563,6 +564,7 @@ EC_POINT *EC_POINT_new(const EC_GROUP *group) } ret->meth = group->meth; + ret->curve_name = group->curve_name; if (!ret->meth->point_init(ret)) { OPENSSL_free(ret); @@ -600,7 +602,10 @@ int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) ECerr(EC_F_EC_POINT_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (dest->meth != src->meth) { + if (dest->meth != src->meth + || (dest->curve_name != src->curve_name + && dest->curve_name != 0 + && src->curve_name != 0)) { ECerr(EC_F_EC_POINT_COPY, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -657,7 +662,7 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -676,7 +681,7 @@ int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -694,7 +699,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -720,7 +725,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -746,7 +751,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -764,7 +769,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -780,8 +785,8 @@ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, ECerr(EC_F_EC_POINT_ADD, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if ((group->meth != r->meth) || (r->meth != a->meth) - || (a->meth != b->meth)) { + if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group) + || !ec_point_is_compat(b, group)) { ECerr(EC_F_EC_POINT_ADD, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -795,7 +800,7 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, ECerr(EC_F_EC_POINT_DBL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if ((group->meth != r->meth) || (r->meth != a->meth)) { + if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)) { ECerr(EC_F_EC_POINT_DBL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -808,7 +813,7 @@ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != a->meth) { + if (!ec_point_is_compat(a, group)) { ECerr(EC_F_EC_POINT_INVERT, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -822,7 +827,7 @@ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_IS_AT_INFINITY, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -843,7 +848,7 @@ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, ECerr(EC_F_EC_POINT_IS_ON_CURVE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_IS_ON_CURVE, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -857,7 +862,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, ECerr(EC_F_EC_POINT_CMP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return -1; } - if ((group->meth != a->meth) || (a->meth != b->meth)) { + if (!ec_point_is_compat(a, group) || !ec_point_is_compat(b, group)) { ECerr(EC_F_EC_POINT_CMP, EC_R_INCOMPATIBLE_OBJECTS); return -1; } @@ -870,7 +875,7 @@ int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) ECerr(EC_F_EC_POINT_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_MAKE_AFFINE, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -887,7 +892,7 @@ int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, return 0; } for (i = 0; i < num; i++) { - if (group->meth != points[i]->meth) { + if (!ec_point_is_compat(points[i], group)) { ECerr(EC_F_EC_POINTS_MAKE_AFFINE, EC_R_INCOMPATIBLE_OBJECTS); return 0; } diff --git a/deps/openssl/openssl/crypto/ec/ec_mult.c b/deps/openssl/openssl/crypto/ec/ec_mult.c index b39777fbf2f0..56c7767772d1 100644 --- a/deps/openssl/openssl/crypto/ec/ec_mult.c +++ b/deps/openssl/openssl/crypto/ec/ec_mult.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -105,6 +105,224 @@ void EC_ec_pre_comp_free(EC_PRE_COMP *pre) OPENSSL_free(pre); } +#define EC_POINT_BN_set_flags(P, flags) do { \ + BN_set_flags((P)->X, (flags)); \ + BN_set_flags((P)->Y, (flags)); \ + BN_set_flags((P)->Z, (flags)); \ +} while(0) + +/*- + * This functions computes (in constant time) a point multiplication over the + * EC group. + * + * At a high level, it is Montgomery ladder with conditional swaps. + * + * It performs either a fixed scalar point multiplication + * (scalar * generator) + * when point is NULL, or a generic scalar point multiplication + * (scalar * point) + * when point is not NULL. + * + * scalar should be in the range [0,n) otherwise all constant time bets are off. + * + * NB: This says nothing about EC_POINT_add and EC_POINT_dbl, + * which of course are not constant time themselves. + * + * The product is stored in r. + * + * Returns 1 on success, 0 otherwise. + */ +static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *scalar, const EC_POINT *point, + BN_CTX *ctx) +{ + int i, cardinality_bits, group_top, kbit, pbit, Z_is_one; + EC_POINT *s = NULL; + BIGNUM *k = NULL; + BIGNUM *lambda = NULL; + BIGNUM *cardinality = NULL; + BN_CTX *new_ctx = NULL; + int ret = 0; + + if (ctx == NULL && (ctx = new_ctx = BN_CTX_secure_new()) == NULL) + return 0; + + BN_CTX_start(ctx); + + s = EC_POINT_new(group); + if (s == NULL) + goto err; + + if (point == NULL) { + if (!EC_POINT_copy(s, group->generator)) + goto err; + } else { + if (!EC_POINT_copy(s, point)) + goto err; + } + + EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME); + + cardinality = BN_CTX_get(ctx); + lambda = BN_CTX_get(ctx); + k = BN_CTX_get(ctx); + if (k == NULL || !BN_mul(cardinality, group->order, group->cofactor, ctx)) + goto err; + + /* + * Group cardinalities are often on a word boundary. + * So when we pad the scalar, some timing diff might + * pop if it needs to be expanded due to carries. + * So expand ahead of time. + */ + cardinality_bits = BN_num_bits(cardinality); + group_top = bn_get_top(cardinality); + if ((bn_wexpand(k, group_top + 1) == NULL) + || (bn_wexpand(lambda, group_top + 1) == NULL)) + goto err; + + if (!BN_copy(k, scalar)) + goto err; + + BN_set_flags(k, BN_FLG_CONSTTIME); + + if ((BN_num_bits(k) > cardinality_bits) || (BN_is_negative(k))) { + /*- + * this is an unusual input, and we don't guarantee + * constant-timeness + */ + if (!BN_nnmod(k, k, cardinality, ctx)) + goto err; + } + + if (!BN_add(lambda, k, cardinality)) + goto err; + BN_set_flags(lambda, BN_FLG_CONSTTIME); + if (!BN_add(k, lambda, cardinality)) + goto err; + /* + * lambda := scalar + cardinality + * k := scalar + 2*cardinality + */ + kbit = BN_is_bit_set(lambda, cardinality_bits); + BN_consttime_swap(kbit, k, lambda, group_top + 1); + + group_top = bn_get_top(group->field); + if ((bn_wexpand(s->X, group_top) == NULL) + || (bn_wexpand(s->Y, group_top) == NULL) + || (bn_wexpand(s->Z, group_top) == NULL) + || (bn_wexpand(r->X, group_top) == NULL) + || (bn_wexpand(r->Y, group_top) == NULL) + || (bn_wexpand(r->Z, group_top) == NULL)) + goto err; + + /* top bit is a 1, in a fixed pos */ + if (!EC_POINT_copy(r, s)) + goto err; + + EC_POINT_BN_set_flags(r, BN_FLG_CONSTTIME); + + if (!EC_POINT_dbl(group, s, s, ctx)) + goto err; + + pbit = 0; + +#define EC_POINT_CSWAP(c, a, b, w, t) do { \ + BN_consttime_swap(c, (a)->X, (b)->X, w); \ + BN_consttime_swap(c, (a)->Y, (b)->Y, w); \ + BN_consttime_swap(c, (a)->Z, (b)->Z, w); \ + t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \ + (a)->Z_is_one ^= (t); \ + (b)->Z_is_one ^= (t); \ +} while(0) + + /*- + * The ladder step, with branches, is + * + * k[i] == 0: S = add(R, S), R = dbl(R) + * k[i] == 1: R = add(S, R), S = dbl(S) + * + * Swapping R, S conditionally on k[i] leaves you with state + * + * k[i] == 0: T, U = R, S + * k[i] == 1: T, U = S, R + * + * Then perform the ECC ops. + * + * U = add(T, U) + * T = dbl(T) + * + * Which leaves you with state + * + * k[i] == 0: U = add(R, S), T = dbl(R) + * k[i] == 1: U = add(S, R), T = dbl(S) + * + * Swapping T, U conditionally on k[i] leaves you with state + * + * k[i] == 0: R, S = T, U + * k[i] == 1: R, S = U, T + * + * Which leaves you with state + * + * k[i] == 0: S = add(R, S), R = dbl(R) + * k[i] == 1: R = add(S, R), S = dbl(S) + * + * So we get the same logic, but instead of a branch it's a + * conditional swap, followed by ECC ops, then another conditional swap. + * + * Optimization: The end of iteration i and start of i-1 looks like + * + * ... + * CSWAP(k[i], R, S) + * ECC + * CSWAP(k[i], R, S) + * (next iteration) + * CSWAP(k[i-1], R, S) + * ECC + * CSWAP(k[i-1], R, S) + * ... + * + * So instead of two contiguous swaps, you can merge the condition + * bits and do a single swap. + * + * k[i] k[i-1] Outcome + * 0 0 No Swap + * 0 1 Swap + * 1 0 Swap + * 1 1 No Swap + * + * This is XOR. pbit tracks the previous bit of k. + */ + + for (i = cardinality_bits - 1; i >= 0; i--) { + kbit = BN_is_bit_set(k, i) ^ pbit; + EC_POINT_CSWAP(kbit, r, s, group_top, Z_is_one); + if (!EC_POINT_add(group, s, r, s, ctx)) + goto err; + if (!EC_POINT_dbl(group, r, r, ctx)) + goto err; + /* + * pbit logic merges this cswap with that of the + * next iteration + */ + pbit ^= kbit; + } + /* one final cswap to move the right value into r */ + EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one); +#undef EC_POINT_CSWAP + + ret = 1; + + err: + EC_POINT_free(s); + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + + return ret; +} + +#undef EC_POINT_BN_set_flags + /* * TODO: table should be optimised for the wNAF-based implementation, * sometimes smaller windows will give better performance (thus the @@ -155,7 +373,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, * precomputation is not available */ int ret = 0; - if (group->meth != r->meth) { + if (!ec_point_is_compat(r, group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -164,8 +382,34 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, return EC_POINT_set_to_infinity(group, r); } + /*- + * Handle the common cases where the scalar is secret, enforcing a constant + * time scalar multiplication algorithm. + */ + if ((scalar != NULL) && (num == 0)) { + /*- + * In this case we want to compute scalar * GeneratorPoint: this + * codepath is reached most prominently by (ephemeral) key generation + * of EC cryptosystems (i.e. ECDSA keygen and sign setup, ECDH + * keygen/first half), where the scalar is always secret. This is why + * we ignore if BN_FLG_CONSTTIME is actually set and we always call the + * constant time version. + */ + return ec_mul_consttime(group, r, scalar, NULL, ctx); + } + if ((scalar == NULL) && (num == 1)) { + /*- + * In this case we want to compute scalar * GenericPoint: this codepath + * is reached most prominently by the second half of ECDH, where the + * secret scalar is multiplied by the peer's public point. To protect + * the secret scalar, we ignore if BN_FLG_CONSTTIME is actually set and + * we always call the constant time version. + */ + return ec_mul_consttime(group, r, scalars[0], points[0], ctx); + } + for (i = 0; i < num; i++) { - if (group->meth != points[i]->meth) { + if (!ec_point_is_compat(points[i], group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } diff --git a/deps/openssl/openssl/crypto/ec/ec_oct.c b/deps/openssl/openssl/crypto/ec/ec_oct.c index effc42a344da..e185df6edfd5 100644 --- a/deps/openssl/openssl/crypto/ec/ec_oct.c +++ b/deps/openssl/openssl/crypto/ec/ec_oct.c @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -30,7 +30,7 @@ int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -66,7 +66,7 @@ int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS); return 0; @@ -93,7 +93,7 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, ECerr(EC_F_EC_POINT_POINT2OCT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_POINT2OCT, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -123,7 +123,7 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, ECerr(EC_F_EC_POINT_OCT2POINT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (group->meth != point->meth) { + if (!ec_point_is_compat(point, group)) { ECerr(EC_F_EC_POINT_OCT2POINT, EC_R_INCOMPATIBLE_OBJECTS); return 0; } diff --git a/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c b/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c index 449be0e92a60..9e4a68d9ca35 100644 --- a/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c +++ b/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,9 +10,8 @@ #include #include #include -#include #include -#include +#include "internal/bn_int.h" #include "ec_lcl.h" int ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen, @@ -53,13 +52,12 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, return 0; } - if (ctx_in == NULL) { + if ((ctx = ctx_in) == NULL) { if ((ctx = BN_CTX_new()) == NULL) { ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_MALLOC_FAILURE); return 0; } - } else - ctx = ctx_in; + } k = BN_new(); /* this value is later returned in *kinvp */ r = BN_new(); /* this value is later returned in *rp */ @@ -73,10 +71,6 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, goto err; } order = EC_GROUP_get0_order(group); - if (order == NULL) { - ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB); - goto err; - } /* Preallocate space */ order_bits = BN_num_bits(order); @@ -87,23 +81,23 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, do { /* get random k */ - do + do { if (dgst != NULL) { - if (!BN_generate_dsa_nonce - (k, order, EC_KEY_get0_private_key(eckey), dgst, dlen, - ctx)) { + if (!BN_generate_dsa_nonce(k, order, + EC_KEY_get0_private_key(eckey), + dgst, dlen, ctx)) { ECerr(EC_F_ECDSA_SIGN_SETUP, - EC_R_RANDOM_NUMBER_GENERATION_FAILED); + EC_R_RANDOM_NUMBER_GENERATION_FAILED); goto err; } } else { if (!BN_rand_range(k, order)) { ECerr(EC_F_ECDSA_SIGN_SETUP, - EC_R_RANDOM_NUMBER_GENERATION_FAILED); + EC_R_RANDOM_NUMBER_GENERATION_FAILED); goto err; } } - while (BN_is_zero(k)); + } while (BN_is_zero(k)); /* * We do not want timing information to leak the length of k, so we @@ -129,18 +123,16 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, } if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) { - if (!EC_POINT_get_affine_coordinates_GFp - (group, tmp_point, X, NULL, ctx)) { + if (!EC_POINT_get_affine_coordinates_GFp(group, tmp_point, X, + NULL, ctx)) { ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB); goto err; } } #ifndef OPENSSL_NO_EC2M else { /* NID_X9_62_characteristic_two_field */ - - if (!EC_POINT_get_affine_coordinates_GF2m(group, - tmp_point, X, NULL, - ctx)) { + if (!EC_POINT_get_affine_coordinates_GF2m(group, tmp_point, X, + NULL, ctx)) { ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB); goto err; } @@ -150,8 +142,7 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB); goto err; } - } - while (BN_is_zero(r)); + } while (BN_is_zero(r)); /* compute the inverse of k */ if (EC_GROUP_get_mont_data(group) != NULL) { @@ -210,8 +201,7 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, EC_KEY *eckey) { int ok = 0, i; - BIGNUM *kinv = NULL, *s, *m = NULL, *tmp = NULL, *blind = NULL; - BIGNUM *blindm = NULL; + BIGNUM *kinv = NULL, *s, *m = NULL; const BIGNUM *order, *ckinv; BN_CTX *ctx = NULL; const EC_GROUP *group; @@ -244,27 +234,13 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, } s = ret->s; - ctx = BN_CTX_secure_new(); - if (ctx == NULL) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_MALLOC_FAILURE); - goto err; - } - - BN_CTX_start(ctx); - tmp = BN_CTX_get(ctx); - m = BN_CTX_get(ctx); - blind = BN_CTX_get(ctx); - blindm = BN_CTX_get(ctx); - if (blindm == NULL) { + if ((ctx = BN_CTX_new()) == NULL + || (m = BN_new()) == NULL) { ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_MALLOC_FAILURE); goto err; } order = EC_GROUP_get0_order(group); - if (order == NULL) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_EC_LIB); - goto err; - } i = BN_num_bits(order); /* * Need to truncate digest if it is too long: first truncate whole bytes. @@ -275,7 +251,7 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); goto err; } - /* If still too long truncate remaining bits with a shift */ + /* If still too long, truncate remaining bits with a shift */ if ((8 * dgst_len > i) && !BN_rshift(m, m, 8 - (i & 0x7))) { ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); goto err; @@ -296,59 +272,27 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, } /* - * The normal signature calculation is: - * - * s := k^-1 * (m + r * priv_key) mod order - * - * We will blind this to protect against side channel attacks - * - * s := k^-1 * blind^-1 * (blind * m + blind * r * priv_key) mod order + * With only one multiplicant being in Montgomery domain + * multiplication yields real result without post-conversion. + * Also note that all operations but last are performed with + * zero-padded vectors. Last operation, BN_mod_mul_montgomery + * below, returns user-visible value with removed zero padding. */ - - /* Generate a blinding value */ - do { - if (!BN_rand(blind, BN_num_bits(order) - 1, BN_RAND_TOP_ANY, - BN_RAND_BOTTOM_ANY)) - goto err; - } while (BN_is_zero(blind)); - BN_set_flags(blind, BN_FLG_CONSTTIME); - BN_set_flags(blindm, BN_FLG_CONSTTIME); - BN_set_flags(tmp, BN_FLG_CONSTTIME); - - /* tmp := blind * priv_key * r mod order */ - if (!BN_mod_mul(tmp, blind, priv_key, order, ctx)) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); - goto err; - } - if (!BN_mod_mul(tmp, tmp, ret->r, order, ctx)) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); - goto err; - } - - /* blindm := blind * m mod order */ - if (!BN_mod_mul(blindm, blind, m, order, ctx)) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); - goto err; - } - - /* s : = (blind * priv_key * r) + (blind * m) mod order */ - if (!BN_mod_add_quick(s, tmp, blindm, order)) { - ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); - goto err; - } - - /* s:= s * blind^-1 mod order */ - if (BN_mod_inverse(blind, blind, order, ctx) == NULL) { + if (!bn_to_mont_fixed_top(s, ret->r, group->mont_data, ctx) + || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); goto err; } - if (!BN_mod_mul(s, s, blind, order, ctx)) { + if (!bn_mod_add_fixed_top(s, s, m, order)) { ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); goto err; } - - /* s := s * k^-1 mod order */ - if (!BN_mod_mul(s, s, ckinv, order, ctx)) { + /* + * |s| can still be larger than modulus, because |m| can be. In + * such case we count on Montgomery reduction to tie it up. + */ + if (!bn_to_mont_fixed_top(s, s, group->mont_data, ctx) + || !BN_mod_mul_montgomery(s, s, ckinv, group->mont_data, ctx)) { ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); goto err; } @@ -362,11 +306,11 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, EC_R_NEED_NEW_SETUP_VALUES); goto err; } - } else + } else { /* s != 0 => we have a valid signature */ break; - } - while (1); + } + } while (1); ok = 1; err: @@ -374,8 +318,8 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, ECDSA_SIG_free(ret); ret = NULL; } - BN_CTX_end(ctx); BN_CTX_free(ctx); + BN_clear_free(m); BN_clear_free(kinv); return ret; } diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c index 246189833ec2..4dbe21692721 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1110,28 +1110,12 @@ __owur static int ecp_nistz256_set_from_affine(EC_POINT *out, const EC_GROUP *gr const P256_POINT_AFFINE *in, BN_CTX *ctx) { - BIGNUM *x, *y; - BN_ULONG d_x[P256_LIMBS], d_y[P256_LIMBS]; int ret = 0; - x = BN_new(); - if (x == NULL) - return 0; - y = BN_new(); - if (y == NULL) { - BN_free(x); - return 0; - } - memcpy(d_x, in->X, sizeof(d_x)); - bn_set_static_words(x, d_x, P256_LIMBS); - - memcpy(d_y, in->Y, sizeof(d_y)); - bn_set_static_words(y, d_y, P256_LIMBS); - - ret = EC_POINT_set_affine_coordinates_GFp(group, out, x, y, ctx); - - BN_free(x); - BN_free(y); + if ((ret = bn_set_words(out->X, in->X, P256_LIMBS)) + && (ret = bn_set_words(out->Y, in->Y, P256_LIMBS)) + && (ret = bn_set_words(out->Z, ONE, P256_LIMBS))) + out->Z_is_one = 1; return ret; } @@ -1168,7 +1152,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group, return 0; } - if (group->meth != r->meth) { + if (!ec_point_is_compat(r, group)) { ECerr(EC_F_ECP_NISTZ256_POINTS_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -1177,7 +1161,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group, return EC_POINT_set_to_infinity(group, r); for (j = 0; j < num; j++) { - if (group->meth != points[j]->meth) { + if (!ec_point_is_compat(points[j], group)) { ECerr(EC_F_ECP_NISTZ256_POINTS_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -1210,9 +1194,9 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group, if (pre_comp_generator == NULL) goto err; + ecp_nistz256_gather_w7(&p.a, pre_comp->precomp[0], 1); if (!ecp_nistz256_set_from_affine(pre_comp_generator, - group, pre_comp->precomp[0], - ctx)) { + group, &p.a, ctx)) { EC_POINT_free(pre_comp_generator); goto err; } diff --git a/deps/openssl/openssl/crypto/ec/ecp_smpl.c b/deps/openssl/openssl/crypto/ec/ecp_smpl.c index abd379504666..e3b88315fd47 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_smpl.c +++ b/deps/openssl/openssl/crypto/ec/ecp_smpl.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -352,6 +352,7 @@ int ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src) if (!BN_copy(dest->Z, src->Z)) return 0; dest->Z_is_one = src->Z_is_one; + dest->curve_name = src->curve_name; return 1; } diff --git a/deps/openssl/openssl/crypto/engine/eng_lib.c b/deps/openssl/openssl/crypto/engine/eng_lib.c index cbefc7eb6c6d..ef8e99550334 100644 --- a/deps/openssl/openssl/crypto/engine/eng_lib.c +++ b/deps/openssl/openssl/crypto/engine/eng_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -18,7 +18,8 @@ CRYPTO_ONCE engine_lock_init = CRYPTO_ONCE_STATIC_INIT; DEFINE_RUN_ONCE(do_engine_lock_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; global_engine_lock = CRYPTO_THREAD_lock_new(); return global_engine_lock != NULL; } @@ -143,8 +144,10 @@ void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb) if (!int_cleanup_check(1)) return; item = int_cleanup_item(cb); - if (item) - sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item); + if (item != NULL) { + if (sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item) <= 0) + OPENSSL_free(item); + } } /* The API function that performs all cleanup */ diff --git a/deps/openssl/openssl/crypto/engine/eng_openssl.c b/deps/openssl/openssl/crypto/engine/eng_openssl.c index 0e53c4d1fdcf..9208f7eafc50 100644 --- a/deps/openssl/openssl/crypto/engine/eng_openssl.c +++ b/deps/openssl/openssl/crypto/engine/eng_openssl.c @@ -649,3 +649,4 @@ int openssl_destroy(ENGINE *e) #endif return 1; } + diff --git a/deps/openssl/openssl/crypto/engine/tb_asnmth.c b/deps/openssl/openssl/crypto/engine/tb_asnmth.c index 480267daabad..5c7b16170390 100644 --- a/deps/openssl/openssl/crypto/engine/tb_asnmth.c +++ b/deps/openssl/openssl/crypto/engine/tb_asnmth.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -170,7 +170,8 @@ static void look_str_cb(int nid, STACK_OF(ENGINE) *sk, ENGINE *def, void *arg) ENGINE *e = sk_ENGINE_value(sk, i); EVP_PKEY_ASN1_METHOD *ameth; e->pkey_asn1_meths(e, &ameth, NULL, nid); - if (((int)strlen(ameth->pem_str) == lk->len) + if (ameth != NULL + && ((int)strlen(ameth->pem_str) == lk->len) && strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) { lk->e = e; lk->ameth = ameth; diff --git a/deps/openssl/openssl/crypto/err/err.c b/deps/openssl/openssl/crypto/err/err.c index c4399285fe12..08c27a3e8385 100644 --- a/deps/openssl/openssl/crypto/err/err.c +++ b/deps/openssl/openssl/crypto/err/err.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -254,7 +254,8 @@ static void ERR_STATE_free(ERR_STATE *s) DEFINE_RUN_ONCE_STATIC(do_err_strings_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; err_string_lock = CRYPTO_THREAD_lock_new(); return err_string_lock != NULL; } @@ -653,29 +654,31 @@ DEFINE_RUN_ONCE_STATIC(err_do_init) ERR_STATE *ERR_get_state(void) { - ERR_STATE *state = NULL; + ERR_STATE *state; - if (!RUN_ONCE(&err_init, err_do_init)) + if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) return NULL; - /* - * If base OPENSSL_init_crypto() hasn't been called yet, be sure to call - * it now to avoid state to be doubly allocated and thereby leak memory. - * Needed on any platform that doesn't define OPENSSL_USE_NODELETE. - */ - if (!OPENSSL_init_crypto(0, NULL)) + if (!RUN_ONCE(&err_init, err_do_init)) return NULL; state = CRYPTO_THREAD_get_local(&err_thread_local); + if (state == (ERR_STATE*)-1) + return NULL; if (state == NULL) { - state = OPENSSL_zalloc(sizeof(*state)); - if (state == NULL) + if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) return NULL; + if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { + CRYPTO_THREAD_set_local(&err_thread_local, NULL); + return NULL; + } + if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) - || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { + || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ERR_STATE_free(state); + CRYPTO_THREAD_set_local(&err_thread_local, NULL); return NULL; } @@ -686,13 +689,41 @@ ERR_STATE *ERR_get_state(void) return state; } +/* + * err_shelve_state returns the current thread local error state + * and freezes the error module until err_unshelve_state is called. + */ +int err_shelve_state(void **state) +{ + if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) + return 0; + + if (!RUN_ONCE(&err_init, err_do_init)) + return 0; + + *state = CRYPTO_THREAD_get_local(&err_thread_local); + if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) + return 0; + + return 1; +} + +/* + * err_unshelve_state restores the error state that was returned + * by err_shelve_state previously. + */ +void err_unshelve_state(void* state) +{ + if (state != (void*)-1) + CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state); +} + int ERR_get_next_error_library(void) { int ret; - if (!RUN_ONCE(&err_string_init, do_err_strings_init)) { + if (!RUN_ONCE(&err_string_init, do_err_strings_init)) return 0; - } CRYPTO_THREAD_write_lock(err_string_lock); ret = int_err_library_number++; diff --git a/deps/openssl/openssl/crypto/evp/cmeth_lib.c b/deps/openssl/openssl/crypto/evp/cmeth_lib.c index 5769e0a554ed..e2295c4dc589 100644 --- a/deps/openssl/openssl/crypto/evp/cmeth_lib.c +++ b/deps/openssl/openssl/crypto/evp/cmeth_lib.c @@ -148,3 +148,4 @@ int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, { return cipher->ctrl; } + diff --git a/deps/openssl/openssl/crypto/evp/evp_err.c b/deps/openssl/openssl/crypto/evp/evp_err.c index c4b163f0ba65..3543d44cb416 100644 --- a/deps/openssl/openssl/crypto/evp/evp_err.c +++ b/deps/openssl/openssl/crypto/evp/evp_err.c @@ -70,6 +70,8 @@ static ERR_STRING_DATA EVP_str_functs[] = { {ERR_FUNC(EVP_F_EVP_PKEY_GET0_RSA), "EVP_PKEY_get0_RSA"}, {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN), "EVP_PKEY_keygen"}, {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN_INIT), "EVP_PKEY_keygen_init"}, + {ERR_FUNC(EVP_F_EVP_PKEY_METH_ADD0), "EVP_PKEY_meth_add0"}, + {ERR_FUNC(EVP_F_EVP_PKEY_METH_NEW), "EVP_PKEY_meth_new"}, {ERR_FUNC(EVP_F_EVP_PKEY_NEW), "EVP_PKEY_new"}, {ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN), "EVP_PKEY_paramgen"}, {ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN_INIT), "EVP_PKEY_paramgen_init"}, @@ -143,6 +145,7 @@ static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_OPERATON_NOT_INITIALIZED), "operaton not initialized"}, {ERR_REASON(EVP_R_PARTIALLY_OVERLAPPING), "partially overlapping buffers"}, + {ERR_REASON(EVP_R_PBKDF2_ERROR), "pbkdf2 error"}, {ERR_REASON(EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED), "pkey application asn1 method already registered"}, {ERR_REASON(EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED), diff --git a/deps/openssl/openssl/crypto/evp/pmeth_lib.c b/deps/openssl/openssl/crypto/evp/pmeth_lib.c index 5e650a9db33e..f623db34836a 100644 --- a/deps/openssl/openssl/crypto/evp/pmeth_lib.c +++ b/deps/openssl/openssl/crypto/evp/pmeth_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -151,8 +151,10 @@ EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags) EVP_PKEY_METHOD *pmeth; pmeth = OPENSSL_zalloc(sizeof(*pmeth)); - if (pmeth == NULL) + if (pmeth == NULL) { + EVPerr(EVP_F_EVP_PKEY_METH_NEW, ERR_R_MALLOC_FAILURE); return NULL; + } pmeth->pkey_id = id; pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC; @@ -238,8 +240,10 @@ EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx) } #endif rctx = OPENSSL_malloc(sizeof(*rctx)); - if (rctx == NULL) + if (rctx == NULL) { + EVPerr(EVP_F_EVP_PKEY_CTX_DUP, ERR_R_MALLOC_FAILURE); return NULL; + } rctx->pmeth = pctx->pmeth; #ifndef OPENSSL_NO_ENGINE @@ -273,11 +277,15 @@ int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth) { if (app_pkey_methods == NULL) { app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp); - if (app_pkey_methods == NULL) + if (app_pkey_methods == NULL) { + EVPerr(EVP_F_EVP_PKEY_METH_ADD0, ERR_R_MALLOC_FAILURE); return 0; + } } - if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth)) + if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth)) { + EVPerr(EVP_F_EVP_PKEY_METH_ADD0, ERR_R_MALLOC_FAILURE); return 0; + } sk_EVP_PKEY_METHOD_sort(app_pkey_methods); return 1; } @@ -557,26 +565,26 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, pmeth->ctrl_str = ctrl_str; } -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)) { *pinit = pmeth->init; } -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)) { *pcopy = pmeth->copy; } -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)) { *pcleanup = pmeth->cleanup; } -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)) @@ -587,7 +595,7 @@ void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, *pparamgen = pmeth->paramgen; } -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)) @@ -598,7 +606,7 @@ void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, *pkeygen = pmeth->keygen; } -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, @@ -611,7 +619,7 @@ void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, *psign = pmeth->sign; } -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -625,7 +633,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, *pverify = pmeth->verify; } -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -643,7 +651,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, *pverify_recover = pmeth->verify_recover; } -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -657,7 +665,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, *psignctx = pmeth->signctx; } -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -671,7 +679,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, *pverifyctx = pmeth->verifyctx; } -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -685,7 +693,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, *pencryptfn = pmeth->encrypt; } -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -699,7 +707,7 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, *pdecrypt = pmeth->decrypt; } -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, @@ -711,7 +719,7 @@ void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, *pderive = pmeth->derive; } -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, diff --git a/deps/openssl/openssl/crypto/evp/scrypt.c b/deps/openssl/openssl/crypto/evp/scrypt.c index 101bb1edbd48..3543df540337 100644 --- a/deps/openssl/openssl/crypto/evp/scrypt.c +++ b/deps/openssl/openssl/crypto/evp/scrypt.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -171,8 +171,10 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, if (r == 0 || p == 0 || N < 2 || (N & (N - 1))) return 0; /* Check p * r < SCRYPT_PR_MAX avoiding overflow */ - if (p > SCRYPT_PR_MAX / r) + if (p > SCRYPT_PR_MAX / r) { + EVPerr(EVP_F_EVP_PBE_SCRYPT, EVP_R_MEMORY_LIMIT_EXCEEDED); return 0; + } /* * Need to check N: if 2^(128 * r / 8) overflows limit this is @@ -180,8 +182,10 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, */ if (16 * r <= LOG2_UINT64_MAX) { - if (N >= (((uint64_t)1) << (16 * r))) + if (N >= (((uint64_t)1) << (16 * r))) { + EVPerr(EVP_F_EVP_PBE_SCRYPT, EVP_R_MEMORY_LIMIT_EXCEEDED); return 0; + } } /* Memory checks: check total allocated buffer size fits in uint64_t */ @@ -199,13 +203,17 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, * This is combined size V, X and T (section 4) */ i = UINT64_MAX / (32 * sizeof(uint32_t)); - if (N + 2 > i / r) + if (N + 2 > i / r) { + EVPerr(EVP_F_EVP_PBE_SCRYPT, EVP_R_MEMORY_LIMIT_EXCEEDED); return 0; + } Vlen = 32 * r * (N + 2) * sizeof(uint32_t); /* check total allocated size fits in uint64_t */ - if (Blen > UINT64_MAX - Vlen) + if (Blen > UINT64_MAX - Vlen) { + EVPerr(EVP_F_EVP_PBE_SCRYPT, EVP_R_MEMORY_LIMIT_EXCEEDED); return 0; + } /* check total allocated size fits in size_t */ if (Blen > SIZE_MAX - Vlen) return 0; @@ -225,8 +233,10 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, return 1; B = OPENSSL_malloc(allocsize); - if (B == NULL) + if (B == NULL) { + EVPerr(EVP_F_EVP_PBE_SCRYPT, ERR_R_MALLOC_FAILURE); return 0; + } X = (uint32_t *)(B + Blen); T = X + 32 * r; V = T + 32 * r; @@ -242,6 +252,9 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, goto err; rv = 1; err: + if (rv == 0) + EVPerr(EVP_F_EVP_PBE_SCRYPT, EVP_R_PBKDF2_ERROR); + OPENSSL_clear_free(B, allocsize); return rv; } diff --git a/deps/openssl/openssl/crypto/ex_data.c b/deps/openssl/openssl/crypto/ex_data.c index 22c4d3d9b904..6e3072f2a948 100644 --- a/deps/openssl/openssl/crypto/ex_data.c +++ b/deps/openssl/openssl/crypto/ex_data.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -38,7 +38,8 @@ static CRYPTO_ONCE ex_data_init = CRYPTO_ONCE_STATIC_INIT; DEFINE_RUN_ONCE_STATIC(do_ex_data_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; ex_data_lock = CRYPTO_THREAD_lock_new(); return ex_data_lock != NULL; } diff --git a/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_EPILOGUE.H b/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_EPILOGUE.H new file mode 100644 index 000000000000..5f63860808b6 --- /dev/null +++ b/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_EPILOGUE.H @@ -0,0 +1,16 @@ +/* + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C on VMS, and is included automatically + * after each header file from this directory + */ + +/* restore state. Must correspond to the save in __decc_include_prologue.h */ +#pragma names restore diff --git a/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_PROLOGUE.H b/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_PROLOGUE.H new file mode 100644 index 000000000000..78b2a87d8868 --- /dev/null +++ b/deps/openssl/openssl/crypto/include/internal/__DECC_INCLUDE_PROLOGUE.H @@ -0,0 +1,20 @@ +/* + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C on VMS, and is included automatically + * after each header file from this directory + */ + +/* save state */ +#pragma names save +/* have the compiler shorten symbols larger than 31 chars to 23 chars + * followed by a 8 hex char CRC + */ +#pragma names as_is,shortened diff --git a/deps/openssl/openssl/crypto/include/internal/asn1_int.h b/deps/openssl/openssl/crypto/include/internal/asn1_int.h index f70e3b47ba32..ba9c062702c5 100644 --- a/deps/openssl/openssl/crypto/include/internal/asn1_int.h +++ b/deps/openssl/openssl/crypto/include/internal/asn1_int.h @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -90,5 +90,3 @@ struct asn1_pctx_st { unsigned long oid_flags; unsigned long str_flags; } /* ASN1_PCTX */ ; - -int asn1_valid_host(const ASN1_STRING *host); diff --git a/deps/openssl/openssl/crypto/include/internal/async.h b/deps/openssl/openssl/crypto/include/internal/async.h index 16a12a637106..dc8e937b0ced 100644 --- a/deps/openssl/openssl/crypto/include/internal/async.h +++ b/deps/openssl/openssl/crypto/include/internal/async.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,3 +11,5 @@ int async_init(void); void async_deinit(void); +void async_delete_thread_state(void); + diff --git a/deps/openssl/openssl/crypto/include/internal/bn_int.h b/deps/openssl/openssl/crypto/include/internal/bn_int.h index 9c984ba78183..2fcdd0d13e19 100644 --- a/deps/openssl/openssl/crypto/include/internal/bn_int.h +++ b/deps/openssl/openssl/crypto/include/internal/bn_int.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -53,7 +53,7 @@ BN_ULONG *bn_get_words(const BIGNUM *a); * Set the internal data words in a to point to words which contains size * elements. The BN_FLG_STATIC_DATA flag is set */ -void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size); +void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size); /* * Copy words into the BIGNUM |a|, reallocating space as necessary. @@ -64,7 +64,7 @@ void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size); * |num_words| is int because bn_expand2 takes an int. This is an internal * function so we simply trust callers not to pass negative values. */ -int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words); +int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words); size_t bn_sizeof_BIGNUM(void); @@ -74,6 +74,19 @@ size_t bn_sizeof_BIGNUM(void); */ BIGNUM *bn_array_el(BIGNUM *base, int el); +/* + * Some BIGNUM functions assume most significant limb to be non-zero, which + * is customarily arranged by bn_correct_top. Output from below functions + * is not processed with bn_correct_top, and for this reason it may not be + * returned out of public API. It may only be passed internally into other + * functions known to support non-minimal or zero-padded BIGNUMs. + */ +int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_MONT_CTX *mont, BN_CTX *ctx); +int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); +int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); #ifdef __cplusplus } diff --git a/deps/openssl/openssl/crypto/include/internal/cryptlib.h b/deps/openssl/openssl/crypto/include/internal/cryptlib.h index f3ec9b67b825..627fd8caf4a1 100644 --- a/deps/openssl/openssl/crypto/include/internal/cryptlib.h +++ b/deps/openssl/openssl/crypto/include/internal/cryptlib.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -74,6 +74,8 @@ FILE *openssl_fopen(const char *filename, const char *mode); void *openssl_fopen(const char *filename, const char *mode); # endif +unsigned long OPENSSL_rdtsc(void); + #ifdef __cplusplus } #endif diff --git a/deps/openssl/openssl/crypto/include/internal/cryptlib_int.h b/deps/openssl/openssl/crypto/include/internal/cryptlib_int.h index ab86e1e53da2..ceeb63ddd0d6 100644 --- a/deps/openssl/openssl/crypto/include/internal/cryptlib_int.h +++ b/deps/openssl/openssl/crypto/include/internal/cryptlib_int.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -24,7 +24,9 @@ int ossl_init_thread_start(uint64_t opts); * use". */ # define OPENSSL_INIT_ZLIB 0x00010000L +# define OPENSSL_INIT_BASE_ONLY 0x00040000L /* OPENSSL_INIT_THREAD flags */ # define OPENSSL_INIT_THREAD_ASYNC 0x01 # define OPENSSL_INIT_THREAD_ERR_STATE 0x02 + diff --git a/deps/openssl/openssl/crypto/include/internal/err_int.h b/deps/openssl/openssl/crypto/include/internal/err_int.h index 7fec3ed76773..44ac94462750 100644 --- a/deps/openssl/openssl/crypto/include/internal/err_int.h +++ b/deps/openssl/openssl/crypto/include/internal/err_int.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,5 +13,7 @@ int err_load_crypto_strings_int(void); void err_cleanup(void); void err_delete_thread_state(void); +int err_shelve_state(void **); +void err_unshelve_state(void *); #endif diff --git a/deps/openssl/openssl/crypto/include/internal/x509_int.h b/deps/openssl/openssl/crypto/include/internal/x509_int.h index 2845026dd82f..eb439977049b 100644 --- a/deps/openssl/openssl/crypto/include/internal/x509_int.h +++ b/deps/openssl/openssl/crypto/include/internal/x509_int.h @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -166,6 +166,7 @@ struct x509_st { unsigned char sha1_hash[SHA_DIGEST_LENGTH]; X509_CERT_AUX *aux; CRYPTO_RWLOCK *lock; + volatile int ex_cached; } /* X509 */ ; /* diff --git a/deps/openssl/openssl/crypto/init.c b/deps/openssl/openssl/crypto/init.c index 2d16c41bc60f..00a91792d838 100644 --- a/deps/openssl/openssl/crypto/init.c +++ b/deps/openssl/openssl/crypto/init.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,11 +27,25 @@ static int stopped = 0; -static void ossl_init_thread_stop(struct thread_local_inits_st *locals); +/* + * Since per-thread-specific-data destructors are not universally + * available, i.e. not on Windows, only below CRYPTO_THREAD_LOCAL key + * is assumed to have destructor associated. And then an effort is made + * to call this single destructor on non-pthread platform[s]. + * + * Initial value is "impossible". It is used as guard value to shortcut + * destructor for threads terminating before libcrypto is initialized or + * after it's de-initialized. Access to the key doesn't have to be + * serialized for the said threads, because they didn't use libcrypto + * and it doesn't matter if they pick "impossible" or derefernce real + * key value and pull NULL past initialization in the first thread that + * intends to use libcrypto. + */ +static CRYPTO_THREAD_LOCAL destructor_key = (CRYPTO_THREAD_LOCAL)-1; -static CRYPTO_THREAD_LOCAL threadstopkey; +static void ossl_init_thread_stop(struct thread_local_inits_st *locals); -static void ossl_init_thread_stop_wrap(void *local) +static void ossl_init_thread_destructor(void *local) { ossl_init_thread_stop((struct thread_local_inits_st *)local); } @@ -39,17 +53,17 @@ static void ossl_init_thread_stop_wrap(void *local) static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) { struct thread_local_inits_st *local = - CRYPTO_THREAD_get_local(&threadstopkey); + CRYPTO_THREAD_get_local(&destructor_key); - if (local == NULL && alloc) { - local = OPENSSL_zalloc(sizeof(*local)); - if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { + if (alloc) { + if (local == NULL + && (local = OPENSSL_zalloc(sizeof(*local))) != NULL + && !CRYPTO_THREAD_set_local(&destructor_key, local)) { OPENSSL_free(local); return NULL; } - } - if (!alloc) { - CRYPTO_THREAD_set_local(&threadstopkey, NULL); + } else { + CRYPTO_THREAD_set_local(&destructor_key, NULL); } return local; @@ -68,29 +82,42 @@ static CRYPTO_ONCE base = CRYPTO_ONCE_STATIC_INIT; static int base_inited = 0; DEFINE_RUN_ONCE_STATIC(ossl_init_base) { + CRYPTO_THREAD_LOCAL key; + #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_base: Setting up stop handlers\n"); #endif - /* - * We use a dummy thread local key here. We use the destructor to detect - * when the thread is going to stop (where that feature is available) - */ - CRYPTO_THREAD_init_local(&threadstopkey, ossl_init_thread_stop_wrap); + if (!CRYPTO_THREAD_init_local(&key, ossl_init_thread_destructor)) + return 0; + if ((init_lock = CRYPTO_THREAD_lock_new()) == NULL) + goto err; #ifndef OPENSSL_SYS_UEFI - atexit(OPENSSL_cleanup); + if (atexit(OPENSSL_cleanup) != 0) + goto err; #endif - if ((init_lock = CRYPTO_THREAD_lock_new()) == NULL) - return 0; OPENSSL_cpuid_setup(); - /* - * BIG FAT WARNING! - * Everything needed to be initialized in this function before threads - * come along MUST happen before base_inited is set to 1, or we will - * see race conditions. - */ + destructor_key = key; base_inited = 1; + return 1; + +err: +#ifdef OPENSSL_INIT_DEBUG + fprintf(stderr, "OPENSSL_INIT: ossl_init_base not ok!\n"); +#endif + CRYPTO_THREAD_lock_free(init_lock); + init_lock = NULL; + + CRYPTO_THREAD_cleanup_local(&key); + return 0; +} +static CRYPTO_ONCE load_crypto_nodelete = CRYPTO_ONCE_STATIC_INIT; +DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete) +{ +#ifdef OPENSSL_INIT_DEBUG + fprintf(stderr, "OPENSSL_INIT: ossl_init_load_crypto_nodelete()\n"); +#endif #if !defined(OPENSSL_NO_DSO) && !defined(OPENSSL_USE_NODELETE) # ifdef DSO_WIN32 { @@ -102,6 +129,10 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_base) | GET_MODULE_HANDLE_EX_FLAG_PIN, (void *)&base_inited, &handle); +# ifdef OPENSSL_INIT_DEBUG + fprintf(stderr, "OPENSSL_INIT: obtained DSO reference? %s\n", + (ret == TRUE ? "No!" : "Yes.")); +# endif return (ret == TRUE) ? 1 : 0; } # else @@ -110,12 +141,24 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_base) * to remain loaded until the atexit() handler is run at process exit. */ { - DSO *dso = NULL; + DSO *dso; + void *err; + + if (!err_shelve_state(&err)) + return 0; - ERR_set_mark(); dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE); +# ifdef OPENSSL_INIT_DEBUG + fprintf(stderr, "OPENSSL_INIT: obtained DSO reference? %s\n", + (dso == NULL ? "No!" : "Yes.")); + /* + * In case of No!, it is uncertain our exit()-handlers can still be + * called. After dlclose() the whole library might have been unloaded + * already. + */ +# endif DSO_free(dso); - ERR_pop_to_mark(); + err_unshelve_state(err); } # endif #endif @@ -145,7 +188,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings) # endif ret = err_load_crypto_strings_int(); load_crypto_strings_inited = 1; -#endif +#endif return ret; } @@ -335,9 +378,9 @@ static void ossl_init_thread_stop(struct thread_local_inits_st *locals) if (locals->async) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: " - "ASYNC_cleanup_thread()\n"); + "async_delete_thread_state()\n"); #endif - ASYNC_cleanup_thread(); + async_delete_thread_state(); } if (locals->err_state) { @@ -353,8 +396,8 @@ static void ossl_init_thread_stop(struct thread_local_inits_st *locals) void OPENSSL_thread_stop(void) { - ossl_init_thread_stop( - (struct thread_local_inits_st *)ossl_init_get_thread_local(0)); + if (destructor_key != (CRYPTO_THREAD_LOCAL)-1) + ossl_init_thread_stop(ossl_init_get_thread_local(0)); } int ossl_init_thread_start(uint64_t opts) @@ -391,6 +434,7 @@ int ossl_init_thread_start(uint64_t opts) void OPENSSL_cleanup(void) { OPENSSL_INIT_STOP *currhandler, *lasthandler; + CRYPTO_THREAD_LOCAL key; /* If we've not been inited then no need to deinit */ if (!base_inited) @@ -449,7 +493,9 @@ void OPENSSL_cleanup(void) err_free_strings_int(); } - CRYPTO_THREAD_cleanup_local(&threadstopkey); + key = destructor_key; + destructor_key = (CRYPTO_THREAD_LOCAL)-1; + CRYPTO_THREAD_cleanup_local(&key); #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: " @@ -505,22 +551,18 @@ void OPENSSL_cleanup(void) */ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { - static int stoperrset = 0; - if (stopped) { - if (!stoperrset) { - /* - * We only ever set this once to avoid getting into an infinite - * loop where the error system keeps trying to init and fails so - * sets an error etc - */ - stoperrset = 1; + if (!(opts & OPENSSL_INIT_BASE_ONLY)) CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL); - } return 0; } - if (!base_inited && !RUN_ONCE(&base, ossl_init_base)) + if (!RUN_ONCE(&base, ossl_init_base)) + return 0; + + if (!(opts & OPENSSL_INIT_BASE_ONLY) + && !RUN_ONCE(&load_crypto_nodelete, + ossl_init_load_crypto_nodelete)) return 0; if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS) @@ -657,6 +699,12 @@ int OPENSSL_atexit(void (*handler)(void)) ERR_set_mark(); dso = DSO_dsobyaddr(handlersym.sym, DSO_FLAG_NO_UNLOAD_ON_FREE); +# ifdef OPENSSL_INIT_DEBUG + fprintf(stderr, + "OPENSSL_INIT: OPENSSL_atexit: obtained DSO reference? %s\n", + (dso == NULL ? "No!" : "Yes.")); + /* See same code above in ossl_init_base() for an explanation. */ +# endif DSO_free(dso); ERR_pop_to_mark(); } diff --git a/deps/openssl/openssl/crypto/lhash/lhash.c b/deps/openssl/openssl/crypto/lhash/lhash.c index 7777935182bb..f48541171c5f 100644 --- a/deps/openssl/openssl/crypto/lhash/lhash.c +++ b/deps/openssl/openssl/crypto/lhash/lhash.c @@ -49,7 +49,7 @@ OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c) return NULL; if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL) goto err; - if ((ret->retrieve_stats_lock = CRYPTO_THREAD_lock_new()) == NULL) + if ((ret->retrieve_stats_lock = CRYPTO_THREAD_lock_new()) == NULL) goto err; ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c); ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h); diff --git a/deps/openssl/openssl/crypto/lhash/lhash_lcl.h b/deps/openssl/openssl/crypto/lhash/lhash_lcl.h index 64d3134fc108..01d463fb3637 100644 --- a/deps/openssl/openssl/crypto/lhash/lhash_lcl.h +++ b/deps/openssl/openssl/crypto/lhash/lhash_lcl.h @@ -21,7 +21,7 @@ struct lhash_st { /* * some stats are updated on lookup, which callers aren't expecting to have * to take an exclusive lock around. This lock protects them on platforms - * without atomics, and their types are int rather than unsigned long below + * without atomics, and their types are int rather than unsigned long below * so they can be adjusted with CRYPTO_atomic_add. */ CRYPTO_RWLOCK *retrieve_stats_lock; diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl index 7d880c94a7cf..1cf14a6c9f76 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -145,6 +145,8 @@ () .text #if defined(__thumb2__) || defined(__clang__) .syntax unified +#define ldrplb ldrbpl +#define ldrneb ldrbne #endif #if defined(__thumb2__) .thumb @@ -152,11 +154,6 @@ () .code 32 #endif -#ifdef __clang__ -#define ldrplb ldrbpl -#define ldrneb ldrbne -#endif - .type rem_4bit,%object .align 5 rem_4bit: diff --git a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl index dcd5f595d21a..e13c70901920 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -64,6 +64,7 @@ $code=<<___; #include "arm_arch.h" +#if __ARM_MAX_ARCH__>=7 .text ___ $code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); @@ -351,6 +352,7 @@ $code.=<<___; .asciz "GHASH for ARMv8, CRYPTOGAMS by " .align 2 +#endif ___ if ($flavour =~ /64/) { ######## 64-bit code diff --git a/deps/openssl/openssl/crypto/modes/modes_lcl.h b/deps/openssl/openssl/crypto/modes/modes_lcl.h index 7a1603bf9082..4fc32e190fb3 100644 --- a/deps/openssl/openssl/crypto/modes/modes_lcl.h +++ b/deps/openssl/openssl/crypto/modes/modes_lcl.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -174,12 +174,13 @@ struct ocb128_context { OCB_BLOCK l_dollar; OCB_BLOCK *l; /* Must be reset for each session */ - u64 blocks_hashed; - u64 blocks_processed; - OCB_BLOCK tag; - OCB_BLOCK offset_aad; - OCB_BLOCK sum; - OCB_BLOCK offset; - OCB_BLOCK checksum; + struct { + u64 blocks_hashed; + u64 blocks_processed; + OCB_BLOCK offset_aad; + OCB_BLOCK sum; + OCB_BLOCK offset; + OCB_BLOCK checksum; + } sess; }; #endif /* OPENSSL_NO_OCB */ diff --git a/deps/openssl/openssl/crypto/modes/ocb128.c b/deps/openssl/openssl/crypto/modes/ocb128.c index db794d085474..fc92b246bd51 100644 --- a/deps/openssl/openssl/crypto/modes/ocb128.c +++ b/deps/openssl/openssl/crypto/modes/ocb128.c @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -236,6 +236,9 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv, return -1; } + /* Reset nonce-dependent variables */ + memset(&ctx->sess, 0, sizeof(ctx->sess)); + /* Nonce = num2str(TAGLEN mod 128,7) || zeros(120-bitlen(N)) || 1 || N */ nonce[0] = ((taglen * 8) % 128) << 1; memset(nonce + 1, 0, 15); @@ -256,10 +259,10 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv, /* Offset_0 = Stretch[1+bottom..128+bottom] */ shift = bottom % 8; - ocb_block_lshift(stretch + (bottom / 8), shift, ctx->offset.c); + ocb_block_lshift(stretch + (bottom / 8), shift, ctx->sess.offset.c); mask = 0xff; mask <<= 8 - shift; - ctx->offset.c[15] |= + ctx->sess.offset.c[15] |= (*(stretch + (bottom / 8) + 16) & mask) >> (8 - shift); return 1; @@ -278,25 +281,25 @@ int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad, /* Calculate the number of blocks of AAD provided now, and so far */ num_blocks = len / 16; - all_num_blocks = num_blocks + ctx->blocks_hashed; + all_num_blocks = num_blocks + ctx->sess.blocks_hashed; /* Loop through all full blocks of AAD */ - for (i = ctx->blocks_hashed + 1; i <= all_num_blocks; i++) { + for (i = ctx->sess.blocks_hashed + 1; i <= all_num_blocks; i++) { OCB_BLOCK *lookup; /* Offset_i = Offset_{i-1} xor L_{ntz(i)} */ lookup = ocb_lookup_l(ctx, ocb_ntz(i)); if (lookup == NULL) return 0; - ocb_block16_xor(&ctx->offset_aad, lookup, &ctx->offset_aad); + ocb_block16_xor(&ctx->sess.offset_aad, lookup, &ctx->sess.offset_aad); memcpy(tmp.c, aad, 16); aad += 16; /* Sum_i = Sum_{i-1} xor ENCIPHER(K, A_i xor Offset_i) */ - ocb_block16_xor(&ctx->offset_aad, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset_aad, &tmp, &tmp); ctx->encrypt(tmp.c, tmp.c, ctx->keyenc); - ocb_block16_xor(&tmp, &ctx->sum, &ctx->sum); + ocb_block16_xor(&tmp, &ctx->sess.sum, &ctx->sess.sum); } /* @@ -307,20 +310,21 @@ int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad, if (last_len > 0) { /* Offset_* = Offset_m xor L_* */ - ocb_block16_xor(&ctx->offset_aad, &ctx->l_star, &ctx->offset_aad); + ocb_block16_xor(&ctx->sess.offset_aad, &ctx->l_star, + &ctx->sess.offset_aad); /* CipherInput = (A_* || 1 || zeros(127-bitlen(A_*))) xor Offset_* */ memset(tmp.c, 0, 16); memcpy(tmp.c, aad, last_len); tmp.c[last_len] = 0x80; - ocb_block16_xor(&ctx->offset_aad, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset_aad, &tmp, &tmp); /* Sum = Sum_m xor ENCIPHER(K, CipherInput) */ ctx->encrypt(tmp.c, tmp.c, ctx->keyenc); - ocb_block16_xor(&tmp, &ctx->sum, &ctx->sum); + ocb_block16_xor(&tmp, &ctx->sess.sum, &ctx->sess.sum); } - ctx->blocks_hashed = all_num_blocks; + ctx->sess.blocks_hashed = all_num_blocks; return 1; } @@ -341,7 +345,7 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, * so far */ num_blocks = len / 16; - all_num_blocks = num_blocks + ctx->blocks_processed; + all_num_blocks = num_blocks + ctx->sess.blocks_processed; if (num_blocks && all_num_blocks == (size_t)all_num_blocks && ctx->stream != NULL) { @@ -357,11 +361,11 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, return 0; ctx->stream(in, out, num_blocks, ctx->keyenc, - (size_t)ctx->blocks_processed + 1, ctx->offset.c, - (const unsigned char (*)[16])ctx->l, ctx->checksum.c); + (size_t)ctx->sess.blocks_processed + 1, ctx->sess.offset.c, + (const unsigned char (*)[16])ctx->l, ctx->sess.checksum.c); } else { /* Loop through all full blocks to be encrypted */ - for (i = ctx->blocks_processed + 1; i <= all_num_blocks; i++) { + for (i = ctx->sess.blocks_processed + 1; i <= all_num_blocks; i++) { OCB_BLOCK *lookup; OCB_BLOCK tmp; @@ -369,18 +373,18 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, lookup = ocb_lookup_l(ctx, ocb_ntz(i)); if (lookup == NULL) return 0; - ocb_block16_xor(&ctx->offset, lookup, &ctx->offset); + ocb_block16_xor(&ctx->sess.offset, lookup, &ctx->sess.offset); memcpy(tmp.c, in, 16); in += 16; /* Checksum_i = Checksum_{i-1} xor P_i */ - ocb_block16_xor(&tmp, &ctx->checksum, &ctx->checksum); + ocb_block16_xor(&tmp, &ctx->sess.checksum, &ctx->sess.checksum); /* C_i = Offset_i xor ENCIPHER(K, P_i xor Offset_i) */ - ocb_block16_xor(&ctx->offset, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset, &tmp, &tmp); ctx->encrypt(tmp.c, tmp.c, ctx->keyenc); - ocb_block16_xor(&ctx->offset, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset, &tmp, &tmp); memcpy(out, tmp.c, 16); out += 16; @@ -397,10 +401,10 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, OCB_BLOCK pad; /* Offset_* = Offset_m xor L_* */ - ocb_block16_xor(&ctx->offset, &ctx->l_star, &ctx->offset); + ocb_block16_xor(&ctx->sess.offset, &ctx->l_star, &ctx->sess.offset); /* Pad = ENCIPHER(K, Offset_*) */ - ctx->encrypt(ctx->offset.c, pad.c, ctx->keyenc); + ctx->encrypt(ctx->sess.offset.c, pad.c, ctx->keyenc); /* C_* = P_* xor Pad[1..bitlen(P_*)] */ ocb_block_xor(in, pad.c, last_len, out); @@ -409,10 +413,10 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, memset(pad.c, 0, 16); /* borrow pad */ memcpy(pad.c, in, last_len); pad.c[last_len] = 0x80; - ocb_block16_xor(&pad, &ctx->checksum, &ctx->checksum); + ocb_block16_xor(&pad, &ctx->sess.checksum, &ctx->sess.checksum); } - ctx->blocks_processed = all_num_blocks; + ctx->sess.blocks_processed = all_num_blocks; return 1; } @@ -433,7 +437,7 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, * so far */ num_blocks = len / 16; - all_num_blocks = num_blocks + ctx->blocks_processed; + all_num_blocks = num_blocks + ctx->sess.blocks_processed; if (num_blocks && all_num_blocks == (size_t)all_num_blocks && ctx->stream != NULL) { @@ -449,30 +453,30 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, return 0; ctx->stream(in, out, num_blocks, ctx->keydec, - (size_t)ctx->blocks_processed + 1, ctx->offset.c, - (const unsigned char (*)[16])ctx->l, ctx->checksum.c); + (size_t)ctx->sess.blocks_processed + 1, ctx->sess.offset.c, + (const unsigned char (*)[16])ctx->l, ctx->sess.checksum.c); } else { OCB_BLOCK tmp; /* Loop through all full blocks to be decrypted */ - for (i = ctx->blocks_processed + 1; i <= all_num_blocks; i++) { + for (i = ctx->sess.blocks_processed + 1; i <= all_num_blocks; i++) { /* Offset_i = Offset_{i-1} xor L_{ntz(i)} */ OCB_BLOCK *lookup = ocb_lookup_l(ctx, ocb_ntz(i)); if (lookup == NULL) return 0; - ocb_block16_xor(&ctx->offset, lookup, &ctx->offset); + ocb_block16_xor(&ctx->sess.offset, lookup, &ctx->sess.offset); memcpy(tmp.c, in, 16); in += 16; /* P_i = Offset_i xor DECIPHER(K, C_i xor Offset_i) */ - ocb_block16_xor(&ctx->offset, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset, &tmp, &tmp); ctx->decrypt(tmp.c, tmp.c, ctx->keydec); - ocb_block16_xor(&ctx->offset, &tmp, &tmp); + ocb_block16_xor(&ctx->sess.offset, &tmp, &tmp); /* Checksum_i = Checksum_{i-1} xor P_i */ - ocb_block16_xor(&tmp, &ctx->checksum, &ctx->checksum); + ocb_block16_xor(&tmp, &ctx->sess.checksum, &ctx->sess.checksum); memcpy(out, tmp.c, 16); out += 16; @@ -489,10 +493,10 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, OCB_BLOCK pad; /* Offset_* = Offset_m xor L_* */ - ocb_block16_xor(&ctx->offset, &ctx->l_star, &ctx->offset); + ocb_block16_xor(&ctx->sess.offset, &ctx->l_star, &ctx->sess.offset); /* Pad = ENCIPHER(K, Offset_*) */ - ctx->encrypt(ctx->offset.c, pad.c, ctx->keyenc); + ctx->encrypt(ctx->sess.offset.c, pad.c, ctx->keyenc); /* P_* = C_* xor Pad[1..bitlen(C_*)] */ ocb_block_xor(in, pad.c, last_len, out); @@ -501,39 +505,46 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, memset(pad.c, 0, 16); /* borrow pad */ memcpy(pad.c, out, last_len); pad.c[last_len] = 0x80; - ocb_block16_xor(&pad, &ctx->checksum, &ctx->checksum); + ocb_block16_xor(&pad, &ctx->sess.checksum, &ctx->sess.checksum); } - ctx->blocks_processed = all_num_blocks; + ctx->sess.blocks_processed = all_num_blocks; return 1; } -/* - * Calculate the tag and verify it against the supplied tag - */ -int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag, - size_t len) +static int ocb_finish(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len, + int write) { OCB_BLOCK tmp; + if (len > 16 || len < 1) { + return -1; + } + /* * Tag = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) xor HASH(K,A) */ - ocb_block16_xor(&ctx->checksum, &ctx->offset, &tmp); + ocb_block16_xor(&ctx->sess.checksum, &ctx->sess.offset, &tmp); ocb_block16_xor(&ctx->l_dollar, &tmp, &tmp); ctx->encrypt(tmp.c, tmp.c, ctx->keyenc); - ocb_block16_xor(&tmp, &ctx->sum, &ctx->tag); + ocb_block16_xor(&tmp, &ctx->sess.sum, &tmp); - if (len > 16 || len < 1) { - return -1; + if (write) { + memcpy(tag, &tmp, len); + return 1; + } else { + return CRYPTO_memcmp(&tmp, tag, len); } +} - /* Compare the tag if we've been given one */ - if (tag) - return CRYPTO_memcmp(&ctx->tag, tag, len); - else - return -1; +/* + * Calculate the tag and verify it against the supplied tag + */ +int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag, + size_t len) +{ + return ocb_finish(ctx, (unsigned char*)tag, len, 0); } /* @@ -541,17 +552,7 @@ int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag, */ int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) { - if (len > 16 || len < 1) { - return -1; - } - - /* Calculate the tag */ - CRYPTO_ocb128_finish(ctx, NULL, 0); - - /* Copy the tag into the supplied buffer */ - memcpy(tag, ctx->tag.c, len); - - return 1; + return ocb_finish(ctx, tag, len, 1); } /* diff --git a/deps/openssl/openssl/crypto/o_fopen.c b/deps/openssl/openssl/crypto/o_fopen.c index a3a006574d70..bfd5af1151d4 100644 --- a/deps/openssl/openssl/crypto/o_fopen.c +++ b/deps/openssl/openssl/crypto/o_fopen.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,6 +7,24 @@ * https://www.openssl.org/source/license.html */ +# if defined(__linux) || defined(__sun) || defined(__hpux) +/* + * Following definition aliases fopen to fopen64 on above mentioned + * platforms. This makes it possible to open and sequentially access files + * larger than 2GB from 32-bit application. It does not allow to traverse + * them beyond 2GB with fseek/ftell, but on the other hand *no* 32-bit + * platform permits that, not with fseek/ftell. Not to mention that breaking + * 2GB limit for seeking would require surgery to *our* API. But sequential + * access suffices for practical cases when you can run into large files, + * such as fingerprinting, so we can let API alone. For reference, the list + * of 32-bit platforms which allow for sequential access of large files + * without extra "magic" comprise *BSD, Darwin, IRIX... + */ +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 +# endif +# endif + #include "internal/cryptlib.h" #if !defined(OPENSSL_NO_STDIO) diff --git a/deps/openssl/openssl/crypto/o_time.c b/deps/openssl/openssl/crypto/o_time.c index b2fb38a541a6..6d764f55e2e8 100644 --- a/deps/openssl/openssl/crypto/o_time.c +++ b/deps/openssl/openssl/crypto/o_time.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -41,6 +41,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) if (gmtime_r(timer, result) == NULL) return NULL; ts = result; +#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400 + if (gmtime_s(result, timer)) + return NULL; + ts = result; #else ts = gmtime(timer); if (ts == NULL) diff --git a/deps/openssl/openssl/crypto/objects/o_names.c b/deps/openssl/openssl/crypto/objects/o_names.c index e06d5439f233..15fe653d0931 100644 --- a/deps/openssl/openssl/crypto/objects/o_names.c +++ b/deps/openssl/openssl/crypto/objects/o_names.c @@ -202,7 +202,7 @@ const char *OBJ_NAME_get(const char *name, int type) } } - CRYPTO_THREAD_unlock(lock); + CRYPTO_THREAD_unlock(lock); return value; } @@ -212,7 +212,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data) int alias, ok = 0; if (!OBJ_NAME_init()) - return 0; + return 0; CRYPTO_THREAD_write_lock(lock); diff --git a/deps/openssl/openssl/crypto/objects/objects.txt b/deps/openssl/openssl/crypto/objects/objects.txt index f1da8071add2..fc0781d1c9f0 100644 --- a/deps/openssl/openssl/crypto/objects/objects.txt +++ b/deps/openssl/openssl/crypto/objects/objects.txt @@ -1482,3 +1482,4 @@ id-pkinit 5 : pkInitKDC : Signing KDC Response : AuthGOST12 : auth-gost12 : AuthSRP : auth-srp : AuthNULL : auth-null + diff --git a/deps/openssl/openssl/crypto/pem/pem_lib.c b/deps/openssl/openssl/crypto/pem/pem_lib.c index e9202f44ae1c..6f06c5291fbb 100644 --- a/deps/openssl/openssl/crypto/pem/pem_lib.c +++ b/deps/openssl/openssl/crypto/pem/pem_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,23 +28,23 @@ static int load_iv(char **fromp, unsigned char *to, int num); static int check_pem(const char *nm, const char *name); int pem_check_suffix(const char *pem_str, const char *suffix); -int PEM_def_callback(char *buf, int num, int w, void *key) +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata) { -#if defined(OPENSSL_NO_STDIO) || defined(OPENSSL_NO_UI) int i; -#else - int i, j; +#ifndef OPENSSL_NO_UI + int min_len; const char *prompt; #endif - if (key) { - i = strlen(key); + /* We assume that the user passes a default password as userdata */ + if (userdata) { + i = strlen(userdata); i = (i > num) ? num : i; - memcpy(buf, key, i); + memcpy(buf, userdata, i); return i; } -#if defined(OPENSSL_NO_STDIO) || defined(OPENSSL_NO_UI) +#ifdef OPENSSL_NO_UI PEMerr(PEM_F_PEM_DEF_CALLBACK, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return -1; #else @@ -52,28 +52,22 @@ int PEM_def_callback(char *buf, int num, int w, void *key) if (prompt == NULL) prompt = "Enter PEM pass phrase:"; - for (;;) { - /* - * We assume that w == 0 means decryption, - * while w == 1 means encryption - */ - int min_len = w ? MIN_LENGTH : 0; + /* + * rwflag == 0 means decryption + * rwflag == 1 means encryption + * + * We assume that for encryption, we want a minimum length, while for + * decryption, we cannot know any minimum length, so we assume zero. + */ + min_len = rwflag ? MIN_LENGTH : 0; - i = EVP_read_pw_string_min(buf, min_len, num, prompt, w); - if (i != 0) { - PEMerr(PEM_F_PEM_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD); - memset(buf, 0, (unsigned int)num); - return -1; - } - j = strlen(buf); - if (min_len && j < min_len) { - fprintf(stderr, - "phrase is too short, needs to be at least %d chars\n", - min_len); - } else - break; + i = EVP_read_pw_string_min(buf, min_len, num, prompt, rwflag); + if (i != 0) { + PEMerr(PEM_F_PEM_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD); + memset(buf, 0, (unsigned int)num); + return -1; } - return j; + return strlen(buf); #endif } @@ -414,7 +408,7 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, keylen = PEM_def_callback(buf, PEM_BUFSIZE, 0, u); else keylen = callback(buf, PEM_BUFSIZE, 0, u); - if (keylen <= 0) { + if (keylen < 0) { PEMerr(PEM_F_PEM_DO_HEADER, PEM_R_BAD_PASSWORD_READ); return 0; } @@ -472,6 +466,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) char *dekinfostart, c; cipher->cipher = NULL; + memset(cipher->iv, 0, sizeof(cipher->iv)); if ((header == NULL) || (*header == '\0') || (*header == '\n')) return 1; diff --git a/deps/openssl/openssl/crypto/pem/pem_pk8.c b/deps/openssl/openssl/crypto/pem/pem_pk8.c index 5caad9faab87..a8363b39b9df 100644 --- a/deps/openssl/openssl/crypto/pem/pem_pk8.c +++ b/deps/openssl/openssl/crypto/pem/pem_pk8.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -124,7 +124,7 @@ EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, klen = cb(psbuf, PEM_BUFSIZE, 0, u); else klen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); - if (klen <= 0) { + if (klen < 0) { PEMerr(PEM_F_D2I_PKCS8PRIVATEKEY_BIO, PEM_R_BAD_PASSWORD_READ); X509_SIG_free(p8); return NULL; diff --git a/deps/openssl/openssl/crypto/pem/pem_pkey.c b/deps/openssl/openssl/crypto/pem/pem_pkey.c index 671b374f365e..7dadc1391cf4 100644 --- a/deps/openssl/openssl/crypto/pem/pem_pkey.c +++ b/deps/openssl/openssl/crypto/pem/pem_pkey.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -59,7 +59,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, klen = cb(psbuf, PEM_BUFSIZE, 0, u); else klen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); - if (klen <= 0) { + if (klen < 0) { PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY, PEM_R_BAD_PASSWORD_READ); X509_SIG_free(p8); goto err; diff --git a/deps/openssl/openssl/crypto/pem/pvkfmt.c b/deps/openssl/openssl/crypto/pem/pvkfmt.c index d0a423957cb3..63ce9259638a 100644 --- a/deps/openssl/openssl/crypto/pem/pvkfmt.c +++ b/deps/openssl/openssl/crypto/pem/pvkfmt.c @@ -685,7 +685,7 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in, inlen = cb(psbuf, PEM_BUFSIZE, 0, u); else inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); - if (inlen <= 0) { + if (inlen < 0) { PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ); goto err; } diff --git a/deps/openssl/openssl/crypto/perlasm/README b/deps/openssl/openssl/crypto/perlasm/README index 15f139d354d1..e90bd8e01459 100644 --- a/deps/openssl/openssl/crypto/perlasm/README +++ b/deps/openssl/openssl/crypto/perlasm/README @@ -61,7 +61,7 @@ So a very simple version of this function could be coded as push(@INC,"perlasm","../../perlasm"); require "x86asm.pl"; - + &asm_init($ARGV[0],"cacl.pl"); &external_label("other"); @@ -121,3 +121,4 @@ void BF_cbc_encrypt(unsigned char *in, unsigned char *out, long length, &cbc("des_ncbc_encrypt","des_encrypt","des_encrypt",0,4,5,3,5,-1); &cbc("des_ede3_cbc_encrypt","des_encrypt3","des_decrypt3",0,6,7,3,4,5); + diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_asn.c b/deps/openssl/openssl/crypto/pkcs12/p12_asn.c index f2bfe32ebd6e..422dfc398fab 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_asn.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_asn.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -51,7 +51,7 @@ ASN1_ADB_TEMPLATE(safebag_default) = ASN1_EXP(PKCS12_SAFEBAG, value.other, ASN1_ ASN1_ADB(PKCS12_SAFEBAG) = { ADB_ENTRY(NID_keyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, PKCS8_PRIV_KEY_INFO, 0)), ADB_ENTRY(NID_pkcs8ShroudedKeyBag, ASN1_EXP(PKCS12_SAFEBAG, value.shkeybag, X509_SIG, 0)), - ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SET_OF(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0)), + ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SEQUENCE_OF(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0)), ADB_ENTRY(NID_certBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), ADB_ENTRY(NID_crlBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), ADB_ENTRY(NID_secretBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)) diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl index fc899ced8671..5cdb6be05914 100755 --- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl +++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -186,6 +186,7 @@ .type poly1305_blocks,%function .align 5 poly1305_blocks: +.Lpoly1305_blocks: stmdb sp!,{r3-r11,lr} ands $len,$len,#-16 @@ -677,7 +678,7 @@ cmp $len,#64 bhs .Lenter_neon tst ip,ip @ is_base2_26? - beq poly1305_blocks + beq .Lpoly1305_blocks .Lenter_neon: stmdb sp!,{r4-r7} diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl index 024696a5991d..d2b3e90d93f0 100755 --- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl +++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl @@ -422,3 +422,4 @@ $output=pop and open STDOUT,">$output"; print $code; close STDOUT; + diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl index ab24dfcfadda..93179e37d5e1 100755 --- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl +++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -70,7 +70,7 @@ $avx = ($1>=2.09) + ($1>=2.10); } - if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { + if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } } diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl index 1354d1821493..184922c12847 100644 --- a/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl +++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl @@ -89,7 +89,7 @@ || NOP 5 STB $XX,*${KEYA}[-2] ; key->x || SUB4 $YY,$TX,$YY -|| BNOP B3 +|| BNOP B3 STB $YY,*${KEYB}[-1] ; key->y || NOP 5 .endasmfunc diff --git a/deps/openssl/openssl/crypto/rsa/rsa_gen.c b/deps/openssl/openssl/crypto/rsa/rsa_gen.c index 9af43e058631..79f77e3eafdf 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_gen.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_gen.c @@ -89,6 +89,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, if (BN_copy(rsa->e, e_value) == NULL) goto err; + BN_set_flags(rsa->p, BN_FLG_CONSTTIME); + BN_set_flags(rsa->q, BN_FLG_CONSTTIME); BN_set_flags(r2, BN_FLG_CONSTTIME); /* generate p and q */ for (;;) { diff --git a/deps/openssl/openssl/crypto/rsa/rsa_meth.c b/deps/openssl/openssl/crypto/rsa/rsa_meth.c index be84923b34c4..83de5540d0af 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_meth.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_meth.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -75,7 +75,7 @@ int RSA_meth_set1_name(RSA_METHOD *meth, const char *name) return 1; } -int RSA_meth_get_flags(RSA_METHOD *meth) +int RSA_meth_get_flags(const RSA_METHOD *meth) { return meth->flags; } @@ -270,3 +270,4 @@ int RSA_meth_set_keygen(RSA_METHOD *meth, meth->rsa_keygen = keygen; return 1; } + diff --git a/deps/openssl/openssl/crypto/rsa/rsa_oaep.c b/deps/openssl/openssl/crypto/rsa/rsa_oaep.c index 4878d495fe05..f3135198a350 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_oaep.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_oaep.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -155,32 +155,40 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, dblen = num - mdlen - 1; db = OPENSSL_malloc(dblen); - em = OPENSSL_malloc(num); - if (db == NULL || em == NULL) { + if (db == NULL) { RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1, ERR_R_MALLOC_FAILURE); goto cleanup; } - /* - * Always do this zero-padding copy (even when num == flen) to avoid - * leaking that information. The copy still leaks some side-channel - * information, but it's impossible to have a fixed memory access - * pattern since we can't read out of the bounds of |from|. - * - * TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL. - */ - memset(em, 0, num); - memcpy(em + num - flen, from, flen); + if (flen != num) { + em = OPENSSL_zalloc(num); + if (em == NULL) { + RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1, + ERR_R_MALLOC_FAILURE); + goto cleanup; + } + + /* + * Caller is encouraged to pass zero-padded message created with + * BN_bn2binpad, but if it doesn't, we do this zero-padding copy + * to avoid leaking that information. The copy still leaks some + * side-channel information, but it's impossible to have a fixed + * memory access pattern since we can't read out of the bounds of + * |from|. + */ + memcpy(em + num - flen, from, flen); + from = em; + } /* * The first byte must be zero, however we must not leak if this is * true. See James H. Manger, "A Chosen Ciphertext Attack on RSA * Optimal Asymmetric Encryption Padding (OAEP) [...]", CRYPTO 2001). */ - good = constant_time_is_zero(em[0]); + good = constant_time_is_zero(from[0]); - maskedseed = em + 1; - maskeddb = em + 1 + mdlen; + maskedseed = from + 1; + maskeddb = from + 1 + mdlen; if (PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md)) goto cleanup; diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ossl.c b/deps/openssl/openssl/crypto/rsa/rsa_ossl.c index 62a88959fae4..36c4e42a0f12 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_ossl.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_ossl.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -62,7 +62,7 @@ static int rsa_ossl_public_encrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding) { BIGNUM *f, *ret; - int i, j, k, num = 0, r = -1; + int i, num = 0, r = -1; unsigned char *buf = NULL; BN_CTX *ctx = NULL; @@ -136,15 +136,10 @@ static int rsa_ossl_public_encrypt(int flen, const unsigned char *from, goto err; /* - * put in leading 0 bytes if the number is less than the length of the - * modulus + * BN_bn2binpad puts in leading 0 bytes if the number is less than + * the length of the modulus. */ - j = BN_num_bytes(ret); - i = BN_bn2bin(ret, &(to[num - j])); - for (k = 0; k < (num - i); k++) - to[k] = 0; - - r = num; + r = BN_bn2binpad(ret, to, num); err: if (ctx != NULL) BN_CTX_end(ctx); @@ -233,7 +228,7 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding) { BIGNUM *f, *ret, *res; - int i, j, k, num = 0, r = -1; + int i, num = 0, r = -1; unsigned char *buf = NULL; BN_CTX *ctx = NULL; int local_blinding = 0; @@ -337,7 +332,8 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from, goto err; if (padding == RSA_X931_PADDING) { - BN_sub(f, rsa->n, ret); + if (!BN_sub(f, rsa->n, ret)) + goto err; if (BN_cmp(ret, f) > 0) res = f; else @@ -346,15 +342,10 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from, res = ret; /* - * put in leading 0 bytes if the number is less than the length of the - * modulus + * BN_bn2binpad puts in leading 0 bytes if the number is less than + * the length of the modulus. */ - j = BN_num_bytes(res); - i = BN_bn2bin(res, &(to[num - j])); - for (k = 0; k < (num - i); k++) - to[k] = 0; - - r = num; + r = BN_bn2binpad(res, to, num); err: if (ctx != NULL) BN_CTX_end(ctx); @@ -368,7 +359,6 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, { BIGNUM *f, *ret; int j, num = 0, r = -1; - unsigned char *p; unsigned char *buf = NULL; BN_CTX *ctx = NULL; int local_blinding = 0; @@ -463,8 +453,7 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, if (!rsa_blinding_invert(blinding, ret, unblind, ctx)) goto err; - p = buf; - j = BN_bn2bin(ret, p); /* j is only used with no-padding mode */ + j = BN_bn2binpad(ret, buf, num); switch (padding) { case RSA_PKCS1_PADDING: @@ -477,7 +466,7 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, r = RSA_padding_check_SSLv23(to, num, buf, j, num); break; case RSA_NO_PADDING: - r = RSA_padding_check_none(to, num, buf, j, num); + memcpy(to, buf, (r = j)); break; default: RSAerr(RSA_F_RSA_OSSL_PRIVATE_DECRYPT, RSA_R_UNKNOWN_PADDING_TYPE); @@ -500,7 +489,6 @@ static int rsa_ossl_public_decrypt(int flen, const unsigned char *from, { BIGNUM *f, *ret; int i, num = 0, r = -1; - unsigned char *p; unsigned char *buf = NULL; BN_CTX *ctx = NULL; @@ -565,8 +553,7 @@ static int rsa_ossl_public_decrypt(int flen, const unsigned char *from, if (!BN_sub(ret, rsa->n, ret)) goto err; - p = buf; - i = BN_bn2bin(ret, p); + i = BN_bn2binpad(ret, buf, num); switch (padding) { case RSA_PKCS1_PADDING: @@ -576,7 +563,7 @@ static int rsa_ossl_public_decrypt(int flen, const unsigned char *from, r = RSA_padding_check_X931(to, num, buf, i, num); break; case RSA_NO_PADDING: - r = RSA_padding_check_none(to, num, buf, i, num); + memcpy(to, buf, (r = i)); break; default: RSAerr(RSA_F_RSA_OSSL_PUBLIC_DECRYPT, RSA_R_UNKNOWN_PADDING_TYPE); diff --git a/deps/openssl/openssl/crypto/rsa/rsa_pk1.c b/deps/openssl/openssl/crypto/rsa/rsa_pk1.c index aeeb32c2dc0b..63d6c3a3b8dd 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_pk1.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_pk1.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -175,27 +175,30 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, if (num < 11) goto err; - em = OPENSSL_zalloc(num); - if (em == NULL) { - RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2, ERR_R_MALLOC_FAILURE); - return -1; + if (flen != num) { + em = OPENSSL_zalloc(num); + if (em == NULL) { + RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2, ERR_R_MALLOC_FAILURE); + return -1; + } + /* + * Caller is encouraged to pass zero-padded message created with + * BN_bn2binpad, but if it doesn't, we do this zero-padding copy + * to avoid leaking that information. The copy still leaks some + * side-channel information, but it's impossible to have a fixed + * memory access pattern since we can't read out of the bounds of + * |from|. + */ + memcpy(em + num - flen, from, flen); + from = em; } - /* - * Always do this zero-padding copy (even when num == flen) to avoid - * leaking that information. The copy still leaks some side-channel - * information, but it's impossible to have a fixed memory access - * pattern since we can't read out of the bounds of |from|. - * - * TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL. - */ - memcpy(em + num - flen, from, flen); - good = constant_time_is_zero(em[0]); - good &= constant_time_eq(em[1], 2); + good = constant_time_is_zero(from[0]); + good &= constant_time_eq(from[1], 2); found_zero_byte = 0; for (i = 2; i < num; i++) { - unsigned int equals0 = constant_time_is_zero(em[i]); + unsigned int equals0 = constant_time_is_zero(from[i]); zero_index = constant_time_select_int(~found_zero_byte & equals0, i, zero_index); @@ -203,7 +206,7 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, } /* - * PS must be at least 8 bytes long, and it starts two bytes into |em|. + * PS must be at least 8 bytes long, and it starts two bytes into |from|. * If we never found a 0-byte, then |zero_index| is 0 and the check * also fails. */ @@ -232,7 +235,7 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, goto err; } - memcpy(to, em + msg_index, mlen); + memcpy(to, from + msg_index, mlen); err: OPENSSL_clear_free(em, num); diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ssl.c b/deps/openssl/openssl/crypto/rsa/rsa_ssl.c index 9ef6b80ea8ff..77b28b46f2b4 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_ssl.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_ssl.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,6 +63,14 @@ int RSA_padding_check_SSLv23(unsigned char *to, int tlen, RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_SMALL); return (-1); } + /* Accept even zero-padded input */ + if (flen == num) { + if (*(p++) != 0) { + RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_BLOCK_TYPE_IS_NOT_02); + return -1; + } + flen--; + } if ((num != (flen + 1)) || (*(p++) != 02)) { RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_BLOCK_TYPE_IS_NOT_02); return (-1); diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl index 5adca23404fd..cf34b2c2936c 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -141,7 +141,7 @@ `ml 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); # first version supporting AVX -$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && +$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); # first version supporting AVX $shaext=$xmm; ### set to zero if compiling for 1.0.1 diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl index 6af1d84beb2b..72ee0c7b83db 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -93,7 +93,7 @@ $avx = ($1>=10) + ($1>=11); } -if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl index 55d30cba3a21..edcfc31278e3 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -254,7 +254,7 @@ sub BODY_16_XX { $code.=".Lrounds_16_xx:\n"; for (;$i<32;$i++) { &BODY_16_XX($i,@V); unshift(@V,pop(@V)); } $code.=<<___; -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ ite eq @ Thumb2 thing, sanity check in ARM #endif ldreq $t3,[sp,#16*4] @ pull ctx diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl index 22b5a9d0b132..0b4c5674d9df 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -157,7 +157,7 @@ () teq $t0,#$magic ldr $t3,[sp,#$Coff+0] @ c.lo -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ it eq @ Thumb2 thing, sanity check in ARM #endif orreq $Ktbl,$Ktbl,#1 @@ -411,7 +411,7 @@ () ___ &BODY_00_15(0x17); $code.=<<___; -#if __ARM_ARCH__>=7 +#ifdef __thumb2__ ittt eq @ Thumb2 thing, sanity check in ARM #endif ldreq $t0,[sp,#`$Xoff+8*(16-1)`+0] diff --git a/deps/openssl/openssl/crypto/threads_win.c b/deps/openssl/openssl/crypto/threads_win.c index 4e0de908ee26..27334e13f3a2 100644 --- a/deps/openssl/openssl/crypto/threads_win.c +++ b/deps/openssl/openssl/crypto/threads_win.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -98,7 +98,26 @@ int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) { - return TlsGetValue(*key); + DWORD last_error; + void *ret; + + /* + * TlsGetValue clears the last error even on success, so that callers may + * distinguish it successfully returning NULL or failing. It is documented + * to never fail if the argument is a valid index from TlsAlloc, so we do + * not need to handle this. + * + * However, this error-mangling behavior interferes with the caller's use of + * GetLastError. In particular SSL_get_error queries the error queue to + * determine whether the caller should look at the OS's errors. To avoid + * destroying state, save and restore the Windows error. + * + * https://msdn.microsoft.com/en-us/library/windows/desktop/ms686812(v=vs.85).aspx + */ + last_error = GetLastError(); + ret = TlsGetValue(*key); + SetLastError(last_error); + return ret; } int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) diff --git a/deps/openssl/openssl/crypto/ts/ts_lib.c b/deps/openssl/openssl/crypto/ts/ts_lib.c index de36e0e08420..ce2e12c593e0 100644 --- a/deps/openssl/openssl/crypto/ts/ts_lib.c +++ b/deps/openssl/openssl/crypto/ts/ts_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,10 +22,9 @@ int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num) int result = 0; char *hex; - num_bn = BN_new(); + num_bn = ASN1_INTEGER_to_BN(num, NULL); if (num_bn == NULL) return -1; - ASN1_INTEGER_to_BN(num, num_bn); if ((hex = BN_bn2hex(num_bn))) { result = BIO_write(bio, "0x", 2) > 0; result = result && BIO_write(bio, hex, strlen(hex)) > 0; diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c index aea7b922a34d..0d714a71b7a8 100644 --- a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c +++ b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -16,6 +16,7 @@ #include #include #include +#include #include "ts_lcl.h" static ASN1_INTEGER *def_serial_cb(struct TS_resp_ctx *, void *); @@ -840,7 +841,7 @@ static ASN1_GENERALIZEDTIME long sec, long usec, unsigned precision) { time_t time_sec = (time_t)sec; - struct tm *tm = NULL; + struct tm *tm = NULL, tm_result; char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS]; char *p = genTime_str; char *p_end = genTime_str + sizeof(genTime_str); @@ -848,7 +849,7 @@ static ASN1_GENERALIZEDTIME if (precision > TS_MAX_CLOCK_PRECISION_DIGITS) goto err; - if ((tm = gmtime(&time_sec)) == NULL) + if ((tm = OPENSSL_gmtime(&time_sec, &tm_result)) == NULL) goto err; /* diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c index 66f5be6f69d7..2755dd0ef36b 100644 --- a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c +++ b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c @@ -480,7 +480,7 @@ static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text) return result; } -static int ts_check_policy(const ASN1_OBJECT *req_oid, +static int ts_check_policy(const ASN1_OBJECT *req_oid, const TS_TST_INFO *tst_info) { const ASN1_OBJECT *resp_oid = tst_info->policy_id; diff --git a/deps/openssl/openssl/crypto/ui/ui_openssl.c b/deps/openssl/openssl/crypto/ui/ui_openssl.c index 8fa8deca66ad..bfe93a57f1cd 100644 --- a/deps/openssl/openssl/crypto/ui/ui_openssl.c +++ b/deps/openssl/openssl/crypto/ui/ui_openssl.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -524,17 +524,13 @@ static int echo_console(UI *ui) { #if defined(TTY_set) && !defined(OPENSSL_SYS_VMS) memcpy(&(tty_new), &(tty_orig), sizeof(tty_orig)); - tty_new.TTY_FLAGS |= ECHO; -#endif - -#if defined(TTY_set) && !defined(OPENSSL_SYS_VMS) if (is_a_tty && (TTY_set(fileno(tty_in), &tty_new) == -1)) return 0; #endif #ifdef OPENSSL_SYS_VMS if (is_a_tty) { tty_new[0] = tty_orig[0]; - tty_new[1] = tty_orig[1] & ~TT$M_NOECHO; + tty_new[1] = tty_orig[1]; tty_new[2] = tty_orig[2]; status = sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12, 0, 0, 0, 0); @@ -555,7 +551,6 @@ static int echo_console(UI *ui) #if defined(_WIN32) && !defined(_WIN32_WCE) if (is_a_tty) { tty_new = tty_orig; - tty_new |= ENABLE_ECHO_INPUT; SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), tty_new); } #endif diff --git a/deps/openssl/openssl/crypto/x509/build.info b/deps/openssl/openssl/crypto/x509/build.info index 7fc4b45048b5..afd0b6134e52 100644 --- a/deps/openssl/openssl/crypto/x509/build.info +++ b/deps/openssl/openssl/crypto/x509/build.info @@ -4,7 +4,7 @@ SOURCE[../../libcrypto]=\ x509_obj.c x509_req.c x509spki.c x509_vfy.c \ x509_set.c x509cset.c x509rset.c x509_err.c \ x509name.c x509_v3.c x509_ext.c x509_att.c \ - x509type.c x509_lu.c x_all.c x509_txt.c \ + x509type.c x509_meth.c x509_lu.c x_all.c x509_txt.c \ x509_trs.c by_file.c by_dir.c x509_vpm.c \ x_crl.c t_crl.c x_req.c t_req.c x_x509.c t_x509.c \ x_pubkey.c x_x509a.c x_attrib.c x_exten.c x_name.c diff --git a/deps/openssl/openssl/crypto/x509/by_dir.c b/deps/openssl/openssl/crypto/x509/by_dir.c index 21672a7ef551..a69045572927 100644 --- a/deps/openssl/openssl/crypto/x509/by_dir.c +++ b/deps/openssl/openssl/crypto/x509/by_dir.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -111,7 +111,7 @@ static int new_dir(X509_LOOKUP *lu) OPENSSL_free(a); return 0; } - lu->method_data = (char *)a; + lu->method_data = a; return 1; } diff --git a/deps/openssl/openssl/crypto/x509/x509_cmp.c b/deps/openssl/openssl/crypto/x509/x509_cmp.c index 01056356c583..49b0368dfca4 100644 --- a/deps/openssl/openssl/crypto/x509/x509_cmp.c +++ b/deps/openssl/openssl/crypto/x509/x509_cmp.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -174,7 +174,7 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b) ret = a->canon_enclen - b->canon_enclen; - if (ret) + if (ret != 0 || a->canon_enclen == 0) return ret; return memcmp(a->canon_enc, b->canon_enc, a->canon_enclen); diff --git a/deps/openssl/openssl/crypto/x509/x509_err.c b/deps/openssl/openssl/crypto/x509/x509_err.c index 3f4b8ef0bc7a..9f91188a7659 100644 --- a/deps/openssl/openssl/crypto/x509/x509_err.c +++ b/deps/openssl/openssl/crypto/x509/x509_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -51,6 +51,7 @@ static ERR_STRING_DATA X509_str_functs[] = { {ERR_FUNC(X509_F_X509_LOAD_CERT_CRL_FILE), "X509_load_cert_crl_file"}, {ERR_FUNC(X509_F_X509_LOAD_CERT_FILE), "X509_load_cert_file"}, {ERR_FUNC(X509_F_X509_LOAD_CRL_FILE), "X509_load_crl_file"}, + {ERR_FUNC(X509_F_X509_LOOKUP_METH_NEW), "X509_LOOKUP_meth_new"}, {ERR_FUNC(X509_F_X509_NAME_ADD_ENTRY), "X509_NAME_add_entry"}, {ERR_FUNC(X509_F_X509_NAME_ENTRY_CREATE_BY_NID), "X509_NAME_ENTRY_create_by_NID"}, diff --git a/deps/openssl/openssl/crypto/x509/x509_lcl.h b/deps/openssl/openssl/crypto/x509/x509_lcl.h index 40bd102f7028..8a47da4fef0d 100644 --- a/deps/openssl/openssl/crypto/x509/x509_lcl.h +++ b/deps/openssl/openssl/crypto/x509/x509_lcl.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,7 @@ struct x509_crl_method_st { }; struct x509_lookup_method_st { - const char *name; + char *name; int (*new_item) (X509_LOOKUP *ctx); void (*free) (X509_LOOKUP *ctx); int (*init) (X509_LOOKUP *ctx); @@ -91,7 +91,7 @@ struct x509_lookup_st { int init; /* have we been started */ int skip; /* don't use us. */ X509_LOOKUP_METHOD *method; /* the functions */ - char *method_data; /* method data */ + void *method_data; /* method data */ X509_STORE *store_ctx; /* who owns us */ }; diff --git a/deps/openssl/openssl/crypto/x509/x509_lu.c b/deps/openssl/openssl/crypto/x509/x509_lu.c index 90f23520f49a..e5bea5b2764e 100644 --- a/deps/openssl/openssl/crypto/x509/x509_lu.c +++ b/deps/openssl/openssl/crypto/x509/x509_lu.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -117,6 +117,23 @@ int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, return ctx->method->get_by_alias(ctx, type, str, len, ret); } +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data) +{ + ctx->method_data = data; + return 1; +} + +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx) +{ + return ctx->method_data; +} + +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx) +{ + return ctx->store_ctx; +} + + static int x509_object_cmp(const X509_OBJECT *const *a, const X509_OBJECT *const *b) { @@ -265,6 +282,9 @@ int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, X509_OBJECT stmp, *tmp; int i, j; + if (ctx == NULL) + return 0; + CRYPTO_THREAD_write_lock(ctx->lock); tmp = X509_OBJECT_retrieve_by_subject(ctx->objs, type, name); CRYPTO_THREAD_unlock(ctx->lock); @@ -290,26 +310,30 @@ int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, return 1; } -int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) +static int x509_store_add(X509_STORE *ctx, void *x, int crl) { X509_OBJECT *obj; - int ret = 1, added = 1; + int ret = 0, added = 0; if (x == NULL) return 0; obj = X509_OBJECT_new(); if (obj == NULL) return 0; - obj->type = X509_LU_X509; - obj->data.x509 = x; + + if (crl) { + obj->type = X509_LU_CRL; + obj->data.crl = (X509_CRL *)x; + } else { + obj->type = X509_LU_X509; + obj->data.x509 = (X509 *)x; + } X509_OBJECT_up_ref_count(obj); CRYPTO_THREAD_write_lock(ctx->lock); if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { - X509err(X509_F_X509_STORE_ADD_CERT, - X509_R_CERT_ALREADY_IN_HASH_TABLE); - ret = 0; + ret = 1; } else { added = sk_X509_OBJECT_push(ctx->objs, obj); ret = added != 0; @@ -317,46 +341,28 @@ int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) CRYPTO_THREAD_unlock(ctx->lock); - if (!ret) /* obj not pushed */ + if (added == 0) /* obj not pushed */ X509_OBJECT_free(obj); - if (!added) /* on push failure */ - X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE); return ret; } -int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) { - X509_OBJECT *obj; - int ret = 1, added = 1; - - if (x == NULL) - return 0; - obj = X509_OBJECT_new(); - if (obj == NULL) + if (!x509_store_add(ctx, x, 0)) { + X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE); return 0; - obj->type = X509_LU_CRL; - obj->data.crl = x; - X509_OBJECT_up_ref_count(obj); - - CRYPTO_THREAD_write_lock(ctx->lock); - - if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { - X509err(X509_F_X509_STORE_ADD_CRL, X509_R_CERT_ALREADY_IN_HASH_TABLE); - ret = 0; - } else { - added = sk_X509_OBJECT_push(ctx->objs, obj); - ret = added != 0; } + return 1; +} - CRYPTO_THREAD_unlock(ctx->lock); - - if (!ret) /* obj not pushed */ - X509_OBJECT_free(obj); - if (!added) /* on push failure */ +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) +{ + if (!x509_store_add(ctx, x, 1)) { X509err(X509_F_X509_STORE_ADD_CRL, ERR_R_MALLOC_FAILURE); - - return ret; + return 0; + } + return 1; } int X509_OBJECT_up_ref_count(X509_OBJECT *a) @@ -403,8 +409,7 @@ X509_OBJECT *X509_OBJECT_new() return ret; } - -void X509_OBJECT_free(X509_OBJECT *a) +static void x509_object_free_internal(X509_OBJECT *a) { if (a == NULL) return; @@ -418,6 +423,33 @@ void X509_OBJECT_free(X509_OBJECT *a) X509_CRL_free(a->data.crl); break; } +} + +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj) +{ + if (a == NULL || !X509_up_ref(obj)) + return 0; + + x509_object_free_internal(a); + a->type = X509_LU_X509; + a->data.x509 = obj; + return 1; +} + +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj) +{ + if (a == NULL || !X509_CRL_up_ref(obj)) + return 0; + + x509_object_free_internal(a); + a->type = X509_LU_CRL; + a->data.crl = obj; + return 1; +} + +void X509_OBJECT_free(X509_OBJECT *a) +{ + x509_object_free_internal(a); OPENSSL_free(a); } @@ -489,6 +521,9 @@ STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) X509 *x; X509_OBJECT *obj; + if (ctx->ctx == NULL) + return NULL; + CRYPTO_THREAD_write_lock(ctx->ctx->lock); idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); if (idx < 0) { @@ -538,8 +573,10 @@ STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) X509_OBJECT *obj, *xobj = X509_OBJECT_new(); /* Always do lookup to possibly add new CRLs to cache */ - if (sk == NULL || xobj == NULL || - !X509_STORE_CTX_get_by_subject(ctx, X509_LU_CRL, nm, xobj)) { + if (sk == NULL + || xobj == NULL + || ctx->ctx == NULL + || !X509_STORE_CTX_get_by_subject(ctx, X509_LU_CRL, nm, xobj)) { X509_OBJECT_free(xobj); sk_X509_CRL_free(sk); return NULL; @@ -633,6 +670,9 @@ int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) } X509_OBJECT_free(obj); + if (ctx->ctx == NULL) + return 0; + /* Else find index of first cert accepted by 'check_issued' */ ret = 0; CRYPTO_THREAD_write_lock(ctx->ctx->lock); diff --git a/deps/openssl/openssl/crypto/x509/x509_meth.c b/deps/openssl/openssl/crypto/x509/x509_meth.c new file mode 100644 index 000000000000..05ed4bf86372 --- /dev/null +++ b/deps/openssl/openssl/crypto/x509/x509_meth.c @@ -0,0 +1,166 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include + +#include "internal/cryptlib.h" +#include +#include +#include +#include "x509_lcl.h" + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name) +{ + X509_LOOKUP_METHOD *method = OPENSSL_zalloc(sizeof(X509_LOOKUP_METHOD)); + + if (method != NULL) { + method->name = OPENSSL_strdup(name); + if (method->name == NULL) { + X509err(X509_F_X509_LOOKUP_METH_NEW, ERR_R_MALLOC_FAILURE); + goto err; + } + } + + return method; + +err: + OPENSSL_free(method); + return NULL; +} + +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method) +{ + if (method != NULL) + OPENSSL_free(method->name); + OPENSSL_free(method); +} + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)) +{ + method->new_item = new_item; + return 1; +} + +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx) +{ + return method->new_item; +} + +int X509_LOOKUP_meth_set_free( + X509_LOOKUP_METHOD *method, + void (*free) (X509_LOOKUP *ctx)) +{ + method->free = free; + return 1; +} + +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx) +{ + return method->free; +} + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)) +{ + method->init = init; + return 1; +} + +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx) +{ + return method->init; +} + +int X509_LOOKUP_meth_set_shutdown( + X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)) +{ + method->shutdown = shutdown; + return 1; +} + +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx) +{ + return method->shutdown; +} + +int X509_LOOKUP_meth_set_ctrl( + X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl) +{ + method->ctrl = ctrl; + return 1; +} + +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method) +{ + return method->ctrl; +} + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn get_by_subject) +{ + method->get_by_subject = get_by_subject; + return 1; +} + +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method) +{ + return method->get_by_subject; +} + + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn get_by_issuer_serial) +{ + method->get_by_issuer_serial = get_by_issuer_serial; + return 1; +} + +X509_LOOKUP_get_by_issuer_serial_fn + X509_LOOKUP_meth_get_get_by_issuer_serial(const X509_LOOKUP_METHOD *method) +{ + return method->get_by_issuer_serial; +} + + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn get_by_fingerprint) +{ + method->get_by_fingerprint = get_by_fingerprint; + return 1; +} + +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method) +{ + return method->get_by_fingerprint; +} + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn get_by_alias) +{ + method->get_by_alias = get_by_alias; + return 1; +} + +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method) +{ + return method->get_by_alias; +} + diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c index 3018c69ae48a..f86871f6d2b9 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.c +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,6 +7,7 @@ * https://www.openssl.org/source/license.html */ +#include #include #include #include @@ -557,6 +558,27 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) return 1; } +static int has_san_id(X509 *x, int gtype) +{ + int i; + int ret = 0; + GENERAL_NAMES *gs = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); + + if (gs == NULL) + return 0; + + for (i = 0; i < sk_GENERAL_NAME_num(gs); i++) { + GENERAL_NAME *g = sk_GENERAL_NAME_value(gs, i); + + if (g->type == gtype) { + ret = 1; + break; + } + } + GENERAL_NAMES_free(gs); + return ret; +} + static int check_name_constraints(X509_STORE_CTX *ctx) { int i; @@ -655,7 +677,12 @@ static int check_name_constraints(X509_STORE_CTX *ctx) int rv = NAME_CONSTRAINTS_check(x, nc); /* If EE certificate check commonName too */ - if (rv == X509_V_OK && i == 0) + if (rv == X509_V_OK && i == 0 + && (ctx->param->hostflags + & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT) == 0 + && ((ctx->param->hostflags + & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT) != 0 + || !has_san_id(x, GEN_DNS))) rv = NAME_CONSTRAINTS_check_CN(x, nc); switch (rv) { @@ -1756,119 +1783,67 @@ int X509_cmp_current_time(const ASN1_TIME *ctm) int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) { - char *str; - ASN1_TIME atm; - long offset; - char buff1[24], buff2[24], *p; - int i, j, remaining; + static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1; + static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1; + ASN1_TIME *asn1_cmp_time = NULL; + int i, day, sec, ret = 0; - p = buff1; - remaining = ctm->length; - str = (char *)ctm->data; /* - * Note that the following (historical) code allows much more slack in the - * time format than RFC5280. In RFC5280, the representation is fixed: + * Note that ASN.1 allows much more slack in the time format than RFC5280. + * In RFC5280, the representation is fixed: * UTCTime: YYMMDDHHMMSSZ * GeneralizedTime: YYYYMMDDHHMMSSZ + * + * We do NOT currently enforce the following RFC 5280 requirement: + * "CAs conforming to this profile MUST always encode certificate + * validity dates through the year 2049 as UTCTime; certificate validity + * dates in 2050 or later MUST be encoded as GeneralizedTime." */ - if (ctm->type == V_ASN1_UTCTIME) { - /* YYMMDDHHMM[SS]Z or YYMMDDHHMM[SS](+-)hhmm */ - int min_length = sizeof("YYMMDDHHMMZ") - 1; - int max_length = sizeof("YYMMDDHHMMSS+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + switch (ctm->type) { + case V_ASN1_UTCTIME: + if (ctm->length != (int)(utctime_length)) return 0; - memcpy(p, str, 10); - p += 10; - str += 10; - remaining -= 10; - } else { - /* YYYYMMDDHHMM[SS[.fff]]Z or YYYYMMDDHHMM[SS[.f[f[f]]]](+-)hhmm */ - int min_length = sizeof("YYYYMMDDHHMMZ") - 1; - int max_length = sizeof("YYYYMMDDHHMMSS.fff+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + break; + case V_ASN1_GENERALIZEDTIME: + if (ctm->length != (int)(generalizedtime_length)) return 0; - memcpy(p, str, 12); - p += 12; - str += 12; - remaining -= 12; + break; + default: + return 0; } - if ((*str == 'Z') || (*str == '-') || (*str == '+')) { - *(p++) = '0'; - *(p++) = '0'; - } else { - /* SS (seconds) */ - if (remaining < 2) + /** + * Verify the format: the ASN.1 functions we use below allow a more + * flexible format than what's mandated by RFC 5280. + * Digit and date ranges will be verified in the conversion methods. + */ + for (i = 0; i < ctm->length - 1; i++) { + if (!isdigit(ctm->data[i])) return 0; - *(p++) = *(str++); - *(p++) = *(str++); - remaining -= 2; - /* - * Skip any (up to three) fractional seconds... - * TODO(emilia): in RFC5280, fractional seconds are forbidden. - * Can we just kill them altogether? - */ - if (remaining && *str == '.') { - str++; - remaining--; - for (i = 0; i < 3 && remaining; i++, str++, remaining--) { - if (*str < '0' || *str > '9') - break; - } - } - } - *(p++) = 'Z'; - *(p++) = '\0'; - - /* We now need either a terminating 'Z' or an offset. */ - if (!remaining) + if (ctm->data[ctm->length - 1] != 'Z') return 0; - if (*str == 'Z') { - if (remaining != 1) - return 0; - offset = 0; - } else { - /* (+-)HHMM */ - if ((*str != '+') && (*str != '-')) - return 0; - /* Historical behaviour: the (+-)hhmm offset is forbidden in RFC5280. */ - if (remaining != 5) - return 0; - if (str[1] < '0' || str[1] > '9' || str[2] < '0' || str[2] > '9' || - str[3] < '0' || str[3] > '9' || str[4] < '0' || str[4] > '9') - return 0; - offset = ((str[1] - '0') * 10 + (str[2] - '0')) * 60; - offset += (str[3] - '0') * 10 + (str[4] - '0'); - if (*str == '-') - offset = -offset; - } - atm.type = ctm->type; - atm.flags = 0; - atm.length = sizeof(buff2); - atm.data = (unsigned char *)buff2; - if (X509_time_adj(&atm, offset * 60, cmp_time) == NULL) - return 0; + /* + * There is ASN1_UTCTIME_cmp_time_t but no + * ASN1_GENERALIZEDTIME_cmp_time_t or ASN1_TIME_cmp_time_t, + * so we go through ASN.1 + */ + asn1_cmp_time = X509_time_adj(NULL, 0, cmp_time); + if (asn1_cmp_time == NULL) + goto err; + if (!ASN1_TIME_diff(&day, &sec, ctm, asn1_cmp_time)) + goto err; - if (ctm->type == V_ASN1_UTCTIME) { - i = (buff1[0] - '0') * 10 + (buff1[1] - '0'); - if (i < 50) - i += 100; /* cf. RFC 2459 */ - j = (buff2[0] - '0') * 10 + (buff2[1] - '0'); - if (j < 50) - j += 100; - - if (i < j) - return -1; - if (i > j) - return 1; - } - i = strcmp(buff1, buff2); - if (i == 0) /* wait a second then return younger :-) */ - return -1; - else - return i; + /* + * X509_cmp_time comparison is <=. + * The return value 0 is reserved for errors. + */ + ret = (day >= 0 && sec >= 0) ? -1 : 1; + + err: + ASN1_TIME_free(asn1_cmp_time); + return ret; } ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj) @@ -3264,6 +3239,10 @@ static int check_sig_level(X509_STORE_CTX *ctx, X509 *cert) if (level > NUM_AUTH_LEVELS) level = NUM_AUTH_LEVELS; + /* We are not able to look up the CA MD for RSA PSS in this version */ + if (nid == NID_rsassaPss) + return 1; + /* Lookup signature algorithm digest */ if (nid && OBJ_find_sigid_algs(nid, &mdnid, NULL)) { const EVP_MD *md; diff --git a/deps/openssl/openssl/crypto/x509/x509_vpm.c b/deps/openssl/openssl/crypto/x509/x509_vpm.c index b5067220adbe..9bc4c6110130 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vpm.c +++ b/deps/openssl/openssl/crypto/x509/x509_vpm.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -412,6 +412,11 @@ void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, param->hostflags = flags; } +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param) +{ + return param->hostflags; +} + char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param) { return param->peername; diff --git a/deps/openssl/openssl/crypto/x509/x509name.c b/deps/openssl/openssl/crypto/x509/x509name.c index f87dc7db993a..81dce376f856 100644 --- a/deps/openssl/openssl/crypto/x509/x509name.c +++ b/deps/openssl/openssl/crypto/x509/x509name.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,7 +191,7 @@ int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, loc = n; else if (loc < 0) loc = n; - + inc = (set == 0); name->modified = 1; if (set == -1) { @@ -200,7 +200,6 @@ int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, inc = 1; } else { set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; - inc = 0; } } else { /* if (set >= 0) */ @@ -211,12 +210,11 @@ int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, set = 0; } else set = sk_X509_NAME_ENTRY_value(sk, loc)->set; - inc = (set == 0) ? 1 : 0; } /* * X509_NAME_ENTRY_dup is ASN1 generated code, that can't be easily - * const'ified; harmless cast as dup() don't modify its input. + * const'ified; harmless cast since dup() don't modify its input. */ if ((new_name = X509_NAME_ENTRY_dup((X509_NAME_ENTRY *)ne)) == NULL) goto err; @@ -228,7 +226,7 @@ int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, if (inc) { n = sk_X509_NAME_ENTRY_num(sk); for (i = loc + 1; i < n; i++) - sk_X509_NAME_ENTRY_value(sk, i - 1)->set += 1; + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; } return (1); err: diff --git a/deps/openssl/openssl/crypto/x509/x_name.c b/deps/openssl/openssl/crypto/x509/x_name.c index 0af5df5cfc4f..1a33dc1daa7c 100644 --- a/deps/openssl/openssl/crypto/x509/x_name.c +++ b/deps/openssl/openssl/crypto/x509/x_name.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -472,6 +472,8 @@ static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname, int X509_NAME_set(X509_NAME **xn, X509_NAME *name) { + if (*xn == name) + return *xn != NULL; if ((name = X509_NAME_dup(name)) == NULL) return 0; X509_NAME_free(*xn); diff --git a/deps/openssl/openssl/crypto/x509v3/v3_enum.c b/deps/openssl/openssl/crypto/x509v3/v3_enum.c index 3b0f197444af..f39cb5ac2aab 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_enum.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_enum.c @@ -38,7 +38,7 @@ const X509V3_EXT_METHOD v3_crl_reason = { crl_reasons }; -char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) { ENUMERATED_NAMES *enam; diff --git a/deps/openssl/openssl/crypto/x509v3/v3_ncons.c b/deps/openssl/openssl/crypto/x509v3/v3_ncons.c index 2eec405a36b5..bd7301e45589 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_ncons.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_ncons.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2003-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -297,47 +297,140 @@ int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc) } +static int cn2dnsid(ASN1_STRING *cn, unsigned char **dnsid, size_t *idlen) +{ + int utf8_length; + unsigned char *utf8_value; + int i; + int isdnsname = 0; + + /* Don't leave outputs uninitialized */ + *dnsid = NULL; + *idlen = 0; + + /*- + * Per RFC 6125, DNS-IDs representing internationalized domain names appear + * in certificates in A-label encoded form: + * + * https://tools.ietf.org/html/rfc6125#section-6.4.2 + * + * The same applies to CNs which are intended to represent DNS names. + * However, while in the SAN DNS-IDs are IA5Strings, as CNs they may be + * needlessly encoded in 16-bit Unicode. We perform a conversion to UTF-8 + * to ensure that we get an ASCII representation of any CNs that are + * representable as ASCII, but just not encoded as ASCII. The UTF-8 form + * may contain some non-ASCII octets, and that's fine, such CNs are not + * valid legacy DNS names. + * + * Note, 'int' is the return type of ASN1_STRING_to_UTF8() so that's what + * we must use for 'utf8_length'. + */ + if ((utf8_length = ASN1_STRING_to_UTF8(&utf8_value, cn)) < 0) + return X509_V_ERR_OUT_OF_MEM; + + /* + * Some certificates have had names that include a *trailing* NUL byte. + * Remove these harmless NUL characters. They would otherwise yield false + * alarms with the following embedded NUL check. + */ + while (utf8_length > 0 && utf8_value[utf8_length - 1] == '\0') + --utf8_length; + + /* Reject *embedded* NULs */ + if ((size_t)utf8_length != strlen((char *)utf8_value)) { + OPENSSL_free(utf8_value); + return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; + } + + /* + * XXX: Deviation from strict DNS name syntax, also check names with '_' + * Check DNS name syntax, any '-' or '.' must be internal, + * and on either side of each '.' we can't have a '-' or '.'. + * + * If the name has just one label, we don't consider it a DNS name. This + * means that "CN=sometld" cannot be precluded by DNS name constraints, but + * that is not a problem. + */ + for (i = 0; i < utf8_length; ++i) { + unsigned char c = utf8_value[i]; + + if ((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == '_') + continue; + + /* Dot and hyphen cannot be first or last. */ + if (i > 0 && i < utf8_length - 1) { + if (c == '-') + continue; + /* + * Next to a dot the preceding and following characters must not be + * another dot or a hyphen. Otherwise, record that the name is + * plausible, since it has two or more labels. + */ + if (c == '.' + && utf8_value[i + 1] != '.' + && utf8_value[i - 1] != '-' + && utf8_value[i + 1] != '-') { + isdnsname = 1; + continue; + } + } + isdnsname = 0; + break; + } + + if (isdnsname) { + *dnsid = utf8_value; + *idlen = (size_t)utf8_length; + return X509_V_OK; + } + OPENSSL_free(utf8_value); + return X509_V_OK; +} + +/* + * Check CN against DNS-ID name constraints. + */ int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc) { int r, i; - X509_NAME *nm; - + X509_NAME *nm = X509_get_subject_name(x); ASN1_STRING stmp; GENERAL_NAME gntmp; + stmp.flags = 0; stmp.type = V_ASN1_IA5STRING; gntmp.type = GEN_DNS; gntmp.d.dNSName = &stmp; - nm = X509_get_subject_name(x); - /* Process any commonName attributes in subject name */ for (i = -1;;) { X509_NAME_ENTRY *ne; - ASN1_STRING *hn; + ASN1_STRING *cn; + unsigned char *idval; + size_t idlen; + i = X509_NAME_get_index_by_NID(nm, NID_commonName, i); if (i == -1) break; ne = X509_NAME_get_entry(nm, i); - hn = X509_NAME_ENTRY_get_data(ne); - /* Only process attributes that look like host names */ - if (asn1_valid_host(hn)) { - unsigned char *h; - int hlen = ASN1_STRING_to_UTF8(&h, hn); - if (hlen <= 0) - return X509_V_ERR_OUT_OF_MEM; + cn = X509_NAME_ENTRY_get_data(ne); - stmp.length = hlen; - stmp.data = h; - - r = nc_match(&gntmp, nc); - - OPENSSL_free(h); + /* Only process attributes that look like host names */ + if ((r = cn2dnsid(cn, &idval, &idlen)) != X509_V_OK) + return r; + if (idlen == 0) + continue; - if (r != X509_V_OK) - return r; - } + stmp.length = idlen; + stmp.data = idval; + r = nc_match(&gntmp, nc); + OPENSSL_free(idval); + if (r != X509_V_OK) + return r; } return X509_V_OK; } diff --git a/deps/openssl/openssl/crypto/x509v3/v3_purp.c b/deps/openssl/openssl/crypto/x509v3/v3_purp.c index 6d2f354d70f1..7ac067229fbb 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_purp.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_purp.c @@ -78,11 +78,9 @@ int X509_check_purpose(X509 *x, int id, int ca) { int idx; const X509_PURPOSE *pt; - if (!(x->ex_flags & EXFLAG_SET)) { - CRYPTO_THREAD_write_lock(x->lock); - x509v3_cache_extensions(x); - CRYPTO_THREAD_unlock(x->lock); - } + + x509v3_cache_extensions(x); + /* Return if side-effect only call */ if (id == -1) return 1; @@ -352,10 +350,18 @@ static void x509v3_cache_extensions(X509 *x) ASN1_BIT_STRING *ns; EXTENDED_KEY_USAGE *extusage; X509_EXTENSION *ex; - int i; - if (x->ex_flags & EXFLAG_SET) + + /* fast lock-free check, see end of the function for details. */ + if (x->ex_cached) + return; + + CRYPTO_THREAD_write_lock(x->lock); + if (x->ex_flags & EXFLAG_SET) { + CRYPTO_THREAD_unlock(x->lock); return; + } + X509_digest(x, EVP_sha1(), x->sha1_hash, NULL); /* V1 should mean no extensions ... */ if (!X509_get_version(x)) @@ -489,6 +495,13 @@ static void x509v3_cache_extensions(X509 *x) } } x->ex_flags |= EXFLAG_SET; + CRYPTO_THREAD_unlock(x->lock); + /* + * It has to be placed after memory barrier, which is implied by unlock. + * Worst thing that can happen is that another thread proceeds to lock + * and checks x->ex_flags & EXFLAGS_SET. See beginning of the function. + */ + x->ex_cached = 1; } /*- @@ -541,11 +554,7 @@ void X509_set_proxy_pathlen(X509 *x, long l) int X509_check_ca(X509 *x) { - if (!(x->ex_flags & EXFLAG_SET)) { - CRYPTO_THREAD_write_lock(x->lock); - x509v3_cache_extensions(x); - CRYPTO_THREAD_unlock(x->lock); - } + x509v3_cache_extensions(x); return check_ca(x); } @@ -759,6 +768,7 @@ int X509_check_issued(X509 *issuer, X509 *subject) if (X509_NAME_cmp(X509_get_subject_name(issuer), X509_get_issuer_name(subject))) return X509_V_ERR_SUBJECT_ISSUER_MISMATCH; + x509v3_cache_extensions(issuer); x509v3_cache_extensions(subject); diff --git a/deps/openssl/openssl/crypto/x509v3/v3_skey.c b/deps/openssl/openssl/crypto/x509v3/v3_skey.c index 749f51b2f00e..39597dc41d3f 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_skey.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_skey.c @@ -24,7 +24,7 @@ const X509V3_EXT_METHOD v3_skey_id = { NULL }; -char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, const ASN1_OCTET_STRING *oct) { return OPENSSL_buf2hexstr(oct->data, oct->length); diff --git a/deps/openssl/openssl/crypto/x509v3/v3_tlsf.c b/deps/openssl/openssl/crypto/x509v3/v3_tlsf.c index fec67243f8d3..d93781e1b7b7 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_tlsf.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_tlsf.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -121,13 +121,12 @@ static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method, } } - ai = ASN1_INTEGER_new(); - if (ai == NULL) { + if ((ai = ASN1_INTEGER_new()) == NULL + || !ASN1_INTEGER_set(ai, tlsextid) + || sk_ASN1_INTEGER_push(tlsf, ai) <= 0) { X509V3err(X509V3_F_V2I_TLS_FEATURE, ERR_R_MALLOC_FAILURE); goto err; } - ASN1_INTEGER_set(ai, tlsextid); - sk_ASN1_INTEGER_push(tlsf, ai); } return tlsf; diff --git a/deps/openssl/openssl/demos/bio/descrip.mms b/deps/openssl/openssl/demos/bio/descrip.mms index d49725ffd191..8e127b079a51 100644 --- a/deps/openssl/openssl/demos/bio/descrip.mms +++ b/deps/openssl/openssl/demos/bio/descrip.mms @@ -23,7 +23,7 @@ SHARED = TRUE @ ! # Because we use an option file, we need to redefine this -.obj.exe : +.obj.exe : $(LINK) $(LINKFLAGS) $<,OPT:/OPT all : client-arg.exe client-conf.exe saccept.exe sconnect.exe - diff --git a/deps/openssl/openssl/demos/certs/README b/deps/openssl/openssl/demos/certs/README index 88cf56b1f8d0..126663a1d8c9 100644 --- a/deps/openssl/openssl/demos/certs/README +++ b/deps/openssl/openssl/demos/certs/README @@ -8,7 +8,7 @@ automatically using scripts. Example creates a root CA, an intermediate CA signed by the root and several certificates signed by the intermediate CA. The script then creates an empty index.txt file and adds entries for the -certificates and generates a CRL. Then one certificate is revoked and a +certificates and generates a CRL. Then one certificate is revoked and a second CRL generated. The script ocsprun.sh runs the test responder on port 8888 covering the @@ -16,3 +16,6 @@ client certificates. The script ocspquery.sh queries the status of the certificates using the test responder. + + + diff --git a/deps/openssl/openssl/demos/certs/apps/apps.cnf b/deps/openssl/openssl/demos/certs/apps/apps.cnf index f02d43bad03f..531afe64b20f 100644 --- a/deps/openssl/openssl/demos/certs/apps/apps.cnf +++ b/deps/openssl/openssl/demos/certs/apps/apps.cnf @@ -65,3 +65,5 @@ subjectKeyIdentifier=hash authorityKeyIdentifier=keyid:always basicConstraints = critical,CA:true keyUsage = critical, cRLSign, keyCertSign + + diff --git a/deps/openssl/openssl/demos/certs/apps/mkxcerts.sh b/deps/openssl/openssl/demos/certs/apps/mkxcerts.sh index ebe1920432be..0f88a48fb848 100644 --- a/deps/openssl/openssl/demos/certs/apps/mkxcerts.sh +++ b/deps/openssl/openssl/demos/certs/apps/mkxcerts.sh @@ -13,7 +13,7 @@ CN="OpenSSL Test RSA SHA-512 cert" $OPENSSL req \ -config apps.cnf -extensions usr_cert -x509 -nodes \ -keyout tsha512.pem -out tsha512.pem -new -days 3650 -sha512 -# Create EC parameters +# Create EC parameters $OPENSSL ecparam -name P-256 -out ecp256.pem $OPENSSL ecparam -name P-384 -out ecp384.pem diff --git a/deps/openssl/openssl/demos/certs/mkcerts.sh b/deps/openssl/openssl/demos/certs/mkcerts.sh index 498595d28c58..18daa6bcfb8d 100644 --- a/deps/openssl/openssl/demos/certs/mkcerts.sh +++ b/deps/openssl/openssl/demos/certs/mkcerts.sh @@ -42,7 +42,7 @@ CN="Test OCSP Responder Cert" $OPENSSL req -config ca.cnf -nodes \ $OPENSSL x509 -req -in respreq.pem -CA intca.pem -CAkey intkey.pem -days 3600 \ -extfile ca.cnf -extensions ocsp_cert -CAcreateserial -out resp.pem -# Example creating a PKCS#3 DH certificate. +# Example creating a PKCS#3 DH certificate. # First DH parameters @@ -93,3 +93,4 @@ openssl ca -revoke rev.pem -crl_reason superseded \ # Generate another CRL $OPENSSL ca -gencrl -keyfile root.pem -cert root.pem -config ca.cnf \ -md sha1 -crldays 1 -out crl2.pem + diff --git a/deps/openssl/openssl/demos/evp/Makefile b/deps/openssl/openssl/demos/evp/Makefile index 4a753e924771..72c6e81d7a9f 100644 --- a/deps/openssl/openssl/demos/evp/Makefile +++ b/deps/openssl/openssl/demos/evp/Makefile @@ -11,7 +11,7 @@ CFLAGS = $(OPENSSL_INCS_LOCATION) LDFLAGS = $(OPENSSL_LIBS_LOCATION) -lssl -lcrypto -all: aesccm aesgcm +all: aesccm aesgcm aesccm: aesccm.o aesgcm: aesgcm.o diff --git a/deps/openssl/openssl/demos/evp/aesgcm.c b/deps/openssl/openssl/demos/evp/aesgcm.c index 46d9a5639bc0..df59f469fd86 100644 --- a/deps/openssl/openssl/demos/evp/aesgcm.c +++ b/deps/openssl/openssl/demos/evp/aesgcm.c @@ -102,7 +102,7 @@ void aes_gcm_decrypt(void) printf("Plaintext:\n"); BIO_dump_fp(stdout, outbuf, outlen); /* Set expected tag value. */ - EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), + EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), (void *)gcm_tag); /* Finalise: note get no output for GCM */ rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen); diff --git a/deps/openssl/openssl/doc/apps/cms.pod b/deps/openssl/openssl/doc/apps/cms.pod index 96acd315d4d3..64ec106b09cc 100644 --- a/deps/openssl/openssl/doc/apps/cms.pod +++ b/deps/openssl/openssl/doc/apps/cms.pod @@ -393,6 +393,9 @@ When encrypting a message this option may be used multiple times to specify each recipient. This form B be used if customised parameters are required (for example to specify RSA-OAEP). +Only certificates carrying RSA, Diffie-Hellman or EC keys are supported by this +option. + =item B<-keyid> use subject key identifier to identify certificates instead of issuer name and @@ -712,23 +715,20 @@ No revocation checking is done on the signer's certificate. =head1 HISTORY The use of multiple B<-signer> options and the B<-resign> command were first -added in OpenSSL 1.0.0 - -The B option was first added in OpenSSL 1.1.0 +added in OpenSSL 1.0.0. -The use of B<-recip> to specify the recipient when encrypting mail was first -added to OpenSSL 1.1.0 +The B option was first added in OpenSSL 1.0.2 -Support for RSA-OAEP and RSA-PSS was first added to OpenSSL 1.1.0. +Support for RSA-OAEP and RSA-PSS was first added to OpenSSL 1.0.2. The use of non-RSA keys with B<-encrypt> and B<-decrypt> was first added -to OpenSSL 1.1.0. +to OpenSSL 1.0.2. -The -no_alt_chains options was first added to OpenSSL 1.1.0. +The -no_alt_chains options was first added to OpenSSL 1.0.2b. =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/apps/config.pod b/deps/openssl/openssl/doc/apps/config.pod index 76f282f28ce0..a5153a65f1a5 100644 --- a/deps/openssl/openssl/doc/apps/config.pod +++ b/deps/openssl/openssl/doc/apps/config.pod @@ -20,7 +20,7 @@ started or end of file is reached. A section name can consist of alphanumeric characters and underscores. The first section of a configuration file is special and is referred -to as the B section this is usually unnamed and is from the +to as the B section. This section is usually unnamed and spans from the start of file until the first named section. When a name is being looked up it is first looked up in a named section (if any) and then the default section. @@ -377,7 +377,7 @@ L, L, L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/apps/genpkey.pod b/deps/openssl/openssl/doc/apps/genpkey.pod index d48695200b13..91b12e249b3b 100644 --- a/deps/openssl/openssl/doc/apps/genpkey.pod +++ b/deps/openssl/openssl/doc/apps/genpkey.pod @@ -12,7 +12,7 @@ B B [B<-out filename>] [B<-outform PEM|DER>] [B<-pass arg>] -[B<-cipher>] +[B<-I>] [B<-engine id>] [B<-paramfile file>] [B<-algorithm alg>] @@ -39,21 +39,21 @@ standard output is used. =item B<-outform DER|PEM> -This specifies the output format DER or PEM. +This specifies the output format DER or PEM. The default format is PEM. =item B<-pass arg> -the output file password source. For more information about the format of B +The output file password source. For more information about the format of B see the B section in L. -=item B<-cipher> +=item B<-I> This option encrypts the private key with the supplied cipher. Any algorithm name accepted by EVP_get_cipherbyname() is acceptable such as B. =item B<-engine id> -specifying an engine (by its unique B string) will cause B +Specifying an engine (by its unique B string) will cause B to attempt to obtain a functional reference to the specified engine, thus initialising it if needed. The engine will then be set as the default for all available algorithms. If used this option should precede all other @@ -61,19 +61,32 @@ options. =item B<-algorithm alg> -public key algorithm to use such as RSA, DSA or DH. If used this option must +Public key algorithm to use such as RSA, DSA or DH. If used this option must precede any B<-pkeyopt> options. The options B<-paramfile> and B<-algorithm> -are mutually exclusive. +are mutually exclusive. Engines may add algorithms in addition to the standard +built-in ones. + +Valid built-in algorithm names for private key generation are RSA and EC. + +Valid built-in algorithm names for parameter generation (see the B<-genparam> +option) are DH, DSA and EC. + +Note that the algorithm name X9.42 DH may be used as a synonym for the DH +algorithm. These are identical and do not indicate the type of parameters that +will be generated. Use the B option to indicate whether PKCS#3 +or X9.42 DH parameters are required. See L +below for more details. =item B<-pkeyopt opt:value> -set the public key algorithm option B to B. The precise set of +Set the public key algorithm option B to B. The precise set of options supported depends on the public key algorithm used and its -implementation. See B below for more details. +implementation. See L and +L below for more details. =item B<-genparam> -generate a set of parameters instead of a private key. If used this option must +Generate a set of parameters instead of a private key. If used this option must precede any B<-algorithm>, B<-paramfile> or B<-pkeyopt> options. =item B<-paramfile filename> @@ -97,7 +110,7 @@ The options supported by each algorithm and indeed each implementation of an algorithm can vary. The options for the OpenSSL implementations are detailed below. -=head1 RSA KEY GENERATION OPTIONS +=head2 RSA Key Generation Options =over 4 @@ -112,91 +125,92 @@ hexadecimal value if preceded by B<0x>. Default value is 65537. =back -=head1 DSA PARAMETER GENERATION OPTIONS +=head2 EC Key Generation Options + +The EC key generation options can also be used for parameter generation. =over 4 -=item B +=item B + +The EC curve to use. OpenSSL supports NIST curve names such as "P-256". -The number of bits in the generated parameters. If not specified 1024 is used. +=item B + +The encoding to use for parameters. The "encoding" parameter must be either +"named_curve" or "explicit". The default value is "named_curve". =back -=head1 DH PARAMETER GENERATION OPTIONS +=head1 PARAMETER GENERATION OPTIONS + +The options supported by each algorithm and indeed each implementation of an +algorithm can vary. The options for the OpenSSL implementations are detailed +below. + +=head2 DSA Parameter Generation Options =over 4 -=item B +=item B -The number of bits in the prime parameter B

. +The number of bits in the generated prime. If not specified 1024 is used. -=item B +=item B -The value to use for the generator B. +The number of bits in the q parameter. Must be one of 160, 224 or 256. If not +specified 160 is used. -=item B +=item B -If this option is set then the appropriate RFC5114 parameters are used -instead of generating new parameters. The value B can take the -values 1, 2 or 3 corresponding to RFC5114 DH parameters consisting of -1024 bit group with 160 bit subgroup, 2048 bit group with 224 bit subgroup -and 2048 bit group with 256 bit subgroup as mentioned in RFC5114 sections -2.1, 2.2 and 2.3 respectively. +The digest to use during parameter generation. Must be one of B, B +or B. If set, then the number of bits in B will match the output size +of the specified digest and the B parameter will be +ignored. If not set, then a digest will be used that gives an output matching +the number of bits in B, i.e. B if q length is 160, B if it 224 +or B if it is 256. =back -=head1 EC PARAMETER GENERATION OPTIONS - -The EC parameter generation options below can also -be supplied as EC key generation options. This can (for example) generate a -key from a named curve without the need to use an explicit parameter file. +=head2 DH Parameter Generation Options =over 4 -=item B - -the EC curve to use. OpenSSL supports NIST curve names such as "P-256". +=item B -=item B +The number of bits in the prime parameter B

. The default is 1024. -the encoding to use for parameters. The "encoding" parameter must be either -"named_curve" or "explicit". +=item B -=back +The number of bits in the sub prime parameter B. The default is 256 if the +prime is at least 2048 bits long or 160 otherwise. Only relevant if used in +conjunction with the B option to generate X9.42 DH parameters. -=head1 GOST2001 KEY GENERATION AND PARAMETER OPTIONS - -Gost 2001 support is not enabled by default. To enable this algorithm, -one should load the ccgost engine in the OpenSSL configuration file. -See README.gost file in the engines/ccgost directory of the source -distribution for more details. +=item B -Use of a parameter file for the GOST R 34.10 algorithm is optional. -Parameters can be specified during key generation directly as well as -during generation of parameter file. +The value to use for the generator B. The default is 2. -=over 4 +=item B -=item B +The type of DH parameters to generate. Use 0 for PKCS#3 DH and 1 for X9.42 DH. +The default is 0. -Specifies GOST R 34.10-2001 parameter set according to RFC 4357. -Parameter set can be specified using abbreviated name, object short name or -numeric OID. Following parameter sets are supported: +=item B - paramset OID Usage - A 1.2.643.2.2.35.1 Signature - B 1.2.643.2.2.35.2 Signature - C 1.2.643.2.2.35.3 Signature - XA 1.2.643.2.2.36.0 Key exchange - XB 1.2.643.2.2.36.1 Key exchange - test 1.2.643.2.2.35.0 Test purposes +If this option is set, then the appropriate RFC5114 parameters are used +instead of generating new parameters. The value B can take the +values 1, 2 or 3 corresponding to RFC5114 DH parameters consisting of +1024 bit group with 160 bit subgroup, 2048 bit group with 224 bit subgroup +and 2048 bit group with 256 bit subgroup as mentioned in RFC5114 sections +2.1, 2.2 and 2.3 respectively. If present this overrides all other DH parameter +options. =back -=head1 X25519 KEY GENERATION OPTIONS - -The X25519 algorithm does not currently support any key generation options. +=head2 EC Parameter Generation Options +The EC parameter generation options are the same as for key generation. See +L above. =head1 NOTES @@ -219,19 +233,25 @@ Generate a 2048 bit RSA key using 3 as the public exponent: openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:2048 \ -pkeyopt rsa_keygen_pubexp:3 -Generate 1024 bit DSA parameters: +Generate 2048 bit DSA parameters: openssl genpkey -genparam -algorithm DSA -out dsap.pem \ - -pkeyopt dsa_paramgen_bits:1024 + -pkeyopt dsa_paramgen_bits:2048 Generate DSA key from parameters: openssl genpkey -paramfile dsap.pem -out dsakey.pem -Generate 1024 bit DH parameters: +Generate 2048 bit DH parameters: openssl genpkey -genparam -algorithm DH -out dhp.pem \ - -pkeyopt dh_paramgen_prime_len:1024 + -pkeyopt dh_paramgen_prime_len:2048 + +Generate 2048 bit X9.42 DH parameters: + + openssl genpkey -genparam -algorithm DH -out dhpx.pem \ + -pkeyopt dh_paramgen_prime_len:2048 \ + -pkeyopt dh_paramgen_type:1 Output RFC5114 2048 bit DH parameters with 224 bit subgroup: @@ -264,11 +284,12 @@ Generate an X25519 private key: =head1 HISTORY The ability to use NIST curve names, and to generate an EC key directly, -were added in OpenSSL 1.0.2. +were added in OpenSSL 1.0.2. The ability to generate X25519 keys was added in +OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/apps/rehash.pod b/deps/openssl/openssl/doc/apps/rehash.pod index 79268d47926c..22f3b7a40a6d 100644 --- a/deps/openssl/openssl/doc/apps/rehash.pod +++ b/deps/openssl/openssl/doc/apps/rehash.pod @@ -99,6 +99,12 @@ Note that current versions will not use the old style. Do not remove existing links. This is needed when keeping new and old-style links in the same directory. +=item B<-compat> + +Generate links for both old-style (MD5) and new-style (SHA1) hashing. +This allows releases before 1.0.0 to use these links along-side newer +releases. + =item B<-v> Print messages about old links removed and new links created. @@ -130,7 +136,7 @@ L. =head1 COPYRIGHT -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/apps/s_client.pod b/deps/openssl/openssl/doc/apps/s_client.pod index 01a6c5f7fc7a..9c17075337b4 100644 --- a/deps/openssl/openssl/doc/apps/s_client.pod +++ b/deps/openssl/openssl/doc/apps/s_client.pod @@ -281,8 +281,9 @@ be used as a test that session caching is working. =item B<-showcerts> -display the whole server certificate chain: normally only the server -certificate itself is displayed. +Displays the server certificate list as sent by the server: it only consists of +certificates the server has sent (in the order the server has sent them). It is +B a verified chain. =item B<-prexit> @@ -579,7 +580,8 @@ a client certificate. Therefor merely including a client certificate on the command line is no guarantee that the certificate works. If there are problems verifying a server certificate then the -B<-showcerts> option can be used to show the whole chain. +B<-showcerts> option can be used to show all the certificates sent by the +server. The B utility is a test tool and is designed to continue the handshake after any certificate verification errors. As a result it will @@ -609,7 +611,7 @@ The -no_alt_chains options was first added to OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/ASN1_INTEGER_get_int64.pod b/deps/openssl/openssl/doc/crypto/ASN1_INTEGER_get_int64.pod index f61268d6ac39..d0a6a3c810a1 100644 --- a/deps/openssl/openssl/doc/crypto/ASN1_INTEGER_get_int64.pod +++ b/deps/openssl/openssl/doc/crypto/ASN1_INTEGER_get_int64.pod @@ -11,10 +11,10 @@ ASN1_INTEGER_get_int64, ASN1_INTEGER_get, ASN1_INTEGER_set_int64, ASN1_INTEGER_s #include int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a); - int ASN1_INTEGER_get(const ASN1_INTEGER *a, long v); + long ASN1_INTEGER_get(const ASN1_INTEGER *a); int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r); - long ASN1_INTEGER_set(const ASN1_INTEGER *a); + int ASN1_INTEGER_set(const ASN1_INTEGER *a, long v); int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a); int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r); @@ -123,7 +123,7 @@ were added to OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/BIO_meth_new.pod b/deps/openssl/openssl/doc/crypto/BIO_meth_new.pod index f682c37d171e..89179a46e76a 100644 --- a/deps/openssl/openssl/doc/crypto/BIO_meth_new.pod +++ b/deps/openssl/openssl/doc/crypto/BIO_meth_new.pod @@ -17,26 +17,26 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods int BIO_get_new_index(void); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); - int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); + int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); - int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); + int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); - int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); + int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); - int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); + int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); - long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); + long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); - int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); + int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); - int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); + int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); - long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) + long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, @@ -121,7 +121,7 @@ The functions described here were added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/BN_add.pod b/deps/openssl/openssl/doc/crypto/BN_add.pod index db3b0d45b479..b2c5dd2cc54d 100644 --- a/deps/openssl/openssl/doc/crypto/BN_add.pod +++ b/deps/openssl/openssl/doc/crypto/BN_add.pod @@ -92,7 +92,9 @@ BN_exp() raises I to the I

-th power and places the result in I BN_mul(). BN_mod_exp() computes I to the I

-th power modulo I (C). This function uses less time and space than BN_exp(). +m>). This function uses less time and space than BN_exp(). Do not call this +function when B is even and any of the parameters have the +B flag set. BN_gcd() computes the greatest common divisor of I and I and places the result in I. I may be the same B as I or @@ -117,7 +119,7 @@ L, L =head1 COPYRIGHT -Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod b/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod index ac46948477dc..c9ca33fd136d 100644 --- a/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod +++ b/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod @@ -55,8 +55,8 @@ freed later using OPENSSL_free(). BN_hex2bn() takes as many characters as possible from the string B, including the leading character '-' which means negative, to form a valid hexadecimal number representation and converts them to a B and -stores it in **B. If *B is NULL, a new B is created. If -B is NULL, it only computes the length of valid representation. +stores it in **B. If *B is NULL, a new B is created. If +B is NULL, it only computes the length of valid representation. A "negative zero" is converted to zero. BN_dec2bn() is the same using the decimal system. @@ -106,7 +106,7 @@ L =head1 COPYRIGHT -Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/BN_generate_prime.pod b/deps/openssl/openssl/doc/crypto/BN_generate_prime.pod index c97536b5c4e3..4cd667e2e36e 100644 --- a/deps/openssl/openssl/doc/crypto/BN_generate_prime.pod +++ b/deps/openssl/openssl/doc/crypto/BN_generate_prime.pod @@ -100,7 +100,17 @@ If B, this test is skipped. Both BN_is_prime_ex() and BN_is_prime_fasttest_ex() perform a Miller-Rabin probabilistic primality test with B iterations. If B, a number of iterations is used that -yields a false positive rate of at most 2^-80 for random input. +yields a false positive rate of at most 2^-64 for random input. +The error rate depends on the size of the prime and goes down for bigger primes. +The rate is 2^-80 starting at 308 bits, 2^-112 at 852 bits, 2^-128 at 1080 bits, +2^-192 at 3747 bits and 2^-256 at 6394 bits. + +When the source of the prime is not random or not trusted, the number +of checks needs to be much higher to reach the same level of assurance: +It should equal half of the targeted security level in bits (rounded up to the +next integer if necessary). +For instance, to reach the 128 bit security level, B should be set to +64. If B is not B, B is called after the j-th iteration (j = 0, 1, ...). B is a @@ -184,7 +194,7 @@ and BN_GENCB_get_arg() were added in OpenSSL 1.1.0 =head1 COPYRIGHT -Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/CMS_encrypt.pod b/deps/openssl/openssl/doc/crypto/CMS_encrypt.pod index 0ed42628c3cf..cbd5a21353e2 100644 --- a/deps/openssl/openssl/doc/crypto/CMS_encrypt.pod +++ b/deps/openssl/openssl/doc/crypto/CMS_encrypt.pod @@ -18,9 +18,8 @@ B is the symmetric cipher to use. B is an optional set of flags. =head1 NOTES -Only certificates carrying RSA keys are supported so the recipient certificates -supplied to this function must all contain RSA public keys, though they do not -have to be signed using the RSA algorithm. +Only certificates carrying RSA, Diffie-Hellman or EC keys are supported by this +function. EVP_des_ede3_cbc() (triple DES) is the algorithm of choice for S/MIME use because most clients will support it. @@ -94,7 +93,7 @@ The B flag was first supported in OpenSSL 1.0.0. =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/CMS_get0_SignerInfos.pod b/deps/openssl/openssl/doc/crypto/CMS_get0_SignerInfos.pod index e5532c96f440..cea088857a6f 100644 --- a/deps/openssl/openssl/doc/crypto/CMS_get0_SignerInfos.pod +++ b/deps/openssl/openssl/doc/crypto/CMS_get0_SignerInfos.pod @@ -54,7 +54,7 @@ CMS_SignerInfo_set1_signer_cert(). Once all signer certificates have been set CMS_verify() can be used. -Although CMS_get0_SignerInfos() can return NULL is an error occur B if +Although CMS_get0_SignerInfos() can return NULL if an error occurs B if there are no signers this is not a problem in practice because the only error which can occur is if the B structure is not of type signedData due to application error. @@ -79,7 +79,7 @@ L, L =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod b/deps/openssl/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod index 79f5f4232dd1..cb961be79758 100644 --- a/deps/openssl/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod +++ b/deps/openssl/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod @@ -48,7 +48,7 @@ CMS_verify(). CMS_ReceiptRequest_create0() returns a signed receipt request structure or NULL if an error occurred. -CMS_add1_ReceiptRequest() returns 1 for success or 0 is an error occurred. +CMS_add1_ReceiptRequest() returns 1 for success or 0 if an error occurred. CMS_get1_ReceiptRequest() returns 1 is a signed receipt request is found and decoded. It returns 0 if a signed receipt request is not present and -1 if @@ -62,7 +62,7 @@ L =head1 COPYRIGHT -Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/DH_meth_new.pod b/deps/openssl/openssl/doc/crypto/DH_meth_new.pod index d768da8c6eb7..ef0a80b19510 100644 --- a/deps/openssl/openssl/doc/crypto/DH_meth_new.pod +++ b/deps/openssl/openssl/doc/crypto/DH_meth_new.pod @@ -19,7 +19,7 @@ DH_meth_set_generate_params - Routines to build up DH methods DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); - int DH_meth_get_flags(DH_METHOD *dhm); + int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); @@ -146,7 +146,7 @@ The functions described here were added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/DSA_meth_new.pod b/deps/openssl/openssl/doc/crypto/DSA_meth_new.pod index 948ab29b58c8..8ebf7ab6bcc1 100644 --- a/deps/openssl/openssl/doc/crypto/DSA_meth_new.pod +++ b/deps/openssl/openssl/doc/crypto/DSA_meth_new.pod @@ -21,7 +21,7 @@ DSA_meth_set_keygen - Routines to build up DSA methods DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); - int DSA_meth_get_flags(DSA_METHOD *dsam); + int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -183,7 +183,7 @@ The functions described here were added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/DSA_sign.pod b/deps/openssl/openssl/doc/crypto/DSA_sign.pod index ba0f6b863ecf..b91f89f0733c 100644 --- a/deps/openssl/openssl/doc/crypto/DSA_sign.pod +++ b/deps/openssl/openssl/doc/crypto/DSA_sign.pod @@ -24,13 +24,12 @@ digest B using the private key B and places its ASN.1 DER encoding at B. The length of the signature is places in *B. B must point to DSA_size(B) bytes of memory. -DSA_sign_setup() may be used to precompute part of the signing -operation in case signature generation is time-critical. It expects -B to contain DSA parameters. It places the precomputed values -in newly allocated Bs at *B and *B, after freeing -the old ones unless *B and *B are NULL. These values may -be passed to DSA_sign() in Bkinv> and Br>. -B is a pre-allocated B or NULL. +DSA_sign_setup() is defined only for backward binary compatibility and +should not be used. +Since OpenSSL 1.1.0 the DSA type is opaque and the output of +DSA_sign_setup() cannot be used anyway: calling this function will only +cause overhead, and does not affect the actual signature +(pre-)computation. DSA_verify() verifies that the signature B of size B matches a given message digest B of size B. @@ -60,7 +59,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/ECDSA_SIG_new.pod b/deps/openssl/openssl/doc/crypto/ECDSA_SIG_new.pod index 9e1f662c621f..f544ccbb32fe 100644 --- a/deps/openssl/openssl/doc/crypto/ECDSA_SIG_new.pod +++ b/deps/openssl/openssl/doc/crypto/ECDSA_SIG_new.pod @@ -114,6 +114,8 @@ returned as a newly allocated B structure (or NULL on error). =head1 RETURN VALUES +ECDSA_SIG_new() returns NULL if the allocation fails. + ECDSA_SIG_set0() returns 1 on success or 0 on failure. ECDSA_size() returns the maximum length signature or 0 on error. @@ -197,7 +199,7 @@ L =head1 COPYRIGHT -Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/EVP_DigestInit.pod b/deps/openssl/openssl/doc/crypto/EVP_DigestInit.pod index bb7ef7a28fd6..1dc76cbdf86b 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_DigestInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_DigestInit.pod @@ -3,11 +3,12 @@ =head1 NAME EVP_MD_CTX_new, EVP_MD_CTX_reset, EVP_MD_CTX_free, EVP_MD_CTX_copy_ex, +EVP_MD_CTX_set_flags, EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags, EVP_DigestInit_ex, EVP_DigestUpdate, EVP_DigestFinal_ex, EVP_DigestInit, EVP_DigestFinal, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size, EVP_MD_CTX_md, EVP_MD_CTX_size, -EVP_MD_CTX_block_size, EVP_MD_CTX_type, EVP_md_null, EVP_md2, EVP_md5, EVP_sha1, -EVP_sha224, EVP_sha256, EVP_sha384, EVP_sha512, EVP_mdc2, +EVP_MD_CTX_block_size, EVP_MD_CTX_type, EVP_MD_CTX_md_data, EVP_md_null, EVP_md2, +EVP_md5, EVP_sha1, EVP_sha224, EVP_sha256, EVP_sha384, EVP_sha512, EVP_mdc2, EVP_ripemd160, EVP_blake2b512, EVP_blake2s256, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj - EVP digest routines @@ -18,6 +19,9 @@ EVP_get_digestbynid, EVP_get_digestbyobj - EVP digest routines EVP_MD_CTX *EVP_MD_CTX_new(void); int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); void EVP_MD_CTX_free(EVP_MD_CTX *ctx); + void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); + void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); + int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); @@ -41,6 +45,7 @@ EVP_get_digestbynid, EVP_get_digestbyobj - EVP digest routines int EVP_MD_CTX_size(const EVP_MD *ctx); int EVP_MD_CTX_block_size(const EVP_MD *ctx); int EVP_MD_CTX_type(const EVP_MD *ctx); + void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); const EVP_MD *EVP_md_null(void); const EVP_MD *EVP_md2(void); @@ -73,6 +78,9 @@ to reuse an already existing context. EVP_MD_CTX_free() cleans up digest context B and frees up the space allocated to it. +EVP_MD_CTX_set_flags(), EVP_MD_CTX_clear_flags() and EVP_MD_CTX_test_flags() +sets, clears and tests B flags. See L below for more information. + EVP_DigestInit_ex() sets up digest context B to use a digest B from ENGINE B. B must be initialized before calling this function. B will typically be supplied by a function such as EVP_sha1(). @@ -117,6 +125,11 @@ representing the given message digest when passed an B structure. For example EVP_MD_type(EVP_sha1()) returns B. This function is normally used when setting ASN1 OIDs. +EVP_MD_CTX_md_data() return the digest method private data for the passed +B. +The space is allocated by OpenSSL and has the size originally set with +EVP_MD_meth_set_app_datasize(). + EVP_MD_CTX_md() returns the B structure corresponding to the passed B. @@ -139,6 +152,38 @@ EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() return an B structure when passed a digest name, a digest NID or an ASN1_OBJECT structure respectively. +=head1 FLAGS + +EVP_MD_CTX_set_flags(), EVP_MD_CTX_clear_flags() and EVP_MD_CTX_test_flags() +can be used the manipulate and test these B flags: + +=over 4 + +=item EVP_MD_CTX_FLAG_ONESHOT + +This flag instructs the digest to optimize for one update only, if possible. + +=for comment EVP_MD_CTX_FLAG_CLEANED is internal, don't mention it + +=for comment EVP_MD_CTX_FLAG_REUSE is internal, don't mention it + +=for comment We currently avoid documenting flags that are only bit holder: +EVP_MD_CTX_FLAG_NON_FIPS_ALLOW, EVP_MD_CTX_FLAGS_PAD_* + +=item EVP_MD_CTX_FLAG_NO_INIT + +This flag instructs EVP_DigestInit() and similar not to initialise the +implementation specific data. + +=item EVP_MD_CTX_FLAG_FINALISE + +Some functions such as EVP_DigestSign only finalise copies of internal +contexts so additional data can be included after the finalisation call. +This is inefficient if this functionality is not required, and can be +disabled with this flag. + +=back + =head1 RETURN VALUES EVP_DigestInit_ex(), EVP_DigestUpdate() and EVP_DigestFinal_ex() return 1 for @@ -249,7 +294,7 @@ was removed in OpenSSL 1.1.0 =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/EVP_DigestSignInit.pod b/deps/openssl/openssl/doc/crypto/EVP_DigestSignInit.pod index 7ec06b7a272e..5fadc82e6aac 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_DigestSignInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_DigestSignInit.pod @@ -21,7 +21,48 @@ EVP_DigestSignInit() sets up signing context B to use digest B from ENGINE B and private key B. B must be created with EVP_MD_CTX_new() before calling this function. If B is not NULL the EVP_PKEY_CTX of the signing operation will be written to B<*pctx>: this can -be used to set alternative signing options. +be used to set alternative signing options. The digest B may be NULL if +the signing algorithm supports it. + +Only EVP_PKEY types that support signing can be used with these functions. This +includes MAC algorithms where the MAC generation is considered as a form of +"signing." Built-in EVP_PKEY types supported by these functions are CMAC, DSA, +ECDSA, HMAC and RSA. + +Not all digests can be used for all key types. The following combinations apply. + +=over 4 + +=item DSA + +Supports SHA1, SHA224, SHA256, SHA384 and SHA512 + +=item ECDSA + +Supports SHA1, SHA224, SHA256, SHA384 and SHA512 + +=item RSA with no padding + +Supports no digests (the digest B must be NULL) + +=item RSA with X931 padding + +Supports SHA1, SHA256, SHA384 and SHA512 + +=item All other RSA padding types + +Support SHA1, SHA224, SHA256, SHA384, SHA512, MD5, MD5_SHA1, MD2, MD4, MDC2, +RIPEMD160 + +=item HMAC + +Supports any digest + +=item CMAC + +Will ignore any digest provided. + +=back EVP_DigestSignUpdate() hashes B bytes of data at B into the signature context B. This function can be called several times on the @@ -86,7 +127,7 @@ were first added to OpenSSL 1.0.0. =head1 COPYRIGHT -Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_hkdf_md.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_hkdf_md.pod index 61e0eec52882..459e7a02ffcc 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_hkdf_md.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_hkdf_md.pod @@ -59,7 +59,7 @@ All these functions are implemented as macros. A context for HKDF can be obtained by calling: - EVP_PKEY_CTX *pctx = EVP_PKEY_new_id(EVP_PKEY_HKDF, NULL); + EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); The digest, key, salt and info values must be set before a key is derived or an error occurs. @@ -118,7 +118,7 @@ L =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_tls1_prf_md.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_tls1_prf_md.pod index f1f0ae4fbe4d..fe35a5ece8cf 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_tls1_prf_md.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_CTX_set_tls1_prf_md.pod @@ -50,7 +50,7 @@ All these functions are implemented as macros. A context for the TLS PRF can be obtained by calling: - EVP_PKEY_CTX *pctx = EVP_PKEY_new_id(EVP_PKEY_TLS1_PRF, NULL); + EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); The digest, secret value and seed must be set before a key is derived or an error occurs. @@ -98,7 +98,7 @@ L =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_asn1_get_count.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_asn1_get_count.pod index a190f5e9ab0c..9ad2daed4f5b 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_asn1_get_count.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_asn1_get_count.pod @@ -48,7 +48,7 @@ engine that implements it. EVP_PKEY_asn1_get0_info() returns the public key ID, base public key ID (both NIDs), any flags, the method description and PEM type string -associated with the public key ASN.1 method B<*ameth>. +associated with the public key ASN.1 method B<*ameth>. EVP_PKEY_asn1_count(), EVP_PKEY_asn1_get0(), EVP_PKEY_asn1_find() and EVP_PKEY_asn1_find_str() are not thread safe, but as long as all diff --git a/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod b/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod index 3ada6679cf92..c84adb2e4634 100644 --- a/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod +++ b/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod @@ -54,7 +54,7 @@ constants. OBJ_nid2obj(), OBJ_nid2ln() and OBJ_nid2sn() convert the NID B to an ASN1_OBJECT structure, its long name and its short name respectively, -or B is an error occurred. +or B if an error occurred. OBJ_obj2nid(), OBJ_ln2nid(), OBJ_sn2nid() return the corresponding NID for the object B, the long name or the short name respectively @@ -188,7 +188,7 @@ OBJ_cleanup() was deprecated in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/OCSP_resp_find_status.pod b/deps/openssl/openssl/doc/crypto/OCSP_resp_find_status.pod index 5123f0ad6da4..e014df500b6f 100644 --- a/deps/openssl/openssl/doc/crypto/OCSP_resp_find_status.pod +++ b/deps/openssl/openssl/doc/crypto/OCSP_resp_find_status.pod @@ -7,7 +7,8 @@ OCSP_resp_get0_signer, OCSP_resp_get0_id, OCSP_resp_get0_produced_at, OCSP_resp_find_status, OCSP_resp_count, OCSP_resp_get0, OCSP_resp_find, -OCSP_single_get0_status, OCSP_check_validity +OCSP_single_get0_status, OCSP_check_validity, +OCSP_basic_verify - OCSP response utility functions =head1 SYNOPSIS @@ -44,6 +45,9 @@ OCSP_single_get0_status, OCSP_check_validity ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); + int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, + X509_STORE *st, unsigned long flags); + =head1 DESCRIPTION OCSP_resp_find_status() searches B for an OCSP response for B. If it is @@ -93,6 +97,27 @@ OCSP_single_get0_status(). If B is non-zero it indicates how many seconds leeway should be allowed in the check. If B is positive it indicates the maximum age of B in seconds. +OCSP_basic_verify() checks that the basic response message B is correctly +signed and that the signer certificate can be validated. It takes B as +the trusted store and B as a set of untrusted intermediate certificates. +The function first tries to find the signer certificate of the response +in . It also searches the certificates the responder may have included +in B unless the B contain B. +It fails if the signer certificate cannot be found. +Next, the function checks the signature of B and fails on error +unless the B contain B. Then the function already returns +success if the B contain B or if the signer certificate +was found in B and the B contain B. +Otherwise the function continues by validating the signer certificate. +To this end, all certificates in B and in B are considered as +untrusted certificates for the construction of the validation path for the +signer certificate unless the B flag is set. After successful path +validation the function returns success if the B flag is set. +Otherwise it verifies that the signer certificate meets the OCSP issuer +criteria including potential delegation. If this does not succeed and the +B do not contain B the function checks for explicit +trust for OCSP signing in the root CA certificate. + =head1 RETURN VALUES OCSP_resp_find_status() returns 1 if B is found in B and 0 otherwise. @@ -112,6 +137,9 @@ occurred. OCSP_resp_get0_signer() returns 1 if the signing certificate was located, or 0 on error. +OCSP_basic_verify() returns 1 on success, 0 on error, or -1 on fatal error such +as malloc failure. + =head1 NOTES Applications will typically call OCSP_resp_find_status() using the certificate @@ -142,7 +170,7 @@ L =head1 COPYRIGHT -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod b/deps/openssl/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod index f50faec772d5..f5429d217e52 100644 --- a/deps/openssl/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod +++ b/deps/openssl/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod @@ -47,11 +47,6 @@ number was therefore 0x0090581f. OpenSSL_version_num() returns the version number. -The macro OPENSSL_VERSION_AT_LEAST(major,minor) can be used at compile -time test if the current version is at least as new as the version provided. -The arguments major, minor and fix correspond to the version information -as given above. - OpenSSL_version() returns different strings depending on B: =over 4 diff --git a/deps/openssl/openssl/doc/crypto/OPENSSL_init_crypto.pod b/deps/openssl/openssl/doc/crypto/OPENSSL_init_crypto.pod index f0b3c8aa8da5..f9664ee35298 100644 --- a/deps/openssl/openssl/doc/crypto/OPENSSL_init_crypto.pod +++ b/deps/openssl/openssl/doc/crypto/OPENSSL_init_crypto.pod @@ -190,10 +190,10 @@ resources should be freed at an earlier time, or under the circumstances described in the NOTES section below. The B flag will load a default configuration -file. To specify a different file, an B must -be created and used. The routines -OPENSSL_init_new() and OPENSSL_INIT_set_config_appname() can be used to -allocate the object and set the application name, and then the +file. For optional configuration file settings, an B +must be created and used. +The routines OPENSSL_init_new() and OPENSSL_INIT_set_config_appname() can +be used to allocate the object and set the application name, and then the object can be released with OPENSSL_INIT_free() when done. =head1 NOTES @@ -235,7 +235,7 @@ and OPENSSL_INIT_free() functions were added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/OPENSSL_malloc.pod b/deps/openssl/openssl/doc/crypto/OPENSSL_malloc.pod index 2104f43108f1..ba5dc1069f39 100644 --- a/deps/openssl/openssl/doc/crypto/OPENSSL_malloc.pod +++ b/deps/openssl/openssl/doc/crypto/OPENSSL_malloc.pod @@ -68,8 +68,8 @@ CRYPTO_mem_leaks, CRYPTO_mem_leaks_fp - Memory allocation functions int CRYPTO_mem_debug_push(const char *info, const char *file, int line); int CRYPTO_mem_debug_pop(void); - void CRYPTO_mem_leaks(BIO *b); - void CRYPTO_mem_leaks_fp(FILE *fp); + int CRYPTO_mem_leaks(BIO *b); + int CRYPTO_mem_leaks_fp(FILE *fp); =head1 DESCRIPTION @@ -197,7 +197,7 @@ only, say, the malloc() implementation is outright dangerous.> =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/PEM_read_bio_PrivateKey.pod b/deps/openssl/openssl/doc/crypto/PEM_read_bio_PrivateKey.pod index 6b3006ef3523..b0ba62a3b367 100644 --- a/deps/openssl/openssl/doc/crypto/PEM_read_bio_PrivateKey.pod +++ b/deps/openssl/openssl/doc/crypto/PEM_read_bio_PrivateKey.pod @@ -294,7 +294,7 @@ for it twice) if B is 1. The B parameter has the same value as the B parameter passed to the PEM routine. It allows arbitrary data to be passed to the callback by the application (for example a window handle in a GUI application). The callback -B return the number of characters in the passphrase or 0 if +B return the number of characters in the passphrase or -1 if an error occurred. =head1 EXAMPLES @@ -348,17 +348,16 @@ Skeleton pass phrase callback: int pass_cb(char *buf, int size, int rwflag, void *u) { - int len; - char *tmp; /* We'd probably do something else if 'rwflag' is 1 */ printf("Enter pass phrase for \"%s\"\n", (char *)u); /* get pass phrase, length 'len' into 'tmp' */ - tmp = "hello"; - len = strlen(tmp); - if (len <= 0) - return 0; + char *tmp = "hello"; + if (tmp == NULL) /* An error occurred */ + return -1; + + size_t len = strlen(tmp); if (len > size) len = size; @@ -471,7 +470,7 @@ L, L =head1 COPYRIGHT -Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/RSA_meth_new.pod b/deps/openssl/openssl/doc/crypto/RSA_meth_new.pod index 9970aa6b73ef..9c89426a9a28 100644 --- a/deps/openssl/openssl/doc/crypto/RSA_meth_new.pod +++ b/deps/openssl/openssl/doc/crypto/RSA_meth_new.pod @@ -24,7 +24,7 @@ RSA_meth_set_verify, RSA_meth_get_keygen, RSA_meth_set_keygen RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); - int RSA_meth_get_flags(RSA_METHOD *meth); + int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -225,7 +225,7 @@ The functions described here were added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/SMIME_read_PKCS7.pod b/deps/openssl/openssl/doc/crypto/SMIME_read_PKCS7.pod index 3eb8bbc9a0f8..c11090891ad3 100644 --- a/deps/openssl/openssl/doc/crypto/SMIME_read_PKCS7.pod +++ b/deps/openssl/openssl/doc/crypto/SMIME_read_PKCS7.pod @@ -57,7 +57,7 @@ streaming single pass option should be available. =head1 RETURN VALUES SMIME_read_PKCS7() returns a valid B structure or B -is an error occurred. The error can be obtained from ERR_get_error(3). +if an error occurred. The error can be obtained from ERR_get_error(3). =head1 SEE ALSO @@ -68,7 +68,7 @@ L =head1 COPYRIGHT -Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/UI_STRING.pod b/deps/openssl/openssl/doc/crypto/UI_STRING.pod index 8a0d9f2d250c..340d9b2ae2c5 100644 --- a/deps/openssl/openssl/doc/crypto/UI_STRING.pod +++ b/deps/openssl/openssl/doc/crypto/UI_STRING.pod @@ -132,3 +132,4 @@ in the file LICENSE in the source distribution or at L. =cut + diff --git a/deps/openssl/openssl/doc/crypto/X509_LOOKUP_hash_dir.pod b/deps/openssl/openssl/doc/crypto/X509_LOOKUP_hash_dir.pod index 5f8dfa93b0f1..4f2768d4f4a5 100644 --- a/deps/openssl/openssl/doc/crypto/X509_LOOKUP_hash_dir.pod +++ b/deps/openssl/openssl/doc/crypto/X509_LOOKUP_hash_dir.pod @@ -117,10 +117,11 @@ L, L, L, L, +L, =head1 COPYRIGHT -Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/X509_LOOKUP_meth_new.pod b/deps/openssl/openssl/doc/crypto/X509_LOOKUP_meth_new.pod new file mode 100644 index 000000000000..fb165fd6ad9d --- /dev/null +++ b/deps/openssl/openssl/doc/crypto/X509_LOOKUP_meth_new.pod @@ -0,0 +1,189 @@ +=pod + +=head1 NAME + +X509_LOOKUP_meth_new, X509_LOOKUP_meth_free, X509_LOOKUP_meth_set_new_item, +X509_LOOKUP_meth_get_new_item, X509_LOOKUP_meth_set_free, +X509_LOOKUP_meth_get_free, X509_LOOKUP_meth_set_init, +X509_LOOKUP_meth_get_init, X509_LOOKUP_meth_set_shutdown, +X509_LOOKUP_meth_get_shutdown, +X509_LOOKUP_ctrl_fn, X509_LOOKUP_meth_set_ctrl, X509_LOOKUP_meth_get_ctrl, +X509_LOOKUP_get_by_subject_fn, X509_LOOKUP_meth_set_get_by_subject, +X509_LOOKUP_meth_get_get_by_subject, +X509_LOOKUP_get_by_issuer_serial_fn, X509_LOOKUP_meth_set_get_by_issuer_serial, +X509_LOOKUP_meth_get_get_by_issuer_serial, +X509_LOOKUP_get_by_fingerprint_fn, X509_LOOKUP_meth_set_get_by_fingerprint, +X509_LOOKUP_meth_get_get_by_fingerprint, +X509_LOOKUP_get_by_alias_fn, X509_LOOKUP_meth_set_get_by_alias, +X509_LOOKUP_meth_get_get_by_alias, +X509_LOOKUP_set_method_data, X509_LOOKUP_get_method_data, +X509_LOOKUP_get_store, X509_OBJECT_set1_X509, X509_OBJECT_set1_X509_CRL +- Routines to build up X509_LOOKUP methods + +=head1 SYNOPSIS + + #include + + X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); + void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + + int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); + int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + + int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free) (X509_LOOKUP *ctx)); + void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + + int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); + int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + + int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); + int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + + typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); + int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); + X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + + typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); + int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); + X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + + typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); + int X509_LOOKUP_meth_set_get_by_issuer_serial( + X509_LOOKUP_METHOD *method, X509_LOOKUP_get_by_issuer_serial_fn fn); + X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + + typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); + int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); + X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + + typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); + X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); + void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); + + X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); + + int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); + int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); + +=head1 DESCRIPTION + +The B type is a structure used for the implementation of new +X509_LOOKUP types. It provides a set of functions used by OpenSSL for the +implementation of various X509 and X509_CRL lookup capabilities. One instance +of an X509_LOOKUP_METHOD can be associated to many instantiations of an +B structure. + +X509_LOOKUP_meth_new() creates a new B structure. It should +be given a human-readable string containing a brief description of the lookup +method. + +X509_LOOKUP_meth_free() destroys a B structure. + +X509_LOOKUP_get_new_item() and X509_LOOKUP_set_new_item() get and set the +function that is called when an B object is created with +X509_LOOKUP_new(). If an X509_LOOKUP_METHOD requires any per-X509_LOOKUP +specific data, the supplied new_item function should allocate this data and +invoke X509_LOOKUP_set_method_data(). + +X509_LOOKUP_get_free() and X509_LOOKUP_set_free() get and set the function +that is used to free any method data that was allocated and set from within +new_item function. + +X509_LOOKUP_meth_get_init() and X509_LOOKUP_meth_set_init() get and set the +function that is used to initialize the method data that was set with +X509_LOOKUP_set_method_data() as part of the new_item routine. + +X509_LOOKUP_meth_get_shutdown() and X509_LOOKUP_meth_set_shutdown() get and set +the function that is used to shut down the method data whose state was +previously initialized in the init function. + +X509_LOOKUP_meth_get_ctrl() and X509_LOOKUP_meth_set_ctrl() get and set a +function to be used to handle arbitrary control commands issued by +X509_LOOKUP_ctrl(). The control function is given the X509_LOOKUP +B, along with the arguments passed by X509_LOOKUP_ctrl. B is +an arbitrary integer that defines some operation. B is a pointer +to an array of characters. B is an integer. B, if set, +points to a location where any return data should be written to. How +B and B are used depends entirely on the control function. + + +X509_LOOKUP_set_get_by_subject(), X509_LOOKUP_set_get_by_issuer_serial(), +X509_LOOKUP_set_get_by_fingerprint(), X509_LOOKUP_set_get_by_alias() set +the functions used to retrieve an X509 or X509_CRL object by the object's +subject, issuer, fingerprint, and alias respectively. These functions are given +the X509_LOOKUP context, the type of the X509_OBJECT being requested, parameters +related to the lookup, and an X509_OBJECT that will receive the requested +object. + +Implementations should use either X509_OBJECT_set1_X509() or +X509_OBJECT_set1_X509_CRL() to set the result. Any method data that was +created as a result of the new_item function set by +X509_LOOKUP_meth_set_new_item() can be accessed with +X509_LOOKUP_get_method_data(). The B object that owns the +X509_LOOKUP may be accessed with X509_LOOKUP_get_store(). Successful lookups +should return 1, and unsuccessful lookups should return 0. + +X509_LOOKUP_get_get_by_subject(), X509_LOOKUP_get_get_by_issuer_serial(), +X509_LOOKUP_get_get_by_fingerprint(), X509_LOOKUP_get_get_by_alias() retrieve +the function set by the corresponding setter. + +=head1 RETURN VALUES + +The B functions return 1 on success or 0 on error. + +The B functions return the corresponding function +pointers. + +=head1 SEE ALSO + +L, L + +=head1 HISTORY + +The functions described here were added in OpenSSL 1.1.0i. + +=head1 COPYRIGHT + +Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/deps/openssl/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod b/deps/openssl/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod index 5263facfd48d..320b258a85cd 100644 --- a/deps/openssl/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod +++ b/deps/openssl/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod @@ -11,7 +11,9 @@ X509_VERIFY_PARAM_get_auth_level, X509_VERIFY_PARAM_set_time, X509_VERIFY_PARAM_get_time, X509_VERIFY_PARAM_add0_policy, X509_VERIFY_PARAM_set1_policies, X509_VERIFY_PARAM_set1_host, X509_VERIFY_PARAM_add1_host, -X509_VERIFY_PARAM_set_hostflags, X509_VERIFY_PARAM_get0_peername, +X509_VERIFY_PARAM_set_hostflags, +X509_VERIFY_PARAM_get_hostflags, +X509_VERIFY_PARAM_get0_peername, X509_VERIFY_PARAM_set1_email, X509_VERIFY_PARAM_set1_ip, X509_VERIFY_PARAM_set1_ip_asc - X509 verification parameters @@ -54,6 +56,7 @@ X509_VERIFY_PARAM_set1_ip_asc const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); + unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, const char *email, size_t emaillen); @@ -130,14 +133,32 @@ B clearing any previously specified host name or names. If B is NULL, or empty the list of hostnames is cleared, and name checks are not performed on the peer certificate. If B is NUL-terminated, B may be zero, otherwise B -must be set to the length of B. When a hostname is specified, +must be set to the length of B. + +When a hostname is specified, certificate verification automatically invokes L with flags equal to the B argument given to X509_VERIFY_PARAM_set_hostflags() (default zero). Applications are strongly advised to use this interface in preference to explicitly -calling L, hostname checks are out of scope +calling L, hostname checks may be out of scope with the DANE-EE(3) certificate usage, and the internal check will -be suppressed as appropriate when DANE support is added to OpenSSL. +be suppressed as appropriate when DANE verification is enabled. + +When the subject CommonName will not be ignored, whether as a result of the +B host flag, or because no DNS subject +alternative names are present in the certificate, any DNS name constraints in +issuer certificates apply to the subject CommonName as well as the subject +alternative name extension. + +When the subject CommonName will be ignored, whether as a result of the +B host flag, or because some DNS subject +alternative names are present in the certificate, DNS name constraints in +issuer certificates will not be applied to the subject DN. +As described in X509_check_host(3) the B +flag takes precendence over the B flag. + +X509_VERIFY_PARAM_get_hostflags() returns any host flags previously set via a +call to X509_VERIFY_PARAM_set_hostflags(). X509_VERIFY_PARAM_add1_host() adds B as an additional reference identifier that can match the peer's certificate. Any previous names @@ -186,6 +207,8 @@ failure. X509_VERIFY_PARAM_get_flags() returns the current verification flags. +X509_VERIFY_PARAM_get_hostflags() returns any current host flags. + X509_VERIFY_PARAM_get_inh_flags() returns the current inheritance flags. X509_VERIFY_PARAM_set_time() and X509_VERIFY_PARAM_set_depth() do not return @@ -347,6 +370,8 @@ The B flag was added in OpenSSL 1.1.0 The legacy B flag is deprecated as of OpenSSL 1.1.0, and has no effect. +X509_VERIFY_PARAM_get_hostflags() was added in OpenSSL 1.1.0i. + =head1 COPYRIGHT Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved. diff --git a/deps/openssl/openssl/doc/crypto/X509_check_host.pod b/deps/openssl/openssl/doc/crypto/X509_check_host.pod index 93848152b5ec..fb9f6a64ecd5 100644 --- a/deps/openssl/openssl/doc/crypto/X509_check_host.pod +++ b/deps/openssl/openssl/doc/crypto/X509_check_host.pod @@ -93,6 +93,9 @@ consider the subject DN even if the certificate contains no subject alternative names of the right type (DNS name or email address as appropriate); the default is to use the subject DN when no corresponding subject alternative names are present. +If both B and +B are specified, the latter takes +precedence and the subject DN is not checked for matching names. If set, B disables wildcard expansion; this only applies to B. @@ -128,9 +131,9 @@ NULs. Applications are encouraged to use X509_VERIFY_PARAM_set1_host() rather than explicitly calling L. Host name -checks are out of scope with the DANE-EE(3) certificate usage, +checks may be out of scope with the DANE-EE(3) certificate usage, and the internal checks will be suppressed as appropriate when -DANE support is added to OpenSSL. +DANE support is enabled. =head1 SEE ALSO @@ -147,7 +150,7 @@ These functions were added in OpenSSL 1.0.2. =head1 COPYRIGHT -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/crypto/X509_cmp_time.pod b/deps/openssl/openssl/doc/crypto/X509_cmp_time.pod new file mode 100644 index 000000000000..5bf51114511a --- /dev/null +++ b/deps/openssl/openssl/doc/crypto/X509_cmp_time.pod @@ -0,0 +1,39 @@ +=pod + +=head1 NAME + +X509_cmp_time - X509 time functions + +=head1 SYNOPSIS + + X509_cmp_time(const ASN1_TIME *asn1_time, time_t *cmp_time); + +=head1 DESCRIPTION + +X509_cmp_time() compares the ASN1_TIME in B with the time in +. + +B must satisfy the ASN1_TIME format mandated by RFC 5280, i.e., +its format must be either YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ. + +If B is NULL the current time is used. + +=head1 BUGS + +Unlike many standard comparison functions, X509_cmp_time returns 0 on error. + +=head1 RETURN VALUES + +X509_cmp_time() returns -1 if B is earlier than, or equal to, +B, and 1 otherwise. It returns 0 on error. + +=head1 COPYRIGHT + +Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. + +=cut diff --git a/deps/openssl/openssl/doc/crypto/bio.pod b/deps/openssl/openssl/doc/crypto/bio.pod index 7be3121fd1d1..1e1dd02106db 100644 --- a/deps/openssl/openssl/doc/crypto/bio.pod +++ b/deps/openssl/openssl/doc/crypto/bio.pod @@ -87,3 +87,4 @@ in the file LICENSE in the source distribution or at L. =cut + diff --git a/deps/openssl/openssl/doc/fingerprints.txt b/deps/openssl/openssl/doc/fingerprints.txt index 1863224df37a..2cb74aec2778 100644 --- a/deps/openssl/openssl/doc/fingerprints.txt +++ b/deps/openssl/openssl/doc/fingerprints.txt @@ -18,10 +18,7 @@ uid Richard Levitte uid Richard Levitte uid Richard Levitte -pub 4096R/FA40E9E2 2005-03-19 - Key fingerprint = 6260 5AA4 334A F9F0 DDE5 D349 D357 7507 FA40 E9E2 -uid Dr Stephen N Henson - pub 2048R/0E604491 2013-04-30 Key fingerprint = 8657 ABB2 60F0 56B1 E519 0839 D9C4 D26D 0E60 4491 +uid Matt Caswell uid Matt Caswell diff --git a/deps/openssl/openssl/doc/openssl-c-indent.el b/deps/openssl/openssl/doc/openssl-c-indent.el index cca118303e30..852f794f9656 100644 --- a/deps/openssl/openssl/doc/openssl-c-indent.el +++ b/deps/openssl/openssl/doc/openssl-c-indent.el @@ -54,6 +54,7 @@ (arglist-close . c-lineup-arglist) ; From "gnu" style (inline-open . 0) ; From "gnu" style (brace-list-open . +) ; From "gnu" style + (inextern-lang . 0) ; Don't indent inside extern block (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont) ; From "gnu" style ) diff --git a/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod b/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod index a28e21833285..12fdcab83c4a 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod @@ -506,10 +506,6 @@ Set supported curves to P-256, P-384: SSL_CONF_cmd(ctx, "Curves", "P-256:P-384"); -Set automatic support for any elliptic curve for key exchange: - - SSL_CONF_cmd(ctx, "ECDHParameters", "Automatic"); - =head1 RETURN VALUES SSL_CONF_cmd() returns 1 if the value of B is recognised and B is diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_ctlog_list_file.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_ctlog_list_file.pod index 1dead1dbfcca..4a2fa946fe82 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_ctlog_list_file.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_ctlog_list_file.pod @@ -24,7 +24,7 @@ See L for the file format. =head1 NOTES These functions will not clear the existing CT log list - it will be appended -to. To replace the existing list, use L first. +to. To replace the existing list, use L first. If an error occurs whilst parsing a particular log entry in the file, that log entry will be skipped. diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_use_certificate.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_use_certificate.pod index c645f58078e8..8ed7b5ea15c8 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_use_certificate.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_use_certificate.pod @@ -153,6 +153,13 @@ L. of view, it however does not make sense as the data in the certificate is considered public anyway.) +All of the functions to set a new certificate will replace any existing +certificate of the same type that has already been set. Similarly all of the +functions to set a new private key will replace any private key that has already +been set. Applications should call L or +L as appropriate after loading a new certificate and +private key to confirm that the certificate and key match. + =head1 RETURN VALUES On success, the functions return 1. @@ -170,7 +177,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/ssl/SSL_get_ciphers.pod b/deps/openssl/openssl/doc/ssl/SSL_get_ciphers.pod index cc55095d4784..2759cc3cc617 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_get_ciphers.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_get_ciphers.pod @@ -2,8 +2,12 @@ =head1 NAME -SSL_get1_supported_ciphers, SSL_get_client_ciphers, -SSL_get_ciphers, SSL_CTX_get_ciphers, SSL_get_cipher_list +SSL_get1_supported_ciphers, +SSL_get_client_ciphers, +SSL_get_ciphers, +SSL_CTX_get_ciphers, +SSL_get_cipher_list, +SSL_get_shared_ciphers - get list of available SSL_CIPHERs =head1 SYNOPSIS @@ -15,6 +19,7 @@ SSL_get_ciphers, SSL_CTX_get_ciphers, SSL_get_cipher_list STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s); STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const SSL *ssl); const char *SSL_get_cipher_list(const SSL *ssl, int priority); + char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); =head1 DESCRIPTION @@ -25,16 +30,16 @@ is returned. SSL_CTX_get_ciphers() returns the stack of available SSL_CIPHERs for B. SSL_get1_supported_ciphers() returns the stack of enabled SSL_CIPHERs for -B, sorted by preference. +B as would be sent in a ClientHello (that is, sorted by preference). The list depends on settings like the cipher list, the supported protocol versions, the security level, and the enabled signature algorithms. SRP and PSK ciphers are only enabled if the appropriate callbacks or settings have been applied. -This is the list that will be sent by the client to the server. -The list supported by the server might include more ciphers in case there is a -hole in the list of supported protocols. -The server will also not use ciphers from this list depending on the -configured certificates and DH parameters. +The list of ciphers that would be sent in a ClientHello can differ from +the list of ciphers that would be acceptable when acting as a server. +For example, additional ciphers may be usable by a server if there is +a gap in the list of supported protocols, and some ciphers may not be +usable by a server if there is not a suitable certificate configured. If B is NULL or no ciphers are available, NULL is returned. SSL_get_client_ciphers() returns the stack of available SSL_CIPHERs matching the @@ -46,6 +51,19 @@ listed for B with B. If B is NULL, no ciphers are available, or there are less ciphers than B available, NULL is returned. +SSL_get_shared_ciphers() creates a colon separated and NUL terminated list of +SSL_CIPHER names that are available in both the client and the server. B is +the buffer that should be populated with the list of names and B is the +size of that buffer. A pointer to B is returned on success or NULL on +error. If the supplied buffer is not large enough to contain the complete list +of names then a truncated list of names will be returned. Note that just because +a ciphersuite is available (i.e. it is configured in the cipher list) and shared +by both the client and the server it does not mean that it is enabled (see the +description of SSL_get1_supported_ciphers() above). This function will return +available shared ciphersuites whether or not they are enabled. This is a server +side function only and must only be called after the completion of the initial +handshake. + =head1 NOTES The details of the ciphers obtained by SSL_get_ciphers(), SSL_CTX_get_ciphers() @@ -74,7 +92,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/ssl/SSL_get_session.pod b/deps/openssl/openssl/doc/ssl/SSL_get_session.pod index 99936ad76542..2de241fcdae2 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_get_session.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_get_session.pod @@ -28,6 +28,11 @@ count of the B is incremented by one. The ssl session contains all information required to re-establish the connection without a new handshake. +A session will be automatically removed from the session cache and marked as +non-resumable if the connection is not closed down cleanly, e.g. if a fatal +error occurs on the connection or L is not called prior to +L. + SSL_get0_session() returns a pointer to the actual session. As the reference counter is not incremented, the pointer is only valid while the connection is in use. If L or @@ -72,7 +77,7 @@ L =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/ssl/SSL_get_version.pod b/deps/openssl/openssl/doc/ssl/SSL_get_version.pod index 23b6497d4f3b..507ca9f3627d 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_get_version.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_get_version.pod @@ -15,7 +15,9 @@ SSL_get_version, SSL_is_dtls - get the protocol information of a connection =head1 DESCRIPTION SSL_get_version() returns the name of the protocol used for the -connection B. +connection B. It should only be called after the initial handshake has been +completed. Prior to that the results returned from this function may be +unreliable. SSL_is_dtls() returns one if the connection is using DTLS, zero if not. @@ -43,7 +45,7 @@ The connection uses the TLSv1.2 protocol. =item unknown -This indicates that no version has been set (no connection established). +This indicates an unknown protocol version. =back @@ -57,7 +59,7 @@ SSL_is_dtls() was added in OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/ssl/SSL_set1_host.pod b/deps/openssl/openssl/doc/ssl/SSL_set1_host.pod index 3339a0e803b5..715845e1f7c6 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_set1_host.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_set1_host.pod @@ -56,7 +56,7 @@ is cleared or freed, or a renegotiation takes place. Applications must not free the return value. SSL clients are advised to use these functions in preference to -explicitly calling L. Hostname checks are out +explicitly calling L. Hostname checks may be out of scope with the RFC7671 DANE-EE(3) certificate usage, and the internal check will be suppressed as appropriate when DANE is enabled. @@ -111,7 +111,7 @@ These functions were first added to OpenSSL 1.1.0. =head1 COPYRIGHT -Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/doc/ssl/ssl.pod b/deps/openssl/openssl/doc/ssl/ssl.pod index 4d919072ea38..da12e29c6351 100644 --- a/deps/openssl/openssl/doc/ssl/ssl.pod +++ b/deps/openssl/openssl/doc/ssl/ssl.pod @@ -91,12 +91,6 @@ includes both more private SSL headers and headers from the B library. Whenever you need hard-core details on the internals of the SSL API, look inside this header file. -OPENSSL_VERSION_AT_LEAST(major,minor) can be -used in C<#if> statements in order to determine which version of the library is -being used. This can be used to either enable optional features at compile -time, or work around issues with a previous version. -See L. - =item B Unused. Present for backwards compatibility only. @@ -574,7 +568,7 @@ fresh handle for each connection. =item SSL_SESSION *B(const SSL *ssl); -=item char *B(const SSL *ssl, char *buf, int len); +=item char *B(const SSL *ssl, char *buf, int size); =item int B(const SSL *ssl); diff --git a/deps/openssl/openssl/engines/asm/e_padlock-x86.pl b/deps/openssl/openssl/engines/asm/e_padlock-x86.pl index fec99bfb65cf..bf6b312cd1b8 100644 --- a/deps/openssl/openssl/engines/asm/e_padlock-x86.pl +++ b/deps/openssl/openssl/engines/asm/e_padlock-x86.pl @@ -448,7 +448,7 @@ sub generate_mode { &mov ("esi",&wparam(1)); &mov ("ecx",&wparam(2)); if ($::win32 or $::coff) { - &push (&::islabel("_win32_segv_handler")); + &push (&::islabel("_win32_segv_handler")); &data_byte(0x64,0xff,0x30); # push %fs:(%eax) &data_byte(0x64,0x89,0x20); # mov %esp,%fs:(%eax) } @@ -499,7 +499,7 @@ sub generate_mode { &mov ("edi",&wparam(0)); &movups (&QWP(0,"edi"),"xmm0"); # copy-out context &mov (&DWP(16,"edi"),"eax"); - &pop ("esi"); + &pop ("esi"); &pop ("edi"); &ret (); &function_end_B("padlock_sha1_blocks"); @@ -512,7 +512,7 @@ sub generate_mode { &mov ("esi",&wparam(1)); &mov ("ecx",&wparam(2)); if ($::win32 or $::coff) { - &push (&::islabel("_win32_segv_handler")); + &push (&::islabel("_win32_segv_handler")); &data_byte(0x64,0xff,0x30); # push %fs:(%eax) &data_byte(0x64,0x89,0x20); # mov %esp,%fs:(%eax) } diff --git a/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl b/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl index 834b1ea79cd0..da285abc61dd 100644 --- a/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl +++ b/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl @@ -535,7 +535,7 @@ sub generate_mode { sub $len,%rsp shr \$3,$len lea (%rsp),$out - .byte 0xf3,0x48,0xa5 # rep movsq + .byte 0xf3,0x48,0xa5 # rep movsq lea (%r8),$out lea (%rsp),$inp mov $chunk,$len diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/INSTALL b/deps/openssl/openssl/external/perl/Text-Template-1.46/INSTALL index 466f8e5040fe..7c5e4c6bde97 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/INSTALL +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/INSTALL @@ -21,7 +21,7 @@ Detailed documentation is at the bottom of the lib/Text/Template.pm file. You may be able to view it with the following command: perldoc Text::Template - + Or: perldoc lib/Text/Template.pm diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/README b/deps/openssl/openssl/external/perl/Text-Template-1.46/README index bdd3dd4a42d7..e184d8cd2f7b 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/README +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/README @@ -5,7 +5,7 @@ This is a library for generating form letters, building HTML pages, or filling in templates generally. A `template' is a piece of text that has little Perl programs embedded in it here and there. When you `fill in' a template, you evaluate the little programs and replace -them with their values. +them with their values. Here's an example of a template: @@ -45,7 +45,7 @@ encourages functional separation. You can fill in the template in a `Safe' compartment. This means that if you don't trust the person who wrote the code in the template, you won't have to worry that they are tampering with your program when you -execute it. +execute it. ---------------------------------------------------------------- @@ -87,7 +87,7 @@ What's new in v1.46 since v1.44: parameter to ->new is omitted. ---------------------------------------------------------------- -What's new in v1.44 since v1.43: +What's new in v1.44 since v1.43: This is a maintentance release. There are no feature changes. @@ -182,7 +182,7 @@ What's new in v1.40 since v1.31: ---------------------------------------------------------------- What's new in v1.31 since v1.23: - Just bug fixes---fill_in_string was failing. Thanks to + Just bug fixes---fill_in_string was failing. Thanks to Donald L. Greer Jr. for the test case. ---------------------------------------------------------------- @@ -252,7 +252,7 @@ What's new in v1.10 since v1.03: New OUTPUT option delivers template results directly to a filehandle instead of making them into a string. Saves space - and time. + and time. PACKAGE and HASH now work intelligently with SAFE. @@ -263,16 +263,16 @@ What's new in v1.10 since v1.03: { my $blist = ''; foreach $i (@items) { $blist .= qq{ * $i\n}; - } + } $blist; - } + } You can now write this instead, because $OUT is special. { foreach $i (@items) { $OUT.= " * $i\n"; - } - } + } + } (`A spoonful of sugar makes the medicine go down.') @@ -281,7 +281,7 @@ What's new in v1.10 since v1.03: More documentation. Errors fixed. - Lots more tests. + Lots more tests. ---------------------------------------------------------------- @@ -289,22 +289,22 @@ What's new in v1.03 since v1.0: Code added to support HASH option to fill_in. (Incl. `_gensym' function.) - + Documentation for HASH. - + New test file for HASH. - + Note about failure of lexical variables to propagate into - templates. Why does this surprise people? - + templates. Why does this surprise people? + Bug fix: program fragments are evaluated in an environment with - `no strict' by default. Otherwise, you get a lot of `Global - symbol "$v" requires explicit package name' failures. Why didn't - the test program pick this up? Because the only variable the test - program ever used was `$a', which is exempt. Duhhhhh. - + `no strict' by default. Otherwise, you get a lot of `Global + symbol "$v" requires explicit package name' failures. Why didn't + the test program pick this up? Because the only variable the test + program ever used was `$a', which is exempt. Duhhhhh. + Fixed the test program. - + Various minor documentation fixes. @@ -315,24 +315,25 @@ Improvements of 1.0 over the old 0.1beta: New features: - At least twice as fast + At least twice as fast - Better support for filling out the same template more than once + Better support for filling out the same template more than once Now supports evaluation of program fragments in Safe - compartments. (Thanks, Jonathan!) + compartments. (Thanks, Jonathan!) - Better argument syntax + Better argument syntax - More convenience functions + More convenience functions - The parser is much better and simpler. + The parser is much better and simpler. Once a template is parsed, the parsed version is stored so that - it needn't be parsed again. + it needn't be parsed again. BROKEN function behavior is rationalized. You can now pass an arbitrary argument to your BROKEN function, or return a value - from it to the main program. + from it to the main program. + + Documentation overhauled. - Documentation overhauled. diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template.pm b/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template.pm index 2b8a391b5398..dc4f3bac77e1 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template.pm +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template.pm @@ -5,7 +5,7 @@ # # Copyright 2013 M. J. Dominus. # You may copy and distribute this program under the -# same terms as Perl iteself. +# same terms as Perl iteself. # If in doubt, write to mjd-perl-template+@plover.com for a license. # # Version 1.46 @@ -44,7 +44,7 @@ sub always_prepend { my %LEGAL_TYPE; - BEGIN { + BEGIN { %LEGAL_TYPE = map {$_=>1} qw(FILE FILEHANDLE STRING ARRAY); } sub new { @@ -78,7 +78,7 @@ sub always_prepend bless $self => $pack; return unless $self->_acquire_data; - + $self; } } @@ -89,7 +89,7 @@ sub _acquire_data { my ($self) = @_; my $type = $self->{TYPE}; if ($type eq 'STRING') { - # nothing necessary + # nothing necessary } elsif ($type eq 'FILE') { my $data = _load_text($self->{SOURCE}); unless (defined $data) { @@ -115,7 +115,7 @@ sub _acquire_data { } $self->{SOURCE} = $data; } else { - # This should have been caught long ago, so it represents a + # This should have been caught long ago, so it represents a # drastic `can't-happen' sort of failure my $pack = ref $self; die "Can only acquire data for $pack objects of subtype STRING, but this is $type; aborting"; @@ -145,7 +145,7 @@ sub compile { return undef unless $self->_acquire_data; unless ($self->{TYPE} eq 'STRING') { my $pack = ref $self; - # This should have been caught long ago, so it represents a + # This should have been caught long ago, so it represents a # drastic `can't-happen' sort of failure die "Can only compile $pack objects of subtype STRING, but this is $self->{TYPE}; aborting"; } @@ -153,7 +153,7 @@ sub compile { my @tokens; my $delim_pats = shift() || $self->{DELIM}; - + my ($t_open, $t_close) = ('{', '}'); my $DELIM; # Regex matches a delimiter if $delim_pats @@ -215,7 +215,7 @@ sub compile { } else { die "Can't happen error #1"; } - + $self->{TYPE} = 'PREPARSED'; $self->{SOURCE} = \@content; 1; @@ -247,7 +247,7 @@ sub fill_in { my $fi_varhash = _param('hash', %fi_a); my $fi_package = _param('package', %fi_a) ; - my $fi_broken = + my $fi_broken = _param('broken', %fi_a) || $fi_self->{BROKEN} || \&_default_broken; my $fi_broken_arg = _param('broken_arg', %fi_a) || []; my $fi_safe = _param('safe', %fi_a); @@ -305,7 +305,7 @@ sub fill_in { } elsif ($fi_type eq 'PROG') { no strict; my $fi_lcomment = "#line $fi_lineno $fi_filename"; - my $fi_progtext = + my $fi_progtext = "package $fi_eval_package; $fi_prepend;\n$fi_lcomment\n$fi_text;"; my $fi_res; my $fi_eval_err = ''; @@ -445,7 +445,7 @@ sub _unconditionally_untaint { } } } - + # Given a hashful of variables (or a list of such hashes) # install the variables into the specified package, # overwriting whatever variables were there before. @@ -467,7 +467,7 @@ sub _install_hash { } elsif (ref $val) { *SYM = $val; } else { - *SYM = \$val; + *SYM = \$val; } } } @@ -478,7 +478,7 @@ sub TTerror { $ERROR } 1; -=head1 NAME +=head1 NAME Text::Template - Expand template text with embedded Perl @@ -539,7 +539,7 @@ This file documents C version B<1.46> $text = fill_in_string( < 'T', ...); Dear {$recipient}, Pay me at once. - Love, + Love, G.V. EOM @@ -555,7 +555,7 @@ This is a library for generating form letters, building HTML pages, or filling in templates generally. A `template' is a piece of text that has little Perl programs embedded in it here and there. When you `fill in' a template, you evaluate the little programs and replace -them with their values. +them with their values. You can store a template in a file outside your program. People can modify the template without modifying the program. You can separate @@ -683,16 +683,16 @@ The fragments are evaluated in order, and side effects from earlier fragments will persist into later fragments: {$x = @things; ''}The Lord High Chamberlain has gotten {$x} - things for me this year. - { $diff = $x - 17; + things for me this year. + { $diff = $x - 17; $more = 'more' if ($diff == 0) { $diff = 'no'; } elsif ($diff < 0) { $more = 'fewer'; - } + } ''; - } + } That is {$diff} {$more} than he gave me last year. The value of C<$x> set in the first line will persist into the next @@ -701,11 +701,11 @@ C<$more> set in the second fragment will persist and be interpolated into the last line. The output will look something like this: The Lord High Chamberlain has gotten 42 - things for me this year. + things for me this year. That is 25 more than he gave me last year. -That is all the syntax there is. +That is all the syntax there is. =head2 The C<$OUT> variable @@ -726,9 +726,9 @@ One way to do it is with a template like this: { my $blist = ''; foreach $i (@items) { $blist .= qq{ * $i\n}; - } + } $blist; - } + } Here we construct the list in a variable called C<$blist>, which we return at the end. This is a little cumbersome. There is a shortcut. @@ -743,11 +743,11 @@ This means that you can write the template above like this: Here is a list of the things I have got for you since 1907: { foreach $i (@items) { $OUT .= " * $i\n"; - } - } + } + } C<$OUT> is reinitialized to the empty string at the start of each -program fragment. It is private to C, so +program fragment. It is private to C, so you can't use a variable named C<$OUT> in your template without invoking the special behavior. @@ -780,15 +780,15 @@ else that makes sense with C. The C can also be C, in which case the C should be a string: - new Text::Template ( TYPE => 'STRING', + new Text::Template ( TYPE => 'STRING', SOURCE => "This is the actual template!" ); The C can be C, in which case the source should be a reference to an array of strings. The concatenation of these strings is the template: - new Text::Template ( TYPE => 'ARRAY', - SOURCE => [ "This is ", "the actual", + new Text::Template ( TYPE => 'ARRAY', + SOURCE => [ "This is ", "the actual", " template!", ] ); @@ -800,7 +800,7 @@ C will read the text from the filehandle up to end-of-file, and that text is the template: # Read template source code from STDIN: - new Text::Template ( TYPE => 'FILEHANDLE', + new Text::Template ( TYPE => 'FILEHANDLE', SOURCE => \*STDIN ); @@ -870,7 +870,7 @@ overridden in the arguments to C. See L> below. Loads all the template text from the template's source, parses and compiles it. If successful, returns true; otherwise returns false and sets C<$Text::Template::ERROR>. If the template is already compiled, -it returns true and does nothing. +it returns true and does nothing. You don't usually need to invoke this function, because C (see below) compiles the template if it isn't compiled already. @@ -977,10 +977,10 @@ variables. You may not want to put the template variables into a package. Packages can be hard to manage: You can't copy them, for example. -C provides an alternative. +C provides an alternative. The value for C should be a reference to a hash that maps -variable names to values. For example, +variable names to values. For example, $template->fill_in(HASH => { recipient => "The King", items => ['gold', 'frankincense', 'myrrh'], @@ -996,19 +996,19 @@ should be passed by reference. We also want to pass an object, which is in C<$self>; note that we pass a reference to the object, C<\$self> instead. Since we've passed a reference to a scalar, inside the template the object appears as -C<$object>. +C<$object>. The full details of how it works are a little involved, so you might want to skip to the next section. -Suppose the key in the hash is I and the value is I. +Suppose the key in the hash is I and the value is I. =over 4 =item * If the I is C, then any variables named C<$key>, -C<@key>, C<%key>, etc., are undefined. +C<@key>, C<%key>, etc., are undefined. =item * @@ -1032,7 +1032,7 @@ and have almost exactly the same effect. (The difference is that in the former case, the value is copied, and in the latter case it is -aliased.) +aliased.) =item * @@ -1074,7 +1074,7 @@ You can also use this to set two variables with the same name: ] ); -This sets C<$v> to C<"The King"> and C<@v> to C<(1,2,3)>. +This sets C<$v> to C<"The King"> and C<@v> to C<(1,2,3)>. =item C @@ -1082,13 +1082,13 @@ If any of the program fragments fails to compile or aborts for any reason, and you have set the C option to a function reference, C will invoke the function. This function is called the I function>. The C function will tell -C what to do next. +C what to do next. If the C function returns C, C will immediately abort processing the template and return the text that it has accumulated so far. If your function does this, it should set a flag that you can examine after C returns so that you can -tell whether there was a premature return or not. +tell whether there was a premature return or not. If the C function returns any other value, that value will be interpolated into the template as if that value had been the return @@ -1150,7 +1150,7 @@ If you supply the C option to C, the value of the option is passed to the C function whenever it is called. The default C function ignores the C, but you can write a custom C function that uses the C to get -more information about what went wrong. +more information about what went wrong. The C function could also use the C as a reference to store an error message or some other information that it wants to @@ -1158,7 +1158,7 @@ communicate back to the caller. For example: $error = ''; - sub my_broken { + sub my_broken { my %args = @_; my $err_ref = $args{arg}; ... @@ -1191,7 +1191,7 @@ operations that can be performed in them. If you use the C option with C, the package you specify will be placed into the safe compartment and evaluation will take -place in that package as usual. +place in that package as usual. If not, C operation is a little different from the default. Usually, if you don't specify a package, evaluation of program @@ -1235,11 +1235,11 @@ If this option is present, its value should be a reference to a list of two strings. The first string is the string that signals the beginning of each program fragment, and the second string is the string that signals the end of each program fragment. See -L<"Alternative Delimiters">, below. +L<"Alternative Delimiters">, below. If you specify C in the call to C, they override any delimiters you set when you created the template object with -C. +C. =back @@ -1266,7 +1266,7 @@ An example: $text = Text::Template->fill_this_in( <<'EOM', PACKAGE => Q); Dear {$name}, - You owe me \\${sprintf('%.2f', $amount)}. + You owe me \\${sprintf('%.2f', $amount)}. Pay or I will break your {$part}. Love, Grand Vizopteryx of Irkutsk. @@ -1371,7 +1371,7 @@ The text C doesn't get into the form letter. Why not? Because C<$recipient> is a C variable, and the whole point of C variables is that they're private and inaccessible except in the scope in which they're declared. The template is not part of that -scope, so the template can't see C<$recipient>. +scope, so the template can't see C<$recipient>. If that's not the behavior you want, don't use C. C means a private variable, and in this case you don't want the variable to be @@ -1380,7 +1380,7 @@ package, and use the C option to C: $Q::recipient = $recipient; my $text = fill_in_file('formletter.tmpl', PACKAGE => 'Q'); - + or pass the names and values in a hash with the C option: @@ -1397,8 +1397,8 @@ rest of your program and wreck something. Nevertheless, there's really no way (except with C) to protect against a template that says - { $Important::Secret::Security::Enable = 0; - # Disable security checks in this program + { $Important::Secret::Security::Enable = 0; + # Disable security checks in this program } or @@ -1462,12 +1462,12 @@ you may be able to make it work by doing this instead: --@] It may be safer to choose delimiters that begin with a newline -character. +character. Because the parsing of templates is simplified by the absence of backslash escapes, using alternative C may speed up the parsing process by 20-25%. This shows that my original choice of C<{> -and C<}> was very bad. +and C<}> was very bad. =head2 C feature and using C in templates @@ -1492,11 +1492,11 @@ each and every code fragment: Because we didn't put C at the top of the second fragment, it was only active in the first fragment, and we didn't get any C checking in the second fragment. Then we mispelled C<$foo> -and the error wasn't caught. +and the error wasn't caught. C version 1.22 and higher has a new feature to make this easier. You can specify that any text at all be automatically -added to the beginning of each program fragment. +added to the beginning of each program fragment. When you make a call to C, you can specify a @@ -1541,7 +1541,7 @@ except where overridden by C options to C or C. =head2 Prepending in Derived Classes This section is technical, and you should skip it on the first few -readings. +readings. Normally there are three places that prepended text could come from. It could come from the C option in the C call, from @@ -1551,12 +1551,12 @@ C looks for these three things in order and takes the first one that it finds. In a subclass of C, this last possibility is -ambiguous. Suppose C is a subclass of C. Should +ambiguous. Suppose C is a subclass of C. Should Text::Template->always_prepend(...); affect objects in class C? The answer is that you can have it -either way. +either way. The C value for C is normally stored in a hash variable named C<%GLOBAL_PREPEND> under the key @@ -1587,7 +1587,7 @@ method to get an arbitrary effect. Jennifer D. St Clair asks: > Most of my pages contain JavaScript and Stylesheets. - > How do I change the template identifier? + > How do I change the template identifier? Jennifer is worried about the braces in the JavaScript being taken as the delimiters of the Perl program fragments. Of course, disaster @@ -1600,13 +1600,13 @@ some reason, there are two easy workarounds: 1. You can put C<\> in front of C<{>, C<}>, or C<\> to remove its special meaning. So, for example, instead of - if (br== "n3") { + if (br== "n3") { // etc. } you can put - if (br== "n3") \{ + if (br== "n3") \{ // etc. \} @@ -1627,21 +1627,21 @@ So if we wrote {q{foo}} -it would turn into +it would turn into foo So for your JavaScript, just write - {q{if (br== "n3") { - // etc. + {q{if (br== "n3") { + // etc. }} } and it'll come out as - if (br== "n3") { - // etc. + if (br== "n3") { + // etc. } which is what you want. @@ -1657,7 +1657,7 @@ their templates, like this: } Then they complain because there is a C<17> at the top of the output -that they didn't want to have there. +that they didn't want to have there. Remember that a program fragment is replaced with its own return value, and that in Perl the return value of a code block is the value @@ -1723,14 +1723,14 @@ complicated to remember, but probably easier to use. The rule is now: Backslashes are always passed to Perl unchanged I they occur as part of a sequence like C<\\\\\\{> or C<\\\\\\}>. In these contexts, they are special; C<\\> is replaced with C<\>, and C<\{> and -C<\}> signal a literal brace. +C<\}> signal a literal brace. Examples: \{ foo \} is I evaluated, because the C<\> before the braces signals that -they should be taken literally. The result in the output looks like this: +they should be taken literally. The result in the output looks like this: { foo } @@ -1797,7 +1797,7 @@ It's totally straightforward. Just call the C functions from inside the template: { $q->checkbox_group(NAME => 'toppings', - LINEBREAK => true, + LINEBREAK => true, COLUMNS => 3, VALUES => \@toppings, ); @@ -1864,7 +1864,7 @@ of the mailing list. The mailing list address is a secret.) =head1 THANKS Many thanks to the following people for offering support, -encouragement, advice, bug reports, and all the other good stuff. +encouragement, advice, bug reports, and all the other good stuff. David H. Adler / Joel Appelbaum / @@ -1895,7 +1895,7 @@ Matt X. Hunter / Robert M. Ioffe / Daniel LaLiberte / Reuven M. Lerner / -Trip Lilley / +Trip Lilley / Yannis Livassof / Val Luck / Kevin Madsen / @@ -1941,12 +1941,12 @@ Special thanks to: =over 2 -=item Jonathan Roy +=item Jonathan Roy for telling me how to do the C support (I spent two years worrying about it, and then Jonathan pointed out that it was trivial.) -=item Ranjit Bhatnagar +=item Ranjit Bhatnagar for demanding less verbose fragments like they have in ASP, for helping me figure out the Right Thing, and, especially, for talking me diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm b/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm index c6e3298ee221..1e41037bd362 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm @@ -28,7 +28,7 @@ sub preprocessor { 1; -=head1 NAME +=head1 NAME Text::Template::Preprocess - Expand template text with embedded Perl @@ -82,8 +82,8 @@ this: Plain text here... { perl code } { more perl code } @@ -96,7 +96,7 @@ JavaScript program with executable Perl code. One strategy: s()(q{$1})gsi; } -Then use C \"e_scripts>. This will transform +Then use C \"e_scripts>. This will transform @@ -141,3 +141,4 @@ For updates, visit C. =cut + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/00-version.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/00-version.t index 4784ba008e5c..5f9560f89875 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/00-version.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/00-version.t @@ -8,3 +8,4 @@ if ($Text::Template::VERSION == 1.46) { } else { print "not ok 1\n"; } + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/01-basic.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/01-basic.t index d983797786c4..be43390c67fa 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/01-basic.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/01-basic.t @@ -33,12 +33,12 @@ if (defined($template)) { $n++; # (3) Fill in template from file -$X::v = "abc"; +$X::v = "abc"; $resultX = < abc We will evaluate 1+1 here -> 2 EOM -$Y::v = "ABC"; +$Y::v = "ABC"; $resultY = < ABC We will evaluate 1+1 here -> 2 @@ -74,7 +74,7 @@ $n++; # (6) test creation of template from filehandle if (open (TMPL, "< $TEMPFILE")) { - $template = new Text::Template ('type' => 'FILEHANDLE', + $template = new Text::Template ('type' => 'FILEHANDLE', 'source' => *TMPL); if (defined($template)) { print "ok $n\n"; @@ -109,9 +109,9 @@ if (open (TMPL, "< $TEMPFILE")) { # (9) test creation of template from array -$template = new Text::Template - ('type' => 'ARRAY', - 'source' => [ +$template = new Text::Template + ('type' => 'ARRAY', + 'source' => [ 'We will put value of $v (which is "abc") here -> {$v}', "\n", 'We will evaluate 1+1 here -> {1+1}', @@ -209,7 +209,7 @@ for ($i=0; $i<@tests; $i+=2) { # MJD 20010827 # (28) test creation of template from filehandle if (open (TMPL, "< $TEMPFILE")) { - $template = new Text::Template ('type' => 'FILEHANDLE', + $template = new Text::Template ('type' => 'FILEHANDLE', 'source' => \*TMPL); if (defined($template)) { print "ok $n\n"; diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/02-hash.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/02-hash.t index 050638c853a5..29ba51a40e21 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/02-hash.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/02-hash.t @@ -68,13 +68,13 @@ my $WARNINGS = 0; local $^W = 1; # Make sure this is on for this test $template8 = 'We will put value of $v (which is "good") here -> {defined $v ? "bad" : "good"}'; $result8 = 'We will put value of $v (which is "good") here -> good'; - my $template = + my $template = new Text::Template ('type' => 'STRING', 'source' => $template8); my $text = $template->fill_in(HASH => {'v' => undef}); # (8) Did we generate a warning? print +($WARNINGS == 0 ? '' : 'not '), "ok $n\n"; $n++; - + # (9) Was the output correct? print +($text eq $result8 ? '' : 'not '), "ok $n\n"; $n++; @@ -85,7 +85,7 @@ my $WARNINGS = 0; # (10) Did we generate a warning? print +($WARNINGS == 0 ? '' : 'not '), "ok $n\n"; $n++; - + # (11) Was the output correct? if ($] < 5.005) { print "ok $n # skipped -- not supported before 5.005\n"; @@ -98,7 +98,7 @@ my $WARNINGS = 0; # (12) Now we'll test the multiple-hash option (Added for 1.20.) $text = Text::Template::fill_in_string(q{$v: {$v}. @v: [{"@v"}].}, - HASH => [{'v' => 17}, + HASH => [{'v' => 17}, {'v' => ['a', 'b', 'c']}, {'v' => \23}, ]); @@ -108,3 +108,4 @@ $n++; exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/03-out.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/03-out.t index 8094392dcaf3..0ba65a54dc5e 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/03-out.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/03-out.t @@ -46,10 +46,11 @@ $textOUT = $templateOUT->fill_in() print +($text eq $textOUT ? '' : 'not '), "ok $n\n"; $n++; -# Missing: Test this feature in Safe compartments; +# Missing: Test this feature in Safe compartments; # it's a totally different code path. # Decision: Put that into safe.t, because that file should # be skipped when Safe.pm is unavailable. exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/04-safe.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/04-safe.t index 6d94820d2a91..4c07121b449f 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/04-safe.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/04-safe.t @@ -141,13 +141,13 @@ print +($text1 eq $text2 ? '' : 'not '), "ok $n\n"; $n++; # (16) Try the BROKEN routine in safe compartments -sub my_broken { +sub my_broken { my %a = @_; $a{error} =~ s/ at.*//s; "OK! text:$a{text} error:$a{error} lineno:$a{lineno} arg:$a{arg}" ; } $templateB = new Text::Template (TYPE => 'STRING', SOURCE => '{die}') or die; -$text1 = $templateB->fill_in(BROKEN => \&my_broken, +$text1 = $templateB->fill_in(BROKEN => \&my_broken, BROKEN_ARG => 'barg', SAFE => new Safe, ); @@ -158,3 +158,4 @@ $n++; exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/05-safe2.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/05-safe2.t index 71f242592f99..03534770f175 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/05-safe2.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/05-safe2.t @@ -96,7 +96,10 @@ print +($Q::H eq 'good7' ? '' : 'not '), "ok $n\n"; $Q::H = $Q::H; $n++; -# (12) +# (12) print +($Q2::H eq 'good8' ? '' : 'not '), "ok $n\n"; $Q2::H = $Q2::H; $n++; + + + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/06-ofh.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/06-ofh.t index 22d4a1c841e4..6865ad194531 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/06-ofh.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/06-ofh.t @@ -36,3 +36,4 @@ print +($t eq "My process ID is $$" ? '' : 'not '), "ok $n\n"; $n++; exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/07-safe3.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/07-safe3.t index 8baaf7ad4449..5f438f61480e 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/07-safe3.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/07-safe3.t @@ -88,3 +88,4 @@ $n++; } exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/08-exported.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/08-exported.t index 6014400840a7..ef9cfafdeeed 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/08-exported.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/08-exported.t @@ -14,7 +14,7 @@ Aborting" print "1..6\n"; $n=1; -$Q::n = $Q::n = 119; +$Q::n = $Q::n = 119; # (1) Test fill_in_string $out = fill_in_string('The value of $n is {$n}.', PACKAGE => 'Q' ); @@ -26,7 +26,7 @@ $TEMPFILE = "tt$$"; open F, "> $TEMPFILE" or die "Couldn't open test file: $!; aborting"; print F 'The value of $n is {$n}.', "\n"; close F or die "Couldn't write test file: $!; aborting"; -$R::n = $R::n = 8128; +$R::n = $R::n = 8128; $out = fill_in_file($TEMPFILE, PACKAGE => 'R'); print +($out eq "The value of \$n is 8128.\n" ? '' : 'not '), "ok $n\n"; @@ -42,7 +42,7 @@ print +($out eq "With a message here? It is good!\n" ? '' : 'not '), "ok $n\n"; $n++; # (4) It probably occurs in fill_this_in also: -$out = +$out = Text::Template->fill_this_in("With a message here? [% \$var %]\n", DELIMITERS => ['[%', '%]'], HASH => { "var" => \"It is good!" }); @@ -50,7 +50,7 @@ print +($out eq "With a message here? It is good!\n" ? '' : 'not '), "ok $n\n"; $n++; # (5) This test failed in 1.25. It was supplied by Donald L. Greer Jr. -# Note that it's different from (1) in that there's no explicit +# Note that it's different from (1) in that there's no explicit # package=> argument. use vars qw($string $foo $r); $string='Hello {$foo}'; @@ -72,3 +72,4 @@ package main; END { $TEMPFILE && unlink $TEMPFILE } exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/09-error.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/09-error.t index c9d03f27f873..40f9fac6cbc8 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/09-error.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/09-error.t @@ -49,14 +49,15 @@ if ($@ =~ /^\QIllegal value `WLUNCH' for TYPE parameter/) { $n++; # (4-5) File does not exist -my $o = Text::Template->new(TYPE => 'file', +my $o = Text::Template->new(TYPE => 'file', SOURCE => 'this file does not exist'); print $o ? "not ok $n\n" : "ok $n\n"; $n++; -print defined($Text::Template::ERROR) +print defined($Text::Template::ERROR) && $Text::Template::ERROR =~ /^Couldn't open file/ ? "ok $n\n" : "not ok $n\n"; $n++; exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/10-delimiters.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/10-delimiters.t index 4b32ce041154..f74d591cc755 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/10-delimiters.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/10-delimiters.t @@ -19,7 +19,7 @@ $n = 1; $V = $V = 119; $template = q{The value of $V is <<$V>>.}; $result = q{The value of $V is 119.}; -$template1 = Text::Template->new(TYPE => STRING, +$template1 = Text::Template->new(TYPE => STRING, SOURCE => $template, DELIMITERS => ['<<', '>>'] ) @@ -37,7 +37,7 @@ $n++; # (3) Now we'll try using regex metacharacters # First with the delimiters specified at object creation time $template = q{The value of $V is [$V].}; -$template1 = Text::Template->new(TYPE => STRING, +$template1 = Text::Template->new(TYPE => STRING, SOURCE => $template, DELIMITERS => ['[', ']'] ) @@ -63,10 +63,10 @@ my @tests = ('{""}' => '', # (5) '{"}"}' => undef, '{"\\}"}' => undef, # One backslash '{"\\\\}"}' => undef, # Two backslashes - '{"\\\\\\}"}' => undef, # Three backslashes + '{"\\\\\\}"}' => undef, # Three backslashes '{"\\\\\\\\}"}' => undef, # Four backslashes (10) '{"\\\\\\\\\\}"}' => undef, # Five backslashes - + # Backslashes are always passed directly to Perl '{"x20"}' => 'x20', '{"\\x20"}' => ' ', # One backslash @@ -96,3 +96,4 @@ for ($i=0; $i<@tests; $i+=2) { exit; + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/11-prepend.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/11-prepend.t index 833a5fa4449c..fe242e5898a2 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/11-prepend.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/11-prepend.t @@ -22,11 +22,11 @@ my $tin = q{The value of $foo is: {$foo}}; Text::Template->always_prepend(q{$foo = "global"}); $tmpl1 = Text::Template->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, ); $tmpl2 = Text::Template->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, PREPEND => q{$foo = "template"}, ); @@ -46,11 +46,11 @@ print "ok $n\n"; $n++; Emptyclass1->always_prepend(q{$foo = 'Emptyclass global';}); $tmpl1 = Emptyclass1->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, ); $tmpl2 = Emptyclass1->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, PREPEND => q{$foo = "template"}, ); @@ -69,11 +69,11 @@ print "ok $n\n"; $n++; print "ok $n\n"; $n++; $tmpl1 = Emptyclass2->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, ); $tmpl2 = Emptyclass2->new(TYPE => 'STRING', - SOURCE => $tin, + SOURCE => $tin, PREPEND => q{$foo = "template"}, ); @@ -90,3 +90,5 @@ print "ok $n\n"; $n++; print "ok $n\n"; $n++; ($t3 eq 'The value of $foo is: fillin') or print "not "; print "ok $n\n"; $n++; + + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/12-preprocess.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/12-preprocess.t index 422b10ec9aec..60b6b0c65beb 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/12-preprocess.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/12-preprocess.t @@ -32,16 +32,16 @@ for my $trial (1, 0) { for my $test (0 .. 3) { my $tmpl; if ($trial == 0) { - $tmpl = new Text::Template::Preprocess + $tmpl = new Text::Template::Preprocess (TYPE => 'STRING', SOURCE => $t) or die; } else { open TF, "< $TMPFILE" or die "Couldn't open test file: $!; aborting"; - $tmpl = new Text::Template::Preprocess + $tmpl = new Text::Template::Preprocess (TYPE => 'FILEHANDLE', SOURCE => \*TF) or die; } $tmpl->preprocessor($py) if ($test & 1) == 1; my @args = ((($test & 2) == 2) ? (PREPROCESSOR => $pz) : ()); - my $o = $tmpl->fill_in(@args, + my $o = $tmpl->fill_in(@args, HASH => {x => 119, 'y' => 23, z => 5}); # print STDERR "$o/$result[$test]\n"; print +(($o eq $result[$test]) ? '' : 'not '), "ok $n\n"; diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/13-taint.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/13-taint.t index 30664993ac36..d92a37463ab3 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/13-taint.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/13-taint.t @@ -58,14 +58,14 @@ sub should_be_tainted { if (Text::Template::_is_clean($_[0])) { print "not ok $n\n"; $n++; return; } - print "ok $n\n"; $n++; return; + print "ok $n\n"; $n++; return; } sub should_be_clean { unless (Text::Template::_is_clean($_[0])) { print "not ok $n\n"; $n++; return; } - print "ok $n\n"; $n++; return; + print "ok $n\n"; $n++; return; } # Tainted filename should die with and without UNTAINT option @@ -116,3 +116,4 @@ Text::Template::_unconditionally_untaint($tfile); should_be_clean($tfile); END { unlink $file } + diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/14-broken.t b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/14-broken.t index db88a0711f19..d362395cfbc7 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.46/t/14-broken.t +++ b/deps/openssl/openssl/external/perl/Text-Template-1.46/t/14-broken.t @@ -68,7 +68,7 @@ Aborting" # (5) BROKEN sub passed correct args when called in ->fill_in? { my $r = Text::Template->new(TYPE => 'string', SOURCE => '{1/0}', - )->fill_in(BROKEN => + )->fill_in(BROKEN => sub { my %a = @_; qq{$a{lineno},$a{error},$a{text}} }); @@ -79,3 +79,4 @@ Aborting" } $n++; } + diff --git a/deps/openssl/openssl/external/perl/transfer/Text/Template.pm b/deps/openssl/openssl/external/perl/transfer/Text/Template.pm index 7dbfe3f84f4d..b21f875312b5 100644 --- a/deps/openssl/openssl/external/perl/transfer/Text/Template.pm +++ b/deps/openssl/openssl/external/perl/transfer/Text/Template.pm @@ -1,4 +1,4 @@ -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -7,6 +7,9 @@ # Quick transfer to the downloaded Text::Template +package transfer::Text::Template; +$VERSION = 1.46; + BEGIN { use File::Spec::Functions; use File::Basename; diff --git a/deps/openssl/openssl/fuzz/test-corpus.c b/deps/openssl/openssl/fuzz/test-corpus.c index c553697d6c78..628e633536d3 100644 --- a/deps/openssl/openssl/fuzz/test-corpus.c +++ b/deps/openssl/openssl/fuzz/test-corpus.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL licenses, (the "License"); * you may not use this file except in compliance with the License. @@ -16,31 +16,86 @@ #include #include +#include #include #include #include "fuzzer.h" +#include "internal/o_dir.h" -int main(int argc, char **argv) { - int n; +#if defined(_WIN32) && defined(_MAX_PATH) +# define PATH_MAX _MAX_PATH +#endif - FuzzerInitialize(&argc, &argv); +#ifndef PATH_MAX +# define PATH_MAX 4096 +#endif - for (n = 1; n < argc; ++n) { - struct stat st; - FILE *f; - unsigned char *buf; - size_t s; - - stat(argv[n], &st); - f = fopen(argv[n], "rb"); - if (f == NULL) - continue; - buf = malloc(st.st_size); +# if !defined(S_ISREG) +# define S_ISREG(m) ((m) & S_IFREG) +# endif + +static void testfile(const char *pathname) +{ + struct stat st; + FILE *f; + unsigned char *buf; + size_t s; + + if (stat(pathname, &st) < 0 || !S_ISREG(st.st_mode)) + return; + printf("# %s\n", pathname); + fflush(stdout); + f = fopen(pathname, "rb"); + if (f == NULL) + return; + buf = malloc(st.st_size); + if (buf != NULL) { s = fread(buf, 1, st.st_size, f); OPENSSL_assert(s == (size_t)st.st_size); FuzzerTestOneInput(buf, s); free(buf); - fclose(f); + } + fclose(f); +} + +int main(int argc, char **argv) { + int n; + + FuzzerInitialize(&argc, &argv); + + for (n = 1; n < argc; ++n) { + size_t dirname_len = strlen(argv[n]); + const char *filename = NULL; + char *pathname = NULL; + OPENSSL_DIR_CTX *ctx = NULL; + int wasdir = 0; + + /* + * We start with trying to read the given path as a directory. + */ + while ((filename = OPENSSL_DIR_read(&ctx, argv[n])) != NULL) { + wasdir = 1; + if (pathname == NULL) { + pathname = malloc(PATH_MAX); + if (pathname == NULL) + break; + strcpy(pathname, argv[n]); +#ifdef __VMS + if (strchr(":<]", pathname[dirname_len - 1]) == NULL) +#endif + pathname[dirname_len++] = '/'; + pathname[dirname_len] = '\0'; + } + strcpy(pathname + dirname_len, filename); + testfile(pathname); + } + OPENSSL_DIR_end(&ctx); + + /* If it wasn't a directory, treat it as a file instead */ + if (!wasdir) + testfile(argv[n]); + + free(pathname); } return 0; } diff --git a/deps/openssl/openssl/include/internal/__DECC_INCLUDE_EPILOGUE.H b/deps/openssl/openssl/include/internal/__DECC_INCLUDE_EPILOGUE.H new file mode 100644 index 000000000000..5f63860808b6 --- /dev/null +++ b/deps/openssl/openssl/include/internal/__DECC_INCLUDE_EPILOGUE.H @@ -0,0 +1,16 @@ +/* + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C on VMS, and is included automatically + * after each header file from this directory + */ + +/* restore state. Must correspond to the save in __decc_include_prologue.h */ +#pragma names restore diff --git a/deps/openssl/openssl/include/internal/__DECC_INCLUDE_PROLOGUE.H b/deps/openssl/openssl/include/internal/__DECC_INCLUDE_PROLOGUE.H new file mode 100644 index 000000000000..78b2a87d8868 --- /dev/null +++ b/deps/openssl/openssl/include/internal/__DECC_INCLUDE_PROLOGUE.H @@ -0,0 +1,20 @@ +/* + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C on VMS, and is included automatically + * after each header file from this directory + */ + +/* save state */ +#pragma names save +/* have the compiler shorten symbols larger than 31 chars to 23 chars + * followed by a 8 hex char CRC + */ +#pragma names as_is,shortened diff --git a/deps/openssl/openssl/include/internal/numbers.h b/deps/openssl/openssl/include/internal/numbers.h index cf2c30eebbc4..31931df3c2ff 100644 --- a/deps/openssl/openssl/include/internal/numbers.h +++ b/deps/openssl/openssl/include/internal/numbers.h @@ -65,3 +65,4 @@ # endif #endif + diff --git a/deps/openssl/openssl/include/internal/sslconf.h b/deps/openssl/openssl/include/internal/sslconf.h new file mode 100644 index 000000000000..d538f8614f58 --- /dev/null +++ b/deps/openssl/openssl/include/internal/sslconf.h @@ -0,0 +1,20 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_SSLCONF_H +# define HEADER_SSLCONF_H + +typedef struct ssl_conf_cmd_st SSL_CONF_CMD; + +const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt); +int conf_ssl_name_find(const char *name, size_t *idx); +void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr, + char **arg); + +#endif diff --git a/deps/openssl/openssl/include/openssl/asn1.h b/deps/openssl/openssl/include/openssl/asn1.h index 05ae1dbe1c23..d0b1099a4faf 100644 --- a/deps/openssl/openssl/include/openssl/asn1.h +++ b/deps/openssl/openssl/include/openssl/asn1.h @@ -953,8 +953,10 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 diff --git a/deps/openssl/openssl/include/openssl/bio.h b/deps/openssl/openssl/include/openssl/bio.h index f435bd8ef6db..3a72862561fa 100644 --- a/deps/openssl/openssl/include/openssl/bio.h +++ b/deps/openssl/openssl/include/openssl/bio.h @@ -730,26 +730,26 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, diff --git a/deps/openssl/openssl/include/openssl/bn.h b/deps/openssl/openssl/include/openssl/bn.h index 54ae760152f1..301edd525062 100644 --- a/deps/openssl/openssl/include/openssl/bn.h +++ b/deps/openssl/openssl/include/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) diff --git a/deps/openssl/openssl/include/openssl/conf.h b/deps/openssl/openssl/include/openssl/conf.h index 980a51b157f4..e0539e312884 100644 --- a/deps/openssl/openssl/include/openssl/conf.h +++ b/deps/openssl/openssl/include/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,6 +207,10 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 # define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 diff --git a/deps/openssl/openssl/include/openssl/crypto.h b/deps/openssl/openssl/include/openssl/crypto.h index 1ba7f25f0123..fa3f12af3b23 100644 --- a/deps/openssl/openssl/include/openssl/crypto.h +++ b/deps/openssl/openssl/include/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -371,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/deps/openssl/openssl/include/openssl/dh.h b/deps/openssl/openssl/include/openssl/dh.h index fbd479039e9e..8cf879e14fad 100644 --- a/deps/openssl/openssl/include/openssl/dh.h +++ b/deps/openssl/openssl/include/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -187,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/deps/openssl/openssl/include/openssl/dsa.h b/deps/openssl/openssl/include/openssl/dsa.h index 139718edb940..3a7b1a626e19 100644 --- a/deps/openssl/openssl/include/openssl/dsa.h +++ b/deps/openssl/openssl/include/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ diff --git a/deps/openssl/openssl/include/openssl/evp.h b/deps/openssl/openssl/include/openssl/evp.h index 43c97a7560fb..36e2934485aa 100644 --- a/deps/openssl/openssl/include/openssl/evp.h +++ b/deps/openssl/openssl/include/openssl/evp.h @@ -1351,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1386,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1398,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1406,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1414,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1422,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1430,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1506,6 +1506,8 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 @@ -1570,6 +1572,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 # define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 # define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 diff --git a/deps/openssl/openssl/include/openssl/lhash.h b/deps/openssl/openssl/include/openssl/lhash.h index 82d40c1e0e70..8ecc58848420 100644 --- a/deps/openssl/openssl/include/openssl/lhash.h +++ b/deps/openssl/openssl/include/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete diff --git a/deps/openssl/openssl/include/openssl/opensslconf.h.in b/deps/openssl/openssl/include/openssl/opensslconf.h.in index 9f8634a3a28e..17807fb6bd37 100644 --- a/deps/openssl/openssl/include/openssl/opensslconf.h.in +++ b/deps/openssl/openssl/include/openssl/opensslconf.h.in @@ -68,12 +68,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/deps/openssl/openssl/include/openssl/opensslv.h b/deps/openssl/openssl/include/openssl/opensslv.h index 4fb437f2ee3e..c5ef2a753564 100644 --- a/deps/openssl/openssl/include/openssl/opensslv.h +++ b/deps/openssl/openssl/include/openssl/opensslv.h @@ -39,18 +39,13 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010008fL +# define OPENSSL_VERSION_NUMBER 0x1010009fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0h-fips 27 Mar 2018" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0i-fips 14 Aug 2018" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0h 27 Mar 2018" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0i 14 Aug 2018" # endif -#define OPENSSL_MAKE_VERSION(maj,min,fix,patch) ((0x10000000L)+((maj&0xff)<<20)+((min&0xff)<<12)+((fix&0xff)<<4)+patch) - -/* use this for #if tests, should never depend upon fix/patch */ -#define OPENSSL_VERSION_AT_LEAST(maj,min) (OPENSSL_MAKE_VERSION(maj,min, 0, 0) >= OPENSSL_VERSION_NUMBER) - /*- * The macros below are to be used for shared library (.so, .dll, ...) * versioning. That kind of versioning works a bit differently between diff --git a/deps/openssl/openssl/include/openssl/pem.h b/deps/openssl/openssl/include/openssl/pem.h index 2375d6355381..f7ce3c61f5fa 100644 --- a/deps/openssl/openssl/include/openssl/pem.h +++ b/deps/openssl/openssl/include/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/deps/openssl/openssl/include/openssl/rsa.h b/deps/openssl/openssl/include/openssl/rsa.h index d97d6e075aef..790831b94545 100644 --- a/deps/openssl/openssl/include/openssl/rsa.h +++ b/deps/openssl/openssl/include/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); diff --git a/deps/openssl/openssl/include/openssl/ssl.h b/deps/openssl/openssl/include/openssl/ssl.h index 1cb3462f4854..56e2056260d6 100644 --- a/deps/openssl/openssl/include/openssl/ssl.h +++ b/deps/openssl/openssl/include/openssl/ssl.h @@ -381,7 +381,7 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); # define SSL_OP_PKCS1_CHECK_1 0x0 /* Removed from OpenSSL 1.0.1. Was 0x10000000L */ # define SSL_OP_PKCS1_CHECK_2 0x0 -/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ # define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 /* Removed from OpenSSL 1.1.0. Was 0x40000000L */ # define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 @@ -967,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1358,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); diff --git a/deps/openssl/openssl/include/openssl/ssl3.h b/deps/openssl/openssl/include/openssl/ssl3.h index 4ca434e760ed..115940ad3157 100644 --- a/deps/openssl/openssl/include/openssl/ssl3.h +++ b/deps/openssl/openssl/include/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 diff --git a/deps/openssl/openssl/include/openssl/tls1.h b/deps/openssl/openssl/include/openssl/tls1.h index 3fe01fe81383..732e87ab35c2 100644 --- a/deps/openssl/openssl/include/openssl/tls1.h +++ b/deps/openssl/openssl/include/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/deps/openssl/openssl/include/openssl/x509.h b/deps/openssl/openssl/include/openssl/x509.h index d23fad8e3596..780386d530ce 100644 --- a/deps/openssl/openssl/include/openssl/x509.h +++ b/deps/openssl/openssl/include/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -805,7 +805,7 @@ X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const unsigned char *bytes, int len); X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, - int type, + int type, const unsigned char *bytes, int len); int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h b/deps/openssl/openssl/include/openssl/x509_vfy.h index 1aa0a33b8a32..d91581c77353 100644 --- a/deps/openssl/openssl/include/openssl/x509_vfy.h +++ b/deps/openssl/openssl/include/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -475,6 +550,7 @@ int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/deps/openssl/openssl/ms/uplink-x86.pl b/deps/openssl/openssl/ms/uplink-x86.pl index e25668ea35d1..2c0b12b86e74 100755 --- a/deps/openssl/openssl/ms/uplink-x86.pl +++ b/deps/openssl/openssl/ms/uplink-x86.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -41,4 +41,4 @@ } &asm_finish(); -close OUTPUT; +close STDOUT; diff --git a/deps/openssl/openssl/ssl/record/rec_layer_d1.c b/deps/openssl/openssl/ssl/record/rec_layer_d1.c index b3ff5f1fbfc7..6111a2e1913e 100644 --- a/deps/openssl/openssl/ssl/record/rec_layer_d1.c +++ b/deps/openssl/openssl/ssl/record/rec_layer_d1.c @@ -423,6 +423,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, /* get new packet if necessary */ if ((SSL3_RECORD_get_length(rr) == 0) || (s->rlayer.rstate == SSL_ST_READ_BODY)) { + RECORD_LAYER_set_numrpipes(&s->rlayer, 0); ret = dtls1_get_record(s); if (ret <= 0) { ret = dtls1_read_failed(s, ret); @@ -432,6 +433,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, else goto start; } + RECORD_LAYER_set_numrpipes(&s->rlayer, 1); } /* @@ -442,6 +444,19 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, && SSL3_RECORD_get_length(rr) != 0) s->rlayer.alert_count = 0; + if (SSL3_RECORD_get_type(rr) != SSL3_RT_HANDSHAKE + && SSL3_RECORD_get_type(rr) != SSL3_RT_CHANGE_CIPHER_SPEC + && !SSL_in_init(s) + && (s->d1->next_timeout.tv_sec != 0 + || s->d1->next_timeout.tv_usec != 0)) { + /* + * The timer is still running but we've received something that isn't + * handshake data - so the peer must have finished processing our + * last handshake flight. Stop the timer. + */ + dtls1_stop_timer(s); + } + /* we now have a packet which can be read and processed */ if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec, @@ -458,6 +473,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, return -1; } SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); goto start; } @@ -467,8 +483,9 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, */ if (s->shutdown & SSL_RECEIVED_SHUTDOWN) { SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); s->rwstate = SSL_NOTHING; - return (0); + return 0; } if (type == SSL3_RECORD_get_type(rr) @@ -493,8 +510,16 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, if (recvd_type != NULL) *recvd_type = SSL3_RECORD_get_type(rr); - if (len <= 0) - return (len); + if (len <= 0) { + /* + * Mark a zero length record as read. This ensures multiple calls to + * SSL_read() with a zero length buffer will eventually cause + * SSL_pending() to report data as being available. + */ + if (SSL3_RECORD_get_length(rr) == 0) + SSL3_RECORD_set_read(rr); + return len; + } if ((unsigned int)len > SSL3_RECORD_get_length(rr)) n = SSL3_RECORD_get_length(rr); @@ -502,12 +527,16 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, n = (unsigned int)len; memcpy(buf, &(SSL3_RECORD_get_data(rr)[SSL3_RECORD_get_off(rr)]), n); - if (!peek) { + if (peek) { + if (SSL3_RECORD_get_length(rr) == 0) + SSL3_RECORD_set_read(rr); + } else { SSL3_RECORD_sub_length(rr, n); SSL3_RECORD_add_off(rr, n); if (SSL3_RECORD_get_length(rr) == 0) { s->rlayer.rstate = SSL_ST_READ_HEADER; SSL3_RECORD_set_off(rr, 0); + SSL3_RECORD_set_read(rr); } } #ifndef OPENSSL_NO_SCTP @@ -558,6 +587,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, } /* Exit and notify application to read again */ SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); s->rwstate = SSL_READING; BIO_clear_retry_flags(SSL_get_rbio(s)); BIO_set_retry_read(SSL_get_rbio(s)); @@ -602,6 +632,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, #endif s->rlayer.rstate = SSL_ST_READ_HEADER; SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); goto start; } @@ -611,6 +642,8 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, SSL3_RECORD_add_off(rr, 1); SSL3_RECORD_add_length(rr, -1); } + if (SSL3_RECORD_get_length(rr) == 0) + SSL3_RECORD_set_read(rr); *dest_len = dest_maxlen; } } @@ -681,6 +714,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, } } else { SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION); } /* @@ -705,6 +739,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, || (s->options & SSL_OP_NO_RENEGOTIATION) != 0)) { s->rlayer.d->handshake_fragment_len = 0; SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION); goto start; } @@ -732,6 +767,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; + SSL3_RECORD_set_read(rr); s->rlayer.alert_count++; if (s->rlayer.alert_count == MAX_WARN_ALERT_COUNT) { @@ -796,6 +832,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, BIO_snprintf(tmp, sizeof(tmp), "%d", alert_descr); ERR_add_error_data(2, "SSL alert number ", tmp); s->shutdown |= SSL_RECEIVED_SHUTDOWN; + SSL3_RECORD_set_read(rr); SSL_CTX_remove_session(s->session_ctx, s->session); return (0); } else { @@ -811,7 +848,8 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, * shutdown */ s->rwstate = SSL_NOTHING; SSL3_RECORD_set_length(rr, 0); - return (0); + SSL3_RECORD_set_read(rr); + return 0; } if (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC) { @@ -820,6 +858,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, * are still missing, so just drop it. */ SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); goto start; } @@ -834,6 +873,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, dtls1_get_message_header(rr->data, &msg_hdr); if (SSL3_RECORD_get_epoch(rr) != s->rlayer.d->r_epoch) { SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); goto start; } @@ -847,6 +887,19 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, dtls1_retransmit_buffered_messages(s); SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); + if (!(s->mode & SSL_MODE_AUTO_RETRY)) { + if (SSL3_BUFFER_get_left(&s->rlayer.rbuf) == 0) { + /* no read-ahead left? */ + BIO *bio; + + s->rwstate = SSL_READING; + bio = SSL_get_rbio(s); + BIO_clear_retry_flags(bio); + BIO_set_retry_read(bio); + return -1; + } + } goto start; } @@ -889,6 +942,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, /* TLS just ignores unknown message types */ if (s->version == TLS1_VERSION) { SSL3_RECORD_set_length(rr, 0); + SSL3_RECORD_set_read(rr); goto start; } al = SSL_AD_UNEXPECTED_MESSAGE; diff --git a/deps/openssl/openssl/ssl/record/rec_layer_s3.c b/deps/openssl/openssl/ssl/record/rec_layer_s3.c index 20225d2db779..1ffc1205d97b 100644 --- a/deps/openssl/openssl/ssl/record/rec_layer_s3.c +++ b/deps/openssl/openssl/ssl/record/rec_layer_s3.c @@ -368,7 +368,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) * promptly send beyond the end of the users buffer ... so we trap and * report the error in a way the user will notice */ - if (((unsigned int)len < s->rlayer.wnum) + if (((unsigned int)len < s->rlayer.wnum) || ((wb->left != 0) && ((unsigned int)len < (s->rlayer.wnum + s->rlayer.wpend_tot)))) { SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH); return -1; diff --git a/deps/openssl/openssl/ssl/record/ssl3_record.c b/deps/openssl/openssl/ssl/record/ssl3_record.c index c7a54feb126a..c80add37f931 100644 --- a/deps/openssl/openssl/ssl/record/ssl3_record.c +++ b/deps/openssl/openssl/ssl/record/ssl3_record.c @@ -1531,6 +1531,7 @@ int dtls1_get_record(SSL *s) p += 6; n2s(p, rr->length); + rr->read = 0; /* * Lets check the version. We tolerate alerts that don't have the exact @@ -1540,6 +1541,7 @@ int dtls1_get_record(SSL *s) if (version != s->version) { /* unexpected version, silently discard */ rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); goto again; } @@ -1548,6 +1550,7 @@ int dtls1_get_record(SSL *s) if ((version & 0xff00) != (s->version & 0xff00)) { /* wrong version, silently discard record */ rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); goto again; } @@ -1555,10 +1558,10 @@ int dtls1_get_record(SSL *s) if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH) { /* record too long, silently discard it */ rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); goto again; } - /* now s->rlayer.rstate == SSL_ST_READ_BODY */ } @@ -1572,6 +1575,7 @@ int dtls1_get_record(SSL *s) /* this packet contained a partial record, dump it */ if (n != i) { rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); goto again; } @@ -1588,6 +1592,7 @@ int dtls1_get_record(SSL *s) bitmap = dtls1_get_bitmap(s, rr, &is_next_epoch); if (bitmap == NULL) { rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */ goto again; /* get another record */ } @@ -1602,6 +1607,7 @@ int dtls1_get_record(SSL *s) */ if (!dtls1_record_replay_check(s, bitmap)) { rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */ goto again; /* get another record */ } @@ -1610,8 +1616,10 @@ int dtls1_get_record(SSL *s) #endif /* just read a 0 length packet */ - if (rr->length == 0) + if (rr->length == 0) { + rr->read = 1; goto again; + } /* * If this record is from the next epoch (either HM or ALERT), and a @@ -1626,12 +1634,14 @@ int dtls1_get_record(SSL *s) return -1; } rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); goto again; } if (!dtls1_process_record(s, bitmap)) { rr->length = 0; + rr->read = 1; RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */ goto again; /* get another record */ } diff --git a/deps/openssl/openssl/ssl/ssl_ciph.c b/deps/openssl/openssl/ssl/ssl_ciph.c index 7a393cbe8031..b8da98210585 100644 --- a/deps/openssl/openssl/ssl/ssl_ciph.c +++ b/deps/openssl/openssl/ssl/ssl_ciph.c @@ -101,10 +101,7 @@ static const ssl_cipher_table ssl_cipher_table_cipher[SSL_ENC_NUM_IDX] = { {SSL_CHACHA20POLY1305, NID_chacha20_poly1305}, }; -static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL -}; +static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]; #define SSL_COMP_NULL_IDX 0 #define SSL_COMP_ZLIB_IDX 1 diff --git a/deps/openssl/openssl/ssl/ssl_conf.c b/deps/openssl/openssl/ssl/ssl_conf.c index 7f894885dc51..9d9309ac15f3 100644 --- a/deps/openssl/openssl/ssl/ssl_conf.c +++ b/deps/openssl/openssl/ssl/ssl_conf.c @@ -222,8 +222,9 @@ static int cmd_ECDHParameters(SSL_CONF_CTX *cctx, const char *value) int nid; /* Ignore values supported by 1.0.2 for the automatic selection */ - if ((cctx->flags & SSL_CONF_FLAG_FILE) && - strcasecmp(value, "+automatic") == 0) + if ((cctx->flags & SSL_CONF_FLAG_FILE) + && (strcasecmp(value, "+automatic") == 0 + || strcasecmp(value, "automatic") == 0)) return 1; if ((cctx->flags & SSL_CONF_FLAG_CMDLINE) && strcmp(value, "auto") == 0) diff --git a/deps/openssl/openssl/ssl/ssl_init.c b/deps/openssl/openssl/ssl/ssl_init.c index 3e62d4811102..dc16e39bf341 100644 --- a/deps/openssl/openssl/ssl/ssl_init.c +++ b/deps/openssl/openssl/ssl/ssl_init.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -12,6 +12,7 @@ #include "internal/err.h" #include #include +#include #include #include "ssl_locl.h" #include "internal/thread_once.h" @@ -126,8 +127,8 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_ssl_strings) "ERR_load_SSL_strings()\n"); # endif ERR_load_SSL_strings(); -#endif ssl_strings_inited = 1; +#endif return 1; } @@ -191,11 +192,13 @@ int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS * settings) return 0; } - if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base)) + if (!OPENSSL_init_crypto(opts + | OPENSSL_INIT_ADD_ALL_CIPHERS + | OPENSSL_INIT_ADD_ALL_DIGESTS, + settings)) return 0; - if (!OPENSSL_init_crypto(opts | OPENSSL_INIT_ADD_ALL_CIPHERS - | OPENSSL_INIT_ADD_ALL_DIGESTS, settings)) + if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base)) return 0; if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS) diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c index 8a190d23e807..2002c1712f68 100644 --- a/deps/openssl/openssl/ssl/ssl_lib.c +++ b/deps/openssl/openssl/ssl/ssl_lib.c @@ -2213,28 +2213,37 @@ int SSL_set_cipher_list(SSL *s, const char *str) return 1; } -char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len) +char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size) { char *p; - STACK_OF(SSL_CIPHER) *sk; + STACK_OF(SSL_CIPHER) *clntsk, *srvrsk; const SSL_CIPHER *c; int i; - if ((s->session == NULL) || (s->session->ciphers == NULL) || (len < 2)) - return (NULL); + if (!s->server + || s->session == NULL + || s->session->ciphers == NULL + || size < 2) + return NULL; p = buf; - sk = s->session->ciphers; + clntsk = s->session->ciphers; + srvrsk = SSL_get_ciphers(s); + if (clntsk == NULL || srvrsk == NULL) + return NULL; - if (sk_SSL_CIPHER_num(sk) == 0) + if (sk_SSL_CIPHER_num(clntsk) == 0 || sk_SSL_CIPHER_num(srvrsk) == 0) return NULL; - for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { + for (i = 0; i < sk_SSL_CIPHER_num(clntsk); i++) { int n; - c = sk_SSL_CIPHER_value(sk, i); + c = sk_SSL_CIPHER_value(clntsk, i); + if (sk_SSL_CIPHER_find(srvrsk, c) < 0) + continue; + n = strlen(c->name); - if (n + 1 > len) { + if (n + 1 > size) { if (p != buf) --p; *p = '\0'; @@ -2243,7 +2252,7 @@ char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len) memcpy(p, c->name, n + 1); p += n; *(p++) = ':'; - len -= n + 1; + size -= n + 1; } p[-1] = '\0'; return (buf); @@ -3035,12 +3044,13 @@ void ssl_update_cache(SSL *s, int mode) /* * If sid_ctx_length is 0 there is no specific application context * associated with this session, so when we try to resume it and - * SSL_VERIFY_PEER is requested, we have no indication that this is - * actually a session for the proper application context, and the - * *handshake* will fail, not just the resumption attempt. - * Do not cache these sessions that are not resumable. + * SSL_VERIFY_PEER is requested to verify the client identity, we have no + * indication that this is actually a session for the proper application + * context, and the *handshake* will fail, not just the resumption attempt. + * Do not cache (on the server) these sessions that are not resumable + * (clients can set SSL_VERIFY_PEER without needing a sid_ctx set). */ - if (s->session->sid_ctx_length == 0 + if (s->server && s->session->sid_ctx_length == 0 && (s->verify_mode & SSL_VERIFY_PEER) != 0) return; @@ -3519,7 +3529,6 @@ void ssl_free_wbio_buffer(SSL *s) return; s->wbio = BIO_pop(s->wbio); - assert(s->wbio != NULL); BIO_free(s->bbio); s->bbio = NULL; } diff --git a/deps/openssl/openssl/ssl/ssl_locl.h b/deps/openssl/openssl/ssl/ssl_locl.h index d86bd7e8e207..3c7c1a8e6483 100644 --- a/deps/openssl/openssl/ssl/ssl_locl.h +++ b/deps/openssl/openssl/ssl/ssl_locl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -164,6 +164,8 @@ (c)[1]=(unsigned char)(((l)>> 8)&0xff), \ (c)[2]=(unsigned char)(((l) )&0xff)),(c)+=3) +# define SSL_MAX_2_BYTE_LEN (0xffff) + /* * DTLS version numbers are strange because they're inverted. Except for * DTLS1_BAD_VER, which should be considered "lower" than the rest. @@ -347,6 +349,9 @@ /* we have used 0000003f - 26 bits left to go */ +# define SSL_IS_FIRST_HANDSHAKE(S) ((s)->s3->tmp.finish_md_len == 0 \ + || (s)->s3->tmp.peer_finish_md_len == 0) + /* Check if an SSL structure is using DTLS */ # define SSL_IS_DTLS(s) (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) /* See if we need explicit IV */ @@ -537,7 +542,7 @@ struct ssl_session_st { const SSL_CIPHER *cipher; unsigned long cipher_id; /* when ASN.1 loaded, this needs to be used to * load the 'cipher' structure */ - STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */ + STACK_OF(SSL_CIPHER) *ciphers; /* ciphers offered by the client */ CRYPTO_EX_DATA ex_data; /* application specific data */ /* * These are used to make removal of session-ids more efficient and to diff --git a/deps/openssl/openssl/ssl/ssl_mcnf.c b/deps/openssl/openssl/ssl/ssl_mcnf.c index c2d9dba64ac9..24742660e434 100644 --- a/deps/openssl/openssl/ssl/ssl_mcnf.c +++ b/deps/openssl/openssl/ssl/ssl_mcnf.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,148 +11,35 @@ #include #include #include "ssl_locl.h" +#include "internal/sslconf.h" /* SSL library configuration module. */ -struct ssl_conf_name { - /* Name of this set of commands */ - char *name; - /* List of commands */ - struct ssl_conf_cmd *cmds; - /* Number of commands */ - size_t cmd_count; -}; - -struct ssl_conf_cmd { - /* Command */ - char *cmd; - /* Argument */ - char *arg; -}; - -static struct ssl_conf_name *ssl_names; -static size_t ssl_names_count; - -static void ssl_module_free(CONF_IMODULE *md) -{ - size_t i, j; - if (ssl_names == NULL) - return; - for (i = 0; i < ssl_names_count; i++) { - struct ssl_conf_name *tname = ssl_names + i; - OPENSSL_free(tname->name); - for (j = 0; j < tname->cmd_count; j++) { - OPENSSL_free(tname->cmds[j].cmd); - OPENSSL_free(tname->cmds[j].arg); - } - OPENSSL_free(tname->cmds); - } - OPENSSL_free(ssl_names); - ssl_names = NULL; - ssl_names_count = 0; -} - -static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf) -{ - size_t i, j, cnt; - int rv = 0; - const char *ssl_conf_section; - STACK_OF(CONF_VALUE) *cmd_lists; - ssl_conf_section = CONF_imodule_get_value(md); - cmd_lists = NCONF_get_section(cnf, ssl_conf_section); - if (sk_CONF_VALUE_num(cmd_lists) <= 0) { - if (cmd_lists == NULL) - SSLerr(SSL_F_SSL_MODULE_INIT, SSL_R_SSL_SECTION_NOT_FOUND); - else - SSLerr(SSL_F_SSL_MODULE_INIT, SSL_R_SSL_SECTION_EMPTY); - ERR_add_error_data(2, "section=", ssl_conf_section); - goto err; - } - cnt = sk_CONF_VALUE_num(cmd_lists); - ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt); - ssl_names_count = cnt; - for (i = 0; i < ssl_names_count; i++) { - struct ssl_conf_name *ssl_name = ssl_names + i; - CONF_VALUE *sect = sk_CONF_VALUE_value(cmd_lists, i); - STACK_OF(CONF_VALUE) *cmds = NCONF_get_section(cnf, sect->value); - if (sk_CONF_VALUE_num(cmds) <= 0) { - if (cmds == NULL) - SSLerr(SSL_F_SSL_MODULE_INIT, - SSL_R_SSL_COMMAND_SECTION_NOT_FOUND); - else - SSLerr(SSL_F_SSL_MODULE_INIT, SSL_R_SSL_COMMAND_SECTION_EMPTY); - ERR_add_error_data(4, "name=", sect->name, ", value=", sect->value); - goto err; - } - ssl_name->name = BUF_strdup(sect->name); - if (ssl_name->name == NULL) - goto err; - cnt = sk_CONF_VALUE_num(cmds); - ssl_name->cmds = OPENSSL_zalloc(cnt * sizeof(struct ssl_conf_cmd)); - if (ssl_name->cmds == NULL) - goto err; - ssl_name->cmd_count = cnt; - for (j = 0; j < cnt; j++) { - const char *name; - CONF_VALUE *cmd_conf = sk_CONF_VALUE_value(cmds, j); - struct ssl_conf_cmd *cmd = ssl_name->cmds + j; - /* Skip any initial dot in name */ - name = strchr(cmd_conf->name, '.'); - if (name != NULL) - name++; - else - name = cmd_conf->name; - cmd->cmd = BUF_strdup(name); - cmd->arg = BUF_strdup(cmd_conf->value); - if (cmd->cmd == NULL || cmd->arg == NULL) - goto err; - } - - } - rv = 1; - err: - if (rv == 0) - ssl_module_free(md); - return rv; -} - void SSL_add_ssl_module(void) { - CONF_module_add("ssl_conf", ssl_module_init, ssl_module_free); -} - -static const struct ssl_conf_name *ssl_name_find(const char *name) -{ - size_t i; - const struct ssl_conf_name *nm; - if (name == NULL) - return NULL; - for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) { - if (strcmp(nm->name, name) == 0) - return nm; - } - return NULL; + /* Just load all of the crypto builtin modules. This includes the SSL one */ + OPENSSL_load_builtin_modules(); } static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name) { SSL_CONF_CTX *cctx = NULL; - size_t i; + size_t i, idx, cmd_count; int rv = 0; unsigned int flags; const SSL_METHOD *meth; - const struct ssl_conf_name *nm; - struct ssl_conf_cmd *cmd; + const SSL_CONF_CMD *cmds; + if (s == NULL && ctx == NULL) { SSLerr(SSL_F_SSL_DO_CONFIG, ERR_R_PASSED_NULL_PARAMETER); goto err; } - nm = ssl_name_find(name); - if (nm == NULL) { + if (!conf_ssl_name_find(name, &idx)) { SSLerr(SSL_F_SSL_DO_CONFIG, SSL_R_INVALID_CONFIGURATION_NAME); ERR_add_error_data(2, "name=", name); goto err; } + cmds = conf_ssl_get(idx, &name, &cmd_count); cctx = SSL_CONF_CTX_new(); if (cctx == NULL) goto err; @@ -170,15 +57,18 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name) if (meth->ssl_connect != ssl_undefined_function) flags |= SSL_CONF_FLAG_CLIENT; SSL_CONF_CTX_set_flags(cctx, flags); - for (i = 0, cmd = nm->cmds; i < nm->cmd_count; i++, cmd++) { - rv = SSL_CONF_cmd(cctx, cmd->cmd, cmd->arg); + for (i = 0; i < cmd_count; i++) { + char *cmdstr, *arg; + + conf_ssl_get_cmd(cmds, i, &cmdstr, &arg); + rv = SSL_CONF_cmd(cctx, cmdstr, arg); if (rv <= 0) { if (rv == -2) SSLerr(SSL_F_SSL_DO_CONFIG, SSL_R_UNKNOWN_COMMAND); else SSLerr(SSL_F_SSL_DO_CONFIG, SSL_R_BAD_VALUE); - ERR_add_error_data(6, "section=", name, ", cmd=", cmd->cmd, - ", arg=", cmd->arg); + ERR_add_error_data(6, "section=", name, ", cmd=", cmdstr, + ", arg=", arg); goto err; } } diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c index 0dea8b52242a..926b55c7ba2b 100644 --- a/deps/openssl/openssl/ssl/ssl_sess.c +++ b/deps/openssl/openssl/ssl/ssl_sess.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -734,11 +734,11 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) if (lck) CRYPTO_THREAD_unlock(ctx->lock); - if (ret) - SSL_SESSION_free(r); - if (ctx->remove_session_cb != NULL) ctx->remove_session_cb(ctx, c); + + if (ret) + SSL_SESSION_free(r); } else ret = 0; return (ret); diff --git a/deps/openssl/openssl/ssl/ssl_txt.c b/deps/openssl/openssl/ssl/ssl_txt.c index dbbf9d9e8d8b..f149a3ad0915 100644 --- a/deps/openssl/openssl/ssl/ssl_txt.c +++ b/deps/openssl/openssl/ssl/ssl_txt.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -70,18 +70,18 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) if (x->cipher == NULL) { if (((x->cipher_id) & 0xff000000) == 0x02000000) { - if (BIO_printf - (bp, " Cipher : %06lX\n", x->cipher_id & 0xffffff) <= 0) + if (BIO_printf(bp, " Cipher : %06lX\n", + x->cipher_id & 0xffffff) <= 0) goto err; } else { - if (BIO_printf - (bp, " Cipher : %04lX\n", x->cipher_id & 0xffff) <= 0) + if (BIO_printf(bp, " Cipher : %04lX\n", + x->cipher_id & 0xffff) <= 0) goto err; } } else { - if (BIO_printf - (bp, " Cipher : %s\n", - ((x->cipher == NULL) ? "unknown" : x->cipher->name)) <= 0) + if (BIO_printf(bp, " Cipher : %s\n", + ((x->cipher->name == NULL) ? "unknown" + : x->cipher->name)) <= 0) goto err; } if (BIO_puts(bp, " Session-ID: ") <= 0) diff --git a/deps/openssl/openssl/ssl/statem/README b/deps/openssl/openssl/ssl/statem/README index 4467bd1e5889..145c69db8d54 100644 --- a/deps/openssl/openssl/ssl/statem/README +++ b/deps/openssl/openssl/ssl/statem/README @@ -60,3 +60,4 @@ Conceptually the state machine component is designed as follows: | Non core functions common | | Non core functions common to | | to both servers and clients | | both DTLS servers and clients | |_____________________________| |_______________________________| + diff --git a/deps/openssl/openssl/ssl/statem/statem.c b/deps/openssl/openssl/ssl/statem/statem.c index b91ec0a360a3..69bb40f00e11 100644 --- a/deps/openssl/openssl/ssl/statem/statem.c +++ b/deps/openssl/openssl/ssl/statem/statem.c @@ -556,10 +556,8 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) * Validate that we are allowed to move to the new state and move * to that state if so */ - if (!transition(s, mt)) { - ossl_statem_set_error(s); + if (!transition(s, mt)) return SUB_STATE_ERROR; - } if (s->s3->tmp.message_size > max_message_size(s)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); diff --git a/deps/openssl/openssl/ssl/statem/statem_clnt.c b/deps/openssl/openssl/ssl/statem/statem_clnt.c index 6fa3f1db6702..ed993553c56e 100644 --- a/deps/openssl/openssl/ssl/statem/statem_clnt.c +++ b/deps/openssl/openssl/ssl/statem/statem_clnt.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -265,6 +265,21 @@ int ossl_statem_client_read_transition(SSL *s, int mt) err: /* No valid transition found */ + if (SSL_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) { + BIO *rbio; + + /* + * CCS messages don't have a message sequence number so this is probably + * because of an out-of-order CCS. We'll just drop it. + */ + s->init_num = 0; + s->rwstate = SSL_READING; + rbio = SSL_get_rbio(s); + BIO_clear_retry_flags(rbio); + BIO_set_retry_read(rbio); + return 0; + } + ossl_statem_set_error(s); ssl3_send_alert(s, SSL3_AL_FATAL, SSL3_AD_UNEXPECTED_MESSAGE); SSLerr(SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION, SSL_R_UNEXPECTED_MESSAGE); return 0; diff --git a/deps/openssl/openssl/ssl/statem/statem_dtls.c b/deps/openssl/openssl/ssl/statem/statem_dtls.c index 6b80620ee9c5..5b3442544536 100644 --- a/deps/openssl/openssl/ssl/statem/statem_dtls.c +++ b/deps/openssl/openssl/ssl/statem/statem_dtls.c @@ -493,7 +493,8 @@ static int dtls1_retrieve_buffered_fragment(SSL *s, int *ok) al = dtls1_preprocess_fragment(s, &frag->msg_header); - if (al == 0) { /* no alert */ + /* al will be 0 if no alert */ + if (al == 0 && frag->msg_header.frag_len > 0) { unsigned char *p = (unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH; memcpy(&p[frag->msg_header.frag_off], frag->fragment, diff --git a/deps/openssl/openssl/ssl/statem/statem_lib.c b/deps/openssl/openssl/ssl/statem/statem_lib.c index 36d410bdf778..eba4c6fb4011 100644 --- a/deps/openssl/openssl/ssl/statem/statem_lib.c +++ b/deps/openssl/openssl/ssl/statem/statem_lib.c @@ -299,6 +299,15 @@ WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst) s->ctx->stats.sess_accept_good++; s->handshake_func = ossl_statem_accept; + + if (SSL_IS_DTLS(s) && !s->hit) { + /* + * We are finishing after the client. We start the timer going + * in case there are any retransmits of our final flight + * required. + */ + dtls1_start_timer(s); + } } else { ssl_update_cache(s, SSL_SESS_CACHE_CLIENT); if (s->hit) @@ -306,6 +315,15 @@ WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst) s->handshake_func = ossl_statem_connect; s->ctx->stats.sess_connect_good++; + + if (SSL_IS_DTLS(s) && s->hit) { + /* + * We are finishing after the server. We start the timer going + * in case there are any retransmits of our final flight + * required. + */ + dtls1_start_timer(s); + } } if (s->info_callback != NULL) @@ -1073,6 +1091,13 @@ int ssl_set_client_hello_version(SSL *s) { int ver_min, ver_max, ret; + /* + * In a renegotiation we always send the same client_version that we sent + * last time, regardless of which version we eventually negotiated. + */ + if (!SSL_IS_FIRST_HANDSHAKE(s)) + return 0; + ret = ssl_get_client_min_max_version(s, &ver_min, &ver_max); if (ret != 0) diff --git a/deps/openssl/openssl/ssl/statem/statem_srvr.c b/deps/openssl/openssl/ssl/statem/statem_srvr.c index c7cd9eb662d4..f81fa5e19943 100644 --- a/deps/openssl/openssl/ssl/statem/statem_srvr.c +++ b/deps/openssl/openssl/ssl/statem/statem_srvr.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -213,6 +213,21 @@ int ossl_statem_server_read_transition(SSL *s, int mt) } /* No valid transition found */ + if (SSL_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) { + BIO *rbio; + + /* + * CCS messages don't have a message sequence number so this is probably + * because of an out-of-order CCS. We'll just drop it. + */ + s->init_num = 0; + s->rwstate = SSL_READING; + rbio = SSL_get_rbio(s); + BIO_clear_retry_flags(rbio); + BIO_set_retry_read(rbio); + return 0; + } + ossl_statem_set_error(s); ssl3_send_alert(s, SSL3_AL_FATAL, SSL3_AD_UNEXPECTED_MESSAGE); SSLerr(SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION, SSL_R_UNEXPECTED_MESSAGE); return 0; @@ -1698,6 +1713,12 @@ int tls_construct_server_key_exchange(SSL *s) } dh = EVP_PKEY_get0_DH(s->s3->tmp.pkey); + if (dh == NULL) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto err; + } EVP_PKEY_free(pkdh); pkdh = NULL; @@ -1985,6 +2006,11 @@ int tls_construct_certificate_request(SSL *s) const unsigned char *psigs; unsigned char *etmp = p; nl = tls12_get_psigalgs(s, 1, &psigs); + if (nl > SSL_MAX_2_BYTE_LEN) { + SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST, + SSL_R_LENGTH_TOO_LONG); + goto err; + } /* Skip over length for now */ p += 2; nl = tls12_copy_sigalgs(s, p, psigs, nl); @@ -2004,6 +2030,11 @@ int tls_construct_certificate_request(SSL *s) for (i = 0; i < sk_X509_NAME_num(sk); i++) { name = sk_X509_NAME_value(sk, i); j = i2d_X509_NAME(name, NULL); + if (j > SSL_MAX_2_BYTE_LEN) { + SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST, + SSL_R_LENGTH_TOO_LONG); + goto err; + } if (!BUF_MEM_grow_clean(buf, SSL_HM_HEADER_LENGTH(s) + n + j + 2)) { SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST, ERR_R_BUF_LIB); goto err; @@ -2013,6 +2044,11 @@ int tls_construct_certificate_request(SSL *s) i2d_X509_NAME(name, &p); n += 2 + j; nl += 2 + j; + if (nl > SSL_MAX_2_BYTE_LEN) { + SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST, + SSL_R_LENGTH_TOO_LONG); + goto err; + } } } /* else no CA names */ @@ -2303,13 +2339,12 @@ static int tls_process_cke_dhe(SSL *s, PACKET *pkt, int *al) SSLerr(SSL_F_TLS_PROCESS_CKE_DHE, SSL_R_BN_LIB); goto err; } + cdh = EVP_PKEY_get0_DH(ckey); pub_key = BN_bin2bn(data, i, NULL); - - if (pub_key == NULL || !DH_set0_key(cdh, pub_key, NULL)) { + if (pub_key == NULL || cdh == NULL || !DH_set0_key(cdh, pub_key, NULL)) { SSLerr(SSL_F_TLS_PROCESS_CKE_DHE, ERR_R_INTERNAL_ERROR); - if (pub_key != NULL) - BN_free(pub_key); + BN_free(pub_key); goto err; } diff --git a/deps/openssl/openssl/ssl/t1_lib.c b/deps/openssl/openssl/ssl/t1_lib.c index 7a5721a1e213..95711fb6df87 100644 --- a/deps/openssl/openssl/ssl/t1_lib.c +++ b/deps/openssl/openssl/ssl/t1_lib.c @@ -408,7 +408,7 @@ int tls1_set_curves(unsigned char **pext, size_t *pextlen, return 1; } -# define MAX_CURVELIST 28 +# define MAX_CURVELIST OSSL_NELEM(nid_list) typedef struct { size_t nidcnt; @@ -490,13 +490,16 @@ static int tls1_set_ec_id(unsigned char *curve_id, unsigned char *comp_id, return 1; } +# define DONT_CHECK_OWN_GROUPS 0 +# define CHECK_OWN_GROUPS 1 /* Check an EC key is compatible with extensions */ -static int tls1_check_ec_key(SSL *s, - unsigned char *curve_id, unsigned char *comp_id) +static int tls1_check_ec_key(SSL *s, unsigned char *curve_id, + unsigned char *comp_id, int check_own_groups) { const unsigned char *pformats, *pcurves; size_t num_formats, num_curves, i; int j; + /* * If point formats extension present check it, otherwise everything is * supported (see RFC4492). @@ -513,8 +516,12 @@ static int tls1_check_ec_key(SSL *s, } if (!curve_id) return 1; + + if (!s->server && !check_own_groups) + return 1; + /* Check curve is consistent with client and server preferences */ - for (j = 0; j <= 1; j++) { + for (j = check_own_groups ? 0 : 1; j <= 1; j++) { if (!tls1_get_curvelist(s, j, &pcurves, &num_curves)) return 0; if (j == 1 && num_curves == 0) { @@ -579,9 +586,12 @@ static int tls1_check_cert_param(SSL *s, X509 *x, int set_ee_md) return 0; /* * Can't check curve_id for client certs as we don't have a supported - * curves extension. + * curves extension. For server certs we will tolerate certificates that + * aren't in our own list of curves. If we've been configured to use an EC + * cert then we should use it - therefore we use DONT_CHECK_OWN_GROUPS here. */ - rv = tls1_check_ec_key(s, s->server ? curve_id : NULL, &comp_id); + rv = tls1_check_ec_key(s, s->server ? curve_id : NULL, &comp_id, + DONT_CHECK_OWN_GROUPS); if (!rv) return 0; /* @@ -644,7 +654,7 @@ int tls1_check_ec_tmp_key(SSL *s, unsigned long cid) return 0; curve_id[0] = 0; /* Check this curve is acceptable */ - if (!tls1_check_ec_key(s, curve_id, NULL)) + if (!tls1_check_ec_key(s, curve_id, NULL, CHECK_OWN_GROUPS)) return 0; return 1; } @@ -746,8 +756,9 @@ size_t tls12_get_psigalgs(SSL *s, int sent, const unsigned char **psigs) } /* - * Check signature algorithm is consistent with sent supported signature - * algorithms and if so return relevant digest. + * Check signature algorithm received from the peer with a signature is + * consistent with the sent supported signature algorithms and if so return + * relevant digest. */ int tls12_check_peer_sigalg(const EVP_MD **pmd, SSL *s, const unsigned char *sig, EVP_PKEY *pkey) @@ -769,7 +780,8 @@ int tls12_check_peer_sigalg(const EVP_MD **pmd, SSL *s, /* Check compression and curve matches extensions */ if (!tls1_set_ec_id(curve_id, &comp_id, EVP_PKEY_get0_EC_KEY(pkey))) return 0; - if (!s->server && !tls1_check_ec_key(s, curve_id, &comp_id)) { + if (!s->server && !tls1_check_ec_key(s, curve_id, &comp_id, + CHECK_OWN_GROUPS)) { SSLerr(SSL_F_TLS12_CHECK_PEER_SIGALG, SSL_R_WRONG_CURVE); return 0; } @@ -2144,6 +2156,10 @@ static int ssl_scan_clienthello_tlsext(SSL *s, PACKET *pkt, int *al) } } } else if (type == TLSEXT_TYPE_status_request) { + /* Ignore this if resuming */ + if (s->hit) + continue; + if (!PACKET_get_1(&extension, (unsigned int *)&s->tlsext_status_type)) { return 0; @@ -2784,7 +2800,7 @@ int tls1_set_server_sigalgs(SSL *s) if (!s->cert->shared_sigalgs) { SSLerr(SSL_F_TLS1_SET_SERVER_SIGALGS, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS); - al = SSL_AD_ILLEGAL_PARAMETER; + al = SSL_AD_HANDSHAKE_FAILURE; goto err; } } else { @@ -4125,13 +4141,16 @@ DH *ssl_get_auto_dh(SSL *s) if (dhp == NULL) return NULL; g = BN_new(); - if (g != NULL) - BN_set_word(g, 2); + if (g == NULL || !BN_set_word(g, 2)) { + DH_free(dhp); + BN_free(g); + return NULL; + } if (dh_secbits >= 192) p = BN_get_rfc3526_prime_8192(NULL); else p = BN_get_rfc3526_prime_3072(NULL); - if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) { + if (p == NULL || !DH_set0_pqg(dhp, p, NULL, g)) { DH_free(dhp); BN_free(p); BN_free(g); @@ -4172,6 +4191,9 @@ static int ssl_security_cert_sig(SSL *s, SSL_CTX *ctx, X509 *x, int op) if ((X509_get_extension_flags(x) & EXFLAG_SS) != 0) return 1; sig_nid = X509_get_signature_nid(x); + /* We are not able to look up the CA MD for RSA PSS in this version */ + if (sig_nid == NID_rsassaPss) + return 1; if (sig_nid && OBJ_find_sigid_algs(sig_nid, &md_nid, NULL)) { const EVP_MD *md; if (md_nid && (md = EVP_get_digestbynid(md_nid))) diff --git a/deps/openssl/openssl/ssl/t1_trce.c b/deps/openssl/openssl/ssl/t1_trce.c index 76bdf792ae3b..588cb8cc3d8f 100644 --- a/deps/openssl/openssl/ssl/t1_trce.c +++ b/deps/openssl/openssl/ssl/t1_trce.c @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -725,6 +725,8 @@ static int ssl_print_extensions(BIO *bio, int indent, int server, BIO_puts(bio, "No Extensions\n"); return 1; } + if (msglen < 2) + return 0; extslen = (msg[0] << 8) | msg[1]; if (extslen != msglen - 2) return 0; @@ -1092,6 +1094,8 @@ static int ssl_print_cert_request(BIO *bio, int indent, SSL *s, msglen -= xlen + 2; skip_sig: + if (msglen < 2) + return 0; xlen = (msg[0] << 8) | msg[1]; BIO_indent(bio, indent, 80); if (msglen < xlen + 2) @@ -1271,7 +1275,16 @@ void SSL_trace(int write_p, int version, int content_type, switch (content_type) { case SSL3_RT_HEADER: { - int hvers = msg[1] << 8 | msg[2]; + int hvers; + + /* avoid overlapping with length at the end of buffer */ + if (msglen < (size_t)(SSL_IS_DTLS(ssl) ? + DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH)) { + BIO_puts(bio, write_p ? "Sent" : "Received"); + ssl_print_hex(bio, 0, " too short message", msg, msglen); + break; + } + hvers = msg[1] << 8 | msg[2]; BIO_puts(bio, write_p ? "Sent" : "Received"); BIO_printf(bio, " Record\nHeader:\n Version = %s (0x%x)\n", ssl_trace_str(hvers, ssl_version_tbl), hvers); diff --git a/deps/openssl/openssl/test/README b/deps/openssl/openssl/test/README index b1222399f7b7..ef39d38ac97c 100644 --- a/deps/openssl/openssl/test/README +++ b/deps/openssl/openssl/test/README @@ -38,9 +38,9 @@ A recipe that just runs a test executable A script that just runs a program looks like this: #! /usr/bin/perl - + use OpenSSL::Test::Simple; - + simple_test("test_{name}", "{name}test", "{name}"); {name} is the unique name you have chosen for your test. @@ -62,28 +62,28 @@ documentation. For OpenSSL::Test, do `perldoc test/testlib/OpenSSL/Test.pm'. A script to start from could be this: #! /usr/bin/perl - + use strict; use warnings; use OpenSSL::Test; - + setup("test_{name}"); - + plan tests => 2; # The number of tests being performed - + ok(test1, "test1"); ok(test2, "test1"); - + sub test1 { # test feature 1 } - + sub test2 { # test feature 2 } - + Changes to test/Makefile ======================== diff --git a/deps/openssl/openssl/test/bioprinttest.c b/deps/openssl/openssl/test/bioprinttest.c index d8bb2c2e349a..b2d26225e52c 100644 --- a/deps/openssl/openssl/test/bioprinttest.c +++ b/deps/openssl/openssl/test/bioprinttest.c @@ -221,3 +221,5 @@ int main(int argc, char **argv) } return 0; } + + diff --git a/deps/openssl/openssl/test/build.info b/deps/openssl/openssl/test/build.info index c262248b6f27..d850b5229cee 100644 --- a/deps/openssl/openssl/test/build.info +++ b/deps/openssl/openssl/test/build.info @@ -1,5 +1,6 @@ IF[{- !$disabled{tests} -}] PROGRAMS_NO_INST=\ + versions \ aborttest \ sanitytest exdatatest bntest \ ectest ecdsatest gmdifftest pbelutest ideatest \ @@ -17,7 +18,11 @@ IF[{- !$disabled{tests} -}] dtlsv1listentest ct_test threadstest afalgtest d2i_test \ ssl_test_ctx_test ssl_test x509aux cipherlist_test asynciotest \ bioprinttest sslapitest dtlstest sslcorrupttest bio_enc_test \ - ocspapitest fatalerrtest + ocspapitest fatalerrtest x509_time_test x509_dup_cert_test errtest + + SOURCE[versions]=versions.c + INCLUDE[versions]=../include + DEPEND[versions]=../libcrypto SOURCE[aborttest]=aborttest.c INCLUDE[aborttest]=../include @@ -292,11 +297,23 @@ IF[{- !$disabled{tests} -}] INCLUDE[bio_enc_test]=../include DEPEND[bio_enc_test]=../libcrypto + SOURCE[x509_time_test]=x509_time_test.c testutil.c + INCLUDE[x509_time_test]=.. ../include + DEPEND[x509_time_test]=../libcrypto + + SOURCE[x509_dup_cert_test]=x509_dup_cert_test.c + INCLUDE[x509_dup_cert_test]=../include + DEPEND[x509_dup_cert_test]=../libcrypto + IF[{- !$disabled{shared} -}] PROGRAMS_NO_INST=shlibloadtest SOURCE[shlibloadtest]=shlibloadtest.c INCLUDE[shlibloadtest]=../include ENDIF + + SOURCE[errtest]=errtest.c testutil.c + INCLUDE[errtest]=../include + DEPEND[errtest]=../libcrypto ENDIF {- diff --git a/deps/openssl/openssl/test/certs/alt1-cert.pem b/deps/openssl/openssl/test/certs/alt1-cert.pem index b94d0eaf9ddd..d68b0e519305 100644 --- a/deps/openssl/openssl/test/certs/alt1-cert.pem +++ b/deps/openssl/openssl/test/certs/alt1-cert.pem @@ -1,22 +1,21 @@ -----BEGIN CERTIFICATE----- -MIIDlTCCAn2gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 -IE5DIENBIDEwIBcNMTYwNzA5MTQ0ODExWhgPMjExNjA3MTAxNDQ4MTFaMGgxIzAh -BgNVBAoMGkdvb2QgTkMgVGVzdCBDZXJ0aWZpY2F0ZSAxMRUwEwYDVQQDDAx3d3cu -Z29vZC5vcmcxEzARBgNVBAMMCkpvZSBCbG9nZ3MxFTATBgNVBAMMDGFueS5nb29k -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALAv1X8S8uUpnjTa -3bv7m1jJbbX7bC9w7k4TfxiU5XL/m3EhN//EUBJSoamy6vFC6oy/6jA8XmptlVrY -Sp3ZKFdjdZh+CyYZKcrv4JReF2lfRIINn6d6EgcAobGTNwdcv67xuNtMi0meAvmK -gLjOa/IhCHNC+l8vNDJx/a+7mxH+yNxPL6lC/kJMja6oaYndx74WJpPC22LJ/cCp -xspKKsoPYYjk0BX9RvbKO8s4b86Wjzzntht+NpQ4LLh9XwPZog11qGE4UIrsV8XA -YxJrMGQNZd69cnCOz8vnOVCszFOa4qVvXeAGr0iFlZAXbQJevpiiXaXHMEt8C1qH -xpcW8DcCAwEAAaOBmDCBlTAdBgNVHQ4EFgQUw8nB25NP0gUaFCrOwAO5KzllnREw -HwYDVR0jBBgwFoAUCNGb+ebVZHCg8Wsanu1S2t31UEMwCQYDVR0TBAIwADBIBgNV -HREEQTA/ggx3d3cuZ29vZC5vcmeCDGFueS5nb29kLmNvbYENZ29vZEBnb29kLm9y -Z4EMYW55QGdvb2QuY29thwTAqAABMA0GCSqGSIb3DQEBCwUAA4IBAQBUnDMrg1py -8/iYXzs11Qbw7bBhc/HQDpu5QVgriaX2zDUpTLSEUV7qZFSHmwWm91ILw2VA1Xni -ua2sF19o/tJT0ZHpapkfqGpfsym2H04NDMKy0l0fSZhlCB5Kv5wpiFt9hBUrxS/2 -Dd6Kg+Ka02nD5QBXSAk/xz0FmgezzGGCLjg85/Sfe9Y7tNhQXh3HuGXuJizYccdQ -Fh1IAFYW3DZoDKS7dDTCltvDEma/2IE684+CRJiA6PH9rYfJ1CCUfAMpyA85CxKT -P68GDKI++WoUgM8LDfxS0KOL7A9cqcpM2L27hjyEgnqIBPHFfm9fxztBotuCTl5L -vRlTFVjv65nn +MIIDgTCCAmmgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 +IE5DIENBIDEwIBcNMTgwNTE2MDIzODEzWhgPMjExODA1MTcwMjM4MTNaMFQxIzAh +BgNVBAoMGkdvb2QgTkMgVGVzdCBDZXJ0aWZpY2F0ZSAxMRgwFgYDVQQDDA93d3cu +ZXhhbXBsZS5uZXQxEzARBgNVBAMMCkpvZSBCbG9nZ3MwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDTqvf6j+WxCtn4RU8/6uXXgCTcksv6NDXCZ9JAz4Vv +cQbJfhFbDWpGZQZDOCqwtj+7CSVIraxItHzPlrt36cevsoPmpuqGbHrUaOLneme2 +x81SXUq0z/DmDvwxVENmRj1u7iCt3sL7awcid4SiotLOY2F1jBazmqprqKZBUiyQ +XqpSp+9uSav77ydwDXCrQozBdns1YRshgU9omQrTcIqHCj1f9Lo+A2y4+TZYZkvS +DuUZiTfPTPouR6sopM8JLyAZc+TvFFncEg24N+zz3O3jwH82BZEjzavw92J9npJB +UXvKb8O9z7UA65WYuL2he7kSQCsPNLoRWZnVpchwr3VHAgMBAAGjgZgwgZUwHQYD +VR0OBBYEFHvLhGWckFjVXdDI3ds9Wti6zgXAMB8GA1UdIwQYMBaAFAjRm/nm1WRw +oPFrGp7tUtrd9VBDMAkGA1UdEwQCMAAwSAYDVR0RBEEwP4IMd3d3Lmdvb2Qub3Jn +ggxhbnkuZ29vZC5jb22BDWdvb2RAZ29vZC5vcmeBDGFueUBnb29kLmNvbYcEwKgA +ATANBgkqhkiG9w0BAQsFAAOCAQEATVcTyrAxsehdQNrkL6kquXxWlyegJcxvVxUe +hfh9+Lw4620b2S1/l2YxFM3peLAsRgJOznmJOeG18+y7/kx/3UNqYGY7e8iJQ3Gl +JwDIJp5JCaUOlodjhMJtRc7jn9RcsL97oizXdcryyWT0vSlM9Pie9NtHG5iq5X4+ +oL3X8+OG25MOkF2h3YVCEG3vDu7quyTlHc2ebwpdLZRndcOewO2Cap1ettyWXUPP +Mha6wyJE8LJhrGmrI8Lw+i7gGscP0xYZn3yCLk5BtOabn4dvCiDmb+TPruKQQARw +BG45LEZzGxz+Ad3xRdZyVi1I67v9YShoYTCpMTSxJaR0erH74g== -----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/certs/alt1-key.pem b/deps/openssl/openssl/test/certs/alt1-key.pem index b5d4d326c55a..6df050a38f3a 100644 --- a/deps/openssl/openssl/test/certs/alt1-key.pem +++ b/deps/openssl/openssl/test/certs/alt1-key.pem @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCwL9V/EvLlKZ40 -2t27+5tYyW21+2wvcO5OE38YlOVy/5txITf/xFASUqGpsurxQuqMv+owPF5qbZVa -2Eqd2ShXY3WYfgsmGSnK7+CUXhdpX0SCDZ+nehIHAKGxkzcHXL+u8bjbTItJngL5 -ioC4zmvyIQhzQvpfLzQycf2vu5sR/sjcTy+pQv5CTI2uqGmJ3ce+FiaTwttiyf3A -qcbKSirKD2GI5NAV/Ub2yjvLOG/Olo8857YbfjaUOCy4fV8D2aINdahhOFCK7FfF -wGMSazBkDWXevXJwjs/L5zlQrMxTmuKlb13gBq9IhZWQF20CXr6Yol2lxzBLfAta -h8aXFvA3AgMBAAECggEAa073DcqQvhq3DSIw4wm/+DfW5nwXzF1QB6XAR0yI453j -IuhEnzcGPeKuLBmZFxDWoptRG8fpCZFs4kPSTomxFGizewlp6O5ykfPAKR2VzMwF -geCiWPL0f+dWlD1Byu4moXsASDE6tL/UuAAvnl+7R2HvL6SfsdGiTQc4qAvvyukM -szks+MePHSlXmL5Eld7HfKgpvxY1SbYOQU0aPXAQAnLaOT931q+tgZMG6nBWN+pu -w5bgKCA26BMAAaUAdIIDEa9fjzkpXjElCT4qhJYVKQn9Pb7aSc4jihSpCknqbb9c -55nW5PWMZJyCbCOUG/SVTblXV+NmhdtwrgUbHImXIQKBgQDcb/7vp+rq06uNx3b4 -AjTZdzCVbHM8gp7b1GkGD0SncrzX6RxPSzNn7d4AUKY065bwa89A+TRwV8DSo7G8 -hxjzdU/FKCg8ce0eqoCtWjIT2r+rV2P9dFhfRT5jdOwHrym8LeSGzANjIBNV7FOf -FIRkQ1BVD0QSPla+26ASqsw60wKBgQDMnEzChQWgAsBelALmGaj/wDdWDUXK8xRg -s7dG1Sx41SLk39SAjCUYXPyy8IHBitJtPZNDp23tR4/m8Ui1pB2T0EnlzBsuzrZ/ -0aCbJnQ08FXE8iVajrgce4ZCdT8vkeH8EVhqDpJIlAhoKy3HaoAr4o2/uRoGDpHZ -iAbDLTEOjQKBgFrp4dXLhkqFNArMShetKUjLLIFj8f7xzDzT1ODH6UO6QYI2xRM6 -65+gbd/pYzMOOvk7LYYZgXQX7RGyq3oaqcK3Dkg88KNFRUtRfLKCMYcYv9YVu8pr -cosQTtPMBBCDQI44yziA6aC3OOJGDpLcbmG/lWEPY762cSZUBCfOw147AoGAd8S+ -AdcPtdwmcrY9BCfdDuea/JoEUon7UaehDqtVvt0z8bk7kIt4Y0x69ttleL8j8aHr -g9yLsisDhvGR2BFa5t0zhHn3J20E0skINAlMWHieHAyJ5PpJtxJvQpOTCutf1sbo -dBxXcHiGe0NbJrGmmQmiY6mcHBOHOEgxfSoE3zkCgYAc+ozIr3xmUcooUeA7uqpd -LvGGqHThGrtXVFIErOIcajC9bHEeZw4Do/oT5L7Wr7pOZ20VUmuRvwytd7IYYTVV -g+nIyKaMttEaCzHEsO0CQUHexOkJbL4rpc3HiK5hIhL8Yo2L/obQgCxYmvyChpo3 -sXJAoFllBNfAK3aanFOR1Q== +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDTqvf6j+WxCtn4 +RU8/6uXXgCTcksv6NDXCZ9JAz4VvcQbJfhFbDWpGZQZDOCqwtj+7CSVIraxItHzP +lrt36cevsoPmpuqGbHrUaOLneme2x81SXUq0z/DmDvwxVENmRj1u7iCt3sL7awci +d4SiotLOY2F1jBazmqprqKZBUiyQXqpSp+9uSav77ydwDXCrQozBdns1YRshgU9o +mQrTcIqHCj1f9Lo+A2y4+TZYZkvSDuUZiTfPTPouR6sopM8JLyAZc+TvFFncEg24 +N+zz3O3jwH82BZEjzavw92J9npJBUXvKb8O9z7UA65WYuL2he7kSQCsPNLoRWZnV +pchwr3VHAgMBAAECggEACPTB+1sdV+lioaulF8pDoWOtq5uWf+a3o5sq/U0Kk1WP ++PSZnWWq6oGZyzxUKhf8CFjxt+qJUKY6Zbo2AnPk3B1MkXTclYV/iP9LIoo+WzCH +EoYaBB6MTd+ycg/jri8oqEnxHgo/681yhtXRyePj0ZHI7OVZjI3tyhJfvoHQmuci +u6qYYUP0GWuyM+kHS11vn6Q1U8nOZWvXpEDXDDdJ7+2QRuv01AXcjFxpbFzkMn2W +JkhKkCTIQpUU66VMRHwNexi+TR2rRESq0G+fa+6gaVFVIs0vBukq48IeC5W21j1L +zyftHxci67FlYC9iaiUxDVt3KB+lcukx6Cz5mjtzqQKBgQD/GrAtFfjiXKj9O5ld +K7dnnBHE8fzyWQWyOfwpVjNAC1J7tgwFvDpBpTHOwS5JnCwMWWM3rkBPRhCusmrF +AtfE8b643G+cJbTgDuEhGh11QR0p9VWMVFQL9kZxx12PegDtFBfzcfcI3XQwKVKL +ZbQn4ibW3BKSt9+Nh3APa0s5iwKBgQDUaTxZBajTdzoDd6Pg3warL5BhsxWr2tUQ +qf+iVoba2Y9NTBdxBht2whSaYweU9kxmeNZvnCu95B8HeRGE69Dxb7IWwpsaxoaf +ND0NcCF7aPZgx7hvhbHF7duzt3nuv+q5sOuuyHPzm+nF2snAuY3Zg+Bpv3nlYekf +18aXZdwStQKBgEpF8e9ei1UUl1sLZC6dUMvIw9+sePHye1cVzNYYM9m8sio0qbFt +ySRdvW+uDRT/dE+wItQOVsj95FOIvM9ZcYr0u4vFGnXDALOPgXqKyPLfn2cc9+hg +kQvei0oLOrFQWz6rcAHAN6WMHIz9KvxNAzPtg1NhRcMT5/Gj8jt7CK7bAoGAIeKz +7OO5Phr8F0eDzkDmGHMbDmr6XxMnAGSOUoCJPOqOMN+dsbsusHBfxw1bTUlJgONw +GhgI5l85EAEhaVoRWCLgfz8GbWwUV9uGjdlAjiZ9f4z9AFWMua2rae0wN4VIVd1C +i/yQeuF5lsXDf8paNcQTDeus74oCHcFXfhmS1S0CgYB2q8E+H0kFHbUxkIZYwhsM +r0lTecn+kVsyPPje2UlzfTwvcC9dFIC4ppCdJGUJAwi/PJnr6xNyOH6I1pjUA8ER +Aofm4Oj2DwX8W+81oO71/RXSfEFUjdOw0H6iRDyvWa1gqftj2/aWjV7Ifdo49thx +EzX/9GdsRInifN6FfOfo/A== -----END PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/certs/badalt6-cert.pem b/deps/openssl/openssl/test/certs/badalt6-cert.pem index fbe040b52c6a..f41568f6eefa 100644 --- a/deps/openssl/openssl/test/certs/badalt6-cert.pem +++ b/deps/openssl/openssl/test/certs/badalt6-cert.pem @@ -1,22 +1,21 @@ -----BEGIN CERTIFICATE----- -MIIDljCCAn6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 -IE5DIENBIDEwIBcNMTYwNzA5MTQ0ODExWhgPMjExNjA3MTAxNDQ4MTFaMGkxIjAg +MIIDeDCCAmCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 +IE5DIENBIDEwIBcNMTgwNTE2MDMyNjMyWhgPMjExODA1MTcwMzI2MzJaMGkxIjAg BgNVBAoMGUJhZCBOQyBUZXN0IENlcnRpZmljYXRlIDYxFzAVBgNVBAMMDm90aGVy Lmdvb2Qub3JnMRMwEQYDVQQDDApKb2UgQmxvZ2dzMRUwEwYDVQQDDAxhbnkuZ29v -ZC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKz8F/ndKz0vuv -BymjTUjtrWSQsnsuisR+oW8CIliNBi8yqqeNrtoa2s+e2GBC7gxDlK9IOqGo4Ulu -9jY5On6RysrFWLpK97I7EP9cg63alH+NRFEwczRzErHtYx54yiBjcovcCVeTtdnd -7/P4T8hIGy6QjdW68lzwnN/I9x11NWoipIKvAOGXz0L/WaPPWZ0GJFlBqEX//O3+ -6sweSUX4ivAC9txou3rwDA8kJx5Ge9trQ9dPPG/jpL96f1DLE9H2SkVff1KLTPmb -jUwiYj161lsKLxGkbdmPWRjt1pP4+5UUhioo1Y0WrTd5ELwB1eKTtWsOlRsdLOa8 -1L6m8ngXAgMBAAGjgZgwgZUwHQYDVR0OBBYEFBIKyD5bUUNIFxlQJl/rBvvIm0XZ -MB8GA1UdIwQYMBaAFAjRm/nm1WRwoPFrGp7tUtrd9VBDMAkGA1UdEwQCMAAwSAYD -VR0RBEEwP4IMd3d3Lmdvb2Qub3JnggxhbnkuZ29vZC5jb22BDWdvb2RAZ29vZC5v -cmeBDGFueUBnb29kLmNvbYcEwKgAATANBgkqhkiG9w0BAQsFAAOCAQEAa2lydA7a -YgRhYeIuPEtR+bKyDkIKNjvx2IRL/FL70s/IWFWDK1rpsMYLGNa7rWpW5gq4T6zb -JIwC/770Rw1p+0j9eAC95d2wCEhyNcLdoP4ch7whr0MhxYHUJ8zQGPdQ97DWGoEB -2seLjrhMrX004TM4UlM+lpjsb88QEcD+kOEhdDTKm0ABUygOr1KRay437mtUhAzb -WyUbAjKbhgyv6IFRNHKy6YtCMugPihn+Pd1NY6c2ACRVOAUS/+rvVyjxBCATW5Wk -zAtNIxYgcm3rYRroGYT2BGj8Ic7oqPOWPdGWhsieX0c+y2ZnS727Kwc5tXFfW9By -GH32QmEN5o5jZQ== +ZC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDl46xhstHmmYhp +XY/FcnQStR4XHtHcNRyvq1perl0fezeCY85KkddGppic5qIWQDL4ViP3HfvhMlDZ +E0tAjEfr8Auac9gpa2IFVJAzMnnzOkhO6cr5kmid4392tNCG5sUWS99t2Z4f9sOP +DQKdoN7lnmxnpZqNf9NUERsN5i4fcvErfQZ4LqV5ld810ZAQZUfarn1rg6/U/ADc +qA0uQgk9RxVgSDt3M5mi8AaC73Be9nAefXQUybzs6J8EfsDijhD85msxs4Fha4pg +gM+bXHv9C7whxM5F2WTeET0cIcAfE3+jzQlkjcjlS1rTEq4d0Pd+1rXkhMwZeze2 +KRL2Le8jAgMBAAGjezB5MB0GA1UdDgQWBBRJJljvheyfKr9neNplhIMIFx25QjAf +BgNVHSMEGDAWgBQI0Zv55tVkcKDxaxqe7VLa3fVQQzAJBgNVHRMEAjAAMCwGA1Ud +EQQlMCOBDWdvb2RAZ29vZC5vcmeBDGFueUBnb29kLmNvbYcEwKgAATANBgkqhkiG +9w0BAQsFAAOCAQEAPfRFkpkTsPlH54n/i3kxR8Hw17kUOV0/v39fnNzV+PXS/IIU +9OFfP7qNeuoWVQKXCwNWGWYXb7O0LNJMJQWWtyXtzWH3rOSxdSRIrTsCVHA41Lbo +te2nrfnGMtg6em51Do6Kk0JM304sVAWl5OY/eckBmuDgN/5WfZudOLd8Ohv8vZ6U +ZNoSBNpu1x5gfEPywMUGAgbkNZVpzNAfulx3/D2kWk0qwEKqnphUyaXiTVqO49gr +n1LwSVdqBcmapBmEO3puV4TBWFwM49iMMNGn0fp/JBVsLjt+q7TK96qGBo/BSEL+ +e2TXTNpdkn3l+ZK2FYdf7s8fytoe+6o92dN+fA== -----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/certs/badalt6-key.pem b/deps/openssl/openssl/test/certs/badalt6-key.pem index 203a4c7a0010..782d69334a40 100644 --- a/deps/openssl/openssl/test/certs/badalt6-key.pem +++ b/deps/openssl/openssl/test/certs/badalt6-key.pem @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDKz8F/ndKz0vuv -BymjTUjtrWSQsnsuisR+oW8CIliNBi8yqqeNrtoa2s+e2GBC7gxDlK9IOqGo4Ulu -9jY5On6RysrFWLpK97I7EP9cg63alH+NRFEwczRzErHtYx54yiBjcovcCVeTtdnd -7/P4T8hIGy6QjdW68lzwnN/I9x11NWoipIKvAOGXz0L/WaPPWZ0GJFlBqEX//O3+ -6sweSUX4ivAC9txou3rwDA8kJx5Ge9trQ9dPPG/jpL96f1DLE9H2SkVff1KLTPmb -jUwiYj161lsKLxGkbdmPWRjt1pP4+5UUhioo1Y0WrTd5ELwB1eKTtWsOlRsdLOa8 -1L6m8ngXAgMBAAECggEBAJNMHK8BAvzTqTPPsfAGu4bTvgxRdKGy609FFAiqxUF3 -UmQsCZEfgwyqCszFPfSeS43xuPRukObE6L6MV4ls8GwWqvp1nKfCClJX3/9jK6tq -2tDQ416a7Wb+FvfgW0tDEg7oLKfcqRyAoQFNuxWHbGDiTQlz2dzzFYkzhlzBDUYH -/pu9qkNFGfYMFwsBUd8pp8zMnv552CCIgalBBFr1hy9q47HBaJPaF2/CjZJmsqkp -rVMBH7+j0y1DW3JO5rSKcRdz+mgEd9m/yQIazvBPJKxeGza8JfLBuACYFLIoO1S+ -b8s/zmQPHeZwTxSsM64M1uYi4dmJy0viozLlWsjrE1ECgYEA/GxGG/lB1mL+Hzmc -kXzWmA2nLPxZXGxMBOYH/n8l4OyDmKi2Bmly7kS0kLdY6gYTVBWFCRcvPxf+UJu9 -x4NcKDkjXVXSg7Muux3Bh1JoRCOKB2Hk3pqdDe55GcT5bSikkd5PYCNobcnqzSK1 -HzKveDdukraZxIPFpVs1VM9/gxMCgYEAza+BJUAEWoq925a1RKlMwdXW1ONBhFqU -fXon15fgycHkiYIBGbGE65Oyz8BwE6jNAT+SwKlNCc6jPAkXvEUpczEi5Rcox8Ec -hNoXBHcBxHEhtfV2VKX5I9JFAadmvnfS5St7HjRLzE2Y6xym1+fKfnAlSLpdb3W2 -eRqVBi3F020CgYEA6K/yrQTHwRX+BdC42JCIzSAA1IJG6eDW7skR43NX+pBr+sTD -DwQTszrYbHLnXst888zmluutXO8EO1Bl0E3yHQ4W4IolhcweLtUOOm0nunA8Y/PE -48MJNfd34N5nw01s7x5Mc2YQdOxmKvVsmzbA9AO9RTdYZgPGpVh/wA+LDssCgYBh -F2+G/ekQNF3awhFfD+vDtAVtCLlsmLVvZbJY+sCJfJU8s7mBP2LXMSk/GD/Ph+b9 -p9zGRSSwdHJpbIFfxeYDEja+nWgKowWrUKd83BBhgmW/Vtc8rfwlBKS+Wx8M2dMb -iqLbZyRAlICSuzumvyu+84EmC5L/gjlYgUvHVuQDIQKBgHH7q3hrKI5mQ0BR9h75 -4yP98c+Duz8IsQllIG0gzCiiOYIVTl3uzTCa/E9Sa+jG+kFsCeUDchmC6LmHdF/Z -ZHfECcQT4B37xMMwvjwNW7E6/FyRx3XC762Fd5vlz3fBuVKburfh1JpfpcO85Wvo -R1UfsJugW9Yetsqd9WB6q3ln +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDl46xhstHmmYhp +XY/FcnQStR4XHtHcNRyvq1perl0fezeCY85KkddGppic5qIWQDL4ViP3HfvhMlDZ +E0tAjEfr8Auac9gpa2IFVJAzMnnzOkhO6cr5kmid4392tNCG5sUWS99t2Z4f9sOP +DQKdoN7lnmxnpZqNf9NUERsN5i4fcvErfQZ4LqV5ld810ZAQZUfarn1rg6/U/ADc +qA0uQgk9RxVgSDt3M5mi8AaC73Be9nAefXQUybzs6J8EfsDijhD85msxs4Fha4pg +gM+bXHv9C7whxM5F2WTeET0cIcAfE3+jzQlkjcjlS1rTEq4d0Pd+1rXkhMwZeze2 +KRL2Le8jAgMBAAECggEBAMcDjTTa2GmYWoZUr+UPizqyvsTnMmg/NoFBhy9WJVne +kpR3kJvvm30XNiEGbCV1GGryL5p7w5UVuPXjhQ7xIkY3feQNC4H361iP93HK7dXJ +i9V9AfGCdLzSuILsT2Wpm88MifUQIpqrRmqtqakKHkyMFG655409rpYlZNVogl9H +vzrTE8rjysNMjP+bpbgkxUJfeATw8OYhEwd9ahj/E0r0r2enYhGEP3j+1zYsGdmM +L2Uy4M+modaAWpZg5pUWpFjxl+V2cSJHdaQc8KYg8Z8RUyzYipFk3YzjP5jtprq5 +dHf9FqlcXk+MtzcYe+x8mIb3uwZhOtdpnUqe5l+GTyECgYEA9j++rS9sajQzMqp0 +p+EptacD/p7A3wldIDGEpPJsSQL+vhcigyn4iPCM1pGWR4iuR7Od9RpQSf3Tfnqc +ZwUJQOpiYpxo1+QlqlBJkDjDRztp+kETZAgzc084ZhwQv9PfYyxa+8layQFhnClt +Z9G0o4AV1povVeQLO5+9CQZQ4VMCgYEA7v4WuydzlLGKppsJEG8vvieR64mjOfO4 +gHBMEYnzEeTZPDvIfEfguM1upJCvt5GXp3huVHCAsFgs6kDjVbpIL1A2HzrMPtOa +MNDSOrpuLcakAgEgx2VFv4TMnA1QKPg3//YCqEqqTJyX0C4OwaADRZJS7YfHp9lg +mpv90baE8PECgYAv3oxulj15F9SsEL7Es9yr11/La4kK0oMr8vRaLFYoi1CCG3U2 +Ej6iQEDgpUSVe1iFz8DxGMBq4dDvUV5+GFiIKggeK1GmRk+cICdsxdwQSNh9MZFX +bNCzpb7M+r+2yrUuTj0RnT7svDwBY3xFJlr7PbcBFNAG3mHgoVjaHEQ0yQKBgHbS +zepvSv/65bzACFmrbklU0zAQVp9RlcIGE0wFEl0rMvbHon5oHkrDmOcpKLRUJtqU +/gXtiY4jyPEPIfhVjd44OzB7w2DZRChRKrUYS/9ma9SzSuDYcT0vgat00w4Lm4wf +fGK//Lvqf3B59cw/CmFkxuZiQ9ooMees9x11adOBAoGBAMdb0r8sAtgh+KTbA8Kq +guIWiknOk6/LYUTuT3fidPIPbErrUQQR9WWHuXjrj2RyHI/RLjYLFamikvhU7PmE +jPjPAo4p1a0WBwrYgjGDIRjTVjbUK282vuYkunGWYfgnZurAyjJCndL/eNZuX2F5 +m1rTfab8O+tOOGKGyzfouD2A -----END PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/certs/badalt7-cert.pem b/deps/openssl/openssl/test/certs/badalt7-cert.pem index b515ba43d99b..4fa81b3c6f8d 100644 --- a/deps/openssl/openssl/test/certs/badalt7-cert.pem +++ b/deps/openssl/openssl/test/certs/badalt7-cert.pem @@ -1,23 +1,22 @@ -----BEGIN CERTIFICATE----- -MIID1DCCArygAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 -IE5DIENBIDEwIBcNMTYwNzA5MTQ0ODExWhgPMjExNjA3MTAxNDQ4MTFaMIGmMTsw +MIIDtjCCAp6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 +IE5DIENBIDEwIBcNMTgwNTE2MDMyNzA5WhgPMjExODA1MTcwMzI3MDlaMIGmMTsw OQYDVQQKHjIAQgBhAGQAIABOAEMAIABUAGUAcwB0ACAAQwBlAHIAdABpAGYAaQBj AGEAdABlACAANzElMCMGA1UEAx4cAG8AdABoAGUAcgAuAGcAbwBvAGQALgBvAHIA ZzEdMBsGA1UEAx4UAEoAbwBlACAAQgBsAG8AZwBnAHMxITAfBgNVBAMeGABhAG4A eQAuAGcAbwBvAGQALgBjAG8AbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBANStByWr70u2A49OO+LYu0ivQP+uBu2n3E6RoEYf+op/+JF3clwfMQCGqiSg -QxOJMHkcu4gJDudRLCSXqHPnR0hOd+mQ5wQQJmLj8A99ImcD2oN5R3V5I4bSlXP9 -GCq2pFDnwXuEcJ3d2Dt1HYO4jA4Ol/RBT3NIqmwSnQzXv98mjYFpy6AuAIaYGmbh -1DLWxsTPI2NjNafJYS85NrQDLkTpq48nCmQCJ+ly6Zzu7WuJiDKD1Rxs7ZwgNtLi -Zhp41TeFHxCbfSFKe9u4rnUmImKxwgc9KuzOLpLAzD9avWpPGHtkCsLFsiw/EJYf -UdeCXc7tz9WhXZzOk/ffLOcrorMCAwEAAaOBmDCBlTAdBgNVHQ4EFgQUwYsR1XfZ -2cPcAR7i5i9obalnJcIwHwYDVR0jBBgwFoAUCNGb+ebVZHCg8Wsanu1S2t31UEMw -CQYDVR0TBAIwADBIBgNVHREEQTA/ggx3d3cuZ29vZC5vcmeCDGFueS5nb29kLmNv -bYENZ29vZEBnb29kLm9yZ4EMYW55QGdvb2QuY29thwTAqAABMA0GCSqGSIb3DQEB -CwUAA4IBAQAN/klfzMLi2acp5KdH9UZR4XCk3cZBOuMuI0vU+wrU/ETgY6rFhAwY -gSZsO6vX0mt/G6QfOmY5+kW4FY5XavGhhNVY2x5ATZKvQCf+orIsUHOBxVTjH6az -uEnxGDRTbjXSkBTCTSoOqdJNeOmEwiaHEVy/atumUW2B2KP5FeBGdud/94c4Q9/O -WBJ0EICGF6hYTDra63lAjxyARTvocVakIE8zytT1SbU4yO05mYPyNdXxiXikepFE -phPQWNSLx4EPBIorGCFj7MPDmFCH/+EjDjGz3SNUvqsak6MstzK94KVriQyIHKex -IL5WuKFm0XSGKTX8SzyMGErMGeriveL2 +ggEBAOG4PegItzkmJDwlSA/FyVHWLWUIQrnxgS0KSds3On2CMsjDJ+X77B4s1IPI +yKHuqNbXqV/hJGAxKnZRZe0D6VsmKlYOYpz9QtFxvpo5DwA3q6BTx6sIElFn/lip +Pbu5ZeIMNeN4bot7x5sBobr6OgidAVaAuqQHHJnD7mQ1s22qY0UqkBqNBhhJWOmx +YC0Q56WDi9+C7Cy2+kiiSlT4jCZ8m1K0F7tTK5mF0p4HppXmXLzcecZ/Sw8jOqQK +JM/4UCj/nxWCGYKWkv8zLJtG+ryfZMf15/0Cd1dzHAS9mYU4mFssPdFyT+WFpw7b +K3TOTXkS/tAPbj0xin2wqBJz8m8CAwEAAaN7MHkwHQYDVR0OBBYEFOWYNq+H1LH6 +lZUpgijb/S/sAiDsMB8GA1UdIwQYMBaAFAjRm/nm1WRwoPFrGp7tUtrd9VBDMAkG +A1UdEwQCMAAwLAYDVR0RBCUwI4ENZ29vZEBnb29kLm9yZ4EMYW55QGdvb2QuY29t +hwTAqAABMA0GCSqGSIb3DQEBCwUAA4IBAQAwUxnqq0gBgKmEHIRgZVu10KtOknjt +p/wEcqQ9METvXb+4/a4U6ftjTgaOrPVjamNFlaoUcTgx2nk2zRsjM+e+tpnxDgRR +/yoVB3HsISpdeN70s/WYAgvev/FdV3O+JWhUYHdKrDB4DMfPhlRIfSgOymJljo6+ +wL8qa7lVonF91Im4SCbq4dqtAnbg4ttblQ3yjFfQtuwzyJD/3ism6FQPLbg1K4eu +1Si0EDL4Fct581Gb5D+NU8PYiwg7Nk8ubNlRHXydoVGDLmT0hLE+/IsPd1M8tMqm +sifRl2Is+lGVeg4pPHFjB0npTNkaYafu89dz/3PNRRr5If06B+apk4AX -----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/certs/badalt7-key.pem b/deps/openssl/openssl/test/certs/badalt7-key.pem index 50557e896812..b453f1ff30a2 100644 --- a/deps/openssl/openssl/test/certs/badalt7-key.pem +++ b/deps/openssl/openssl/test/certs/badalt7-key.pem @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDUrQclq+9LtgOP -Tjvi2LtIr0D/rgbtp9xOkaBGH/qKf/iRd3JcHzEAhqokoEMTiTB5HLuICQ7nUSwk -l6hz50dITnfpkOcEECZi4/APfSJnA9qDeUd1eSOG0pVz/RgqtqRQ58F7hHCd3dg7 -dR2DuIwODpf0QU9zSKpsEp0M17/fJo2BacugLgCGmBpm4dQy1sbEzyNjYzWnyWEv -OTa0Ay5E6auPJwpkAifpcumc7u1riYgyg9UcbO2cIDbS4mYaeNU3hR8Qm30hSnvb -uK51JiJiscIHPSrszi6SwMw/Wr1qTxh7ZArCxbIsPxCWH1HXgl3O7c/VoV2czpP3 -3yznK6KzAgMBAAECggEADjQ0Kv7tr3fLixGljEP/Vh5mT+02hz7TxueQ9b4DBKcB -We3JVH+8zRUxXdraP/7EnwIdQDuipC5WrWb3mC4VI64h8hZ8Z1gQyEAC83XfC1RF -jsxVynG5vrJnyuRXbdre5Ixl7rLsto5vd6EdxINZz0KIQYbvIHr07tzbYlUyelvA -mu0kYdtbjm2p2AGJJ99zN3EiQ9lZDyiFirOXEA9P/YdKKVlIwpDPbn/TmNY/k6Ul -mRxgAJKwKiR6Gg3QMdTUKeaXBpKf/pa+5rzR7zxNbiQO3IXOVx7ZzQ2R0Wuivpqk -yjMaqUa7dDuvtIHJBpJB7TIL6SlQkiS1lEQFhO7EAQKBgQDz30obdymxqQVy7IsH -NLo5xRX1hRRN9h34Y4qC0JXkCTG1fWJ19KYHod0S5peaIo/ThDVf1UXln6amdCjM -oIfhmo0baNIdMMpxxBdsdLfUKwyVh8qROaBscPE4FGBUrfEW/wSn1WRYcWh+oda3 -LuLVf5Qt9a9f6ZYuy1X6dDi8swKBgQDfQJTSFUNkV8yKfMX54x0DcUkiWOu3LaET -GSu0UXqBVn1Q+u6CUAkh5jA9fpyM5sp9+t5FuwjO+ITHfiNFoD/LCeMUfYVDF7O2 -uCLTsN+7gTGpKMnfL/rg9exrsfDdsmbQe4BhrUFBsYfKgBlBraL0QGD+25qgU8CS -CQ6toGCCAQKBgQDCYJskwRoObPXW4AsAN1qnaRtTkjrY2O6SaGSiV7bhByMD0WiF -M/aR5sXapsj3Jc0Vfi88rzUDDPk7eyJ51wn3G8SUsDuo4Ja7jtxMqctL5PQmyxD+ -J7xiMrNRS4xscifTeHgxfbh5dgsfw8bsQwaxvPpSl5ytCfWWXqOs+K2wWQKBgBM4 -Mher8PNQg7FgcILExJipRgyI7zID4ZwNTK/nW86KrZstHx9k2IRslraUkdGnhMM3 -t671HRsEVhn+h/bUhulp3nzDGZffEH+odocW8QvpYWcYtdha/xQi18mltgC//Q3x -s+m0yqtnJzONt57p3d99M1x9d2BaFXf9A6B68BQBAoGBAOatu9+wGaIEB//fpaQt -mnsS2XBJco5gHTjOegCSNe3gQQsB5mhTEekOeMzJ8WLTMVXQVCXx9/8HxKoycbq8 -M/7ScH1iT/wJTkSsjyeycUgH31GPeRvmo9YU2PsW3NN6ZyNpxWJFdcPYHAzZqJeA -cZtQWiEyaf026DdR8YBYn6tf +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDhuD3oCLc5JiQ8 +JUgPxclR1i1lCEK58YEtCknbNzp9gjLIwyfl++weLNSDyMih7qjW16lf4SRgMSp2 +UWXtA+lbJipWDmKc/ULRcb6aOQ8AN6ugU8erCBJRZ/5YqT27uWXiDDXjeG6Le8eb +AaG6+joInQFWgLqkBxyZw+5kNbNtqmNFKpAajQYYSVjpsWAtEOelg4vfguwstvpI +okpU+IwmfJtStBe7UyuZhdKeB6aV5ly83HnGf0sPIzqkCiTP+FAo/58VghmClpL/ +MyybRvq8n2TH9ef9AndXcxwEvZmFOJhbLD3Rck/lhacO2yt0zk15Ev7QD249MYp9 +sKgSc/JvAgMBAAECggEAZG2cJawTEXtV7ejMii//Jck8g1JMlfzM86Q7Pizxejw+ +qjKiguI2qSpbF5NzKRFNz+E+e+lpTN8zPFd1GSJ/Zk2x0n4uBBlu7E9GdcnjUb5z +Py9njEJYHB4//WS3kdmoag3ywBWqYaceJWpxcga5YXGx0bIO2MJNSGDzpWR7Q9QQ +tG/lWmno5goY2BxI08BTKSlqNIBkg/rr9jJo3axRcEmbx7hj4vUkAlypFKtmR4dW +bNo0f6VAd5Y6c9YbnKybR/44lScBksuSkZjm076cbbbp5PpsiLGe/12bqUcwCH+T +8hRVndmOLdOxC11OZOvMbX6x2uXNh3/Qr/GMyfzZcQKBgQD4we7E9vOygk1J5Vbl +1zETR9x3dujpBBx3xaHXUSJNUTNwmnZ+0JoFTqPkRmmPMNK7XfZuPymBehtk8WYt +NnezM2UNTdbfVOnJWnU6igRNGBaDW6F9AezlADBNwIbFVw6RqP4fTUFsmm9TQ/8M +4kZmmlW4uLZyX0WQO+AJa7NShwKBgQDoSpnQgmWqXMcaHwY2l8fEDuDc41nDoJIm +/CMppPbr7GkUX4OU785p6E0N0o1ONt+xCBT1lxHwWEeMAKZXrNC1XGpfvhpVZ72v +VruATDFs1rcL3S2Sty7A+jhFKKXlGeDWNcpaKY8nDvv2uJG0+J3bLprdMqnY/gQ1 +C+FzyQ6S2QKBgDnHIaRSD6xoo3cEc7iS0O0/ha+hyNtGfy46kyqlx6fZsm73EYrG +/N86ssp0qFP/7RJj8rcMqKFQMUiy4R6jRg4zY8dBSyU4XczM2+mq4PDfJWuBPvMA +HXvbHV0R2LvBSrr+W3f9w7Jr9GuMoZLmg5+VPU/YZ1gNVOT5Y0IM5+vFAoGBANx9 +CzlGvLeTrw1VS3GAaobn1Hr2dlrhTDki9UFvK03PLgK/ksdJRLV0YcdwBt6p6XRB +hpuC1O087lSuvTXVfJnZacMNUDOm7/7BpeJm8DcuK7tgKwTrSb61A7ppleY7xRWv +Iy6n6hCaAYIzuWJ85mGJAEhb8apdmqK7bzmXK3UpAoGBALdOvJfqbF0YlHbdQCVi +ftjtxs/dZKdF1rNARR0VMqUtZX+WP2b6OPXlwux94Cr//iNv5ih3B4Z4LIgTpgBJ +AKGXEBGMMthAlptC4BcOAEs9cYeWGLAoYk8jpNmXvXjhGqvzhPO2YrX5xy46dVOG +iiCseyA7Kr8Axt9QhUzoi5f7 -----END PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/certs/badcn1-cert.pem b/deps/openssl/openssl/test/certs/badcn1-cert.pem new file mode 100644 index 000000000000..3b3bad658bc4 --- /dev/null +++ b/deps/openssl/openssl/test/certs/badcn1-cert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDQDCCAiigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 +IE5DIENBIDEwIBcNMTgwNTE2MDI0MTMyWhgPMjExODA1MTcwMjQxMzJaME4xIzAh +BgNVBAoMGkdvb2QgTkMgVGVzdCBDZXJ0aWZpY2F0ZSAxMRUwEwYDVQQDDAx3d3cu +Z29vZC5vcmcxEDAOBgNVBAMMB2JhZC5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN9WI6OyxnW+R98FqrWwMo3JE165bRB8iQOdDP3xE1+bvUMDYh +8wFR9gfNrKhqXubJ3lCHKgaApTXNKM/jwrT/pqhF6iNfPIbKAMTT4VZPy4/eI45R +03Yn+dJnZLDz7BDpnuhORp8XzQqfxSGBX0Rdr17xYOwGHcruwoitRyS/w8p8EKos +/LIDvjzye5GaPXqXkAkcBcLBpWlgMm+j8xE+LzGw1NVw8vWMSpP2WX9kp7aPbh+A +jSbT522yHy1r6WeElbSY7WOFvnmgbZ19pUdyz8CN6KKb87dBA0joyWSly5ZsNbjh +/YuRhCgRExvdQ6kImwdKAfO7RLkxho6jny1HAgMBAAGjXjBcMB0GA1UdDgQWBBT5 +fenRjyFKUb1XvUnm4GV9kZmONDAfBgNVHSMEGDAWgBQI0Zv55tVkcKDxaxqe7VLa +3fVQQzAJBgNVHRMEAjAAMA8GA1UdEQQIMAaHBMCoAAEwDQYJKoZIhvcNAQELBQAD +ggEBACKtfZCcP/pY8Bu+lb/pGZj5txsmNbJ1l2RVACQA7CGjwfUr7VaQGMuT+FuA +Erlh+UnEC3R/e1xQwgJeuAXBOWFkxA61isVSrmM7YM6vDB0+t8N9lMUFjPbRyEkM +A5kaSLPrgSOg7ONsO6YGbaWm1XCoUC6Ilrdzy+ckzklgjYRth99b2d5WrjIxEWIq +BX2DI2ruetjXYGRzsqSK+O9d4fsqrb5M0ZCNWQZ4WnrMNaAeHWpW6NqSvof/N21x +WC5zcU7GXLrDigwWPMDLQhVtu4OihWjsqugh6Jl7DxDBhi8JKO6tJQAISHjKaL98 +yXZFsQ//q7ATwlcHyB81B+X16AI= +-----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/certs/badcn1-key.pem b/deps/openssl/openssl/test/certs/badcn1-key.pem new file mode 100644 index 000000000000..dbcf4b5d44ca --- /dev/null +++ b/deps/openssl/openssl/test/certs/badcn1-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDN9WI6OyxnW+R9 +8FqrWwMo3JE165bRB8iQOdDP3xE1+bvUMDYh8wFR9gfNrKhqXubJ3lCHKgaApTXN +KM/jwrT/pqhF6iNfPIbKAMTT4VZPy4/eI45R03Yn+dJnZLDz7BDpnuhORp8XzQqf +xSGBX0Rdr17xYOwGHcruwoitRyS/w8p8EKos/LIDvjzye5GaPXqXkAkcBcLBpWlg +Mm+j8xE+LzGw1NVw8vWMSpP2WX9kp7aPbh+AjSbT522yHy1r6WeElbSY7WOFvnmg +bZ19pUdyz8CN6KKb87dBA0joyWSly5ZsNbjh/YuRhCgRExvdQ6kImwdKAfO7RLkx +ho6jny1HAgMBAAECggEBAKDxiUHx7cATShm0ElZnd6+dtQfKwv8zsuIpm+hk62Ef +d0zYI+UhrT1sIiryKmV9JaJITOtixtQOxl088D+Obrx8cnC4B84rUTVXpnfgVf9j +FljDtjpxIZsZmPbc836ZUZoOaICKpVYHD69Mb+NWG+mN2oaLc8VP0L4FXKLzvl7u +69NQlTPG2CS61BktVqMtWWc/9CvdOwqwVbckyISj9QLUgSXIyB4IP3bjp0RYSpOu +m3nhuhil1G3c05R4UfiE2d9Er7SBBoQ304ld892YRinSgtZqC1G25uZmWJ3ekAAM +bg6P0hBd86F/G2TxNdelYrxTazjqZShYi1N48SK6kUECgYEA+51O19Q5XkskD/Dn +VfaCjSOTFwDlb5ATmVCrJu+13/5IJfmJgWA6xdqfWoqxSOsJzXBEETKWgkahoo4K +OU1UaBTHEJ588xOpoMzbJkKlb5hPseEQsvu055Ky0euMgmlrALPQQ9e1DUSlowui +Cq9wCak4dqq9NNs6FMIeGhqczGECgYEA0YxcajJFxPHJsdFCVa4tdy9jgfC64t4Y +CWDzRfUnuX24ILbW9+olvvoZkMSzoVpiQ9YU8kPJUaOyFrw6jUV5GRHUCMgfkx2Y +nqe+7aSFmv0Nlo0RMV2PqaOZzlxnG9FzyNE+4PygZqtFhN21b5Idc69k2Ltu7K4J +J4MG1kMUGqcCgYEA0ttUPEisPtoHgZhntUFczHx4gnmMzH5X/k5876dIqkrFGZXR +5urGthHtIwpBYZMeZtxjHmpfeRNJ1xjjdnvYdVScMdAvc+ERcSDbsmd9jlR8zNuI +jAWl576nPoX//TXspu0JZiE5p8HUcRuJkxzMbjwyhje1Ubs6JDU81rFgn2ECgYAG +3WVNqVX1zMIBzEwzCGC+7dOBt0Q4GHSLIhz2JsDlZ8P3dmX2ezo/Vmwt/POxjod3 +l3TaNvRKc2VrL0FvzV3ZP2dF3mCCbk7Iq9AqcuBZon6mdvqgNmN1eEGarBZIqAT2 +CDzaHAyZMHU3lBfUjuHeH1nba9CHenAcVkOME2h+MwKBgQDiHAnTK4ovCNmT5E9i +03x/wPSH8FZ3Wrb1GMtNlTc7lOtB5eYIvwkaloJkNKHbUDv57V66hnYT6CyH4u45 +dPtuohtafL9mdScYqmicGLtbLLglSQpJYt4J59hffNZ30E84dKXtyDN7E5P5Z00Z +8PbOMUy3oK6j+GMP/xRNI76RtA== +-----END PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/certs/goodcn1-cert.pem b/deps/openssl/openssl/test/certs/goodcn1-cert.pem new file mode 100644 index 000000000000..d9205e03b005 --- /dev/null +++ b/deps/openssl/openssl/test/certs/goodcn1-cert.pem @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDkTCCAnmgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxUZXN0 +IE5DIENBIDEwIBcNMTgwNTE2MDI0MDA0WhgPMjExODA1MTcwMjQwMDRaMIGeMSMw +IQYDVQQKDBpHb29kIE5DIFRlc3QgQ2VydGlmaWNhdGUgMTEVMBMGA1UEAwwMd3d3 +Lmdvb2Qub3JnMRUwEwYDVQQDDAxhbnkuZ29vZC5jb20xETAPBgNVBAMMCG5vdC4u +ZG5zMRAwDgYDVQQDDAdub3RAZG5zMREwDwYDVQQDDAhub3QtLmRuczERMA8GA1UE +AwwIbm90LmRucy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDigxI +nlYVjHtrFI+Iv/3b0jeZbs1jVnPF6ZREk46BTNAVNZsq24jKFG6yK4n9vKA/JuS7 +jZe+gMX+sWh/S1IlsNDY8/Io1UsG/s1tmsvE2UrURUX4s8HnqB6AZ4Y9Cp4rSADe +mD/YdekRf3HFA0IKQvIFRkpegj8uuWwILC0n/ozMNUlNmxCBlOmtFwjFxmNr9Txa +ZeFvWvvc6oTubAETK4HcjLdimx1tePdd4+0mxJ/akQ3wVzUAI2ysijMmMJDzTxLs +FPkw4yUtJHK0/H2yJtpoJ4wQjsWd6a8F7wY/pHszAud1M8QZJKQDzkJOMnqLKNLT +OKw6dm1UG2J7iuqtAgMBAAGjXjBcMB0GA1UdDgQWBBSTKvqap2ab0z/UPrdDgc0V +m88R3TAfBgNVHSMEGDAWgBQI0Zv55tVkcKDxaxqe7VLa3fVQQzAJBgNVHRMEAjAA +MA8GA1UdEQQIMAaHBMCoAAEwDQYJKoZIhvcNAQELBQADggEBADcdm62qaOHbIDoa +5oUjXGHSQjV1g4BFe6DLH5/CZ0wOws3QzfQbPIxJrp3yJgDcQyZNOE/xQlq/nASS +thU6cUTB07voFVnbotB8YQuNU1wM9TAJOHC9LT1Y0J2GIP6QeXts6Cz6aBlqaQEZ +IrGRLuKVZePTO0Haup0mZ91XoXs3CBzkSerl0XpFL7BeugSigrhprFRPB4UC3IWb +pdNar61Wk4bN/COb6utRkK3iYk5YUTqYFib9EG4VBdxYfXv/tiBIGqQLnqPbId6w +q+McpSEPF1DIcCyL0vEDdIVN0SzxMfnfHMx0Qp0sh2aydIZk4xfEqXHZgZthSrse +u7nhn7s= +-----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/certs/goodcn1-key.pem b/deps/openssl/openssl/test/certs/goodcn1-key.pem new file mode 100644 index 000000000000..2ad660c6dbfa --- /dev/null +++ b/deps/openssl/openssl/test/certs/goodcn1-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDDigxInlYVjHtr +FI+Iv/3b0jeZbs1jVnPF6ZREk46BTNAVNZsq24jKFG6yK4n9vKA/JuS7jZe+gMX+ +sWh/S1IlsNDY8/Io1UsG/s1tmsvE2UrURUX4s8HnqB6AZ4Y9Cp4rSADemD/YdekR +f3HFA0IKQvIFRkpegj8uuWwILC0n/ozMNUlNmxCBlOmtFwjFxmNr9TxaZeFvWvvc +6oTubAETK4HcjLdimx1tePdd4+0mxJ/akQ3wVzUAI2ysijMmMJDzTxLsFPkw4yUt +JHK0/H2yJtpoJ4wQjsWd6a8F7wY/pHszAud1M8QZJKQDzkJOMnqLKNLTOKw6dm1U +G2J7iuqtAgMBAAECggEAeQ1xZVOAf36kuTnVUhdplTii6v3JcQIIUjG0dG/U/P8M +otS45uNZ36CelvaVStwHaJEvcVzK4EjgSjiSNJvwkxzPbkA3XkgNVptPmdcG5yqO +RLNOChVeqYdOurdcR1XXbXv57dPbUqpMS2TWjdzieW/QXKuTRsbjTo3D75tJqUO6 +1Bm4sSM3PogmsQwTP8HlZAmJXuSD+ZSB22Np5pT1dn5TvQU6xeA3NJR4ZO/HEZz4 +CHJEiOx2BuGD6M0V1ZL6DzEsyIS/KKsvj4I2F4ROAK1j3lSD5VqrYPXn3oEsQdlm +OW8aVnHPYO6FI0LVLgcIEKxhdwGV3i6v/GRUe0Y9kQKBgQD0Zqn1trAuP5Peiy1K +Wc91yRjQxQTwSD00hzXMtvKzkEIiLEuVZq9qrqQ2TRRa5xneDGHDuUY9eZY8JwEr +l7f8CcfYC93PXLyRM2Gaz0jMxZxVPz5w7zssK3DZ+7JvH3nKkCUl7+Y0tH26qTO0 +wTD9w9jd9bf85SLVgk3zSbUDwwKBgQDM0b2ffZpxyA16h7w8ZBuk1Z+iumrxnn5/ +lKtffR2b4dZN37KiWw2c265vYhRfe/ANnVuagXb9aRM97yeQloRlWR10AaXJz3EB +sromqFShkorYRhwZoRiJC0laLG3W76wKMRr2T6TM1UG9gJ0szdGFG/yUDU+9pTRo +uq514rGgzwKBgQCGtsAgLF7YXzsGg/im7vInnn0LNk4OlAMInS7OdFk7GN0bMQdI +hp1SVIk3VS1PHetoNbL9y3YoFIj3BxjiCnLjfhClyYSt9BQMhSHbzz31gUc2xfGJ +FpSrOBawUMh97/+V4/ZV/vIJQyO6a+GQVJzIg9daIUMVJsgYoAaPf6VDOQKBgFyH +eHnf/XDfpq8vOOuzcgWieG7EduHW72DlohIObNzqRq2BnKraJakyWXh6P6fvTsBn +0WVYjY/n80hsjVw1k3RRsQuiXupv66aPvqcOLsWbdVxFOBaf/3yR+75gCfMq7Xbh +PkP+MP5UbVGWE+uUw821mgKsjNSpGKcjhwM8uXBjAoGAFEU3O8gQXfocVB8lxUeU +c0inLdAIgiw/36NPuW4NwKxzLOmHzlmvn7C98ihnbnGoQ0XBRfLw8siTbD3INgHY +NA0JeK8Qrt56b6wK14w9RzLQTu9gy1pULW21p1wswdNK4tlxfnnnozISZAYxeqAx +YMTtYZN77nb+yY4oE6XEugQ= +-----END PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/certs/setup.sh b/deps/openssl/openssl/test/certs/setup.sh index 7e1086a2240d..018e5fc69095 100755 --- a/deps/openssl/openssl/test/certs/setup.sh +++ b/deps/openssl/openssl/test/certs/setup.sh @@ -241,15 +241,30 @@ NC="$NC excluded;DNS:bad.ok.good.com" NC=$NC ./mkcert.sh genca "Test NC sub CA" ncca3-key ncca3-cert \ ncca1-key ncca1-cert -# all subjectAltNames allowed by CA1. +# all subjectAltNames allowed by CA1. Some CNs are not! ./mkcert.sh req alt1-key "O = Good NC Test Certificate 1" \ - "1.CN=www.good.org" "2.CN=Joe Bloggs" "3.CN=any.good.com" | \ + "1.CN=www.example.net" "2.CN=Joe Bloggs" | \ ./mkcert.sh geneealt alt1-key alt1-cert ncca1-key ncca1-cert \ "DNS.1 = www.good.org" "DNS.2 = any.good.com" \ "email.1 = good@good.org" "email.2 = any@good.com" \ "IP = 127.0.0.1" "IP = 192.168.0.1" +# all DNS-like CNs allowed by CA1, no DNS SANs. + +./mkcert.sh req goodcn1-key "O = Good NC Test Certificate 1" \ + "1.CN=www.good.org" "2.CN=any.good.com" \ + "3.CN=not..dns" "4.CN=not@dns" "5.CN=not-.dns" "6.CN=not.dns." | \ + ./mkcert.sh geneealt goodcn1-key goodcn1-cert ncca1-key ncca1-cert \ + "IP = 127.0.0.1" "IP = 192.168.0.1" + +# Some DNS-like CNs not permitted by CA1, no DNS SANs. + +./mkcert.sh req badcn1-key "O = Good NC Test Certificate 1" \ + "1.CN=www.good.org" "3.CN=bad.net" | \ + ./mkcert.sh geneealt badcn1-key badcn1-cert ncca1-key ncca1-cert \ + "IP = 127.0.0.1" "IP = 192.168.0.1" + # no subjectAltNames excluded by CA2. ./mkcert.sh req alt2-key "O = Good NC Test Certificate 2" | \ @@ -293,19 +308,17 @@ NC=$NC ./mkcert.sh genca "Test NC sub CA" ncca3-key ncca3-cert \ "email.1 = good@good.org" "email.2 = any@good.com" \ "IP = 127.0.0.2" -# all subject alt names OK but subject CN not allowed by CA1. +# No DNS-ID SANs and subject CN not allowed by CA1. ./mkcert.sh req badalt6-key "O = Bad NC Test Certificate 6" \ "1.CN=other.good.org" "2.CN=Joe Bloggs" "3.CN=any.good.com" | \ ./mkcert.sh geneealt badalt6-key badalt6-cert ncca1-key ncca1-cert \ - "DNS.1 = www.good.org" "DNS.2 = any.good.com" \ "email.1 = good@good.org" "email.2 = any@good.com" \ "IP = 127.0.0.1" "IP = 192.168.0.1" -# all subject alt names OK but subject CN not allowed by CA1, BMPSTRING +# No DNS-ID SANS and subject CN not allowed by CA1, BMPSTRING REQMASK=MASK:0x800 ./mkcert.sh req badalt7-key "O = Bad NC Test Certificate 7" \ "1.CN=other.good.org" "2.CN=Joe Bloggs" "3.CN=any.good.com" | \ ./mkcert.sh geneealt badalt7-key badalt7-cert ncca1-key ncca1-cert \ - "DNS.1 = www.good.org" "DNS.2 = any.good.com" \ "email.1 = good@good.org" "email.2 = any@good.com" \ "IP = 127.0.0.1" "IP = 192.168.0.1" diff --git a/deps/openssl/openssl/test/ct/log_list.conf b/deps/openssl/openssl/test/ct/log_list.conf index 3724599a9d32..4b68e5355803 100644 --- a/deps/openssl/openssl/test/ct/log_list.conf +++ b/deps/openssl/openssl/test/ct/log_list.conf @@ -35,3 +35,4 @@ key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEluqsHEYMG1XcDfy1lCdGV0JwOmkY4r87xNuroP [venafi] description = Venafi log key = MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAolpIHxdSlTXLo1s6H1OCdpSj/4DyHDc8wLG9wVmLqy1lk9fz4ATVmm+/1iN2Nk8jmctUKK2MFUtlWXZBSpym97M7frGlSaQXUWyA3CqQUEuIJOmlEjKTBEiQAvpfDjCHjlV2Be4qTM6jamkJbiWtgnYPhJL6ONaGTiSPm7Byy57iaz/hbckldSOIoRhYBiMzeNoA0DiRZ9KmfSeXZ1rB8y8X5urSW+iBzf2SaOfzBvDpcoTuAaWx2DPazoOl28fP1hZ+kHUYvxbcMjttjauCFx+JII0dmuZNIwjfeG/GBb9frpSX219k1O4Wi6OEbHEr8at/XQ0y7gTikOxBn/s5wQIDAQAB + diff --git a/deps/openssl/openssl/test/danetest.in b/deps/openssl/openssl/test/danetest.in index c94f526aabfb..0cedf10a2a78 100644 --- a/deps/openssl/openssl/test/danetest.in +++ b/deps/openssl/openssl/test/danetest.in @@ -26,7 +26,7 @@ # 3 1 0 3059301306072A8648CE3D020106082A8648CE3D03010703420004664995F47BDE35E7B4DE48B258E9E8A07ADEBBDB863B3D06F481A1946C83DA9F56CFF4D9389B855D2F364B1585B0C734FCFA263026964FF5A4308B3FC879BDB8 # 3 1 1 3111668338043DE264D0256A702248696C9484B6221A42740F920187B4C61838 # 3 1 2 CB861AF6DDED185EE04472A9092052CCC735120C34785E72C996C94B122EBA6F329BE630B1B4C6E2756E7A75392C21E253C6AEACC31FD45FF4595DED375FAF62 -# -- +# -- # subject= CN = Issuer CA # 2 0 0 308201683082010DA003020102020102300A06082A8648CE3D04030230123110300E06035504030C07526F6F742043413020170D3135313231333233323030395A180F33303135303431353233323030395A30143112301006035504030C094973737565722043413059301306072A8648CE3D020106082A8648CE3D030107034200047D4BAE18B49F5DC69D0A3C85C66A3E2119DE92CFAD081FAD55C12D510EC97B6C00E13695A8D9713548FE60DF15573390433E2A1BD92DB4B7AA016EC6185DC5AFA350304E301D0603551D0E041604147AB75A3CD295CA5DF7C5150916E18FF5CC376A15301F0603551D23041830168014E4BD405F052A820DDF9883F93D7D3F90AAEC723F300C0603551D13040530030101FF300A06082A8648CE3D0403020349003046022100831DCD882DA8785D50E41020898C0248879DDDF72D701D1DC1DE6BE08155B43E022100B84B2FB519C4CD3CBC791603D4488F7707597DB7980D9C173E7FDD0ECD7CA308 # 2 0 1 0DAA76425A1FC398C55A643D5A2485AE4CC2B64B9515A75054722B2E83C31BBD diff --git a/deps/openssl/openssl/test/errtest.c b/deps/openssl/openssl/test/errtest.c new file mode 100644 index 000000000000..df4cddb096dd --- /dev/null +++ b/deps/openssl/openssl/test/errtest.c @@ -0,0 +1,40 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include + +#include "testutil.h" + +#if defined(OPENSSL_SYS_WINDOWS) +# include +#else +# include +#endif + +/* Test that querying the error queue preserves the OS error. */ +static int preserves_system_error(void) +{ +#if defined(OPENSSL_SYS_WINDOWS) + SetLastError(ERROR_INVALID_FUNCTION); + ERR_get_error(); + return GetLastError() == ERROR_INVALID_FUNCTION; +#else + errno = EINVAL; + ERR_get_error(); + return errno == EINVAL; +#endif +} + +int main(int argc, char **argv) +{ + ADD_TEST(preserves_system_error); + + return run_tests(argv[0]); +} diff --git a/deps/openssl/openssl/test/evp_test.c b/deps/openssl/openssl/test/evp_test.c index 4bea4ea2b92c..ea9455374f48 100644 --- a/deps/openssl/openssl/test/evp_test.c +++ b/deps/openssl/openssl/test/evp_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1592,19 +1592,19 @@ static int pderive_test_run(struct evp_test *t) struct pkey_data *kdata = t->data; unsigned char *out = NULL; size_t out_len; - const char *err = "INTERNAL_ERROR"; + const char *err = "DERIVE_ERROR"; - out_len = kdata->output_len; + if (EVP_PKEY_derive(kdata->ctx, NULL, &out_len) <= 0) + goto err; out = OPENSSL_malloc(out_len); if (!out) { fprintf(stderr, "Error allocating output buffer!\n"); exit(1); } - err = "DERIVE_ERROR"; if (EVP_PKEY_derive(kdata->ctx, out, &out_len) <= 0) goto err; err = "SHARED_SECRET_LENGTH_MISMATCH"; - if (out_len != kdata->output_len) + if (kdata->output == NULL || out_len != kdata->output_len) goto err; err = "SHARED_SECRET_MISMATCH"; if (check_output(t, kdata->output, out, out_len)) @@ -2169,3 +2169,4 @@ static const struct evp_test_method keypair_test_method = { void_test_parse, keypair_test_run }; + diff --git a/deps/openssl/openssl/test/evptests.txt b/deps/openssl/openssl/test/evptests.txt index 83c6c6a3a913..269684e11b3f 100644 --- a/deps/openssl/openssl/test/evptests.txt +++ b/deps/openssl/openssl/test/evptests.txt @@ -1,5 +1,5 @@ # -# Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -15,7 +15,7 @@ # Which is currently unsupported by OpenSSL. They were generated using the # reference implementation. RFC7693 also mentions the 616263 / "abc" values. Digest = BLAKE2s256 -Input = +Input = Output = 69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9 Digest = BLAKE2s256 @@ -51,7 +51,7 @@ Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223 Output = C80ABEEBB669AD5DEEB5F5EC8EA6B7A05DDF7D31EC4C0A2EE20B0B98CAEC6746 Digest = BLAKE2b512 -Input = +Input = Output = 786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce Digest = BLAKE2b512 @@ -19144,6 +19144,35 @@ PeerKey=KAS-ECC-CDH_B-571_C24-Peer-PUBLIC Ctrl=ecdh_cofactor_mode:1 SharedSecret=02da266a269bdc8d8b2a0c6bb5762f102fc801c8d5394a9271539136bd81d4b69cfbb7525cd0a983fb7f7e9deec583b8f8e574c6184b2d79831ec770649e484dc006fa35b0bffd0b +# for cofactor-order points, ECC CDH (co-factor ECDH) should fail. Test that. + +PrivateKey=ALICE_cf_sect283k1 +-----BEGIN PRIVATE KEY----- +MIGQAgEAMBAGByqGSM49AgEGBSuBBAAQBHkwdwIBAQQkAHtPwRfQZ9pWgSctyHdt +xt3pd8ESMI3ugVx8MDLkiVB8GkCRoUwDSgAEA+xpY5sDcgM2yYxoWOrzH7WUH+b3 +n68A32kODgcKu8PXRYEKBH8Xzbr974982ZJW1sGrDs+P81sIFH8tdp45Jkr+OtfM +8uKr +-----END PRIVATE KEY----- + +PublicKey=ALICE_cf_sect283k1_PUB +-----BEGIN PUBLIC KEY----- +MF4wEAYHKoZIzj0CAQYFK4EEABADSgAEA+xpY5sDcgM2yYxoWOrzH7WUH+b3n68A +32kODgcKu8PXRYEKBH8Xzbr974982ZJW1sGrDs+P81sIFH8tdp45Jkr+OtfM8uKr +-----END PUBLIC KEY----- + +PublicKey=BOB_cf_sect283k1_PUB +-----BEGIN PUBLIC KEY----- +MF4wEAYHKoZIzj0CAQYFK4EEABADSgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB +-----END PUBLIC KEY----- + +PrivPubKeyPair = ALICE_cf_sect283k1:ALICE_cf_sect283k1_PUB + +# ECDH Alice with Bob peer +Derive=ALICE_cf_sect283k1 +PeerKey=BOB_cf_sect283k1_PUB +Ctrl=ecdh_cofactor_mode:1 +Result = DERIVE_ERROR # Test mismatches PrivPubKeyPair = Alice-25519:Bob-25519-PUBLIC diff --git a/deps/openssl/openssl/test/r160test.c b/deps/openssl/openssl/test/r160test.c index 9ed453849e1f..06033eb91f83 100644 --- a/deps/openssl/openssl/test/r160test.c +++ b/deps/openssl/openssl/test/r160test.c @@ -6,3 +6,4 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ + diff --git a/deps/openssl/openssl/test/recipes/04-test_err.t b/deps/openssl/openssl/test/recipes/04-test_err.t new file mode 100644 index 000000000000..dd7681afa4e4 --- /dev/null +++ b/deps/openssl/openssl/test/recipes/04-test_err.t @@ -0,0 +1,12 @@ +#! /usr/bin/env perl +# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the OpenSSL license (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + + +use OpenSSL::Test::Simple; + +simple_test("test_err", "errtest"); diff --git a/deps/openssl/openssl/test/recipes/04-test_pem_data/cert-trailingwhitespace.pem b/deps/openssl/openssl/test/recipes/04-test_pem_data/cert-trailingwhitespace.pem index 99ddf079a499..ab0dfe85b7c0 100644 --- a/deps/openssl/openssl/test/recipes/04-test_pem_data/cert-trailingwhitespace.pem +++ b/deps/openssl/openssl/test/recipes/04-test_pem_data/cert-trailingwhitespace.pem @@ -1,28 +1,28 @@ -----BEGIN CERTIFICATE----- -MIIEzDCCA7QCCQCgxkRox+YljjANBgkqhkiG9w0BAQsFADCCASYxYzBhBgNVBAgM -WlRoZSBHcmVhdCBTdGF0ZSBvZiBMb25nLVdpbmRlZCBDZXJ0aWZpY2F0ZSBGaWVs -ZCBOYW1lcyBXaGVyZWJ5IHRvIEluY3JlYXNlIHRoZSBPdXRwdXQgU2l6ZTEfMB0G -A1UEBwwWVG9vbWFueWNoYXJhY3RlcnN2aWxsZTFIMEYGA1UECgw/VGhlIEJlbmV2 -b2xlbnQgU29jaWV0eSBvZiBMb3F1YWNpb3VzIGFuZCBQbGVvbmFzdGljIFBlcmlw -aHJhc2lzMT0wOwYDVQQLDDRFbmRvcnNlbWVudCBvZiBWb3VjaHNhZmUnZCBFdmlk -ZW50aWFyeSBDZXJ0aWZpY2F0aW9uMRUwEwYDVQQDDAxjZXJ0LmV4YW1wbGUwHhcN -MTcwMjIzMjAyNTM2WhcNMTcwMzI1MjAyNTM2WjCCASYxYzBhBgNVBAgMWlRoZSBH -cmVhdCBTdGF0ZSBvZiBMb25nLVdpbmRlZCBDZXJ0aWZpY2F0ZSBGaWVsZCBOYW1l -cyBXaGVyZWJ5IHRvIEluY3JlYXNlIHRoZSBPdXRwdXQgU2l6ZTEfMB0GA1UEBwwW -VG9vbWFueWNoYXJhY3RlcnN2aWxsZTFIMEYGA1UECgw/VGhlIEJlbmV2b2xlbnQg -U29jaWV0eSBvZiBMb3F1YWNpb3VzIGFuZCBQbGVvbmFzdGljIFBlcmlwaHJhc2lz -MT0wOwYDVQQLDDRFbmRvcnNlbWVudCBvZiBWb3VjaHNhZmUnZCBFdmlkZW50aWFy -eSBDZXJ0aWZpY2F0aW9uMRUwEwYDVQQDDAxjZXJ0LmV4YW1wbGUwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7MOIrqH+ZIJiZdroKMrelKMSvvRKg2MEg -j/sx9TaHHqrKys4AiL4Rq/ybQEigFC6G8mpZWbBrU+vN2SLr1ZsPftCHIY12LF56 -0WLYTYNqDgF5BdCZCrjJ2hhN+XwML2tgYdWioV/Eey8SJSqUskf03MpcwnLbVfSp -hwmowqNfiEFFqPBCf7E8IVarGWctbMpvlMbAM5owhMev/Ccmqqt81NFkb1WVejvN -5v/JKv243/Xedf4I7ZJv7zKeswoP9piFzWHXCd9SIVzWqF77u/crHufIhoEa7NkZ -hSC2aosQF619iKnfk0nqWaLDJ182CCXkHERoQC7q9X2IGLDLoA0XAgMBAAEwDQYJ -KoZIhvcNAQELBQADggEBAKbtLx+YlCGRCBmYn3dfYF+BIvK/b/e0DKNhDKhb4s9J -ywlJ4qnAB48tgPx0q+ZB+EdMYRqCwyvXJxEdZ7PsCdUeU6xI2ybkhSdUUfQbYem3 -aYRG+yukGzazySQJs8lGqxBlRMFl/FGCg+oSQ/I32eGf8micDskj2zkAJtCkUPHX -30YrWMfOwW1r2xYr2mBNXbNWXJhW/sIg5u8aa9fcALeuQcMXkbsbVoPmC5aLdiVZ -rvUFoJ8DPg0aYYwj64RwU0B5HW/7jKhQ25FgKVAzLGrgYx1DivkM7UQGdWYnU8IA -A8S89gRjGk2hnkeagWas3dxqTTpgJDhprgWzyKa9hII= +MIIEzDCCA7QCCQCgxkRox+YljjANBgkqhkiG9w0BAQsFADCCASYxYzBhBgNVBAgM +WlRoZSBHcmVhdCBTdGF0ZSBvZiBMb25nLVdpbmRlZCBDZXJ0aWZpY2F0ZSBGaWVs +ZCBOYW1lcyBXaGVyZWJ5IHRvIEluY3JlYXNlIHRoZSBPdXRwdXQgU2l6ZTEfMB0G +A1UEBwwWVG9vbWFueWNoYXJhY3RlcnN2aWxsZTFIMEYGA1UECgw/VGhlIEJlbmV2 +b2xlbnQgU29jaWV0eSBvZiBMb3F1YWNpb3VzIGFuZCBQbGVvbmFzdGljIFBlcmlw +aHJhc2lzMT0wOwYDVQQLDDRFbmRvcnNlbWVudCBvZiBWb3VjaHNhZmUnZCBFdmlk +ZW50aWFyeSBDZXJ0aWZpY2F0aW9uMRUwEwYDVQQDDAxjZXJ0LmV4YW1wbGUwHhcN +MTcwMjIzMjAyNTM2WhcNMTcwMzI1MjAyNTM2WjCCASYxYzBhBgNVBAgMWlRoZSBH +cmVhdCBTdGF0ZSBvZiBMb25nLVdpbmRlZCBDZXJ0aWZpY2F0ZSBGaWVsZCBOYW1l +cyBXaGVyZWJ5IHRvIEluY3JlYXNlIHRoZSBPdXRwdXQgU2l6ZTEfMB0GA1UEBwwW +VG9vbWFueWNoYXJhY3RlcnN2aWxsZTFIMEYGA1UECgw/VGhlIEJlbmV2b2xlbnQg +U29jaWV0eSBvZiBMb3F1YWNpb3VzIGFuZCBQbGVvbmFzdGljIFBlcmlwaHJhc2lz +MT0wOwYDVQQLDDRFbmRvcnNlbWVudCBvZiBWb3VjaHNhZmUnZCBFdmlkZW50aWFy +eSBDZXJ0aWZpY2F0aW9uMRUwEwYDVQQDDAxjZXJ0LmV4YW1wbGUwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7MOIrqH+ZIJiZdroKMrelKMSvvRKg2MEg +j/sx9TaHHqrKys4AiL4Rq/ybQEigFC6G8mpZWbBrU+vN2SLr1ZsPftCHIY12LF56 +0WLYTYNqDgF5BdCZCrjJ2hhN+XwML2tgYdWioV/Eey8SJSqUskf03MpcwnLbVfSp +hwmowqNfiEFFqPBCf7E8IVarGWctbMpvlMbAM5owhMev/Ccmqqt81NFkb1WVejvN +5v/JKv243/Xedf4I7ZJv7zKeswoP9piFzWHXCd9SIVzWqF77u/crHufIhoEa7NkZ +hSC2aosQF619iKnfk0nqWaLDJ182CCXkHERoQC7q9X2IGLDLoA0XAgMBAAEwDQYJ +KoZIhvcNAQELBQADggEBAKbtLx+YlCGRCBmYn3dfYF+BIvK/b/e0DKNhDKhb4s9J +ywlJ4qnAB48tgPx0q+ZB+EdMYRqCwyvXJxEdZ7PsCdUeU6xI2ybkhSdUUfQbYem3 +aYRG+yukGzazySQJs8lGqxBlRMFl/FGCg+oSQ/I32eGf8micDskj2zkAJtCkUPHX +30YrWMfOwW1r2xYr2mBNXbNWXJhW/sIg5u8aa9fcALeuQcMXkbsbVoPmC5aLdiVZ +rvUFoJ8DPg0aYYwj64RwU0B5HW/7jKhQ25FgKVAzLGrgYx1DivkM7UQGdWYnU8IA +A8S89gRjGk2hnkeagWas3dxqTTpgJDhprgWzyKa9hII= -----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem b/deps/openssl/openssl/test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem index 78ebd1b70289..0b5de58c4cfb 100644 --- a/deps/openssl/openssl/test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem +++ b/deps/openssl/openssl/test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem @@ -2,22 +2,22 @@ Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,A2A7FA3E5E454B59C8777564E7AF3CD6 -EBDWX0Qfarl+QNsHgCUudLyb6DkC4zyaDU/vUqWyHX0m+8W2bbmT5TexlL3hsM5U -gz7KsGqyjeOuK9QT5LOM4VyK6BgmhqpQaJ1MgCWA/gbBPTgBp2jfp3oS0WC5D6GM -wcsdqoeIpD/wce3k0H2Gfu6+rINBmbITtn4DTf3PkOcDIwdDceN2qkZanloFVriS -3kABUIh1ehYIXQibLRFY5rXdQnhY2CZNrQFIMwl64hK5P5hQbcyJKGDHAYzXV7ou -pdXy5F9oyEd6eA5ix+n1jKFRB7PmApZmuiQjzfExVKmBPGxRzOGT0qR5vLylQhei -SC77nkerawUyjA2QlIa/SmNzXEYkN3goDzHSFKBauB0o5qFc1b1x7dXPCFL0atG5 -UxoRr/Ep7tiab4DZmYEnOGkL2dVN8jA04F+HQGBeP6nDOSKhXRjbUODUpDpDvj+F -Jf77Rv0p48l9ip8i/bquwukXlMed3O4d6rnEwkggdySS5itiShwaVLPf+icI/Yd4 -vcPXDPUHTkj1XmoZ4f1mUF17OtCohsJT7O4oMBBMBwqCkC7enrLaALi9jiKym47g -2bZH05xJPpWXS/kSEkwt/jI+a+o4CuDPly3XhIcYRtsaWBJWiam1OT7sGQ+zkjTG -Aa6NfwbR8ScQC8MzDfVnkJ3VnXjT345bz+F7HTAveQ8a7KGxNntPhE0KVjpl369K -q2TMLyexQARJapabBf/ST9zWP7wxzWfrEbX3OEZCuRDVkwWf18BH/Eh6Lqnqg5QM -4GuX708NiFpiwQt9p/DAuQdhBrP67BxL64CbI7CgW4Lv3z3qnKfFV9zY5/mxCERn -9mPOig2r8WvvXt7ch6nhzBPfCwq0BoPqLKUFgDpeXsNdJ9sW5IV3yi/3Bh98ZBYX -zj8g/7XMo6v998fct+EiHPscuqeYUaoJZ6+Zj7W45nGA9DGsnEmZ0Wux2tTj70mD -oH//21TiRAx6ypPP+Iq2YDzqh7VXc/gssOn/vU1Aj19gzL+MRn1Z55SMrA7nO90m -OgOyEP+uGrXyahfZGPbmpgIx+MTbtfvRtZBsG3EcXyW9NnHJfk4O8xN3hYPWXaBI -o15qB3jYbx1oktbcQPo0hzaNv+PJ5wtT47JLNcbMeMSnwKM8MB4CXlM43RUtKws6 +EBDWX0Qfarl+QNsHgCUudLyb6DkC4zyaDU/vUqWyHX0m+8W2bbmT5TexlL3hsM5U +gz7KsGqyjeOuK9QT5LOM4VyK6BgmhqpQaJ1MgCWA/gbBPTgBp2jfp3oS0WC5D6GM +wcsdqoeIpD/wce3k0H2Gfu6+rINBmbITtn4DTf3PkOcDIwdDceN2qkZanloFVriS +3kABUIh1ehYIXQibLRFY5rXdQnhY2CZNrQFIMwl64hK5P5hQbcyJKGDHAYzXV7ou +pdXy5F9oyEd6eA5ix+n1jKFRB7PmApZmuiQjzfExVKmBPGxRzOGT0qR5vLylQhei +SC77nkerawUyjA2QlIa/SmNzXEYkN3goDzHSFKBauB0o5qFc1b1x7dXPCFL0atG5 +UxoRr/Ep7tiab4DZmYEnOGkL2dVN8jA04F+HQGBeP6nDOSKhXRjbUODUpDpDvj+F +Jf77Rv0p48l9ip8i/bquwukXlMed3O4d6rnEwkggdySS5itiShwaVLPf+icI/Yd4 +vcPXDPUHTkj1XmoZ4f1mUF17OtCohsJT7O4oMBBMBwqCkC7enrLaALi9jiKym47g +2bZH05xJPpWXS/kSEkwt/jI+a+o4CuDPly3XhIcYRtsaWBJWiam1OT7sGQ+zkjTG +Aa6NfwbR8ScQC8MzDfVnkJ3VnXjT345bz+F7HTAveQ8a7KGxNntPhE0KVjpl369K +q2TMLyexQARJapabBf/ST9zWP7wxzWfrEbX3OEZCuRDVkwWf18BH/Eh6Lqnqg5QM +4GuX708NiFpiwQt9p/DAuQdhBrP67BxL64CbI7CgW4Lv3z3qnKfFV9zY5/mxCERn +9mPOig2r8WvvXt7ch6nhzBPfCwq0BoPqLKUFgDpeXsNdJ9sW5IV3yi/3Bh98ZBYX +zj8g/7XMo6v998fct+EiHPscuqeYUaoJZ6+Zj7W45nGA9DGsnEmZ0Wux2tTj70mD +oH//21TiRAx6ypPP+Iq2YDzqh7VXc/gssOn/vU1Aj19gzL+MRn1Z55SMrA7nO90m +OgOyEP+uGrXyahfZGPbmpgIx+MTbtfvRtZBsG3EcXyW9NnHJfk4O8xN3hYPWXaBI +o15qB3jYbx1oktbcQPo0hzaNv+PJ5wtT47JLNcbMeMSnwKM8MB4CXlM43RUtKws6 -----END DSA PRIVATE KEY----- diff --git a/deps/openssl/openssl/test/recipes/15-test_genrsa.t b/deps/openssl/openssl/test/recipes/15-test_genrsa.t index cc74e303f115..766ea4f0aa3f 100644 --- a/deps/openssl/openssl/test/recipes/15-test_genrsa.t +++ b/deps/openssl/openssl/test/recipes/15-test_genrsa.t @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -18,9 +18,38 @@ setup("test_genrsa"); plan tests => 5; +# We want to know that an absurdly small number of bits isn't support is(run(app([ 'openssl', 'genrsa', '-3', '-out', 'genrsatest.pem', '8'])), 0, "genrsa -3 8"); -ok(run(app([ 'openssl', 'genrsa', '-3', '-out', 'genrsatest.pem', '16'])), "genrsa -3 16"); -ok(run(app([ 'openssl', 'rsa', '-check', '-in', 'genrsatest.pem', '-noout'])), "rsa -check"); -ok(run(app([ 'openssl', 'genrsa', '-f4', '-out', 'genrsatest.pem', '16'])), "genrsa -f4 16"); -ok(run(app([ 'openssl', 'rsa', '-check', '-in', 'genrsatest.pem', '-noout'])), "rsa -check"); + +# Depending on the shared library, we might have different lower limits. +# Let's find it! This is a simple binary search +# ------------------------------------------------------------ +# NOTE: $good may need an update in the future +# ------------------------------------------------------------ +note "Looking for lowest amount of bits"; +my $bad = 3; # Log2 of number of bits (2 << 3 == 8) +my $good = 11; # Log2 of number of bits (2 << 11 == 2048) +while ($good > $bad + 1) { + my $checked = int(($good + $bad + 1) / 2); + if (run(app([ 'openssl', 'genrsa', '-3', '-out', 'genrsatest.pem', + 2 ** $checked ], stderr => undef))) { + note 2 ** $checked, " bits is good"; + $good = $checked; + } else { + note 2 ** $checked, " bits is bad"; + $bad = $checked; + } +} +$good++ if $good == $bad; +$good = 2 ** $good; +note "Found lowest allowed amount of bits to be $good"; + +ok(run(app([ 'openssl', 'genrsa', '-3', '-out', 'genrsatest.pem', $good ])), + "genrsa -3 $good"); +ok(run(app([ 'openssl', 'rsa', '-check', '-in', 'genrsatest.pem', '-noout' ])), + "rsa -check"); +ok(run(app([ 'openssl', 'genrsa', '-f4', '-out', 'genrsatest.pem', $good ])), + "genrsa -f4 $good"); +ok(run(app([ 'openssl', 'rsa', '-check', '-in', 'genrsatest.pem', '-noout' ])), + "rsa -check"); unlink 'genrsatest.pem'; diff --git a/deps/openssl/openssl/test/recipes/25-test_verify.t b/deps/openssl/openssl/test/recipes/25-test_verify.t index 11bd43090f0b..11f54d0486f6 100644 --- a/deps/openssl/openssl/test/recipes/25-test_verify.t +++ b/deps/openssl/openssl/test/recipes/25-test_verify.t @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -30,7 +30,7 @@ sub verify { run(app([@args])); } -plan tests => 127; +plan tests => 129; # Canonical success ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]), @@ -326,6 +326,12 @@ ok(verify("alt2-cert", "sslserver", ["root-cert"], ["ncca2-cert"], ), ok(verify("alt3-cert", "sslserver", ["root-cert"], ["ncca1-cert", "ncca3-cert"], ), "Name Constraints nested test all permitted"); +ok(verify("goodcn1-cert", "sslserver", ["root-cert"], ["ncca1-cert"], ), + "Name Constraints CNs permitted"); + +ok(!verify("badcn1-cert", "sslserver", ["root-cert"], ["ncca1-cert"], ), + "Name Constraints CNs not permitted"); + ok(!verify("badalt1-cert", "sslserver", ["root-cert"], ["ncca1-cert"], ), "Name Constraints hostname not permitted"); diff --git a/deps/openssl/openssl/test/recipes/60-test_x509_dup_cert.t b/deps/openssl/openssl/test/recipes/60-test_x509_dup_cert.t new file mode 100644 index 000000000000..8e1c31381470 --- /dev/null +++ b/deps/openssl/openssl/test/recipes/60-test_x509_dup_cert.t @@ -0,0 +1,19 @@ +#! /usr/bin/env perl +# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the OpenSSL license (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html +# +# ====================================================================== +# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + + +use OpenSSL::Test qw/:DEFAULT srctop_file/; + +setup("test_x509_dup_cert"); + +plan tests => 1; + +ok(run(test(["x509_dup_cert_test", srctop_file("test", "certs", "leaf.pem")]))); diff --git a/deps/openssl/openssl/test/recipes/60-test_x509_time.t b/deps/openssl/openssl/test/recipes/60-test_x509_time.t new file mode 100644 index 000000000000..e812cd0b26f3 --- /dev/null +++ b/deps/openssl/openssl/test/recipes/60-test_x509_time.t @@ -0,0 +1,12 @@ +#! /usr/bin/env perl +# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the OpenSSL license (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + + +use OpenSSL::Test::Simple; + +simple_test("test_x509_time", "x509_time_test"); diff --git a/deps/openssl/openssl/test/recipes/80-test_ca.t b/deps/openssl/openssl/test/recipes/80-test_ca.t index f40aba1d4ddd..28a090ea7dd9 100644 --- a/deps/openssl/openssl/test/recipes/80-test_ca.t +++ b/deps/openssl/openssl/test/recipes/80-test_ca.t @@ -56,3 +56,4 @@ sub yes { close PIPE; return 0; } + diff --git a/deps/openssl/openssl/test/recipes/80-test_cipherlist.t b/deps/openssl/openssl/test/recipes/80-test_cipherlist.t index 98d537e5f368..5c1b1d45457f 100644 --- a/deps/openssl/openssl/test/recipes/80-test_cipherlist.t +++ b/deps/openssl/openssl/test/recipes/80-test_cipherlist.t @@ -1,6 +1,6 @@ #! /usr/bin/perl # -# Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -12,11 +12,16 @@ use strict; use warnings; use OpenSSL::Test::Simple; -use OpenSSL::Test; +use OpenSSL::Test qw(:DEFAULT openssl_versions); use OpenSSL::Test::Utils qw(alldisabled available_protocols); setup("test_cipherlist"); +my ($build_version, $library_version) = openssl_versions(); +plan skip_all => + "This test recipe isn't supported when doing regression testing" + if $build_version != $library_version; + my $no_anytls = alldisabled(available_protocols("tls")); # If we have no protocols, then we also have no supported ciphers. diff --git a/deps/openssl/openssl/test/recipes/80-test_x509aux.t b/deps/openssl/openssl/test/recipes/80-test_x509aux.t index b4897c580883..65ba5fcf5292 100644 --- a/deps/openssl/openssl/test/recipes/80-test_x509aux.t +++ b/deps/openssl/openssl/test/recipes/80-test_x509aux.t @@ -19,7 +19,7 @@ plan skip_all => "test_dane uses ec which is not supported by this OpenSSL build plan tests => 1; # The number of tests being performed -ok(run(test(["x509aux", +ok(run(test(["x509aux", srctop_file("test", "certs", "roots.pem"), srctop_file("test", "certs", "root+anyEKU.pem"), srctop_file("test", "certs", "root-anyEKU.pem"), diff --git a/deps/openssl/openssl/test/recipes/90-test_fuzz.t b/deps/openssl/openssl/test/recipes/90-test_fuzz.t index d15292573350..8d3b3541fc4b 100644 --- a/deps/openssl/openssl/test/recipes/90-test_fuzz.t +++ b/deps/openssl/openssl/test/recipes/90-test_fuzz.t @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -26,14 +26,14 @@ plan tests => scalar @fuzzers; foreach my $f (@fuzzers) { subtest "Fuzzing $f" => sub { - my @files = glob(srctop_file('fuzz', 'corpora', $f, '*')); - push @files, glob(srctop_file('fuzz', 'corpora', "$f-*", '*')); + my @dirs = glob(srctop_file('fuzz', 'corpora', $f)); + push @dirs, glob(srctop_file('fuzz', 'corpora', "$f-*")); - plan skip_all => "No corpora for $f-test" unless @files; + plan skip_all => "No corpora for $f-test" unless @dirs; - plan tests => scalar @files; + plan tests => scalar @dirs; - foreach (@files) { + foreach (@dirs) { ok(run(fuzz(["$f-test", $_]))); } } diff --git a/deps/openssl/openssl/test/recipes/90-test_shlibload.t b/deps/openssl/openssl/test/recipes/90-test_shlibload.t index 2bc86fdec55d..04d52658900b 100644 --- a/deps/openssl/openssl/test/recipes/90-test_shlibload.t +++ b/deps/openssl/openssl/test/recipes/90-test_shlibload.t @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -20,7 +20,7 @@ use configdata; plan skip_all => "Test only supported in a shared build" if disabled("shared"); -plan tests => 3; +plan tests => 4; my $libcrypto_idx = $unified_info{rename}->{libcrypto} // "libcrypto"; my $libssl_idx = $unified_info{rename}->{libssl} // "libssl"; @@ -35,3 +35,6 @@ ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl])), "running shlibloadtest -ssl_first"); ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl])), "running shlibloadtest -just_crypto"); +ok(run(test(["shlibloadtest", "-dso_ref", $libcrypto, $libssl])), + "running shlibloadtest -dso_ref"); + diff --git a/deps/openssl/openssl/test/recipes/tconversion.pl b/deps/openssl/openssl/test/recipes/tconversion.pl index e19147b69757..1cf68dc09b8b 100644 --- a/deps/openssl/openssl/test/recipes/tconversion.pl +++ b/deps/openssl/openssl/test/recipes/tconversion.pl @@ -23,7 +23,7 @@ sub tconversion { my $testtype = shift; my $t = shift; - my @conversionforms = + my @conversionforms = defined($conversionforms{$testtype}) ? @{$conversionforms{$testtype}} : @{$conversionforms{"*"}}; diff --git a/deps/openssl/openssl/test/run_tests.pl b/deps/openssl/openssl/test/run_tests.pl index 889d6dc117eb..77dffb332b39 100644 --- a/deps/openssl/openssl/test/run_tests.pl +++ b/deps/openssl/openssl/test/run_tests.pl @@ -21,7 +21,7 @@ BEGIN use OpenSSL::Glob; use Module::Load::Conditional qw(can_load); -my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef }) +my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef }) ? 'TAP::Harness' : 'OpenSSL::TAP::Harness'; my $srctop = $ENV{SRCTOP} || $ENV{TOP}; diff --git a/deps/openssl/openssl/test/shlibloadtest.c b/deps/openssl/openssl/test/shlibloadtest.c index 25df363f235b..d584413ac9be 100644 --- a/deps/openssl/openssl/test/shlibloadtest.c +++ b/deps/openssl/openssl/test/shlibloadtest.c @@ -40,6 +40,16 @@ static OpenSSL_version_num_t OpenSSL_version_num; #ifdef DSO_DLFCN +# define DSO_DSOBYADDR "DSO_dsobyaddr" +# define DSO_FREE "DSO_free" + +typedef void DSO; +typedef DSO * (*DSO_dsobyaddr_t)(void (*addr)(void), int flags); +typedef int (*DSO_free_t)(DSO *dso); + +static DSO_dsobyaddr_t DSO_dsobyaddr; +static DSO_free_t DSO_free; + # include typedef void * SHLIB; @@ -108,11 +118,13 @@ static int shlib_close(SHLIB lib) # define CRYPTO_FIRST_OPT "-crypto_first" # define SSL_FIRST_OPT "-ssl_first" # define JUST_CRYPTO_OPT "-just_crypto" +# define DSO_REFTEST_OPT "-dso_ref" enum test_types_en { CRYPTO_FIRST, SSL_FIRST, - JUST_CRYPTO + JUST_CRYPTO, + DSO_REFTEST }; int main(int argc, char **argv) @@ -123,7 +135,7 @@ int main(int argc, char **argv) void (*func) (void); SHLIB_SYM sym; } tls_method_sym, ssl_ctx_new_sym, ssl_ctx_free_sym, err_get_error_sym, - openssl_version_num_sym; + openssl_version_num_sym, dso_dsobyaddr_sym, dso_free_sym; enum test_types_en test_type; int i; @@ -138,6 +150,8 @@ int main(int argc, char **argv) test_type = SSL_FIRST; } else if (strcmp(argv[1], JUST_CRYPTO_OPT) == 0) { test_type = JUST_CRYPTO; + } else if (strcmp(argv[1], DSO_REFTEST_OPT) == 0) { + test_type = DSO_REFTEST; } else { printf("Unrecognised argument\n"); return 1; @@ -145,7 +159,8 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { if ((i == 0 && (test_type == CRYPTO_FIRST - || test_type == JUST_CRYPTO)) + || test_type == JUST_CRYPTO + || test_type == DSO_REFTEST)) || (i == 1 && test_type == SSL_FIRST)) { if (!shlib_load(argv[2], &cryptolib)) { printf("Unable to load libcrypto\n"); @@ -161,7 +176,7 @@ int main(int argc, char **argv) } } - if (test_type != JUST_CRYPTO) { + if (test_type != JUST_CRYPTO && test_type != DSO_REFTEST) { if (!shlib_sym(ssllib, TLS_METHOD, &tls_method_sym.sym) || !shlib_sym(ssllib, SSL_CTX_NEW, &ssl_ctx_new_sym.sym) || !shlib_sym(ssllib, SSL_CTX_FREE, &ssl_ctx_free_sym.sym)) { @@ -215,6 +230,38 @@ int main(int argc, char **argv) return 1; } + if (test_type == DSO_REFTEST) { +# ifdef DSO_DLFCN + /* + * This is resembling the code used in ossl_init_base() and + * OPENSSL_atexit() to block unloading the library after dlclose(). + * We are not testing this on Windows, because it is done there in a + * completely different way. Especially as a call to DSO_dsobyaddr() + * will always return an error, because DSO_pathbyaddr() is not + * implemented there. + */ + if (!shlib_sym(cryptolib, DSO_DSOBYADDR, &dso_dsobyaddr_sym.sym) + || !shlib_sym(cryptolib, DSO_FREE, &dso_free_sym.sym)) { + printf("Unable to load crypto dso symbols\n"); + return 1; + } + + DSO_dsobyaddr = (DSO_dsobyaddr_t)dso_dsobyaddr_sym.func; + DSO_free = (DSO_free_t)dso_free_sym.func; + + { + DSO *hndl; + /* use known symbol from crypto module */ + if ((hndl = DSO_dsobyaddr((void (*)(void))ERR_get_error, 0)) != NULL) { + DSO_free(hndl); + } else { + printf("Unable to obtain DSO reference from crypto symbol\n"); + return 1; + } + } +# endif /* DSO_DLFCN */ + } + for (i = 0; i < 2; i++) { if ((i == 0 && test_type == CRYPTO_FIRST) || (i == 1 && test_type == SSL_FIRST)) { @@ -224,7 +271,8 @@ int main(int argc, char **argv) } } if ((i == 0 && (test_type == SSL_FIRST - || test_type == JUST_CRYPTO)) + || test_type == JUST_CRYPTO + || test_type == DSO_REFTEST)) || (i == 1 && test_type == CRYPTO_FIRST)) { if (!shlib_close(cryptolib)) { printf("Unable to close libcrypto\n"); diff --git a/deps/openssl/openssl/test/ssl-tests/01-simple.conf b/deps/openssl/openssl/test/ssl-tests/01-simple.conf index 65c7e5d151f1..5f4dd841b473 100644 --- a/deps/openssl/openssl/test/ssl-tests/01-simple.conf +++ b/deps/openssl/openssl/test/ssl-tests/01-simple.conf @@ -74,3 +74,5 @@ VerifyMode = Peer [test-2] ExpectedClientAlert = UnknownCA ExpectedResult = ClientFail + + diff --git a/deps/openssl/openssl/test/ssl-tests/02-protocol-version.conf b/deps/openssl/openssl/test/ssl-tests/02-protocol-version.conf index cb737f80722e..cb89dbc10aa6 100644 --- a/deps/openssl/openssl/test/ssl-tests/02-protocol-version.conf +++ b/deps/openssl/openssl/test/ssl-tests/02-protocol-version.conf @@ -9971,3 +9971,5 @@ VerifyMode = Peer [test-360] ExpectedProtocol = TLSv1.2 ExpectedResult = Success + + diff --git a/deps/openssl/openssl/test/ssl-tests/03-custom_verify.conf b/deps/openssl/openssl/test/ssl-tests/03-custom_verify.conf index 65c9005ff85c..8dca715e74da 100644 --- a/deps/openssl/openssl/test/ssl-tests/03-custom_verify.conf +++ b/deps/openssl/openssl/test/ssl-tests/03-custom_verify.conf @@ -234,3 +234,5 @@ client = 8-verify-custom-fail-no-root-client-extra [8-verify-custom-fail-no-root-client-extra] VerifyCallback = RejectAll + + diff --git a/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf b/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf index bf374039d186..0e91bed9f18e 100644 --- a/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf +++ b/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf @@ -588,3 +588,5 @@ VerifyMode = Peer [test-19] ExpectedResult = ServerFail ExpectedServerAlert = UnknownCA + + diff --git a/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf.in b/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf.in index bb7fddb8bc90..8738aaa76966 100644 --- a/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf.in +++ b/deps/openssl/openssl/test/ssl-tests/04-client_auth.conf.in @@ -119,5 +119,5 @@ sub generate_tests() { } } } - + generate_tests(); diff --git a/deps/openssl/openssl/test/ssl-tests/05-sni.conf b/deps/openssl/openssl/test/ssl-tests/05-sni.conf index 4278cbf85b0d..e1fb3d9d8967 100644 --- a/deps/openssl/openssl/test/ssl-tests/05-sni.conf +++ b/deps/openssl/openssl/test/ssl-tests/05-sni.conf @@ -199,3 +199,5 @@ ServerNameCallback = RejectMismatch [5-SNI-bad-sni-reject-mismatch-client-extra] ServerName = invalid + + diff --git a/deps/openssl/openssl/test/ssl-tests/06-sni-ticket.conf b/deps/openssl/openssl/test/ssl-tests/06-sni-ticket.conf index 9ee9c71fcc64..9620e015a1a9 100644 --- a/deps/openssl/openssl/test/ssl-tests/06-sni-ticket.conf +++ b/deps/openssl/openssl/test/ssl-tests/06-sni-ticket.conf @@ -730,3 +730,5 @@ ServerNameCallback = IgnoreMismatch [16-sni-session-ticket-client-extra] ServerName = server2 + + diff --git a/deps/openssl/openssl/test/ssl-tests/07-dtls-protocol-version.conf b/deps/openssl/openssl/test/ssl-tests/07-dtls-protocol-version.conf index bd9a5db7a28b..3304a3bbaaec 100644 --- a/deps/openssl/openssl/test/ssl-tests/07-dtls-protocol-version.conf +++ b/deps/openssl/openssl/test/ssl-tests/07-dtls-protocol-version.conf @@ -1816,3 +1816,5 @@ VerifyMode = Peer ExpectedProtocol = DTLSv1.2 ExpectedResult = Success Method = DTLS + + diff --git a/deps/openssl/openssl/test/ssl-tests/08-npn.conf b/deps/openssl/openssl/test/ssl-tests/08-npn.conf index 8b4b5360c070..9115ef458b89 100644 --- a/deps/openssl/openssl/test/ssl-tests/08-npn.conf +++ b/deps/openssl/openssl/test/ssl-tests/08-npn.conf @@ -790,3 +790,5 @@ NPNProtocols = baz [19-npn-used-if-alpn-not-supported-resumption-client-extra] ALPNProtocols = foo NPNProtocols = bar,baz + + diff --git a/deps/openssl/openssl/test/ssl-tests/08-npn.conf.in b/deps/openssl/openssl/test/ssl-tests/08-npn.conf.in index 796599224474..bcb632f051dd 100644 --- a/deps/openssl/openssl/test/ssl-tests/08-npn.conf.in +++ b/deps/openssl/openssl/test/ssl-tests/08-npn.conf.in @@ -237,7 +237,7 @@ our @tests = ( test => { "ExpectedALPNProtocol" => undef, "ExpectedNPNProtocol" => "bar", - "ExpectedServerName" => "server2", + "ExpectedServerName" => "server2", }, }, { diff --git a/deps/openssl/openssl/test/ssl-tests/09-alpn.conf b/deps/openssl/openssl/test/ssl-tests/09-alpn.conf index bb11102636e6..e7e6cb95348b 100644 --- a/deps/openssl/openssl/test/ssl-tests/09-alpn.conf +++ b/deps/openssl/openssl/test/ssl-tests/09-alpn.conf @@ -615,3 +615,5 @@ ALPNProtocols = foo [15-alpn-no-client-support-resumption-client-extra] ALPNProtocols = foo + + diff --git a/deps/openssl/openssl/test/ssl-tests/09-alpn.conf.in b/deps/openssl/openssl/test/ssl-tests/09-alpn.conf.in index 41c9486fa52e..37035f1d84d4 100644 --- a/deps/openssl/openssl/test/ssl-tests/09-alpn.conf.in +++ b/deps/openssl/openssl/test/ssl-tests/09-alpn.conf.in @@ -180,7 +180,7 @@ our @tests = ( name => "alpn-selected-sni-server-does-not-support-alpn", server => { extra => { - "ALPNProtocols" => "bar", + "ALPNProtocols" => "bar", "ServerNameCallback" => "IgnoreMismatch", }, }, diff --git a/deps/openssl/openssl/test/ssl-tests/10-resumption.conf b/deps/openssl/openssl/test/ssl-tests/10-resumption.conf index 4c79b0898e7b..b2deee4209fd 100644 --- a/deps/openssl/openssl/test/ssl-tests/10-resumption.conf +++ b/deps/openssl/openssl/test/ssl-tests/10-resumption.conf @@ -1332,3 +1332,5 @@ VerifyMode = Peer ExpectedProtocol = TLSv1.2 HandshakeMode = Resume ResumptionExpected = Yes + + diff --git a/deps/openssl/openssl/test/ssl-tests/11-dtls_resumption.conf b/deps/openssl/openssl/test/ssl-tests/11-dtls_resumption.conf index df28ecb1e7bd..ceed95974472 100644 --- a/deps/openssl/openssl/test/ssl-tests/11-dtls_resumption.conf +++ b/deps/openssl/openssl/test/ssl-tests/11-dtls_resumption.conf @@ -608,3 +608,5 @@ ExpectedProtocol = DTLSv1.2 HandshakeMode = Resume Method = DTLS ResumptionExpected = Yes + + diff --git a/deps/openssl/openssl/test/ssl-tests/12-ct.conf b/deps/openssl/openssl/test/ssl-tests/12-ct.conf index 985292e9000f..2e6e9dea6757 100644 --- a/deps/openssl/openssl/test/ssl-tests/12-ct.conf +++ b/deps/openssl/openssl/test/ssl-tests/12-ct.conf @@ -187,3 +187,5 @@ CTValidation = Strict [5-ct-strict-resumption-resume-client-extra] CTValidation = Strict + + diff --git a/deps/openssl/openssl/test/ssl-tests/13-fragmentation.conf b/deps/openssl/openssl/test/ssl-tests/13-fragmentation.conf index 02feb2c7783a..4c1e9e2b3389 100644 --- a/deps/openssl/openssl/test/ssl-tests/13-fragmentation.conf +++ b/deps/openssl/openssl/test/ssl-tests/13-fragmentation.conf @@ -393,3 +393,5 @@ VerifyMode = Peer [test-15] ApplicationData = 4096 MaxFragmentSize = 4096 + + diff --git a/deps/openssl/openssl/test/ssl-tests/14-curves.conf b/deps/openssl/openssl/test/ssl-tests/14-curves.conf index 61b297053e7f..7f7ac4ba8dc0 100644 --- a/deps/openssl/openssl/test/ssl-tests/14-curves.conf +++ b/deps/openssl/openssl/test/ssl-tests/14-curves.conf @@ -783,3 +783,5 @@ VerifyMode = Peer [test-28] ExpectedResult = Success ExpectedTmpKeyType = X25519 + + diff --git a/deps/openssl/openssl/test/ssl-tests/15-certstatus.conf b/deps/openssl/openssl/test/ssl-tests/15-certstatus.conf index 770f024d13fc..bf6c41cda2f3 100644 --- a/deps/openssl/openssl/test/ssl-tests/15-certstatus.conf +++ b/deps/openssl/openssl/test/ssl-tests/15-certstatus.conf @@ -58,3 +58,5 @@ server = 1-certstatus-bad-server-extra [1-certstatus-bad-server-extra] CertStatus = BadResponse + + diff --git a/deps/openssl/openssl/test/ssl-tests/16-dtls-certstatus.conf b/deps/openssl/openssl/test/ssl-tests/16-dtls-certstatus.conf index eb55bbd71c2e..a561803a5544 100644 --- a/deps/openssl/openssl/test/ssl-tests/16-dtls-certstatus.conf +++ b/deps/openssl/openssl/test/ssl-tests/16-dtls-certstatus.conf @@ -58,3 +58,5 @@ server = 1-certstatus-bad-server-extra [1-certstatus-bad-server-extra] CertStatus = BadResponse + + diff --git a/deps/openssl/openssl/test/ssl-tests/17-renegotiate.conf b/deps/openssl/openssl/test/ssl-tests/17-renegotiate.conf index 45a9d5864b1f..48f569fad6da 100644 --- a/deps/openssl/openssl/test/ssl-tests/17-renegotiate.conf +++ b/deps/openssl/openssl/test/ssl-tests/17-renegotiate.conf @@ -424,3 +424,5 @@ ExpectedResult = ClientFail HandshakeMode = RenegotiateClient Method = TLS ResumptionExpected = No + + diff --git a/deps/openssl/openssl/test/ssl-tests/18-dtls-renegotiate.conf b/deps/openssl/openssl/test/ssl-tests/18-dtls-renegotiate.conf index d23a84a89b77..3d8ebd74c455 100644 --- a/deps/openssl/openssl/test/ssl-tests/18-dtls-renegotiate.conf +++ b/deps/openssl/openssl/test/ssl-tests/18-dtls-renegotiate.conf @@ -272,3 +272,5 @@ client = 8-renegotiate-aead-to-aead-client-extra [8-renegotiate-aead-to-aead-client-extra] RenegotiateCiphers = AES256-GCM-SHA384 + + diff --git a/deps/openssl/openssl/test/ssl-tests/19-mac-then-encrypt.conf b/deps/openssl/openssl/test/ssl-tests/19-mac-then-encrypt.conf index 8626a06669c5..40480edbf890 100644 --- a/deps/openssl/openssl/test/ssl-tests/19-mac-then-encrypt.conf +++ b/deps/openssl/openssl/test/ssl-tests/19-mac-then-encrypt.conf @@ -152,3 +152,5 @@ VerifyMode = Peer [test-5] ExpectedResult = Success + + diff --git a/deps/openssl/openssl/test/ssl_test.tmpl b/deps/openssl/openssl/test/ssl_test.tmpl index 0517bff44fd8..9506837f84e5 100644 --- a/deps/openssl/openssl/test/ssl_test.tmpl +++ b/deps/openssl/openssl/test/ssl_test.tmpl @@ -92,35 +92,35 @@ client = {-$testname-}-client{- $OUT .= "\n[$testname-server-extra]\n"; foreach my $key (sort keys %{$server{"extra"}}) { $OUT .= qq{$key} . " = " . qq{$server{"extra"}{$key}\n} - if defined $server{"extra"}{$key}; + if defined $server{"extra"}{$key}; } } if (%server2 && $server2{"extra"}) { $OUT .= "\n[$testname-server2-extra]\n"; foreach my $key (sort keys %{$server2{"extra"}}) { $OUT .= qq{$key} . " = " . qq{$server2{"extra"}{$key}\n} - if defined $server2{"extra"}{$key}; + if defined $server2{"extra"}{$key}; } } if (%resume_server && $resume_server{"extra"}) { $OUT .= "\n[$testname-resume-server-extra]\n"; foreach my $key (sort keys %{$resume_server{"extra"}}) { $OUT .= qq{$key} . " = " . qq{$resume_server{"extra"}{$key}\n} - if defined $resume_server{"extra"}{$key}; + if defined $resume_server{"extra"}{$key}; } } if ($client{"extra"}) { $OUT .= "\n[$testname-client-extra]\n"; foreach my $key (sort keys %{$client{"extra"}}) { $OUT .= qq{$key} . " = " . qq{$client{"extra"}{$key}\n} - if defined $client{"extra"}{$key}; + if defined $client{"extra"}{$key}; } } if (%resume_client && $resume_client{"extra"}) { $OUT .= "\n[$testname-resume-client-extra]\n"; foreach my $key (sort keys %{$resume_client{"extra"}}) { $OUT .= qq{$key} . " = " . qq{$resume_client{"extra"}{$key}\n} - if defined $resume_client{"extra"}{$key}; + if defined $resume_client{"extra"}{$key}; } } -} diff --git a/deps/openssl/openssl/test/sslapitest.c b/deps/openssl/openssl/test/sslapitest.c index 77e8f2e9ad36..8badd284e328 100644 --- a/deps/openssl/openssl/test/sslapitest.c +++ b/deps/openssl/openssl/test/sslapitest.c @@ -1208,6 +1208,61 @@ static int test_custom_exts(int tst) return testresult; } +static int test_ssl_pending(int tst) +{ + SSL_CTX *cctx = NULL, *sctx = NULL; + SSL *clientssl = NULL, *serverssl = NULL; + int testresult = 0; + char msg[] = "A test message"; + char buf[5]; + size_t written; + + if (tst == 0) { + if (!create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), + TLS1_VERSION, TLS_MAX_VERSION, + &sctx, &cctx, cert, privkey)) { + printf("Failed creating SSL_CTX pair\n"); + goto end; + } + } else { +#ifndef OPENSSL_NO_DTLS + if (!create_ssl_ctx_pair(DTLS_server_method(), DTLS_client_method(), + DTLS1_VERSION, DTLS_MAX_VERSION, + &sctx, &cctx, cert, privkey)) { + printf("Failed creating SSL_CTX pair\n"); + goto end; + } +#else + return 1; +#endif + } + + if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL) + || !create_ssl_connection(serverssl, clientssl)) { + printf("Failed creating connection\n"); + goto end; + } + + written = SSL_write(serverssl, msg, sizeof(msg)); + if (written != sizeof(msg) + || SSL_read(clientssl, buf, sizeof(buf)) != sizeof(buf) + || SSL_pending(clientssl) != (int)(written - sizeof(buf))) { + printf("Failed checking SSL_pending\n"); + goto end; + } + + testresult = 1; + + end: + SSL_free(serverssl); + SSL_free(clientssl); + SSL_CTX_free(sctx); + SSL_CTX_free(cctx); + + return testresult; +} + + int main(int argc, char *argv[]) { BIO *err = NULL; @@ -1244,6 +1299,7 @@ int main(int argc, char *argv[]) ADD_TEST(test_ssl_bio_change_wbio); ADD_ALL_TESTS(test_set_sigalgs, OSSL_NELEM(testsigalgs) * 2); ADD_ALL_TESTS(test_custom_exts, 2); + ADD_ALL_TESTS(test_ssl_pending, 2); testresult = run_tests(argv[0]); diff --git a/deps/openssl/openssl/test/verify_extra_test.c b/deps/openssl/openssl/test/verify_extra_test.c index cc05bc2ef1f0..fabc1dc59f6f 100644 --- a/deps/openssl/openssl/test/verify_extra_test.c +++ b/deps/openssl/openssl/test/verify_extra_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -137,6 +137,43 @@ static int test_alt_chains_cert_forgery(const char *roots_f, return ret; } +static int test_store_ctx(const char *bad_f) +{ + X509_STORE_CTX *sctx = NULL; + X509 *x = NULL; + BIO *bio = NULL; + int testresult = 0, ret; + + bio = BIO_new_file(bad_f, "r"); + if (bio == NULL) + goto err; + + x = PEM_read_bio_X509(bio, NULL, 0, NULL); + if (x == NULL) + goto err; + + sctx = X509_STORE_CTX_new(); + if (sctx == NULL) + goto err; + + if (!X509_STORE_CTX_init(sctx, NULL, x, NULL)) + goto err; + + /* Verifying a cert where we have no trusted certs should fail */ + ret = X509_verify_cert(sctx); + + if (ret == 0) { + /* This is the result we were expecting: Test passed */ + testresult = 1; + } + + err: + X509_STORE_CTX_free(sctx); + X509_free(x); + BIO_free(bio); + return testresult; +} + int main(int argc, char **argv) { CRYPTO_set_mem_debug(1); @@ -152,6 +189,11 @@ int main(int argc, char **argv) return 1; } + if (!test_store_ctx(argv[3])) { + fprintf(stderr, "Test X509_STORE_CTX failed\n"); + return 1; + } + #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (CRYPTO_mem_leaks_fp(stderr) <= 0) return 1; diff --git a/deps/openssl/openssl/test/versions.c b/deps/openssl/openssl/test/versions.c new file mode 100644 index 000000000000..3ab05ec35d5d --- /dev/null +++ b/deps/openssl/openssl/test/versions.c @@ -0,0 +1,20 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include + +/* A simple helper for the perl function OpenSSL::Test::openssl_versions */ +int main(void) +{ + printf("Build version: 0x%08lX\n", OPENSSL_VERSION_NUMBER); + printf("Library version: 0x%08lX\n", OpenSSL_version_num()); + return 0; +} diff --git a/deps/openssl/openssl/test/x509_dup_cert_test.c b/deps/openssl/openssl/test/x509_dup_cert_test.c new file mode 100644 index 000000000000..7f7adebbb0fb --- /dev/null +++ b/deps/openssl/openssl/test/x509_dup_cert_test.c @@ -0,0 +1,70 @@ +/* + * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* ==================================================================== + * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. + */ + +#include +#include +#include + +static int test_509_dup_cert(const char *cert_f) +{ + int ret = 0; + X509_STORE_CTX *sctx = NULL; + X509_STORE *store = NULL; + X509_LOOKUP *lookup = NULL; + + store = X509_STORE_new(); + if (store == NULL) + goto err; + + lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + if (lookup == NULL) + goto err; + + if (!X509_load_cert_file(lookup, cert_f, X509_FILETYPE_PEM)) + goto err; + if (!X509_load_cert_file(lookup, cert_f, X509_FILETYPE_PEM)) + goto err; + + ret = 1; + + err: + X509_STORE_CTX_free(sctx); + X509_STORE_free(store); + if (ret != 1) + ERR_print_errors_fp(stderr); + return ret; +} + +int main(int argc, char **argv) +{ + CRYPTO_set_mem_debug(1); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + if (argc != 2) { + fprintf(stderr, "usage: x509_dup_cert_test cert.pem\n"); + return 1; + } + + if (!test_509_dup_cert(argv[1])) { + fprintf(stderr, "Test X509 duplicate cert failed\n"); + return 1; + } + +#ifndef OPENSSL_NO_CRYPTO_MDEBUG + if (CRYPTO_mem_leaks_fp(stderr) <= 0) + return 1; +#endif + + printf("PASS\n"); + return 0; +} diff --git a/deps/openssl/openssl/test/x509_time_test.c b/deps/openssl/openssl/test/x509_time_test.c new file mode 100644 index 000000000000..32d65c87617b --- /dev/null +++ b/deps/openssl/openssl/test/x509_time_test.c @@ -0,0 +1,212 @@ +/* + * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* Tests for X509 time functions */ + +#include +#include + +#include +#include +#include "testutil.h" +#include "e_os.h" + +typedef struct { + const char *data; + int type; + time_t cmp_time; + /* -1 if asn1_time <= cmp_time, 1 if asn1_time > cmp_time, 0 if error. */ + int expected; +} TESTDATA; + +static TESTDATA x509_cmp_tests[] = { + { + "20170217180154Z", V_ASN1_GENERALIZEDTIME, + /* The same in seconds since epoch. */ + 1487354514, -1, + }, + { + "20170217180154Z", V_ASN1_GENERALIZEDTIME, + /* One second more. */ + 1487354515, -1, + }, + { + "20170217180154Z", V_ASN1_GENERALIZEDTIME, + /* One second less. */ + 1487354513, 1, + }, + /* Same as UTC time. */ + { + "170217180154Z", V_ASN1_UTCTIME, + /* The same in seconds since epoch. */ + 1487354514, -1, + }, + { + "170217180154Z", V_ASN1_UTCTIME, + /* One second more. */ + 1487354515, -1, + }, + { + "170217180154Z", V_ASN1_UTCTIME, + /* One second less. */ + 1487354513, 1, + }, + /* UTCTime from the 20th century. */ + { + "990217180154Z", V_ASN1_UTCTIME, + /* The same in seconds since epoch. */ + 919274514, -1, + }, + { + "990217180154Z", V_ASN1_UTCTIME, + /* One second more. */ + 919274515, -1, + }, + { + "990217180154Z", V_ASN1_UTCTIME, + /* One second less. */ + 919274513, 1, + }, + /* Various invalid formats. */ + { + /* No trailing Z. */ + "20170217180154", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* No trailing Z, UTCTime. */ + "170217180154", V_ASN1_UTCTIME, 0, 0, + }, + { + /* No seconds. */ + "201702171801Z", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* No seconds, UTCTime. */ + "1702171801Z", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Fractional seconds. */ + "20170217180154.001Z", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Fractional seconds, UTCTime. */ + "170217180154.001Z", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Timezone offset. */ + "20170217180154+0100", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Timezone offset, UTCTime. */ + "170217180154+0100", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Extra digits. */ + "2017021718015400Z", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Extra digits, UTCTime. */ + "17021718015400Z", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Non-digits. */ + "2017021718015aZ", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Non-digits, UTCTime. */ + "17021718015aZ", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Trailing garbage. */ + "20170217180154Zlongtrailinggarbage", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Trailing garbage, UTCTime. */ + "170217180154Zlongtrailinggarbage", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Swapped type. */ + "20170217180154Z", V_ASN1_UTCTIME, 0, 0, + }, + { + /* Swapped type. */ + "170217180154Z", V_ASN1_GENERALIZEDTIME, 0, 0, + }, + { + /* Bad type. */ + "20170217180154Z", V_ASN1_OCTET_STRING, 0, 0, + }, +}; + +static int test_x509_cmp_time(int idx) +{ + ASN1_TIME t; + int result; + + memset(&t, 0, sizeof(t)); + t.type = x509_cmp_tests[idx].type; + t.data = (unsigned char*)(x509_cmp_tests[idx].data); + t.length = strlen(x509_cmp_tests[idx].data); + + result = X509_cmp_time(&t, &x509_cmp_tests[idx].cmp_time); + if (result != x509_cmp_tests[idx].expected) { + fprintf(stderr, "test_x509_cmp_time(%d) failed: expected %d, got %d\n", + idx, x509_cmp_tests[idx].expected, result); + return 0; + } + return 1; +} + +static int test_x509_cmp_time_current() +{ + time_t now = time(NULL); + /* Pick a day earlier and later, relative to any system clock. */ + ASN1_TIME *asn1_before = NULL, *asn1_after = NULL; + int cmp_result, failed = 0; + + asn1_before = ASN1_TIME_adj(NULL, now, -1, 0); + asn1_after = ASN1_TIME_adj(NULL, now, 1, 0); + + cmp_result = X509_cmp_time(asn1_before, NULL); + if (cmp_result != -1) { + fprintf(stderr, "test_x509_cmp_time_current failed: expected -1, got %d\n", + cmp_result); + failed = 1; + } + + cmp_result = X509_cmp_time(asn1_after, NULL); + if (cmp_result != 1) { + fprintf(stderr, "test_x509_cmp_time_current failed: expected 1, got %d\n", + cmp_result); + failed = 1; + } + + ASN1_TIME_free(asn1_before); + ASN1_TIME_free(asn1_after); + + return failed == 0; +} + +int main(int argc, char **argv) +{ + int ret = 0; + unsigned int idx; + + if (!test_x509_cmp_time_current()) + ret = 1; + + for (idx=0 ; idx < OSSL_NELEM(x509_cmp_tests) ; ++idx) { + if (!test_x509_cmp_time(idx)) + ret = 1; + } + + if (ret == 0) + printf("PASS\n"); + return ret; +} diff --git a/deps/openssl/openssl/util/copy.pl b/deps/openssl/openssl/util/copy.pl index 01964f585e87..fe1c908e681a 100644 --- a/deps/openssl/openssl/util/copy.pl +++ b/deps/openssl/openssl/util/copy.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -18,6 +18,7 @@ my $stripcr = 0; my $arg; +my @excludes = (); foreach $arg (@ARGV) { if ($arg eq "-stripcr") @@ -25,11 +26,16 @@ $stripcr = 1; next; } + if ($arg =~ /^-exclude_re=(.*)$/) + { + push @excludes, $1; + next; + } $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob... $arg = qq("$arg") if ($arg =~ /\s/); # compensate for bug in 5.10... - foreach (glob $arg) + foreach my $f (glob $arg) { - push @filelist, $_; + push @filelist, $f unless grep { $f =~ /$_/ } @excludes; } } diff --git a/deps/openssl/openssl/util/dofile.pl b/deps/openssl/openssl/util/dofile.pl index fc72989b0fd9..4533c135a30e 100644 --- a/deps/openssl/openssl/util/dofile.pl +++ b/deps/openssl/openssl/util/dofile.pl @@ -40,7 +40,7 @@ package OpenSSL::Template; use File::Basename; use File::Spec::Functions; use lib "$FindBin::Bin/perl"; -use with_fallback qw(Text::Template); +use with_fallback "Text::Template 1.46"; #use parent qw/Text::Template/; use vars qw/@ISA/; @@ -99,9 +99,9 @@ package main; # This adds quotes (") around the given string, and escapes any $, @, \, # " and ' by prepending a \ to them. sub quotify1 { - my $s = my $orig = shift @_; + my $s = shift @_; $s =~ s/([\$\@\\"'])/\\$1/g; - $s ne $orig || $s =~ /\s/ ? '"'.$s.'"' : $s; + '"'.$s.'"'; } # quotify_l LIST diff --git a/deps/openssl/openssl/util/echo.pl b/deps/openssl/openssl/util/echo.pl new file mode 100644 index 000000000000..d90e52129bab --- /dev/null +++ b/deps/openssl/openssl/util/echo.pl @@ -0,0 +1,12 @@ +#! /usr/bin/perl + +use strict; +use warnings; +use Getopt::Std; + +our $opt_n = 0; + +getopts('n') or die "Invalid option: $!\n"; + +print join(' ', @ARGV); +print "\n" unless $opt_n; diff --git a/deps/openssl/openssl/util/fipslink.pl b/deps/openssl/openssl/util/fipslink.pl index 8248382c8483..18a91532be53 100644 --- a/deps/openssl/openssl/util/fipslink.pl +++ b/deps/openssl/openssl/util/fipslink.pl @@ -20,7 +20,7 @@ sub check_env my ($fips_cc,$fips_cc_args, $fips_link,$fips_target, $fips_libdir, $sha1_exe) = check_env("FIPS_CC", "FIPS_CC_ARGS", "FIPS_LINK", "FIPS_TARGET", - "FIPSLIB_D", "FIPS_SHA1_EXE"); + "FIPSLIB_D", "FIPS_SHA1_EXE"); @@ -109,5 +109,7 @@ sub check_hash $hashval =~ s/^.*=\s+//; die "Invalid hash syntax in file" if (length($hashfile) != 40); die "Invalid hash received for file" if (length($hashval) != 40); - die "***HASH VALUE MISMATCH FOR FILE $filename ***" if ($hashval ne $hashfile); + die "***HASH VALUE MISMATCH FOR FILE $filename ***" if ($hashval ne $hashfile); } + + diff --git a/deps/openssl/openssl/util/incore b/deps/openssl/openssl/util/incore index 8a88f81559c4..26fcf95033fc 100755 --- a/deps/openssl/openssl/util/incore +++ b/deps/openssl/openssl/util/incore @@ -65,7 +65,7 @@ # put aside e_machine in case one has to treat specific # platforms differently, see EM_ constants in elf.h for - # assortment... + # assortment... $self->{e_machine} = $elf_ehdr{e_machine}; ################################################# @@ -131,12 +131,12 @@ my $name; # (STT_OBJECT || STT_FUNC) if ($st_bind<3 && ($st_type==1 || $st_type==2) - && $st_secn <= $#sections # sane st_shndx + && $st_secn <= $#sections # sane st_shndx && @sections[$st_secn]->{sh_type} # not SHN_UNDEF && ($name=(split(chr(0),substr($strings,$elf_sym{st_name},128)))[0]) ) { # synthesize st_offset, ... - $elf_sym{st_offset} = $elf_sym{st_value} + $elf_sym{st_offset} = $elf_sym{st_value} - @sections[$st_secn]->{sh_addr} + @sections[$st_secn]->{sh_offset}; $elf_sym{st_name} = $name; diff --git a/deps/openssl/openssl/util/libcrypto.num b/deps/openssl/openssl/util/libcrypto.num index 8414d97ff114..51f1d7d6540a 100644 --- a/deps/openssl/openssl/util/libcrypto.num +++ b/deps/openssl/openssl/util/libcrypto.num @@ -4234,3 +4234,32 @@ CRYPTO_secure_clear_free 4315 1_1_0g EXIST::FUNCTION: EVP_PKEY_set1_engine 4347 1_1_0g EXIST::FUNCTION:ENGINE OCSP_resp_get0_signer 4374 1_1_0h EXIST::FUNCTION:OCSP X509_get0_authority_key_id 4448 1_1_0h EXIST::FUNCTION: +conf_ssl_name_find 4469 1_1_0i EXIST::FUNCTION: +conf_ssl_get_cmd 4470 1_1_0i EXIST::FUNCTION: +conf_ssl_get 4471 1_1_0i EXIST::FUNCTION: +X509_VERIFY_PARAM_get_hostflags 4472 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_get_by_fingerprint 4493 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_new 4494 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_init 4495 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_get_by_alias 4496 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_new_item 4497 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_shutdown 4498 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_new_item 4499 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_ctrl 4500 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_get_by_issuer_serial 4501 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_get_store 4502 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_ctrl 4503 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_get_by_alias 4504 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_get_by_subject 4505 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_free 4506 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_get_by_subject 4507 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_free 4508 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_shutdown 4509 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_set_method_data 4510 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_get_method_data 4511 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_get_by_fingerprint 4512 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_free 4513 1_1_0i EXIST::FUNCTION: +X509_OBJECT_set1_X509 4514 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_get_get_by_issuer_serial 4515 1_1_0i EXIST::FUNCTION: +X509_LOOKUP_meth_set_init 4516 1_1_0i EXIST::FUNCTION: +X509_OBJECT_set1_X509_CRL 4517 1_1_0i EXIST::FUNCTION: diff --git a/deps/openssl/openssl/util/local_shlib.com.in b/deps/openssl/openssl/util/local_shlib.com.in index a381872537e1..e49aa15c7792 100644 --- a/deps/openssl/openssl/util/local_shlib.com.in +++ b/deps/openssl/openssl/util/local_shlib.com.in @@ -16,7 +16,7 @@ $ $ NAMES := {- join(",", keys %names); -} {- join("\n", map { "\$ __$_ = \"".$names{$_}."\"" } keys %names); --} +-} $ I = 0 $ LOOP: $ E = F$ELEMENT(I,",",NAMES) diff --git a/deps/openssl/openssl/util/mkdef.pl b/deps/openssl/openssl/util/mkdef.pl index 66db26c3b956..823cb664d0ae 100755 --- a/deps/openssl/openssl/util/mkdef.pl +++ b/deps/openssl/openssl/util/mkdef.pl @@ -252,6 +252,7 @@ $crypto.=" include/internal/o_str.h"; $crypto.=" include/internal/err.h"; $crypto.=" include/internal/asn1t.h"; +$crypto.=" include/internal/sslconf.h"; $crypto.=" include/openssl/des.h" ; # unless $no_des; $crypto.=" include/openssl/idea.h" ; # unless $no_idea; $crypto.=" include/openssl/rc4.h" ; # unless $no_rc4; @@ -1335,7 +1336,7 @@ sub print_def_file } elsif ($VMS) { print OUT ")\n"; (my $libvmaj, my $libvmin, my $libvedit) = - $currversion =~ /^(\d+)_(\d+)_(\d+)$/; + $currversion =~ /^(\d+)_(\d+)_(\d+)[a-z]{0,2}$/; # The reason to multiply the edit number with 100 is to make space # for the possibility that we want to encode the patch letters print OUT "GSMATCH=LEQUAL,",($libvmaj * 100 + $libvmin),",",($libvedit * 100),"\n"; diff --git a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm index 5de7b58e8be4..a6be4878950a 100644 --- a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm +++ b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm @@ -21,7 +21,8 @@ $VERSION = "0.8"; @EXPORT_OK = (@Test::More::EXPORT_OK, qw(bldtop_dir bldtop_file srctop_dir srctop_file data_file - pipe with cmdstr quotify)); + pipe with cmdstr quotify + openssl_versions)); =head1 NAME @@ -695,6 +696,32 @@ sub quotify { return map { $arg_formatter->($_) } @_; } +=over 4 + +=item B + +Returns a list of two numbers, the first representing the build version, +the second representing the library version. See opensslv.h for more +information on those numbers. + += back + +=cut + +my @versions = (); +sub openssl_versions { + unless (@versions) { + my %lines = + map { s/\R$//; + /^(.*): (0x[[:xdigit:]]{8})$/; + die "Weird line: $_" unless defined $1; + $1 => hex($2) } + run(test(['versions']), capture => 1); + @versions = ( $lines{'Build version'}, $lines{'Library version'} ); + } + return @versions; +} + ###################################################################### # private functions. These are never exported. diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Message.pm b/deps/openssl/openssl/util/perl/TLSProxy/Message.pm index 10daba4b4246..0821bdedd328 100644 --- a/deps/openssl/openssl/util/perl/TLSProxy/Message.pm +++ b/deps/openssl/openssl/util/perl/TLSProxy/Message.pm @@ -170,7 +170,7 @@ sub get_messages $startoffset = $recoffset; $recoffset += 4; $payload = ""; - + if ($recoffset <= $record->decrypt_len) { #Some payload data is present in this record if ($record->decrypt_len - $recoffset >= $messlen) { @@ -296,7 +296,7 @@ sub new $records, $startoffset, $message_frag_lens) = @_; - + my $self = { server => $server, data => $data, diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Record.pm b/deps/openssl/openssl/util/perl/TLSProxy/Record.pm index ad942d4251de..786ba0c72b66 100644 --- a/deps/openssl/openssl/util/perl/TLSProxy/Record.pm +++ b/deps/openssl/openssl/util/perl/TLSProxy/Record.pm @@ -178,7 +178,7 @@ sub new $decrypt_len, $data, $decrypt_data) = @_; - + my $self = { flight => $flight, content_type => $content_type, diff --git a/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm b/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm index fd3fba569455..79a8be9a895e 100644 --- a/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm +++ b/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm @@ -20,7 +20,7 @@ sub new $records, $startoffset, $message_frag_lens) = @_; - + my $self = $class->SUPER::new( $server, TLSProxy::Message::MT_SERVER_HELLO, @@ -66,7 +66,7 @@ sub parse my $extension_data; if ($extensions_len != 0) { $extension_data = substr($self->data, $ptr); - + if (length($extension_data) != $extensions_len) { die "Invalid extension length\n"; } diff --git a/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm b/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm index c011d2707a9f..6e5b4cdcb42f 100644 --- a/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm +++ b/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm @@ -20,7 +20,7 @@ sub new $records, $startoffset, $message_frag_lens) = @_; - + my $self = $class->SUPER::new( $server, TLSProxy::Message::MT_SERVER_KEY_EXCHANGE, diff --git a/deps/openssl/openssl/util/perl/with_fallback.pm b/deps/openssl/openssl/util/perl/with_fallback.pm index 2af1d5fbd50d..242365033fc4 100644 --- a/deps/openssl/openssl/util/perl/with_fallback.pm +++ b/deps/openssl/openssl/util/perl/with_fallback.pm @@ -1,4 +1,4 @@ -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -8,15 +8,17 @@ package with_fallback; sub import { + shift; + use File::Basename; use File::Spec::Functions; foreach (@_) { - eval "require $_"; + eval "use $_"; if ($@) { unshift @INC, catdir(dirname(__FILE__), "..", "..", "external", "perl"); my $transfer = "transfer::$_"; - eval "require $transfer"; + eval "use $transfer"; shift @INC; warn $@ if $@; } diff --git a/deps/openssl/openssl/util/process_docs.pl b/deps/openssl/openssl/util/process_docs.pl index e084df78a571..f7daef0dd896 100755 --- a/deps/openssl/openssl/util/process_docs.pl +++ b/deps/openssl/openssl/util/process_docs.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -101,7 +101,7 @@ my $suffix = { man => ".$podinfo{section}".($options{suffix} // ""), html => ".html" } -> {$options{type}}; my $generate = { man => "pod2man --name=$name --section=$podinfo{section} --center=OpenSSL --release=$config{version} \"$podpath\"", - html => "pod2html \"--podroot=$options{sourcedir}\" --htmldir=$updir --podpath=apps:crypto:ssl \"--infile=$podpath\" \"--title=$podname\"" + html => "pod2html \"--podroot=$options{sourcedir}\" --htmldir=$updir --podpath=apps:crypto:ssl \"--infile=$podpath\" \"--title=$podname\" --quiet" } -> {$options{type}}; my $output_dir = catdir($options{destdir}, "man$podinfo{section}"); my $output_file = $podname . $suffix; @@ -115,6 +115,32 @@ @output = `$generate`; map { s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html|g; } @output if $options{type} eq "html"; + if ($options{type} eq "man") { + # Because some *roff parsers are more strict than others, + # multiple lines in the NAME section must be merged into + # one. + my $in_name = 0; + my $name_line = ""; + my @newoutput = (); + foreach (@output) { + if ($in_name) { + if (/^\.SH "/) { + $in_name = 0; + push @newoutput, $name_line."\n"; + } else { + chomp (my $x = $_); + $name_line .= " " if $name_line; + $name_line .= $x; + next; + } + } + if (/^\.SH +"NAME" *$/) { + $in_name = 1; + } + push @newoutput, $_; + } + @output = @newoutput; + } } print STDERR "DEBUG: Done processing\n" if $options{debug}; @@ -238,7 +264,7 @@ =head1 OPTIONS =head1 COPYRIGHT -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/deps/v8/.gitattributes b/deps/v8/.gitattributes new file mode 100644 index 000000000000..d38eef01ae52 --- /dev/null +++ b/deps/v8/.gitattributes @@ -0,0 +1,2 @@ +# Automatically normalize line endings (to LF) for all text-based files. +* text=auto diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index d1df5403e9c7..e920bbf42bd3 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -32,6 +32,7 @@ Facebook, Inc. <*@fb.com> Facebook, Inc. <*@oculus.com> Vewd Software AS <*@vewd.com> Groupon <*@groupon.com> +Cloudflare, Inc. <*@cloudflare.com> Aaron Bieber Abdulla Kamar @@ -41,6 +42,7 @@ Alexander Botero-Lowry Alexander Karpinsky Alexandre Vassalotti Alexis Campailla +Amos Lim Andreas Anyuru Andrew Paprocki Andrei Kashcha @@ -61,6 +63,7 @@ Daniel Andersson Daniel Bevenius Daniel James Deon Dior +Dominic Farolini Douglas Crosher Dusan Milosavljevic Erich Ocean @@ -75,6 +78,7 @@ Gwang Yoon Hwang Henrique Ferreiro Hirofumi Mako Honggyu Kim +Ingvar Stepanyan Ioseb Dzmanashvili Isiah Meadows Jaime Bernardo @@ -126,8 +130,10 @@ Paul Lind Qingyan Li Qiuyi Zhang Rafal Krypa +Ray Glover Refael Ackermann Rene Rebe +Rick Waldron Rob Wu Robert Mustacchi Robert Nagy diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 1d42461ba731..fbb34a0b3dc1 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -70,7 +70,7 @@ declare_args() { # Enable embedded builtins. # TODO(jgruber,v8:6666): Support ia32 and maybe MSVC. - # TODO(jgruber,v8:6666): Re-enable after the M67 branch point. + # TODO(jgruber,v8:6666): Re-enable. v8_enable_embedded_builtins = false # Enable code-generation-time checking of types in the CodeStubAssembler. @@ -190,7 +190,10 @@ v8_toolset_for_shell = "host" config("internal_config") { visibility = [ ":*" ] # Only targets in this file can depend on this. - include_dirs = [ "." ] + include_dirs = [ + ".", + "$target_gen_dir", + ] if (is_component_build) { defines = [ "BUILDING_V8_SHARED" ] @@ -200,7 +203,10 @@ config("internal_config") { config("internal_config_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. - include_dirs = [ "." ] + include_dirs = [ + ".", + "$target_gen_dir", + ] } # This config should be applied to code using the libplatform. @@ -569,7 +575,14 @@ config("toolchain") { "/wd4703", # Potentially uninitialized local pointer variable. "/wd4709", # Comma operator within array index expr (bugged). "/wd4714", # Function marked forceinline not inlined. + + # MSVC assumes that control can get past an exhaustive switch and then + # warns if there's no return there (see https://crbug.com/v8/7658) + "/wd4715", # Not all control paths return a value. + "/wd4718", # Recursive call has no side-effect. + "/wd4723", # https://crbug.com/v8/7771 + "/wd4724", # https://crbug.com/v8/7771 "/wd4800", # Forcing value to bool. ] } @@ -580,6 +593,10 @@ config("toolchain") { # signed overflow does not occur. Generates false positives (see # http://crbug.com/v8/6341). "-Wno-strict-overflow", + + # GCC assumes that control can get past an exhaustive switch and then + # warns if there's no return there (see https://crbug.com/v8/7658). + "-Wno-return-type", ] } } @@ -811,6 +828,7 @@ action("postmortem-metadata") { "src/objects/js-regexp-string-iterator.h", "src/objects/map.h", "src/objects/map-inl.h", + "src/objects/scope-info.h", "src/objects/script.h", "src/objects/script-inl.h", "src/objects/shared-function-info.h", @@ -827,6 +845,99 @@ action("postmortem-metadata") { rebase_path(sources, root_build_dir) } +torque_files = [ + "src/builtins/base.tq", + "src/builtins/array.tq", + "src/builtins/typed-array.tq", + "test/torque/test-torque.tq", +] + +torque_modules = [ + "base", + "array", + "typed-array", + "test", +] + +action("run_torque") { + visibility = [ + ":*", + "tools/gcmole/:*", + "test/cctest/:*", + ] + + # We reuse the snapshot toolchain for building torque to not build v8_libbase + # on the host more than once. On mips with big endian, the snapshot toolchain + # is the target toolchain and, hence, can't be used. + v8_torque_toolchain = v8_snapshot_toolchain + if (host_cpu == "x64" && + (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { + v8_torque_toolchain = "//build/toolchain/linux:clang_x64" + } + + deps = [ + ":torque($v8_torque_toolchain)", + ] + + script = "tools/run.py" + + sources = torque_files + + outputs = [ + "$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h", + ] + foreach(module, torque_modules) { + outputs += [ + "$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.cc", + "$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.h", + ] + } + + args = [ + "./" + rebase_path(get_label_info(":torque($v8_torque_toolchain)", + "root_out_dir") + "/torque", + root_build_dir), + "-o", + rebase_path("$target_gen_dir/torque-generated", root_build_dir), + ] + + foreach(file, torque_files) { + args += [ rebase_path(file, root_build_dir) ] + } +} + +v8_source_set("torque_generated_core") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + deps = [ + ":run_torque", + ] + + sources = [ + "$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h", + ] + + configs = [ ":internal_config" ] +} + +v8_source_set("torque_generated_initializers") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + deps = [ + ":run_torque", + ] + + sources = [] + foreach(module, torque_modules) { + sources += [ + "$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.cc", + "$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.h", + ] + } + + configs = [ ":internal_config" ] +} + # Template to generate different V8 snapshots based on different runtime flags. # Can be invoked with run_mksnapshot(). The target will resolve to # run_mksnapshot_. If is "default", no file suffixes will be used. @@ -1054,6 +1165,9 @@ if (v8_use_snapshot && !v8_use_external_startup_data) { ":run_mksnapshot_default", ] + # Do not publicize any header to remove build dependency. + public = [] + sources = [ "$target_gen_dir/experimental-extras-libraries.cc", "$target_gen_dir/extras-libraries.cc", @@ -1104,6 +1218,9 @@ if (v8_use_snapshot && v8_use_external_startup_data) { "src/snapshot/snapshot-external.cc", ] + # Do not publicize any header to remove build dependency. + public = [] + if (v8_enable_embedded_builtins) { sources += [ "$target_gen_dir/embedded.cc" ] @@ -1130,6 +1247,7 @@ v8_source_set("v8_initializers") { ] deps = [ + ":torque_generated_initializers", ":v8_base", ] @@ -1180,8 +1298,8 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-string-gen.cc", "src/builtins/builtins-string-gen.h", "src/builtins/builtins-symbol-gen.cc", - "src/builtins/builtins-typedarray-gen.cc", - "src/builtins/builtins-typedarray-gen.h", + "src/builtins/builtins-typed-array-gen.cc", + "src/builtins/builtins-typed-array-gen.h", "src/builtins/builtins-utils-gen.h", "src/builtins/builtins-wasm-gen.cc", "src/builtins/growable-fixed-array-gen.cc", @@ -1340,6 +1458,7 @@ v8_source_set("v8_base") { "src/api.h", "src/arguments.cc", "src/arguments.h", + "src/asan.h", "src/asmjs/asm-js.cc", "src/asmjs/asm-js.h", "src/asmjs/asm-names.h", @@ -1351,6 +1470,7 @@ v8_source_set("v8_base") { "src/asmjs/asm-types.h", "src/asmjs/switch-logic.cc", "src/asmjs/switch-logic.h", + "src/assembler-arch.h", "src/assembler-inl.h", "src/assembler.cc", "src/assembler.h", @@ -1421,7 +1541,7 @@ v8_source_set("v8_base") { "src/builtins/builtins-string.cc", "src/builtins/builtins-symbol.cc", "src/builtins/builtins-trace.cc", - "src/builtins/builtins-typedarray.cc", + "src/builtins/builtins-typed-array.cc", "src/builtins/builtins-utils.h", "src/builtins/builtins.cc", "src/builtins/builtins.h", @@ -1439,6 +1559,8 @@ v8_source_set("v8_base") { "src/code-events.h", "src/code-factory.cc", "src/code-factory.h", + "src/code-reference.cc", + "src/code-reference.h", "src/code-stub-assembler.cc", "src/code-stub-assembler.h", "src/code-stubs-utils.h", @@ -1498,6 +1620,8 @@ v8_source_set("v8_base") { "src/compiler/common-operator.h", "src/compiler/compiler-source-position-table.cc", "src/compiler/compiler-source-position-table.h", + "src/compiler/constant-folding-reducer.cc", + "src/compiler/constant-folding-reducer.h", "src/compiler/control-equivalence.cc", "src/compiler/control-equivalence.h", "src/compiler/control-flow-optimizer.cc", @@ -1540,8 +1664,6 @@ v8_source_set("v8_base") { "src/compiler/instruction.h", "src/compiler/int64-lowering.cc", "src/compiler/int64-lowering.h", - "src/compiler/js-builtin-reducer.cc", - "src/compiler/js-builtin-reducer.h", "src/compiler/js-call-reducer.cc", "src/compiler/js-call-reducer.h", "src/compiler/js-context-specialization.cc", @@ -1582,6 +1704,8 @@ v8_source_set("v8_base") { "src/compiler/loop-variable-optimizer.h", "src/compiler/machine-graph-verifier.cc", "src/compiler/machine-graph-verifier.h", + "src/compiler/machine-graph.cc", + "src/compiler/machine-graph.h", "src/compiler/machine-operator-reducer.cc", "src/compiler/machine-operator-reducer.h", "src/compiler/machine-operator.cc", @@ -1597,6 +1721,8 @@ v8_source_set("v8_base") { "src/compiler/node-marker.h", "src/compiler/node-matchers.cc", "src/compiler/node-matchers.h", + "src/compiler/node-origin-table.cc", + "src/compiler/node-origin-table.h", "src/compiler/node-properties.cc", "src/compiler/node-properties.h", "src/compiler/node.cc", @@ -1648,6 +1774,8 @@ v8_source_set("v8_base") { "src/compiler/store-store-elimination.h", "src/compiler/type-cache.cc", "src/compiler/type-cache.h", + "src/compiler/type-narrowing-reducer.cc", + "src/compiler/type-narrowing-reducer.h", "src/compiler/typed-optimization.cc", "src/compiler/typed-optimization.h", "src/compiler/typer.cc", @@ -1661,7 +1789,6 @@ v8_source_set("v8_base") { "src/compiler/verifier.h", "src/compiler/wasm-compiler.cc", "src/compiler/wasm-compiler.h", - "src/compiler/wasm-linkage.cc", "src/compiler/zone-stats.cc", "src/compiler/zone-stats.h", "src/contexts-inl.h", @@ -1922,11 +2049,11 @@ v8_source_set("v8_base") { "src/lookup-cache.h", "src/lookup.cc", "src/lookup.h", + "src/lsan.h", "src/machine-type.cc", "src/machine-type.h", "src/macro-assembler-inl.h", "src/macro-assembler.h", - "src/managed.h", "src/map-updater.cc", "src/map-updater.h", "src/messages.cc", @@ -1939,6 +2066,8 @@ v8_source_set("v8_base") { "src/objects-printer.cc", "src/objects.cc", "src/objects.h", + "src/objects/api-callbacks-inl.h", + "src/objects/api-callbacks.h", "src/objects/arguments-inl.h", "src/objects/arguments.h", "src/objects/bigint.cc", @@ -1964,6 +2093,9 @@ v8_source_set("v8_base") { "src/objects/js-array.h", "src/objects/js-collection-inl.h", "src/objects/js-collection.h", + "src/objects/js-locale-inl.h", + "src/objects/js-locale.cc", + "src/objects/js-locale.h", "src/objects/js-promise-inl.h", "src/objects/js-promise.h", "src/objects/js-regexp-inl.h", @@ -1973,6 +2105,8 @@ v8_source_set("v8_base") { "src/objects/literal-objects-inl.h", "src/objects/literal-objects.cc", "src/objects/literal-objects.h", + "src/objects/managed.cc", + "src/objects/managed.h", "src/objects/map-inl.h", "src/objects/map.h", "src/objects/maybe-object-inl.h", @@ -1986,6 +2120,9 @@ v8_source_set("v8_base") { "src/objects/name.h", "src/objects/object-macros-undef.h", "src/objects/object-macros.h", + "src/objects/ordered-hash-table-inl.h", + "src/objects/ordered-hash-table.cc", + "src/objects/ordered-hash-table.h", "src/objects/promise-inl.h", "src/objects/promise.h", "src/objects/property-descriptor-object-inl.h", @@ -2002,6 +2139,8 @@ v8_source_set("v8_base") { "src/objects/string.h", "src/objects/template-objects.cc", "src/objects/template-objects.h", + "src/objects/templates-inl.h", + "src/objects/templates.h", "src/optimized-compilation-info.cc", "src/optimized-compilation-info.h", "src/ostreams.cc", @@ -2208,6 +2347,7 @@ v8_source_set("v8_base") { "src/transitions-inl.h", "src/transitions.cc", "src/transitions.h", + "src/trap-handler/handler-inside.cc", "src/trap-handler/handler-outside.cc", "src/trap-handler/handler-shared.cc", "src/trap-handler/trap-handler-internal.h", @@ -2248,13 +2388,14 @@ v8_source_set("v8_base") { "src/wasm/baseline/liftoff-assembler.cc", "src/wasm/baseline/liftoff-assembler.h", "src/wasm/baseline/liftoff-compiler.cc", + "src/wasm/baseline/liftoff-compiler.h", "src/wasm/baseline/liftoff-register.h", - "src/wasm/compilation-manager.cc", - "src/wasm/compilation-manager.h", "src/wasm/decoder.h", "src/wasm/function-body-decoder-impl.h", "src/wasm/function-body-decoder.cc", "src/wasm/function-body-decoder.h", + "src/wasm/function-compiler.cc", + "src/wasm/function-compiler.h", "src/wasm/leb-helper.h", "src/wasm/local-decl-encoder.cc", "src/wasm/local-decl-encoder.h", @@ -2268,6 +2409,7 @@ v8_source_set("v8_base") { "src/wasm/signature-map.h", "src/wasm/streaming-decoder.cc", "src/wasm/streaming-decoder.h", + "src/wasm/value-type.h", "src/wasm/wasm-code-manager.cc", "src/wasm/wasm-code-manager.h", "src/wasm/wasm-code-specialization.cc", @@ -2283,6 +2425,7 @@ v8_source_set("v8_base") { "src/wasm/wasm-js.cc", "src/wasm/wasm-js.h", "src/wasm/wasm-limits.h", + "src/wasm/wasm-linkage.h", "src/wasm/wasm-memory.cc", "src/wasm/wasm-memory.h", "src/wasm/wasm-module-builder.cc", @@ -2389,7 +2532,13 @@ v8_source_set("v8_base") { "src/x64/sse-instr.h", ] if (is_linux) { - sources += [ "src/trap-handler/handler-inside.cc" ] + sources += [ + "src/trap-handler/handler-inside-linux.cc", + "src/trap-handler/handler-outside-linux.cc", + ] + } + if (is_win) { + sources += [ "src/trap-handler/handler-outside-win.cc" ] } } else if (v8_current_cpu == "arm") { sources += [ ### gcmole(arch:arm) ### @@ -2598,6 +2747,7 @@ v8_source_set("v8_base") { defines = [] deps = [ + ":torque_generated_core", ":v8_headers", ":v8_libbase", ":v8_libsampler", @@ -2620,6 +2770,9 @@ v8_source_set("v8_base") { "src/intl.h", "src/objects/intl-objects.cc", "src/objects/intl-objects.h", + "src/objects/js-locale-inl.h", + "src/objects/js-locale.cc", + "src/objects/js-locale.h", "src/runtime/runtime-intl.cc", ] } @@ -2699,6 +2852,8 @@ v8_component("v8_libbase") { public_configs = [ ":libbase_config" ] + public_deps = [] + data = [] data_deps = [] @@ -2770,6 +2925,7 @@ v8_component("v8_libbase") { "src/base/debug/stack_trace_fuchsia.cc", "src/base/platform/platform-fuchsia.cc", ] + public_deps += [ "//third_party/fuchsia-sdk:launchpad" ] } else if (is_mac) { sources += [ "src/base/debug/stack_trace_posix.cc", @@ -2925,6 +3081,73 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { } } +if (current_toolchain == v8_snapshot_toolchain) { + v8_executable("torque") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + defines = [ "ANTLR4CPP_STATIC" ] + + include_dirs = [ + "third_party/antlr4/runtime/Cpp/runtime/src", + "src/torque", + ] + + sources = [ + "src/torque/TorqueBaseVisitor.cpp", + "src/torque/TorqueBaseVisitor.h", + "src/torque/TorqueLexer.cpp", + "src/torque/TorqueLexer.h", + "src/torque/TorqueParser.cpp", + "src/torque/TorqueParser.h", + "src/torque/TorqueVisitor.cpp", + "src/torque/TorqueVisitor.h", + "src/torque/ast-generator.cc", + "src/torque/ast-generator.h", + "src/torque/ast.h", + "src/torque/contextual.h", + "src/torque/declarable.cc", + "src/torque/declarable.h", + "src/torque/declaration-visitor.cc", + "src/torque/declaration-visitor.h", + "src/torque/declarations.cc", + "src/torque/declarations.h", + "src/torque/file-visitor.cc", + "src/torque/file-visitor.h", + "src/torque/global-context.h", + "src/torque/implementation-visitor.cc", + "src/torque/implementation-visitor.h", + "src/torque/scope.cc", + "src/torque/scope.h", + "src/torque/torque.cc", + "src/torque/type-oracle.h", + "src/torque/types.cc", + "src/torque/types.h", + "src/torque/utils.cc", + "src/torque/utils.h", + ] + + deps = [ + ":v8_libbase", + "third_party/antlr4:antlr4", + "//build/config:exe_and_shlib_deps", + "//build/win:default_exe_manifest", + ] + + remove_configs = [ + "//build/config/compiler:no_rtti", + "//build/config/compiler:no_exceptions", + ] + + configs = [ + "//build/config/compiler:rtti", + "//build/config/compiler:exceptions", + "third_party/antlr4:antlr-compatibility", + ":external_config", + ":internal_config_base", + ] + } +} + ############################################################################### # Public targets # @@ -2942,7 +3165,6 @@ group("gn_all") { ":d8", ":v8_fuzzers", ":v8_hello_world", - ":v8_parser_shell", ":v8_sample_process", "test:gn_all", "tools:gn_all", @@ -3144,26 +3366,6 @@ v8_executable("v8_sample_process") { ] } -v8_executable("v8_parser_shell") { - sources = [ - "tools/parser-shell.cc", - "tools/shell-utils.h", - ] - - configs = [ - ":external_config", - ":internal_config_base", - ] - - deps = [ - ":v8", - ":v8_libbase", - ":v8_libplatform", - "//build/config:exe_and_shlib_deps", - "//build/win:default_exe_manifest", - ] -} - if (want_v8_shell) { v8_executable("v8_shell") { sources = [ @@ -3302,6 +3504,10 @@ v8_source_set("wasm_module_runner") { "test/common/wasm/wasm-module-runner.h", ] + deps = [ + ":torque_generated_core", + ] + configs = [ ":external_config", ":internal_config_base", @@ -3375,6 +3581,10 @@ v8_source_set("lib_wasm_fuzzer_common") { "test/fuzzer/wasm-fuzzer-common.h", ] + deps = [ + ":torque_generated_core", + ] + configs = [ ":external_config", ":internal_config_base", diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index e6b825092c4a..437c09b4d0fb 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,1388 @@ +2018-05-22: Version 6.8.275 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.274 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.273 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.272 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.271 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.270 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.269 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.268 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.267 + + Performance and stability improvements on all platforms. + + +2018-05-22: Version 6.8.266 + + Performance and stability improvements on all platforms. + + +2018-05-21: Version 6.8.265 + + Performance and stability improvements on all platforms. + + +2018-05-21: Version 6.8.264 + + Performance and stability improvements on all platforms. + + +2018-05-21: Version 6.8.263 + + Performance and stability improvements on all platforms. + + +2018-05-21: Version 6.8.262 + + Performance and stability improvements on all platforms. + + +2018-05-19: Version 6.8.261 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.260 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.259 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.258 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.257 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.256 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.255 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.254 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.253 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.252 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.251 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.250 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.249 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.248 + + Performance and stability improvements on all platforms. + + +2018-05-18: Version 6.8.247 + + Performance and stability improvements on all platforms. + + +2018-05-17: Version 6.8.246 + + Performance and stability improvements on all platforms. + + +2018-05-17: Version 6.8.245 + + Performance and stability improvements on all platforms. + + +2018-05-17: Version 6.8.244 + + Performance and stability improvements on all platforms. + + +2018-05-17: Version 6.8.243 + + Performance and stability improvements on all platforms. + + +2018-05-17: Version 6.8.242 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.241 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.240 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.239 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.238 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.237 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.236 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.235 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.234 + + Performance and stability improvements on all platforms. + + +2018-05-16: Version 6.8.233 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.232 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.231 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.230 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.229 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.228 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.227 + + Performance and stability improvements on all platforms. + + +2018-05-15: Version 6.8.226 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.225 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.224 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.223 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.222 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.221 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.220 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.219 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.218 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.217 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.216 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.215 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.214 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.213 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.212 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.211 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.210 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.209 + + Performance and stability improvements on all platforms. + + +2018-05-14: Version 6.8.208 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.207 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.206 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.205 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.204 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.203 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.202 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.201 + + Performance and stability improvements on all platforms. + + +2018-05-11: Version 6.8.200 + + Performance and stability improvements on all platforms. + + +2018-05-10: Version 6.8.199 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.198 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.197 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.196 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.195 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.194 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.193 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.192 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.191 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.190 + + Performance and stability improvements on all platforms. + + +2018-05-08: Version 6.8.189 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.188 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.187 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.186 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.185 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.184 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.183 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.182 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.181 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.180 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.179 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.178 + + Performance and stability improvements on all platforms. + + +2018-05-07: Version 6.8.177 + + Performance and stability improvements on all platforms. + + +2018-05-05: Version 6.8.176 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.175 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.174 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.173 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.172 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.171 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.170 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.169 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.168 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.167 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.166 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.165 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.164 + + Performance and stability improvements on all platforms. + + +2018-05-04: Version 6.8.163 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.162 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.161 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.160 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.159 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.158 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.157 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.156 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.155 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.154 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.153 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.152 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.151 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.150 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.149 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.148 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.147 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.146 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.145 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.144 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.143 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.142 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.141 + + Performance and stability improvements on all platforms. + + +2018-05-03: Version 6.8.140 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.139 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.138 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.137 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.136 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.135 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.134 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.133 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.132 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.131 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.130 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.129 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.128 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.127 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.126 + + Performance and stability improvements on all platforms. + + +2018-05-02: Version 6.8.125 + + Performance and stability improvements on all platforms. + + +2018-05-01: Version 6.8.124 + + Performance and stability improvements on all platforms. + + +2018-05-01: Version 6.8.123 + + Performance and stability improvements on all platforms. + + +2018-05-01: Version 6.8.122 + + Performance and stability improvements on all platforms. + + +2018-05-01: Version 6.8.121 + + Performance and stability improvements on all platforms. + + +2018-05-01: Version 6.8.120 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.119 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.118 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.117 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.116 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.115 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.114 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.113 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.112 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.111 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.110 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.109 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.108 + + Performance and stability improvements on all platforms. + + +2018-04-30: Version 6.8.107 + + Performance and stability improvements on all platforms. + + +2018-04-29: Version 6.8.106 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.105 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.104 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.103 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.102 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.101 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.100 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.99 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.98 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.97 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.96 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.95 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.94 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.93 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.92 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.91 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.90 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.89 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.88 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.87 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.86 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.85 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.84 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.83 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.82 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.81 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.80 + + Performance and stability improvements on all platforms. + + +2018-04-27: Version 6.8.79 + + Performance and stability improvements on all platforms. + + +2018-04-26: Version 6.8.78 + + Performance and stability improvements on all platforms. + + +2018-04-26: Version 6.8.77 + + Performance and stability improvements on all platforms. + + +2018-04-26: Version 6.8.76 + + Performance and stability improvements on all platforms. + + +2018-04-26: Version 6.8.75 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.74 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.73 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.72 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.71 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.70 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.69 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.68 + + Performance and stability improvements on all platforms. + + +2018-04-25: Version 6.8.67 + + Performance and stability improvements on all platforms. + + +2018-04-24: Version 6.8.66 + + Performance and stability improvements on all platforms. + + +2018-04-24: Version 6.8.65 + + Performance and stability improvements on all platforms. + + +2018-04-24: Version 6.8.64 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.63 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.62 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.61 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.60 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.59 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.58 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.57 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.56 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.55 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.54 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.53 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.52 + + Performance and stability improvements on all platforms. + + +2018-04-23: Version 6.8.51 + + Performance and stability improvements on all platforms. + + +2018-04-20: Version 6.8.50 + + Performance and stability improvements on all platforms. + + +2018-04-20: Version 6.8.49 + + Performance and stability improvements on all platforms. + + +2018-04-20: Version 6.8.48 + + Performance and stability improvements on all platforms. + + +2018-04-20: Version 6.8.47 + + Performance and stability improvements on all platforms. + + +2018-04-20: Version 6.8.46 + + Performance and stability improvements on all platforms. + + +2018-04-19: Version 6.8.45 + + Performance and stability improvements on all platforms. + + +2018-04-19: Version 6.8.44 + + Performance and stability improvements on all platforms. + + +2018-04-19: Version 6.8.43 + + Performance and stability improvements on all platforms. + + +2018-04-19: Version 6.8.42 + + Performance and stability improvements on all platforms. + + +2018-04-19: Version 6.8.41 + + Performance and stability improvements on all platforms. + + +2018-04-18: Version 6.8.40 + + Performance and stability improvements on all platforms. + + +2018-04-18: Version 6.8.39 + + Performance and stability improvements on all platforms. + + +2018-04-18: Version 6.8.38 + + Performance and stability improvements on all platforms. + + +2018-04-18: Version 6.8.37 + + Performance and stability improvements on all platforms. + + +2018-04-18: Version 6.8.36 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.35 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.34 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.33 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.32 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.31 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.30 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.29 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.28 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.27 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.26 + + Performance and stability improvements on all platforms. + + +2018-04-17: Version 6.8.25 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.24 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.23 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.22 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.21 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.20 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.19 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.18 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.17 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.16 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.15 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.14 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.13 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.12 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.11 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.10 + + Performance and stability improvements on all platforms. + + +2018-04-16: Version 6.8.9 + + Performance and stability improvements on all platforms. + + +2018-04-15: Version 6.8.8 + + Performance and stability improvements on all platforms. + + +2018-04-15: Version 6.8.7 + + Performance and stability improvements on all platforms. + + +2018-04-14: Version 6.8.6 + + Performance and stability improvements on all platforms. + + +2018-04-14: Version 6.8.5 + + Performance and stability improvements on all platforms. + + +2018-04-13: Version 6.8.4 + + Performance and stability improvements on all platforms. + + +2018-04-13: Version 6.8.3 + + Performance and stability improvements on all platforms. + + +2018-04-12: Version 6.8.2 + + Performance and stability improvements on all platforms. + + +2018-04-12: Version 6.8.1 + + Performance and stability improvements on all platforms. + + +2018-04-11: Version 6.7.290 + + Performance and stability improvements on all platforms. + + +2018-04-11: Version 6.7.289 + + Performance and stability improvements on all platforms. + + 2018-04-11: Version 6.7.288 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 7c4fe6836159..4bac02255de4 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -12,21 +12,21 @@ vars = { deps = { 'v8/build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '73e352e758d90603e23bdc84734c12aa5817ab5f', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'b5df2518f091eea3d358f30757dec3e33db56156', 'v8/tools/gyp': Var('chromium_url') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb', 'v8/third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '024a3317597b06418efea2d45aa54dd2a7030c8a', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '083eb25f9acbe034db94a1bd5c1659125b6ebf98', 'v8/third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'd888fd2a1be890f4d35e43f68d6d79f42519a357', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'f61e46dbee9d539a32551493e3bcc1dea92f83ec', 'v8/third_party/instrumented_libraries': Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '323cf32193caecbf074d1a0cb5b02b905f163e0f', 'v8/buildtools': - Var('chromium_url') + '/chromium/buildtools.git' + '@' + 'e8aa02ea839e087f2db66100d02c3b5d47993852', + Var('chromium_url') + '/chromium/buildtools.git' + '@' + '94288c26d2ffe3aec9848c147839afee597acefd', 'v8/base/trace_event/common': Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '211b3ed9d0481b4caddbee1322321b86a483ca1f', 'v8/third_party/android_ndk': { - 'url': Var('chromium_url') + '/android_ndk.git' + '@' + '635bc380968a76f6948fee65f80a0b28db53ae81', + 'url': Var('chromium_url') + '/android_ndk.git' + '@' + '5cd86312e794bdf542a3685c6f10cbb96072990b', 'condition': 'checkout_android', }, 'v8/third_party/android_tools': { @@ -34,21 +34,25 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '2c59f678c7ede8a844fb687525d594b71aabe3dd', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '49edbd3a2b582cbab0a912cb1989062e9b8453ff', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { 'url': Var('chromium_url') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8', 'condition': 'checkout_android', }, + 'v8/third_party/fuchsia-sdk': { + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + 'afac8ecd6300c9903009e6f233f61aae401aced6', + 'condition': 'checkout_fuchsia', + }, 'v8/third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '7e5f90d3780d553cb86771141fb81349f3a63508', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '08d5b1f33af8c18785fb8ca02792b5fac81e248f', 'v8/third_party/jinja2': Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '45571de473282bd1d8b63a8dfcb1fd268d0635d2', 'v8/third_party/markupsafe': Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '8f45f5cfa0009d2a70589bcda0349b8cb2b72783', 'v8/tools/swarming_client': - Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '88229872dd17e71658fe96763feaa77915d8cbd6', + Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '833f5ebf894be1e3e6d13678d5de8479bf12ff28', 'v8/test/benchmarks/data': Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f', 'v8/test/mozilla/data': @@ -58,11 +62,11 @@ deps = { 'v8/test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '0f2acdd882c84cff43b9d60df7574a1901e2cdcd', 'v8/tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'd7c36b0ae001a5cc31f2da79a430154916a3def2', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c893c7eec4706f8c7fc244ee254b1dadd8f8d158', 'v8/tools/luci-go': Var('chromium_url') + '/chromium/src/tools/luci-go.git' + '@' + 'ff0709d4283b1f233dcf0c9fec1672c6ecaed2f1', 'v8/test/wasm-js': - Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + '586d34770c6445bfb93c9bae8ac50baade7ee168', + Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + '27d63f22e72395248d314520b3ad5b1e0943fc10', } recursedeps = [ @@ -84,6 +88,17 @@ skip_child_includes = [ ] hooks = [ + { + # Ensure that the DEPS'd "depot_tools" has its self-update capability + # disabled. + 'name': 'disable_depot_tools_selfupdate', + 'pattern': '.', + 'action': [ + 'python', + 'v8/third_party/depot_tools/update_depot_tools_toggle.py', + '--disable', + ], + }, { # This clobbers when necessary (based on get_landmines.py). It must be the # first hook so that other things that get/generate into the output diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index e6dbb7939568..055027c7bb60 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -289,6 +289,13 @@ def FilterFile(affected_file): def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] + # TODO(machenbach): Replace some of those checks, e.g. owners and copyright, + # with the canned PanProjectChecks. Need to make sure that the checks all + # pass on all existing files. + results.extend(input_api.canned_checks.CheckOwnersFormat( + input_api, output_api)) + results.extend(input_api.canned_checks.CheckOwners( + input_api, output_api)) results.extend(_CheckCommitMessageBugEntry(input_api, output_api)) results.extend(input_api.canned_checks.CheckPatchFormatted( input_api, output_api)) diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 211f15aab944..1cbba9fefdd7 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -96,7 +96,7 @@ if (is_debug && !v8_optimized_debug) { # TODO(crbug.com/621335) Rework this so that we don't have the confusion # between "optimize_speed" and "optimize_max". - if (is_posix && !is_android && !using_sanitizer) { + if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) { v8_add_configs += [ "//build/config/compiler:optimize_speed" ] } else { v8_add_configs += [ "//build/config/compiler:optimize_max" ] @@ -110,7 +110,7 @@ if (v8_code_coverage && !is_clang) { ] } -if (is_posix && (v8_enable_backtrace || v8_monolithic)) { +if ((is_posix || is_fuchsia) && (v8_enable_backtrace || v8_monolithic)) { v8_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ] v8_add_configs += [ "//build/config/gcc:symbol_visibility_default" ] } diff --git a/deps/v8/gypfiles/toolchain.gypi b/deps/v8/gypfiles/toolchain.gypi index e67a5e22b96a..97d2192ed828 100644 --- a/deps/v8/gypfiles/toolchain.gypi +++ b/deps/v8/gypfiles/toolchain.gypi @@ -1127,7 +1127,7 @@ 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], }], [ 'v8_target_arch=="ppc64"', { - 'cflags': [ '-maix64' ], + 'cflags': [ '-maix64', '-fdollars-in-identifiers' ], 'ldflags': [ '-maix64 -Wl,-bbigtoc' ], }], ], diff --git a/deps/v8/gypfiles/v8.gyp b/deps/v8/gypfiles/v8.gyp index 277488b74a0b..5417365888ef 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/deps/v8/gypfiles/v8.gyp @@ -114,6 +114,7 @@ 'type': 'static_library', 'dependencies': [ 'v8_initializers', + 'v8_torque#host', ], 'variables': { 'optimize': 'max', @@ -124,6 +125,7 @@ ], 'sources': [ '../src/setup-isolate-full.cc', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtin-definitions-from-dsl.h', ], 'conditions': [ ['want_separate_host_toolset==1', { @@ -138,6 +140,7 @@ 'type': 'static_library', 'dependencies': [ 'v8_base', + 'v8_torque#host', ], 'variables': { 'optimize': 'max', @@ -192,8 +195,8 @@ '../src/builtins/builtins-string-gen.cc', '../src/builtins/builtins-string-gen.h', '../src/builtins/builtins-symbol-gen.cc', - '../src/builtins/builtins-typedarray-gen.cc', - '../src/builtins/builtins-typedarray-gen.h', + '../src/builtins/builtins-typed-array-gen.cc', + '../src/builtins/builtins-typed-array-gen.h', '../src/builtins/builtins-utils-gen.h', '../src/builtins/builtins-wasm-gen.cc', '../src/builtins/growable-fixed-array-gen.cc', @@ -214,6 +217,12 @@ '../src/interpreter/interpreter-intrinsics-generator.h', '../src/interpreter/setup-interpreter-internal.cc', '../src/interpreter/setup-interpreter.h', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-array-from-dsl-gen.cc', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-array-from-dsl-gen.h', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-base-from-dsl-gen.cc', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-base-from-dsl-gen.h', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-typed-array-from-dsl-gen.cc', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtins-typed-array-from-dsl-gen.h', ], 'conditions': [ ['want_separate_host_toolset==1', { @@ -357,6 +366,7 @@ 'type': 'static_library', 'dependencies': [ 'v8_base', + 'v8_torque#host', ], 'include_dirs+': [ '..', @@ -507,9 +517,13 @@ 'dependencies': [ 'v8_libbase', 'v8_libsampler', + 'v8_torque#host', 'inspector.gyp:protocol_generated_sources#target', 'inspector.gyp:inspector_injected_script#target', ], + 'direct_dependent_settings': { + 'include_dirs+': ['<(SHARED_INTERMEDIATE_DIR)'], + }, 'objs': ['foo.o'], 'variables': { 'optimize': 'max', @@ -521,7 +535,8 @@ ], 'sources': [ '<@(inspector_all_sources)', - '../include//v8-debug.h', + '../include//v8-inspector-protocol.h', + '../include//v8-inspector.h', '../include//v8-platform.h', '../include//v8-profiler.h', '../include//v8-testing.h', @@ -535,17 +550,18 @@ '../src/accessors.h', '../src/address-map.cc', '../src/address-map.h', + '../src/allocation-site-scopes.h', '../src/allocation.cc', '../src/allocation.h', - '../src/allocation-site-scopes.h', - '../src/api.cc', - '../src/api.h', '../src/api-arguments-inl.h', '../src/api-arguments.h', '../src/api-natives.cc', '../src/api-natives.h', + '../src/api.cc', + '../src/api.h', '../src/arguments.cc', '../src/arguments.h', + '../src/asan.h', '../src/asmjs/asm-js.cc', '../src/asmjs/asm-js.h', '../src/asmjs/asm-names.h', @@ -555,13 +571,14 @@ '../src/asmjs/asm-scanner.h', '../src/asmjs/asm-types.cc', '../src/asmjs/asm-types.h', - '../src/asmjs/switch-logic.h', '../src/asmjs/switch-logic.cc', + '../src/asmjs/switch-logic.h', + '../src/assembler-arch.h', + '../src/assembler-inl.h', '../src/assembler.cc', '../src/assembler.h', - '../src/assembler-inl.h', - '../src/assert-scope.h', '../src/assert-scope.cc', + '../src/assert-scope.h', '../src/ast/ast-function-literal-id-reindexer.cc', '../src/ast/ast-function-literal-id-reindexer.h', '../src/ast/ast-source-ranges.h', @@ -596,8 +613,8 @@ '../src/bootstrapper.h', '../src/boxed-float.h', '../src/builtins/builtins-api.cc', - '../src/builtins/builtins-arraybuffer.cc', '../src/builtins/builtins-array.cc', + '../src/builtins/builtins-arraybuffer.cc', '../src/builtins/builtins-bigint.cc', '../src/builtins/builtins-boolean.cc', '../src/builtins/builtins-call.cc', @@ -614,6 +631,8 @@ '../src/builtins/builtins-global.cc', '../src/builtins/builtins-internal.cc', '../src/builtins/builtins-interpreter.cc', + '../src/builtins/builtins-intl.cc', + '../src/builtins/builtins-intl.h', '../src/builtins/builtins-json.cc', '../src/builtins/builtins-math.cc', '../src/builtins/builtins-number.cc', @@ -623,11 +642,9 @@ '../src/builtins/builtins-regexp.cc', '../src/builtins/builtins-sharedarraybuffer.cc', '../src/builtins/builtins-string.cc', - '../src/builtins/builtins-intl.cc', - '../src/builtins/builtins-intl.h', '../src/builtins/builtins-symbol.cc', '../src/builtins/builtins-trace.cc', - '../src/builtins/builtins-typedarray.cc', + '../src/builtins/builtins-typed-array.cc', '../src/builtins/builtins-utils.h', '../src/builtins/builtins.cc', '../src/builtins/builtins.h', @@ -638,18 +655,20 @@ '../src/callable.h', '../src/cancelable-task.cc', '../src/cancelable-task.h', - '../src/char-predicates.cc', '../src/char-predicates-inl.h', + '../src/char-predicates.cc', '../src/char-predicates.h', '../src/checks.h', '../src/code-events.h', '../src/code-factory.cc', '../src/code-factory.h', + '../src/code-reference.cc', + '../src/code-reference.h', '../src/code-stub-assembler.cc', '../src/code-stub-assembler.h', + '../src/code-stubs-utils.h', '../src/code-stubs.cc', '../src/code-stubs.h', - '../src/code-stubs-utils.h', '../src/codegen.cc', '../src/codegen.h', '../src/collector.h', @@ -659,6 +678,18 @@ '../src/compilation-dependencies.h', '../src/compilation-statistics.cc', '../src/compilation-statistics.h', + '../src/compiler-dispatcher/compiler-dispatcher-job.cc', + '../src/compiler-dispatcher/compiler-dispatcher-job.h', + '../src/compiler-dispatcher/compiler-dispatcher-tracer.cc', + '../src/compiler-dispatcher/compiler-dispatcher-tracer.h', + '../src/compiler-dispatcher/compiler-dispatcher.cc', + '../src/compiler-dispatcher/compiler-dispatcher.h', + '../src/compiler-dispatcher/optimizing-compile-dispatcher.cc', + '../src/compiler-dispatcher/optimizing-compile-dispatcher.h', + '../src/compiler-dispatcher/unoptimized-compile-job.cc', + '../src/compiler-dispatcher/unoptimized-compile-job.h', + '../src/compiler.cc', + '../src/compiler.h', '../src/compiler/access-builder.cc', '../src/compiler/access-builder.h', '../src/compiler/access-info.cc', @@ -679,17 +710,21 @@ '../src/compiler/c-linkage.cc', '../src/compiler/checkpoint-elimination.cc', '../src/compiler/checkpoint-elimination.h', + '../src/compiler/code-assembler.cc', + '../src/compiler/code-assembler.h', '../src/compiler/code-generator-impl.h', '../src/compiler/code-generator.cc', '../src/compiler/code-generator.h', - '../src/compiler/code-assembler.cc', - '../src/compiler/code-assembler.h', '../src/compiler/common-node-cache.cc', '../src/compiler/common-node-cache.h', '../src/compiler/common-operator-reducer.cc', '../src/compiler/common-operator-reducer.h', '../src/compiler/common-operator.cc', '../src/compiler/common-operator.h', + '../src/compiler/compiler-source-position-table.cc', + '../src/compiler/compiler-source-position-table.h', + '../src/compiler/constant-folding-reducer.cc', + '../src/compiler/constant-folding-reducer.h', '../src/compiler/control-equivalence.cc', '../src/compiler/control-equivalence.h', '../src/compiler/control-flow-optimizer.cc', @@ -699,16 +734,16 @@ '../src/compiler/diamond.h', '../src/compiler/effect-control-linearizer.cc', '../src/compiler/effect-control-linearizer.h', - '../src/compiler/escape-analysis.cc', - '../src/compiler/escape-analysis.h', '../src/compiler/escape-analysis-reducer.cc', '../src/compiler/escape-analysis-reducer.h', - '../src/compiler/frame.cc', - '../src/compiler/frame.h', + '../src/compiler/escape-analysis.cc', + '../src/compiler/escape-analysis.h', '../src/compiler/frame-elider.cc', '../src/compiler/frame-elider.h', '../src/compiler/frame-states.cc', '../src/compiler/frame-states.h', + '../src/compiler/frame.cc', + '../src/compiler/frame.h', '../src/compiler/functional-list.h', '../src/compiler/gap-resolver.cc', '../src/compiler/gap-resolver.h', @@ -723,17 +758,15 @@ '../src/compiler/graph.cc', '../src/compiler/graph.h', '../src/compiler/instruction-codes.h', + '../src/compiler/instruction-scheduler.cc', + '../src/compiler/instruction-scheduler.h', '../src/compiler/instruction-selector-impl.h', '../src/compiler/instruction-selector.cc', '../src/compiler/instruction-selector.h', - '../src/compiler/instruction-scheduler.cc', - '../src/compiler/instruction-scheduler.h', '../src/compiler/instruction.cc', '../src/compiler/instruction.h', '../src/compiler/int64-lowering.cc', '../src/compiler/int64-lowering.h', - '../src/compiler/js-builtin-reducer.cc', - '../src/compiler/js-builtin-reducer.h', '../src/compiler/js-call-reducer.cc', '../src/compiler/js-call-reducer.h', '../src/compiler/js-context-specialization.cc', @@ -744,10 +777,10 @@ '../src/compiler/js-generic-lowering.h', '../src/compiler/js-graph.cc', '../src/compiler/js-graph.h', - '../src/compiler/js-inlining.cc', - '../src/compiler/js-inlining.h', '../src/compiler/js-inlining-heuristic.cc', '../src/compiler/js-inlining-heuristic.h', + '../src/compiler/js-inlining.cc', + '../src/compiler/js-inlining.h', '../src/compiler/js-intrinsic-lowering.cc', '../src/compiler/js-intrinsic-lowering.h', '../src/compiler/js-native-context-specialization.cc', @@ -772,12 +805,14 @@ '../src/compiler/loop-peeling.h', '../src/compiler/loop-variable-optimizer.cc', '../src/compiler/loop-variable-optimizer.h', + '../src/compiler/machine-graph-verifier.cc', + '../src/compiler/machine-graph-verifier.h', + '../src/compiler/machine-graph.cc', + '../src/compiler/machine-graph.h', '../src/compiler/machine-operator-reducer.cc', '../src/compiler/machine-operator-reducer.h', '../src/compiler/machine-operator.cc', '../src/compiler/machine-operator.h', - '../src/compiler/machine-graph-verifier.cc', - '../src/compiler/machine-graph-verifier.h', '../src/compiler/memory-optimizer.cc', '../src/compiler/memory-optimizer.h', '../src/compiler/move-optimizer.cc', @@ -789,6 +824,8 @@ '../src/compiler/node-marker.h', '../src/compiler/node-matchers.cc', '../src/compiler/node-matchers.h', + '../src/compiler/node-origin-table.cc', + '../src/compiler/node-origin-table.h', '../src/compiler/node-properties.cc', '../src/compiler/node-properties.h', '../src/compiler/node.cc', @@ -804,20 +841,20 @@ '../src/compiler/osr.cc', '../src/compiler/osr.h', '../src/compiler/persistent-map.h', - '../src/compiler/pipeline.cc', - '../src/compiler/pipeline.h', '../src/compiler/pipeline-statistics.cc', '../src/compiler/pipeline-statistics.h', + '../src/compiler/pipeline.cc', + '../src/compiler/pipeline.h', '../src/compiler/property-access-builder.cc', '../src/compiler/property-access-builder.h', '../src/compiler/raw-machine-assembler.cc', '../src/compiler/raw-machine-assembler.h', '../src/compiler/redundancy-elimination.cc', '../src/compiler/redundancy-elimination.h', - '../src/compiler/register-allocator.cc', - '../src/compiler/register-allocator.h', '../src/compiler/register-allocator-verifier.cc', '../src/compiler/register-allocator-verifier.h', + '../src/compiler/register-allocator.cc', + '../src/compiler/register-allocator.h', '../src/compiler/representation-change.cc', '../src/compiler/representation-change.h', '../src/compiler/schedule.cc', @@ -834,20 +871,20 @@ '../src/compiler/simplified-operator-reducer.h', '../src/compiler/simplified-operator.cc', '../src/compiler/simplified-operator.h', - '../src/compiler/compiler-source-position-table.cc', - '../src/compiler/compiler-source-position-table.h', '../src/compiler/state-values-utils.cc', '../src/compiler/state-values-utils.h', '../src/compiler/store-store-elimination.cc', '../src/compiler/store-store-elimination.h', - '../src/compiler/types.cc', - '../src/compiler/types.h', '../src/compiler/type-cache.cc', '../src/compiler/type-cache.h', + '../src/compiler/type-narrowing-reducer.cc', + '../src/compiler/type-narrowing-reducer.h', '../src/compiler/typed-optimization.cc', '../src/compiler/typed-optimization.h', '../src/compiler/typer.cc', '../src/compiler/typer.h', + '../src/compiler/types.cc', + '../src/compiler/types.h', '../src/compiler/unwinding-info-writer.h', '../src/compiler/value-numbering-reducer.cc', '../src/compiler/value-numbering-reducer.h', @@ -855,21 +892,8 @@ '../src/compiler/verifier.h', '../src/compiler/wasm-compiler.cc', '../src/compiler/wasm-compiler.h', - '../src/compiler/wasm-linkage.cc', '../src/compiler/zone-stats.cc', '../src/compiler/zone-stats.h', - '../src/compiler-dispatcher/compiler-dispatcher.cc', - '../src/compiler-dispatcher/compiler-dispatcher.h', - '../src/compiler-dispatcher/compiler-dispatcher-job.cc', - '../src/compiler-dispatcher/compiler-dispatcher-job.h', - '../src/compiler-dispatcher/compiler-dispatcher-tracer.cc', - '../src/compiler-dispatcher/compiler-dispatcher-tracer.h', - '../src/compiler-dispatcher/optimizing-compile-dispatcher.cc', - '../src/compiler-dispatcher/optimizing-compile-dispatcher.h', - '../src/compiler-dispatcher/unoptimized-compile-job.cc', - '../src/compiler-dispatcher/unoptimized-compile-job.h', - '../src/compiler.cc', - '../src/compiler.h', '../src/contexts-inl.h', '../src/contexts.cc', '../src/contexts.h', @@ -888,9 +912,9 @@ '../src/debug/debug-coverage.h', '../src/debug/debug-evaluate.cc', '../src/debug/debug-evaluate.h', - '../src/debug/debug-interface.h', '../src/debug/debug-frames.cc', '../src/debug/debug-frames.h', + '../src/debug/debug-interface.h', '../src/debug/debug-scope-iterator.cc', '../src/debug/debug-scope-iterator.h', '../src/debug/debug-scopes.cc', @@ -946,8 +970,8 @@ '../src/feedback-vector-inl.h', '../src/feedback-vector.cc', '../src/feedback-vector.h', - '../src/field-index.h', '../src/field-index-inl.h', + '../src/field-index.h', '../src/field-type.cc', '../src/field-type.h', '../src/fixed-dtoa.cc', @@ -987,8 +1011,6 @@ '../src/heap/factory-inl.h', '../src/heap/factory.cc', '../src/heap/factory.h', - '../src/heap/memory-reducer.cc', - '../src/heap/memory-reducer.h', '../src/heap/gc-idle-time-handler.cc', '../src/heap/gc-idle-time-handler.h', '../src/heap/gc-tracer.cc', @@ -1012,14 +1034,16 @@ '../src/heap/mark-compact.h', '../src/heap/marking.cc', '../src/heap/marking.h', + '../src/heap/memory-reducer.cc', + '../src/heap/memory-reducer.h', '../src/heap/object-stats.cc', '../src/heap/object-stats.h', '../src/heap/objects-visiting-inl.h', '../src/heap/objects-visiting.cc', '../src/heap/objects-visiting.h', '../src/heap/remembered-set.h', - '../src/heap/scavenge-job.h', '../src/heap/scavenge-job.cc', + '../src/heap/scavenge-job.h', '../src/heap/scavenger-inl.h', '../src/heap/scavenger.cc', '../src/heap/scavenger.h', @@ -1036,20 +1060,20 @@ '../src/heap/sweeper.cc', '../src/heap/sweeper.h', '../src/heap/worklist.h', - '../src/intl.cc', - '../src/intl.h', - '../src/icu_util.cc', - '../src/icu_util.h', '../src/ic/call-optimization.cc', '../src/ic/call-optimization.h', - '../src/ic/handler-configuration.cc', '../src/ic/handler-configuration-inl.h', + '../src/ic/handler-configuration.cc', '../src/ic/handler-configuration.h', '../src/ic/ic-inl.h', '../src/ic/ic-stats.cc', '../src/ic/ic-stats.h', '../src/ic/ic.cc', '../src/ic/ic.h', + '../src/ic/stub-cache.cc', + '../src/ic/stub-cache.h', + '../src/icu_util.cc', + '../src/icu_util.h', '../src/identity-map.cc', '../src/identity-map.h', '../src/instruction-stream.cc', @@ -1057,8 +1081,6 @@ '../src/interface-descriptors.cc', '../src/interface-descriptors.h', '../src/interpreter/block-coverage-builder.h', - '../src/interpreter/bytecodes.cc', - '../src/interpreter/bytecodes.h', '../src/interpreter/bytecode-array-accessor.cc', '../src/interpreter/bytecode-array-accessor.h', '../src/interpreter/bytecode-array-builder.cc', @@ -1075,32 +1097,36 @@ '../src/interpreter/bytecode-flags.h', '../src/interpreter/bytecode-generator.cc', '../src/interpreter/bytecode-generator.h', + '../src/interpreter/bytecode-jump-table.h', '../src/interpreter/bytecode-label.cc', '../src/interpreter/bytecode-label.h', '../src/interpreter/bytecode-node.cc', '../src/interpreter/bytecode-node.h', '../src/interpreter/bytecode-operands.cc', '../src/interpreter/bytecode-operands.h', - '../src/interpreter/bytecode-register.cc', - '../src/interpreter/bytecode-register.h', '../src/interpreter/bytecode-register-allocator.h', '../src/interpreter/bytecode-register-optimizer.cc', '../src/interpreter/bytecode-register-optimizer.h', + '../src/interpreter/bytecode-register.cc', + '../src/interpreter/bytecode-register.h', '../src/interpreter/bytecode-source-info.cc', '../src/interpreter/bytecode-source-info.h', - '../src/interpreter/bytecode-jump-table.h', '../src/interpreter/bytecode-traits.h', + '../src/interpreter/bytecodes.cc', + '../src/interpreter/bytecodes.h', '../src/interpreter/constant-array-builder.cc', '../src/interpreter/constant-array-builder.h', '../src/interpreter/control-flow-builders.cc', '../src/interpreter/control-flow-builders.h', '../src/interpreter/handler-table-builder.cc', '../src/interpreter/handler-table-builder.h', - '../src/interpreter/interpreter.cc', - '../src/interpreter/interpreter.h', '../src/interpreter/interpreter-generator.h', '../src/interpreter/interpreter-intrinsics.cc', '../src/interpreter/interpreter-intrinsics.h', + '../src/interpreter/interpreter.cc', + '../src/interpreter/interpreter.h', + '../src/intl.cc', + '../src/intl.h', '../src/isolate-inl.h', '../src/isolate.cc', '../src/isolate.h', @@ -1108,8 +1134,8 @@ '../src/json-parser.h', '../src/json-stringifier.cc', '../src/json-stringifier.h', - '../src/keys.h', '../src/keys.cc', + '../src/keys.h', '../src/label.h', '../src/layout-descriptor-inl.h', '../src/layout-descriptor.cc', @@ -1126,13 +1152,13 @@ '../src/lookup-cache.h', '../src/lookup.cc', '../src/lookup.h', - '../src/map-updater.cc', - '../src/map-updater.h', - '../src/macro-assembler-inl.h', - '../src/macro-assembler.h', + '../src/lsan.h', '../src/machine-type.cc', '../src/machine-type.h', - '../src/managed.h', + '../src/macro-assembler-inl.h', + '../src/macro-assembler.h', + '../src/map-updater.cc', + '../src/map-updater.h', '../src/messages.cc', '../src/messages.h', '../src/msan.h', @@ -1143,25 +1169,25 @@ '../src/objects-printer.cc', '../src/objects.cc', '../src/objects.h', + '../src/objects/api-callbacks-inl.h', + '../src/objects/api-callbacks.h', '../src/objects/arguments-inl.h', '../src/objects/arguments.h', '../src/objects/bigint.cc', '../src/objects/bigint.h', '../src/objects/code-inl.h', '../src/objects/code.h', - '../src/objects/compilation-cache.h', '../src/objects/compilation-cache-inl.h', - '../src/objects/data-handler.h', - '../src/objects/data-handler-inl.h', + '../src/objects/compilation-cache.h', '../src/objects/debug-objects-inl.h', '../src/objects/debug-objects.cc', '../src/objects/debug-objects.h', '../src/objects/descriptor-array.h', '../src/objects/dictionary.h', - '../src/objects/fixed-array.h', '../src/objects/fixed-array-inl.h', - '../src/objects/frame-array.h', + '../src/objects/fixed-array.h', '../src/objects/frame-array-inl.h', + '../src/objects/frame-array.h', '../src/objects/hash-table-inl.h', '../src/objects/hash-table.h', '../src/objects/intl-objects.cc', @@ -1170,15 +1196,20 @@ '../src/objects/js-array.h', '../src/objects/js-collection-inl.h', '../src/objects/js-collection.h', + '../src/objects/js-locale-inl.h', + '../src/objects/js-locale.cc', + '../src/objects/js-locale.h', '../src/objects/js-promise-inl.h', '../src/objects/js-promise.h', '../src/objects/js-regexp-inl.h', - '../src/objects/js-regexp.h', '../src/objects/js-regexp-string-iterator-inl.h', '../src/objects/js-regexp-string-iterator.h', - '../src/objects/literal-objects.cc', + '../src/objects/js-regexp.h', '../src/objects/literal-objects-inl.h', + '../src/objects/literal-objects.cc', '../src/objects/literal-objects.h', + '../src/objects/managed.cc', + '../src/objects/managed.h', '../src/objects/map-inl.h', '../src/objects/map.h', '../src/objects/maybe-object-inl.h', @@ -1192,6 +1223,9 @@ '../src/objects/name.h', '../src/objects/object-macros-undef.h', '../src/objects/object-macros.h', + '../src/objects/ordered-hash-table-inl.h', + '../src/objects/ordered-hash-table.cc', + '../src/objects/ordered-hash-table.h', '../src/objects/promise-inl.h', '../src/objects/promise.h', '../src/objects/property-descriptor-object-inl.h', @@ -1199,15 +1233,17 @@ '../src/objects/regexp-match-info.h', '../src/objects/scope-info.cc', '../src/objects/scope-info.h', - '../src/objects/script.h', '../src/objects/script-inl.h', + '../src/objects/script.h', '../src/objects/shared-function-info-inl.h', '../src/objects/shared-function-info.h', '../src/objects/string-inl.h', - '../src/objects/string.h', '../src/objects/string-table.h', + '../src/objects/string.h', '../src/objects/template-objects.cc', '../src/objects/template-objects.h', + '../src/objects/templates-inl.h', + '../src/objects/templates.h', '../src/optimized-compilation-info.cc', '../src/optimized-compilation-info.h', '../src/ostreams.cc', @@ -1257,11 +1293,11 @@ '../src/profiler/heap-snapshot-generator-inl.h', '../src/profiler/heap-snapshot-generator.cc', '../src/profiler/heap-snapshot-generator.h', - '../src/profiler/profiler-listener.cc', - '../src/profiler/profiler-listener.h', '../src/profiler/profile-generator-inl.h', '../src/profiler/profile-generator.cc', '../src/profiler/profile-generator.h', + '../src/profiler/profiler-listener.cc', + '../src/profiler/profiler-listener.h', '../src/profiler/sampling-heap-profiler.cc', '../src/profiler/sampling-heap-profiler.h', '../src/profiler/strings-storage.cc', @@ -1312,14 +1348,14 @@ '../src/runtime/runtime-compiler.cc', '../src/runtime/runtime-date.cc', '../src/runtime/runtime-debug.cc', + '../src/runtime/runtime-error.cc', '../src/runtime/runtime-forin.cc', '../src/runtime/runtime-function.cc', - '../src/runtime/runtime-error.cc', '../src/runtime/runtime-futex.cc', '../src/runtime/runtime-generator.cc', - '../src/runtime/runtime-intl.cc', '../src/runtime/runtime-internal.cc', '../src/runtime/runtime-interpreter.cc', + '../src/runtime/runtime-intl.cc', '../src/runtime/runtime-literals.cc', '../src/runtime/runtime-liveedit.cc', '../src/runtime/runtime-maths.cc', @@ -1364,6 +1400,7 @@ '../src/snapshot/default-serializer-allocator.h', '../src/snapshot/deserializer.cc', '../src/snapshot/deserializer.h', + '../src/snapshot/macros.h', '../src/snapshot/natives-common.cc', '../src/snapshot/natives.h', '../src/snapshot/object-deserializer.cc', @@ -1372,14 +1409,14 @@ '../src/snapshot/partial-deserializer.h', '../src/snapshot/partial-serializer.cc', '../src/snapshot/partial-serializer.h', - '../src/snapshot/serializer.cc', '../src/snapshot/serializer-common.cc', '../src/snapshot/serializer-common.h', + '../src/snapshot/serializer.cc', '../src/snapshot/serializer.h', '../src/snapshot/snapshot-common.cc', - '../src/snapshot/snapshot.h', '../src/snapshot/snapshot-source-sink.cc', '../src/snapshot/snapshot-source-sink.h', + '../src/snapshot/snapshot.h', '../src/snapshot/startup-deserializer.cc', '../src/snapshot/startup-deserializer.h', '../src/snapshot/startup-serializer.cc', @@ -1388,8 +1425,8 @@ '../src/source-position-table.h', '../src/source-position.cc', '../src/source-position.h', - '../src/splay-tree.h', '../src/splay-tree-inl.h', + '../src/splay-tree.h', '../src/startup-data-util.cc', '../src/startup-data-util.h', '../src/string-builder.cc', @@ -1403,8 +1440,6 @@ '../src/string-stream.h', '../src/strtod.cc', '../src/strtod.h', - '../src/ic/stub-cache.cc', - '../src/ic/stub-cache.h', '../src/third_party/utf8-decoder/utf8-decoder.h', '../src/tracing/trace-event.cc', '../src/tracing/trace-event.h', @@ -1415,10 +1450,11 @@ '../src/transitions-inl.h', '../src/transitions.cc', '../src/transitions.h', + '../src/trap-handler/handler-inside.cc', '../src/trap-handler/handler-outside.cc', '../src/trap-handler/handler-shared.cc', - '../src/trap-handler/trap-handler.h', '../src/trap-handler/trap-handler-internal.h', + '../src/trap-handler/trap-handler.h', '../src/type-hints.cc', '../src/type-hints.h', '../src/unicode-cache-inl.h', @@ -1455,13 +1491,14 @@ '../src/wasm/baseline/liftoff-assembler.cc', '../src/wasm/baseline/liftoff-assembler.h', '../src/wasm/baseline/liftoff-compiler.cc', + '../src/wasm/baseline/liftoff-compiler.h', '../src/wasm/baseline/liftoff-register.h', - '../src/wasm/compilation-manager.cc', - '../src/wasm/compilation-manager.h', '../src/wasm/decoder.h', + '../src/wasm/function-body-decoder-impl.h', '../src/wasm/function-body-decoder.cc', '../src/wasm/function-body-decoder.h', - '../src/wasm/function-body-decoder-impl.h', + '../src/wasm/function-compiler.cc', + '../src/wasm/function-compiler.h', '../src/wasm/leb-helper.h', '../src/wasm/local-decl-encoder.cc', '../src/wasm/local-decl-encoder.h', @@ -1475,6 +1512,7 @@ '../src/wasm/signature-map.h', '../src/wasm/streaming-decoder.cc', '../src/wasm/streaming-decoder.h', + '../src/wasm/value-type.h', '../src/wasm/wasm-code-manager.cc', '../src/wasm/wasm-code-manager.h', '../src/wasm/wasm-code-specialization.cc', @@ -1485,17 +1523,18 @@ '../src/wasm/wasm-engine.h', '../src/wasm/wasm-external-refs.cc', '../src/wasm/wasm-external-refs.h', + '../src/wasm/wasm-interpreter.cc', + '../src/wasm/wasm-interpreter.h', '../src/wasm/wasm-js.cc', '../src/wasm/wasm-js.h', '../src/wasm/wasm-limits.h', + '../src/wasm/wasm-linkage.h', '../src/wasm/wasm-memory.cc', '../src/wasm/wasm-memory.h', - '../src/wasm/wasm-module.cc', - '../src/wasm/wasm-module.h', '../src/wasm/wasm-module-builder.cc', '../src/wasm/wasm-module-builder.h', - '../src/wasm/wasm-interpreter.cc', - '../src/wasm/wasm-interpreter.h', + '../src/wasm/wasm-module.cc', + '../src/wasm/wasm-module.h', '../src/wasm/wasm-objects-inl.h', '../src/wasm/wasm-objects.cc', '../src/wasm/wasm-objects.h', @@ -1510,17 +1549,16 @@ '../src/wasm/wasm-value.h', '../src/zone/accounting-allocator.cc', '../src/zone/accounting-allocator.h', - '../src/zone/zone-segment.cc', - '../src/zone/zone-segment.h', - '../src/zone/zone.cc', - '../src/zone/zone.h', - '../src/zone/zone-chunk-list.h', - '../src/zone/zone-segment.cc', - '../src/zone/zone-segment.h', '../src/zone/zone-allocator.h', + '../src/zone/zone-chunk-list.h', '../src/zone/zone-containers.h', '../src/zone/zone-handle-set.h', '../src/zone/zone-list-inl.h', + '../src/zone/zone-segment.cc', + '../src/zone/zone-segment.h', + '../src/zone/zone.cc', + '../src/zone/zone.h', + '<(SHARED_INTERMEDIATE_DIR)/torque-generated/builtin-definitions-from-dsl.h', ], 'conditions': [ ['want_separate_host_toolset==1', { @@ -1528,6 +1566,77 @@ }, { 'toolsets': ['target'], }], + ['v8_target_arch=="ia32"', { + 'sources': [ + '../src/compiler/ia32/code-generator-ia32.cc', + '../src/compiler/ia32/instruction-codes-ia32.h', + '../src/compiler/ia32/instruction-scheduler-ia32.cc', + '../src/compiler/ia32/instruction-selector-ia32.cc', + '../src/debug/ia32/debug-ia32.cc', + '../src/ia32/assembler-ia32-inl.h', + '../src/ia32/assembler-ia32.cc', + '../src/ia32/assembler-ia32.h', + '../src/ia32/code-stubs-ia32.cc', + '../src/ia32/codegen-ia32.cc', + '../src/ia32/cpu-ia32.cc', + '../src/ia32/deoptimizer-ia32.cc', + '../src/ia32/disasm-ia32.cc', + '../src/ia32/frame-constants-ia32.cc', + '../src/ia32/frame-constants-ia32.h', + '../src/ia32/interface-descriptors-ia32.cc', + '../src/ia32/macro-assembler-ia32.cc', + '../src/ia32/macro-assembler-ia32.h', + '../src/ia32/simulator-ia32.cc', + '../src/ia32/simulator-ia32.h', + '../src/ia32/sse-instr.h', + '../src/regexp/ia32/regexp-macro-assembler-ia32.cc', + '../src/regexp/ia32/regexp-macro-assembler-ia32.h', + '../src/wasm/baseline/ia32/liftoff-assembler-ia32.h', + ], + }], + ['v8_target_arch=="x64"', { + 'sources': [ + '../src/compiler/x64/code-generator-x64.cc', + '../src/compiler/x64/instruction-codes-x64.h', + '../src/compiler/x64/instruction-scheduler-x64.cc', + '../src/compiler/x64/instruction-selector-x64.cc', + '../src/compiler/x64/unwinding-info-writer-x64.cc', + '../src/compiler/x64/unwinding-info-writer-x64.h', + '../src/debug/x64/debug-x64.cc', + '../src/regexp/x64/regexp-macro-assembler-x64.cc', + '../src/regexp/x64/regexp-macro-assembler-x64.h', + '../src/third_party/valgrind/valgrind.h', + '../src/wasm/baseline/x64/liftoff-assembler-x64.h', + '../src/x64/assembler-x64-inl.h', + '../src/x64/assembler-x64.cc', + '../src/x64/assembler-x64.h', + '../src/x64/code-stubs-x64.cc', + '../src/x64/codegen-x64.cc', + '../src/x64/cpu-x64.cc', + '../src/x64/deoptimizer-x64.cc', + '../src/x64/disasm-x64.cc', + '../src/x64/eh-frame-x64.cc', + '../src/x64/frame-constants-x64.cc', + '../src/x64/frame-constants-x64.h', + '../src/x64/interface-descriptors-x64.cc', + '../src/x64/macro-assembler-x64.cc', + '../src/x64/macro-assembler-x64.h', + '../src/x64/simulator-x64.cc', + '../src/x64/simulator-x64.h', + '../src/x64/sse-instr.h', + ], + }], + ['v8_target_arch=="x64" and OS=="linux"', { + 'sources': [ + '../src/trap-handler/handler-inside-linux.cc', + '../src/trap-handler/handler-outside-linux.cc', + ], + }], + ['v8_target_arch=="x64" and OS=="win"', { + 'sources': [ + '../src/trap-handler/handler-outside-win.cc', + ], + }], ['v8_target_arch=="arm"', { 'sources': [ '../src/arm/assembler-arm-inl.h', @@ -1541,6 +1650,7 @@ '../src/arm/cpu-arm.cc', '../src/arm/deoptimizer-arm.cc', '../src/arm/disasm-arm.cc', + '../src/arm/eh-frame-arm.cc', '../src/arm/frame-constants-arm.cc', '../src/arm/frame-constants-arm.h', '../src/arm/interface-descriptors-arm.cc', @@ -1549,7 +1659,6 @@ '../src/arm/macro-assembler-arm.h', '../src/arm/simulator-arm.cc', '../src/arm/simulator-arm.h', - '../src/arm/eh-frame-arm.cc', '../src/compiler/arm/code-generator-arm.cc', '../src/compiler/arm/instruction-codes-arm.h', '../src/compiler/arm/instruction-scheduler-arm.cc', @@ -1564,20 +1673,21 @@ }], ['v8_target_arch=="arm64"', { 'sources': [ + '../src/arm64/assembler-arm64-inl.h', '../src/arm64/assembler-arm64.cc', '../src/arm64/assembler-arm64.h', - '../src/arm64/assembler-arm64-inl.h', - '../src/arm64/codegen-arm64.cc', '../src/arm64/code-stubs-arm64.cc', '../src/arm64/code-stubs-arm64.h', + '../src/arm64/codegen-arm64.cc', '../src/arm64/constants-arm64.h', '../src/arm64/cpu-arm64.cc', + '../src/arm64/decoder-arm64-inl.h', '../src/arm64/decoder-arm64.cc', '../src/arm64/decoder-arm64.h', - '../src/arm64/decoder-arm64-inl.h', '../src/arm64/deoptimizer-arm64.cc', '../src/arm64/disasm-arm64.cc', '../src/arm64/disasm-arm64.h', + '../src/arm64/eh-frame-arm64.cc', '../src/arm64/frame-constants-arm64.cc', '../src/arm64/frame-constants-arm64.h', '../src/arm64/instructions-arm64-constants.cc', @@ -1587,15 +1697,14 @@ '../src/arm64/instrument-arm64.h', '../src/arm64/interface-descriptors-arm64.cc', '../src/arm64/interface-descriptors-arm64.h', + '../src/arm64/macro-assembler-arm64-inl.h', '../src/arm64/macro-assembler-arm64.cc', '../src/arm64/macro-assembler-arm64.h', - '../src/arm64/macro-assembler-arm64-inl.h', '../src/arm64/simulator-arm64.cc', '../src/arm64/simulator-arm64.h', '../src/arm64/simulator-logic-arm64.cc', '../src/arm64/utils-arm64.cc', '../src/arm64/utils-arm64.h', - '../src/arm64/eh-frame-arm64.cc', '../src/compiler/arm64/code-generator-arm64.cc', '../src/compiler/arm64/instruction-codes-arm64.h', '../src/compiler/arm64/instruction-scheduler-arm64.cc', @@ -1608,42 +1717,19 @@ '../src/wasm/baseline/arm64/liftoff-assembler-arm64.h', ], }], - ['v8_target_arch=="ia32"', { - 'sources': [ - '../src/ia32/assembler-ia32-inl.h', - '../src/ia32/assembler-ia32.cc', - '../src/ia32/assembler-ia32.h', - '../src/ia32/code-stubs-ia32.cc', - '../src/ia32/codegen-ia32.cc', - '../src/ia32/cpu-ia32.cc', - '../src/ia32/deoptimizer-ia32.cc', - '../src/ia32/disasm-ia32.cc', - '../src/ia32/frame-constants-ia32.cc', - '../src/ia32/frame-constants-ia32.h', - '../src/ia32/interface-descriptors-ia32.cc', - '../src/ia32/macro-assembler-ia32.cc', - '../src/ia32/macro-assembler-ia32.h', - '../src/ia32/simulator-ia32.cc', - '../src/ia32/simulator-ia32.h', - '../src/ia32/sse-instr.h', - '../src/compiler/ia32/code-generator-ia32.cc', - '../src/compiler/ia32/instruction-codes-ia32.h', - '../src/compiler/ia32/instruction-scheduler-ia32.cc', - '../src/compiler/ia32/instruction-selector-ia32.cc', - '../src/debug/ia32/debug-ia32.cc', - '../src/regexp/ia32/regexp-macro-assembler-ia32.cc', - '../src/regexp/ia32/regexp-macro-assembler-ia32.h', - '../src/wasm/baseline/ia32/liftoff-assembler-ia32.h', - ], - }], ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', { 'sources': [ + '../src/compiler/mips/code-generator-mips.cc', + '../src/compiler/mips/instruction-codes-mips.h', + '../src/compiler/mips/instruction-scheduler-mips.cc', + '../src/compiler/mips/instruction-selector-mips.cc', + '../src/debug/mips/debug-mips.cc', + '../src/mips/assembler-mips-inl.h', '../src/mips/assembler-mips.cc', '../src/mips/assembler-mips.h', - '../src/mips/assembler-mips-inl.h', - '../src/mips/codegen-mips.cc', '../src/mips/code-stubs-mips.cc', '../src/mips/code-stubs-mips.h', + '../src/mips/codegen-mips.cc', '../src/mips/constants-mips.cc', '../src/mips/constants-mips.h', '../src/mips/cpu-mips.cc', @@ -1656,11 +1742,6 @@ '../src/mips/macro-assembler-mips.h', '../src/mips/simulator-mips.cc', '../src/mips/simulator-mips.h', - '../src/compiler/mips/code-generator-mips.cc', - '../src/compiler/mips/instruction-codes-mips.h', - '../src/compiler/mips/instruction-scheduler-mips.cc', - '../src/compiler/mips/instruction-selector-mips.cc', - '../src/debug/mips/debug-mips.cc', '../src/regexp/mips/regexp-macro-assembler-mips.cc', '../src/regexp/mips/regexp-macro-assembler-mips.h', '../src/wasm/baseline/mips/liftoff-assembler-mips.h', @@ -1668,12 +1749,17 @@ }], ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 'sources': [ + '../src/compiler/mips64/code-generator-mips64.cc', + '../src/compiler/mips64/instruction-codes-mips64.h', + '../src/compiler/mips64/instruction-scheduler-mips64.cc', + '../src/compiler/mips64/instruction-selector-mips64.cc', + '../src/debug/mips64/debug-mips64.cc', + '../src/mips64/assembler-mips64-inl.h', '../src/mips64/assembler-mips64.cc', '../src/mips64/assembler-mips64.h', - '../src/mips64/assembler-mips64-inl.h', - '../src/mips64/codegen-mips64.cc', '../src/mips64/code-stubs-mips64.cc', '../src/mips64/code-stubs-mips64.h', + '../src/mips64/codegen-mips64.cc', '../src/mips64/constants-mips64.cc', '../src/mips64/constants-mips64.h', '../src/mips64/cpu-mips64.cc', @@ -1686,51 +1772,11 @@ '../src/mips64/macro-assembler-mips64.h', '../src/mips64/simulator-mips64.cc', '../src/mips64/simulator-mips64.h', - '../src/compiler/mips64/code-generator-mips64.cc', - '../src/compiler/mips64/instruction-codes-mips64.h', - '../src/compiler/mips64/instruction-scheduler-mips64.cc', - '../src/compiler/mips64/instruction-selector-mips64.cc', - '../src/debug/mips64/debug-mips64.cc', '../src/regexp/mips64/regexp-macro-assembler-mips64.cc', '../src/regexp/mips64/regexp-macro-assembler-mips64.h', '../src/wasm/baseline/mips64/liftoff-assembler-mips64.h', ], }], - ['v8_target_arch=="x64"', { - 'sources': [ - '../src/compiler/x64/code-generator-x64.cc', - '../src/compiler/x64/instruction-codes-x64.h', - '../src/compiler/x64/instruction-scheduler-x64.cc', - '../src/compiler/x64/instruction-selector-x64.cc', - '../src/compiler/x64/unwinding-info-writer-x64.cc', - '../src/compiler/x64/unwinding-info-writer-x64.h', - '../src/x64/assembler-x64-inl.h', - '../src/x64/assembler-x64.cc', - '../src/x64/assembler-x64.h', - '../src/x64/code-stubs-x64.cc', - '../src/x64/codegen-x64.cc', - '../src/x64/cpu-x64.cc', - '../src/x64/deoptimizer-x64.cc', - '../src/x64/disasm-x64.cc', - '../src/x64/eh-frame-x64.cc', - '../src/x64/frame-constants-x64.cc', - '../src/x64/frame-constants-x64.h', - '../src/x64/interface-descriptors-x64.cc', - '../src/x64/macro-assembler-x64.cc', - '../src/x64/macro-assembler-x64.h', - '../src/x64/simulator-x64.cc', - '../src/x64/simulator-x64.h', - '../src/x64/sse-instr.h', - '../src/debug/x64/debug-x64.cc', - '../src/regexp/x64/regexp-macro-assembler-x64.cc', - '../src/regexp/x64/regexp-macro-assembler-x64.h', - '../src/third_party/valgrind/valgrind.h', - '../src/wasm/baseline/x64/liftoff-assembler-x64.h', - ], - }], - ['v8_target_arch=="x64" and OS=="linux"', { - 'sources': ['../src/trap-handler/handler-inside.cc'] - }], ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { 'sources': [ '../src/compiler/ppc/code-generator-ppc.cc', @@ -1770,12 +1816,12 @@ '../src/debug/s390/debug-s390.cc', '../src/regexp/s390/regexp-macro-assembler-s390.cc', '../src/regexp/s390/regexp-macro-assembler-s390.h', + '../src/s390/assembler-s390-inl.h', '../src/s390/assembler-s390.cc', '../src/s390/assembler-s390.h', - '../src/s390/assembler-s390-inl.h', - '../src/s390/codegen-s390.cc', '../src/s390/code-stubs-s390.cc', '../src/s390/code-stubs-s390.h', + '../src/s390/codegen-s390.cc', '../src/s390/constants-s390.cc', '../src/s390/constants-s390.h', '../src/s390/cpu-s390.cc', @@ -1855,6 +1901,9 @@ '../src/intl.h', '../src/objects/intl-objects.cc', '../src/objects/intl-objects.h', + '../src/objects/js-locale-inl.h', + '../src/objects/js-locale.cc', + '../src/objects/js-locale.h', '../src/runtime/runtime-intl.cc', ], }], @@ -1868,12 +1917,16 @@ { 'target_name': 'v8_libbase', 'type': '<(component)', + 'toolsets': ['host', 'target'], 'variables': { 'optimize': 'max', }, 'include_dirs+': [ '..', ], + 'direct_dependent_settings': { + 'include_dirs+': ['..'], + }, 'sources': [ '../src/base/adapters.h', '../src/base/atomic-utils.h', @@ -1888,10 +1941,10 @@ '../src/base/compiler-specific.h', '../src/base/cpu.cc', '../src/base/cpu.h', - '../src/base/division-by-constant.cc', - '../src/base/division-by-constant.h', '../src/base/debug/stack_trace.cc', '../src/base/debug/stack_trace.h', + '../src/base/division-by-constant.cc', + '../src/base/division-by-constant.h', '../src/base/export-template.h', '../src/base/file-utils.cc', '../src/base/file-utils.h', @@ -1900,8 +1953,8 @@ '../src/base/free_deleter.h', '../src/base/functional.cc', '../src/base/functional.h', - '../src/base/hashmap.h', '../src/base/hashmap-entry.h', + '../src/base/hashmap.h', '../src/base/ieee754.cc', '../src/base/ieee754.h', '../src/base/iterator.h', @@ -1914,16 +1967,16 @@ '../src/base/optional.h', '../src/base/page-allocator.cc', '../src/base/page-allocator.h', - '../src/base/platform/elapsed-timer.h', - '../src/base/platform/time.cc', - '../src/base/platform/time.h', '../src/base/platform/condition-variable.cc', '../src/base/platform/condition-variable.h', + '../src/base/platform/elapsed-timer.h', '../src/base/platform/mutex.cc', '../src/base/platform/mutex.h', '../src/base/platform/platform.h', '../src/base/platform/semaphore.cc', '../src/base/platform/semaphore.h', + '../src/base/platform/time.cc', + '../src/base/platform/time.h', '../src/base/ring-buffer.h', '../src/base/safe_conversions.h', '../src/base/safe_conversions_impl.h', @@ -1948,11 +2001,6 @@ }], ], 'conditions': [ - ['want_separate_host_toolset==1', { - 'toolsets': ['host', 'target'], - }, { - 'toolsets': ['target'], - }], ['component=="shared_library"', { 'defines': [ 'BUILDING_V8_BASE_SHARED', @@ -1973,20 +2021,28 @@ 'sources': [ '../src/base/debug/stack_trace_posix.cc', '../src/base/platform/platform-linux.cc', - '../src/base/platform/platform-posix.h', '../src/base/platform/platform-posix.cc', - '../src/base/platform/platform-posix-time.h', + '../src/base/platform/platform-posix.h', '../src/base/platform/platform-posix-time.cc', + '../src/base/platform/platform-posix-time.h', ], } ], + ['OS=="aix"', { + 'sources': [ + '../src/base/debug/stack_trace_posix.cc', + '../src/base/platform/platform-aix.cc', + '../src/base/platform/platform-posix.cc', + '../src/base/platform/platform-posix.h', + ]}, + ], ['OS=="android"', { 'sources': [ '../src/base/debug/stack_trace_android.cc', - '../src/base/platform/platform-posix.h', '../src/base/platform/platform-posix.cc', - '../src/base/platform/platform-posix-time.h', + '../src/base/platform/platform-posix.h', '../src/base/platform/platform-posix-time.cc', + '../src/base/platform/platform-posix-time.h', ], 'link_settings': { 'target_conditions': [ @@ -2024,6 +2080,71 @@ ], }, ], + ['OS=="fuchsia"', { + 'sources': [ + '../src/base/debug/stack_trace_fuchsia.cc', + '../src/base/platform/platform-fuchsia.cc', + ]}, + ], + ['OS=="mac"', { + 'sources': [ + '../src/base/debug/stack_trace_posix.cc', + '../src/base/platform/platform-macos.cc', + '../src/base/platform/platform-posix.cc', + '../src/base/platform/platform-posix.h', + '../src/base/platform/platform-posix-time.cc', + '../src/base/platform/platform-posix-time.h', + ]}, + ], + ['OS=="win"', { + 'defines': [ + '_CRT_RAND_S' # for rand_s() + ], + 'variables': { + 'gyp_generators': ' GetModuleNamespace(); + + /** + * Returns the corresponding context-unbound module script. + * + * The module must be unevaluated, i.e. its status must not be kEvaluating, + * kEvaluated or kErrored. + */ + Local GetUnboundModuleScript(); }; /** @@ -1578,11 +1593,17 @@ class V8_EXPORT ScriptCompiler { * This will return nullptr if the script cannot be serialized. The * CachedData returned by this function should be owned by the caller. */ - static CachedData* CreateCodeCache(Local unbound_script); - - // Deprecated. static CachedData* CreateCodeCache(Local unbound_script, Local source); + static CachedData* CreateCodeCache(Local unbound_script); + + /** + * Creates and returns code cache for the specified unbound_module_script. + * This will return nullptr if the script cannot be serialized. The + * CachedData returned by this function should be owned by the caller. + */ + static CachedData* CreateCodeCache( + Local unbound_module_script); /** * Creates and returns code cache for the specified function that was @@ -1590,11 +1611,9 @@ class V8_EXPORT ScriptCompiler { * This will return nullptr if the script cannot be serialized. The * CachedData returned by this function should be owned by the caller. */ - static CachedData* CreateCodeCacheForFunction(Local function); - - // Deprecated. static CachedData* CreateCodeCacheForFunction(Local function, Local source); + static CachedData* CreateCodeCacheForFunction(Local function); private: static V8_WARN_UNUSED_RESULT MaybeLocal CompileUnboundInternal( @@ -1913,12 +1932,16 @@ class V8_EXPORT ValueSerializer { * If the memory cannot be allocated, nullptr should be returned. * |actual_size| will be ignored. It is assumed that |old_buffer| is still * valid in this case and has not been modified. + * + * The default implementation uses the stdlib's `realloc()` function. */ virtual void* ReallocateBufferMemory(void* old_buffer, size_t size, size_t* actual_size); /** * Frees a buffer allocated with |ReallocateBufferMemory|. + * + * The default implementation uses the stdlib's `free()` function. */ virtual void FreeBufferMemory(void* buffer); }; @@ -1946,9 +1969,9 @@ class V8_EXPORT ValueSerializer { /** * Returns the stored data (allocated using the delegate's - * AllocateBufferMemory) and its size. This serializer should not be used once - * the buffer is released. The contents are undefined if a previous write has - * failed. + * ReallocateBufferMemory) and its size. This serializer should not be used + * once the buffer is released. The contents are undefined if a previous write + * has failed. Ownership of the buffer is transferred to the caller. */ V8_WARN_UNUSED_RESULT std::pair Release(); @@ -3958,6 +3981,15 @@ class V8_EXPORT Function : public Object { return NewInstance(context, 0, nullptr); } + /** + * When side effect checks are enabled, passing kHasNoSideEffect allows the + * constructor to be invoked without throwing. Calls made within the + * constructor are still checked. + */ + V8_WARN_UNUSED_RESULT MaybeLocal NewInstanceWithSideEffectType( + Local context, int argc, Local argv[], + SideEffectType side_effect_type = SideEffectType::kHasSideEffect) const; + V8_DEPRECATE_SOON("Use maybe version", Local Call(Local recv, int argc, Local argv[])); @@ -4308,8 +4340,6 @@ class V8_EXPORT WasmModuleObjectBuilderStreaming final { ~WasmModuleObjectBuilderStreaming(); private: - typedef std::pair, size_t> Buffer; - WasmModuleObjectBuilderStreaming(const WasmModuleObjectBuilderStreaming&) = delete; WasmModuleObjectBuilderStreaming(WasmModuleObjectBuilderStreaming&&) = @@ -4332,8 +4362,6 @@ class V8_EXPORT WasmModuleObjectBuilderStreaming final { #else Persistent promise_; #endif - std::vector received_buffers_; - size_t total_size_ = 0; std::shared_ptr streaming_decoder_; }; @@ -7093,6 +7121,24 @@ class V8_EXPORT Isolate { internal::Isolate* const isolate_; }; + /** + * This scope allows terminations inside direct V8 API calls and forbid them + * inside any recursice API calls without explicit SafeForTerminationScope. + */ + class V8_EXPORT SafeForTerminationScope { + public: + explicit SafeForTerminationScope(v8::Isolate* isolate); + ~SafeForTerminationScope(); + + // Prevent copying of Scope objects. + SafeForTerminationScope(const SafeForTerminationScope&) = delete; + SafeForTerminationScope& operator=(const SafeForTerminationScope&) = delete; + + private: + internal::Isolate* isolate_; + bool prev_value_; + }; + /** * Types of garbage collections that can be requested via * RequestGarbageCollectionForTesting. @@ -7156,6 +7202,7 @@ class V8_EXPORT Isolate { kErrorStackTraceLimit = 45, kWebAssemblyInstantiation = 46, kDeoptimizerDisableSpeculation = 47, + kArrayPrototypeSortJSArrayModifiedPrototype = 48, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, UseCounterCallback.cpp, and enums.xml. V8 changes to @@ -7176,6 +7223,26 @@ class V8_EXPORT Isolate { typedef void (*UseCounterCallback)(Isolate* isolate, UseCounterFeature feature); + /** + * Allocates a new isolate but does not initialize it. Does not change the + * currently entered isolate. + * + * Only Isolate::GetData() and Isolate::SetData(), which access the + * embedder-controlled parts of the isolate, are allowed to be called on the + * uninitialized isolate. To initialize the isolate, call + * Isolate::Initialize(). + * + * When an isolate is no longer used its resources should be freed + * by calling Dispose(). Using the delete operator is not allowed. + * + * V8::Initialize() must have run prior to this. + */ + static Isolate* Allocate(); + + /** + * Initialize an Isolate previously allocated by Isolate::Allocate(). + */ + static void Initialize(Isolate* isolate, const CreateParams& params); /** * Creates a new isolate. Does not change the currently entered @@ -8230,6 +8297,18 @@ class V8_EXPORT SnapshotCreator { public: enum class FunctionCodeHandling { kClear, kKeep }; + /** + * Initialize and enter an isolate, and set it up for serialization. + * The isolate is either created from scratch or from an existing snapshot. + * The caller keeps ownership of the argument snapshot. + * \param existing_blob existing snapshot from which to create this one. + * \param external_references a null-terminated array of external references + * that must be equivalent to CreateParams::external_references. + */ + SnapshotCreator(Isolate* isolate, + const intptr_t* external_references = nullptr, + StartupData* existing_blob = nullptr); + /** * Create and enter an isolate, and set it up for serialization. * The isolate is either created from scratch or from an existing snapshot. @@ -9040,7 +9119,7 @@ template <> struct SmiTagging<4> { // in fact doesn't work correctly with gcc4.1.1 in some cases: The // compiler may produce undefined results in case of signed integer // overflow. The computation must be done w/ unsigned ints. - return static_cast(value + 0x40000000U) < 0x80000000U; + return static_cast(value) + 0x40000000U < 0x80000000U; } }; diff --git a/deps/v8/infra/config/cq.cfg b/deps/v8/infra/config/cq.cfg index 6159b3f1cdec..49c13c000bcb 100644 --- a/deps/v8/infra/config/cq.cfg +++ b/deps/v8/infra/config/cq.cfg @@ -30,6 +30,11 @@ verifiers { name: "v8_linux64_asan_rel_ng_triggered" triggered_by: "v8_linux64_asan_rel_ng" } + builders { name: "v8_linux64_dbg_ng" } + builders { + name: "v8_linux64_dbg_ng_triggered" + triggered_by: "v8_linux64_dbg_ng" + } builders { name: "v8_linux64_gcc_compile_dbg" } builders { name: "v8_linux64_jumbo_compile_rel" } builders { name: "v8_linux64_rel_ng" } @@ -61,11 +66,6 @@ verifiers { experiment_percentage: 100 } builders { name: "v8_linux_chromium_gn_rel" } - builders { name: "v8_linux_dbg_ng" } - builders { - name: "v8_linux_dbg_ng_triggered" - triggered_by: "v8_linux_dbg_ng" - } builders { name: "v8_linux_gcc_compile_rel" } builders { name: "v8_linux_mips64el_compile_rel" } builders { name: "v8_linux_mipsel_compile_rel" } diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 70a7ad5754e0..23b006245576 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -43,12 +43,6 @@ 'x64.optdebug': 'default_optdebug_x64', 'x64.release': 'default_release_x64', }, - - 'client.dart.fyi': { - 'v8-linux-release': 'release_x86_disassembler', - 'v8-win-release': 'release_x86_disassembler', - 'v8-mac-release': 'release_x86_disassembler', - }, 'client.dynamorio': { 'linux-v8-dr': 'release_x64', }, @@ -110,37 +104,39 @@ 'V8 Random Deopt Fuzzer - debug': 'debug_x64', }, 'client.v8.clusterfuzz': { - 'V8 Win64 ASAN - release builder': + 'V8 Clusterfuzz Win64 ASAN - release builder': 'release_x64_asan_no_lsan_verify_heap', # Note this is called a debug builder, but it uses a release build # configuration with dchecks (which enables DEBUG in V8), since win-asan # debug is not supported. - 'V8 Win64 ASAN - debug builder': + 'V8 Clusterfuzz Win64 ASAN - debug builder': 'release_x64_asan_no_lsan_verify_heap_dchecks', - 'V8 Mac64 ASAN - release builder': + 'V8 Clusterfuzz Mac64 ASAN - release builder': 'release_x64_asan_no_lsan_edge_verify_heap', - 'V8 Mac64 ASAN - debug builder': + 'V8 Clusterfuzz Mac64 ASAN - debug builder': 'debug_x64_asan_no_lsan_static_edge', - 'V8 Linux64 - release builder': 'release_x64_correctness_fuzzer', - 'V8 Linux64 - debug builder': 'debug_x64', - 'V8 Linux64 - nosnap release builder': 'release_x64_no_snap', - 'V8 Linux64 - nosnap debug builder': 'debug_x64_no_snap', - 'V8 Linux64 ASAN no inline - release builder': + 'V8 Clusterfuzz Linux64 - release builder': + 'release_x64_correctness_fuzzer', + 'V8 Clusterfuzz Linux64 - debug builder': 'debug_x64', + 'V8 Clusterfuzz Linux64 - nosnap release builder': 'release_x64_no_snap', + 'V8 Clusterfuzz Linux64 - nosnap debug builder': 'debug_x64_no_snap', + 'V8 Clusterfuzz Linux64 ASAN no inline - release builder': 'release_x64_asan_symbolized_edge_verify_heap', - 'V8 Linux64 ASAN - debug builder': 'debug_x64_asan_edge', - 'V8 Linux64 ASAN arm64 - debug builder': + 'V8 Clusterfuzz Linux64 ASAN - debug builder': 'debug_x64_asan_edge', + 'V8 Clusterfuzz Linux64 ASAN arm64 - debug builder': 'debug_simulate_arm64_asan_edge', - 'V8 Linux ASAN arm - debug builder': + 'V8 Clusterfuzz Linux ASAN arm - debug builder': 'debug_simulate_arm_asan_edge', - 'V8 Linux ASAN mipsel - debug builder': + 'V8 Clusterfuzz Linux ASAN mipsel - debug builder': 'debug_simulate_mipsel_asan_edge', - 'V8 Linux64 CFI - release builder': 'release_x64_cfi_clusterfuzz', - 'V8 Linux MSAN no origins': + 'V8 Clusterfuzz Linux64 CFI - release builder': + 'release_x64_cfi_clusterfuzz', + 'V8 Clusterfuzz Linux MSAN no origins': 'release_simulate_arm64_msan_no_origins_edge', - 'V8 Linux MSAN chained origins': + 'V8 Clusterfuzz Linux MSAN chained origins': 'release_simulate_arm64_msan_edge', - 'V8 Linux64 TSAN - release builder': 'release_x64_tsan', - 'V8 Linux64 UBSanVptr - release builder': + 'V8 Clusterfuzz Linux64 TSAN - release builder': 'release_x64_tsan', + 'V8 Clusterfuzz Linux64 UBSanVptr - release builder': 'release_x64_ubsan_vptr_recover_edge', }, 'client.v8.ports': { @@ -207,6 +203,7 @@ 'v8_linux_gcc_compile_rel': 'release_x86_gcc_minimal_symbols', 'v8_linux_gcc_rel': 'release_x86_gcc_minimal_symbols', 'v8_linux_shared_compile_rel': 'release_x86_shared_verify_heap', + 'v8_linux64_dbg_ng': 'debug_x64_trybot', 'v8_linux64_gcc_compile_dbg': 'debug_x64_gcc', 'v8_linux64_fyi_rel_ng': 'release_x64_test_features_trybot', 'v8_linux64_rel_ng': 'release_x64_test_features_trybot', @@ -238,6 +235,7 @@ 'v8_mac64_dbg': 'debug_x64', 'v8_mac64_dbg_ng': 'debug_x64', 'v8_mac64_asan_rel': 'release_x64_asan_no_lsan', + 'v8_mips_compile_rel': 'release_mips_no_snap_no_i18n', 'v8_linux_arm_rel_ng': 'release_simulate_arm_trybot', 'v8_linux_arm_dbg': 'debug_simulate_arm', 'v8_linux_arm_armv8a_rel': 'release_simulate_arm_trybot', @@ -417,7 +415,7 @@ 'release_x64_fuchsia_trybot': [ 'release_trybot', 'x64', 'fuchsia'], 'release_x64_gcc_coverage': [ - 'release_bot', 'x64', 'coverage', 'gcc'], + 'release_bot', 'x64', 'coverage', 'gcc', 'no_custom_libcxx', 'no_sysroot'], 'release_x64_internal': [ 'release_bot', 'x64', 'v8_enable_embedded_builtins', 'v8_snapshot_internal'], @@ -503,8 +501,6 @@ # Release configs for x86. 'release_x86': [ 'release_bot', 'x86'], - 'release_x86_disassembler': [ - 'release_bot', 'x86', 'v8_enable_disassembler'], 'release_x86_gcc': [ 'release_bot', 'x86', 'gcc'], 'release_x86_gcc_minimal_symbols': [ @@ -566,14 +562,14 @@ 'cfi': { 'mixins': ['v8_enable_test_features'], - 'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_diag=true ' - 'use_cfi_recover=false'), + 'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_icall=true ' + 'use_cfi_diag=true use_cfi_recover=false'), }, 'cfi_clusterfuzz': { 'mixins': ['v8_enable_test_features'], - 'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_diag=true ' - 'use_cfi_recover=true'), + 'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_icall=true ' + 'use_cfi_diag=true use_cfi_recover=true'), }, 'clang': { @@ -669,6 +665,10 @@ 'gn_args': 'is_clang=false', }, + 'no_custom_libcxx': { + 'gn_args': 'use_custom_libcxx=false', + }, + 'no_sysroot': { 'gn_args': 'use_sysroot=false', }, @@ -763,10 +763,6 @@ 'gn_args': 'v8_correctness_fuzzer=true v8_multi_arch_build=true', }, - 'v8_enable_disassembler': { - 'gn_args': 'v8_enable_disassembler=true', - }, - 'v8_enable_embedded_builtins': { 'gn_args': 'v8_enable_embedded_builtins=true', }, diff --git a/deps/v8/infra/testing/PRESUBMIT.py b/deps/v8/infra/testing/PRESUBMIT.py new file mode 100644 index 000000000000..9f242a929943 --- /dev/null +++ b/deps/v8/infra/testing/PRESUBMIT.py @@ -0,0 +1,183 @@ +# Copyright 2018 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +Presubmit checks for the validity of V8-side test specifications in pyl files. + +For simplicity, we check all pyl files on any changes in this folder. +""" + +import ast +import os + + +SUPPORTED_BUILDER_SPEC_KEYS = [ + 'swarming_dimensions', + 'swarming_task_attrs', + 'tests', +] + +# This is not an exhaustive list. It only reflects what we currently use. If +# there's need to specify a different dimension, just add it here. +SUPPORTED_SWARMING_DIMENSIONS = [ + 'cores', + 'cpu', + 'os', +] + +# This is not an exhaustive list. It only reflects what we currently use. If +# there's need to specify a different property, just add it here. +SUPPORTED_SWARMING_TASK_ATTRS = [ + 'expiration', + 'hard_timeout', + 'priority', +] + +SUPPORTED_TEST_KEYS = [ + 'name', + 'shards', + 'suffix', + 'swarming_dimensions', + 'swarming_task_attrs', + 'test_args', + 'variant', +] + +def check_keys(error_msg, src_dict, supported_keys): + errors = [] + for key in src_dict.keys(): + if key not in supported_keys: + errors += error_msg('Key "%s" must be one of %s' % (key, supported_keys)) + return errors + + +def _check_properties(error_msg, src_dict, prop_name, supported_keys): + properties = src_dict.get(prop_name, {}) + if not isinstance(properties, dict): + return error_msg('Value for %s must be a dict' % prop_name) + return check_keys(error_msg, properties, supported_keys) + + +def _check_int_range(error_msg, src_dict, prop_name, lower_bound=None, + upper_bound=None): + if prop_name not in src_dict: + # All properties are optional. + return [] + try: + value = int(src_dict[prop_name]) + except ValueError: + return error_msg('If specified, %s must be an int' % prop_name) + if lower_bound is not None and value < lower_bound: + return error_msg('If specified, %s must be >=%d' % (prop_name, lower_bound)) + if upper_bound is not None and value > upper_bound: + return error_msg('If specified, %s must be <=%d' % (prop_name, upper_bound)) + return [] + + +def _check_swarming_task_attrs(error_msg, src_dict): + errors = [] + task_attrs = src_dict.get('swarming_task_attrs', {}) + errors += _check_int_range( + error_msg, task_attrs, 'priority', lower_bound=25, upper_bound=100) + errors += _check_int_range( + error_msg, task_attrs, 'expiration', lower_bound=1) + errors += _check_int_range( + error_msg, task_attrs, 'hard_timeout', lower_bound=1) + return errors + + +def _check_swarming_config(error_msg, src_dict): + errors = [] + errors += _check_properties( + error_msg, src_dict, 'swarming_dimensions', + SUPPORTED_SWARMING_DIMENSIONS) + errors += _check_properties( + error_msg, src_dict, 'swarming_task_attrs', + SUPPORTED_SWARMING_TASK_ATTRS) + errors += _check_swarming_task_attrs(error_msg, src_dict) + return errors + + +def _check_test(error_msg, test): + if not isinstance(test, dict): + return error_msg('Each test must be specified with a dict') + errors = check_keys(error_msg, test, SUPPORTED_TEST_KEYS) + if not test.get('name'): + errors += error_msg('A test requires a name') + errors += _check_swarming_config(error_msg, test) + + test_args = test.get('test_args', []) + if not isinstance(test_args, list): + errors += error_msg('If specified, test_args must be a list of arguments') + if not all(isinstance(x, basestring) for x in test_args): + errors += error_msg('If specified, all test_args must be strings') + + # Limit shards to 10 to avoid erroneous resource exhaustion. + errors += _check_int_range( + error_msg, test, 'shards', lower_bound=1, upper_bound=10) + + variant = test.get('variant', 'default') + if not variant or not isinstance(variant, basestring): + errors += error_msg('If specified, variant must be a non-empty string') + + return errors + + +def _check_test_spec(file_path, raw_pyl): + def error_msg(msg): + return ['Error in %s:\n%s' % (file_path, msg)] + + try: + # Eval python literal file. + full_test_spec = ast.literal_eval(raw_pyl) + except SyntaxError as e: + return error_msg('Pyl parsing failed with:\n%s' % e) + + if not isinstance(full_test_spec, dict): + return error_msg('Test spec must be a dict') + + errors = [] + for buildername, builder_spec in full_test_spec.iteritems(): + def error_msg(msg): + return ['Error in %s for builder %s:\n%s' % (file_path, buildername, msg)] + + if not isinstance(buildername, basestring) or not buildername: + errors += error_msg('Buildername must be a non-empty string') + + if not isinstance(builder_spec, dict) or not builder_spec: + errors += error_msg('Value must be a non-empty dict') + continue + + errors += check_keys(error_msg, builder_spec, SUPPORTED_BUILDER_SPEC_KEYS) + errors += _check_swarming_config(error_msg, builder_spec) + + for test in builder_spec.get('tests', []): + errors += _check_test(error_msg, test) + + return errors + + + +def CheckChangeOnCommit(input_api, output_api): + def file_filter(regexp): + return lambda f: input_api.FilterSourceFile(f, white_list=(regexp,)) + + # Calculate which files are affected. + if input_api.AffectedFiles(False, file_filter(r'.*PRESUBMIT\.py')): + # If PRESUBMIT.py itself was changed, check also the test spec. + affected_files = [ + os.path.join(input_api.PresubmitLocalPath(), 'builders.pyl'), + ] + else: + # Otherwise, check test spec only when changed. + affected_files = [ + f.AbsoluteLocalPath() + for f in input_api.AffectedFiles(False, file_filter(r'.*builders\.pyl')) + ] + + errors = [] + for file_path in affected_files: + with open(file_path) as f: + errors += _check_test_spec(file_path, f.read()) + return [output_api.PresubmitError(r) for r in errors] diff --git a/deps/v8/infra/testing/README.md b/deps/v8/infra/testing/README.md index 8658768cac91..438ba2e6d064 100644 --- a/deps/v8/infra/testing/README.md +++ b/deps/v8/infra/testing/README.md @@ -7,38 +7,65 @@ variants specified [here](https://chromium.googlesource.com/v8/v8/+/master/tools Changes to src-side test specifications go through CQ like any other CL and require tests added for specific trybots to pass. -The test specifications are defined in a V8-side folder called infra/testing. -Every master has an optional file named `.pyl`. E.g. -`tryserver.v8.pyl`. +The test specifications are defined in a V8-side python-literal file +`infra/testing/builders.pyl`. -The structure of each file is: +The structure of the file is: ``` { - : [ - { - 'name': , - 'variant': , - 'shards': , - }, - ... - ], + : { + 'tests': [ + { + 'name': , + 'suffix': , + 'variant': , + 'shards': , + 'test_args': , + 'swarming_task_attrs': {...}, + 'swarming_dimensions': {...}, + }, + ... + ], + 'swarming_task_attrs': {...}, + 'swarming_dimensions': {...}, + }, ... } ``` The `` is a string name of the builder to execute the tests. `` is a label defining a test specification matching the [infra-side](https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/slave/recipe_modules/v8/testing.py#58). -The `` is a testing variant specified +The optional `suffix` will be appended to test-step names for disambiguation. +The optional `variant` is a testing variant specified [here](https://chromium.googlesource.com/v8/v8/+/master/tools/testrunner/local/variants.py). -`` is optional (default 1), but can be provided to increase -the swarming shards for long-running tests. +The optional `shards` (default 1) can be provided to increase the swarming +shards for long-running tests. +The optional `test_args` is a list of string flags that will be passed to the +V8 test driver. +The optional `swarming_task_attrs` is a dict allowing to override the defaults +for `priority`, `expiration` and `hard_timeout`. +The optional `swarming_dimensions` is a dict allowing to override the defaults +for `cpu`, `cores` and `os`. +Both `swarming_task_attrs` and `swarming_dimensions` can be defined per builder +and per test, whereas the latter takes precedence. Example: ``` { - 'v8_linux64_rel_ng_triggered': [ - {'name': 'v8testing', 'variant': 'nooptimization', 'shards': 2}, - ], + 'v8_linux64_rel_ng_triggered': { + 'tests': [ + { + 'name': 'v8testing', + 'suffix': 'stress', + 'variant': 'nooptimization', + 'shards': 2, + 'test_args': ['--gc-stress'], + 'swarming_dimensions': {'os': 'Ubuntu-14.4'}, + }, + ], + 'swarming_properties': {'priority': 35}, + 'swarming_dimensions': {'os': 'Ubuntu'}, + }, } ``` diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl new file mode 100644 index 000000000000..4d76d696b5dc --- /dev/null +++ b/deps/v8/infra/testing/builders.pyl @@ -0,0 +1,432 @@ +# Copyright 2018 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Please keep builder names, builder configs and test definitions sorted. +# Builder names should be sorted alphabetically. Builder configs should have +# keys sorted in the alphabetical order except 'tests' key, which should always +# come last. Test definitions must have keys in the following order, but omit +# optional fields: +# * name (required) +# * variant +# * test_args +# * shards +# * suffix +# * swarming_dimensions +# * swarming_task_attrs +# +# Please also format test definitions as a single line with ', ' separating +# fields, e.g. +# +# {'name': 'v8testing', 'variant': 'extra', 'shards': 2} +# +# After formatting test definitions this way, please sort them alphabetically by +# test name. For all variants of the test with the same name, the +# least-qualified test (no variant, no test args) should come first. You may +# also deviate from the alphabetical order if necessary and group tests +# differently, but in this case please add a comment before each group and +# continue to sort tests using the rules above within each group. + +{ + ############################################################################## + ### luci.v8.try + ############################################################################## + # Linux32 + 'v8_linux_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'test262'}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 3}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + ], + }, + 'v8_linux_gc_stress_dbg': { + 'tests': [ + {'name': 'mjsunit', 'variant': 'slow_path', 'test_args': ['--gc-stress'], 'shards': 2}, + {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 5}, + ], + }, + 'v8_linux_gcc_rel': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'v8_linux_nodcheck_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'test262_variants', 'shards': 2}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'v8_linux_noi18n_rel_ng_triggered': { + 'tests': [ + {'name': 'mozilla', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'default', 'shards': 2}, + ], + }, + 'v8_linux_nosnap_rel': { + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 4}, + ], + }, + 'v8_linux_nosnap_dbg': { + 'swarming_task_attrs': { + 'hard_timeout': 3600, + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 9}, + ], + }, + 'v8_linux_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'gcmole'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 4}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'v8_linux_verify_csa_rel_ng_triggered': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + ############################################################################## + # Linux32 with arm simulators + 'v8_linux_arm_dbg': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + ], + }, + 'v8_linux_arm_rel_ng_triggered': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + ], + }, + ############################################################################## + # Linux64 + 'v8_linux64_asan_rel_ng_triggered': { + 'tests': [ + {'name': 'test262_variants', 'shards': 7}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'slow_path'}, + ], + }, + 'v8_linux64_cfi_rel_ng_triggered': { + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'mozilla'}, + {'name': 'optimize_for_size'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 2}, + ], + }, + 'v8_linux64_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'test262'}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 3}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, + ], + }, + 'v8_linux64_fyi_rel_ng_triggered': { + 'tests': [ + # Stress sampling. + {'name': 'mjsunit', 'variant': 'stress_sampling'}, + {'name': 'webkit', 'variant': 'stress_sampling'}, + # Infra staging. + {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2}, + {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, + ], + }, + 'v8_linux64_msan_rel': { + 'tests': [ + {'name': 'test262', 'shards': 2}, + {'name': 'v8testing', 'shards': 5}, + ], + }, + 'v8_linux64_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + # TODO(machenbach): Add benchmarks. + # TODO(machenbach): Add mozilla tests. + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 4}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8initializers'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'v8testing', 'variant': 'minor_mc'}, + {'name': 'v8testing', 'variant': 'slow_path'}, + ], + }, + 'v8_linux64_tsan_rel': { + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'mozilla'}, + {'name': 'test262', 'shards': 3}, + {'name': 'v8testing', 'shards': 5}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + {'name': 'v8testing', 'variant': 'slow_path'}, + ], + }, + 'v8_linux64_ubsan_rel_ng_triggered': { + 'tests': [ + {'name': 'v8testing', 'shards': 2}, + ], + }, + 'v8_linux64_verify_csa_rel_ng_triggered': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + ############################################################################## + # Linux64 with arm64 simulators + 'v8_linux_arm64_dbg': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + ], + }, + 'v8_linux_arm64_gc_stress_dbg': { + 'tests': [ + {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 8}, + ], + }, + 'v8_linux_arm64_rel_ng_triggered': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + ], + }, + ############################################################################## + # Win32 + 'v8_win_dbg': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'v8_win_nosnap_shared_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 3}, + ], + }, + 'v8_win_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + ############################################################################## + # Win64 + 'v8_win64_asan_rel_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Windows-10', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, + 'v8_win64_dbg': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262', 'shards': 2}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + ], + }, + 'v8_win64_msvc_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'v8_win64_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'test262'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + ############################################################################## + # Mac64 + 'v8_mac64_asan_rel': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 4}, + ], + }, + 'v8_mac64_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + ], + }, + 'v8_mac64_gc_stress_dbg': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 4}, + ], + }, + 'v8_mac64_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + ############################################################################## + ### luci.v8.ci + ############################################################################## + # Linux32 + 'V8 Linux - debug': { + 'tests': [ + {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1}, + ], + }, + 'V8 Linux - gc stress': { + 'tests': [ + {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2}, + ], + }, + ############################################################################## + # Linux64 + 'V8 Linux64': { + 'tests': [ + {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, + ], + }, + 'V8 Linux64 - debug': { + 'tests': [ + {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, + {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, + ], + }, + 'V8 Linux64 - debug - fyi': { + 'tests': [ + # Infra staging. + {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 3}, + {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, + # Stress sampling. + {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, + {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, + ], + }, + 'V8 Linux64 - fyi': { + 'tests': [ + {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, + {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2}, + {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1}, + {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, + ], + }, + 'V8 Linux64 ASAN': { + 'tests': [ + {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, + ], + }, + 'V8 Linux64 TSAN': { + 'tests': [ + {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, + ], + }, +} diff --git a/deps/v8/infra/testing/client.v8.pyl b/deps/v8/infra/testing/client.v8.pyl deleted file mode 100644 index ab1744fc78b3..000000000000 --- a/deps/v8/infra/testing/client.v8.pyl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2017 The V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - ### Example configuration for CI bots (please keep as reference). - # 'V8 Linux64': [ - # {'name': 'benchmarks', 'variant': 'default', 'shards': 1}, - # ], - # 'V8 Linux64 - debug': [ - # {'name': 'benchmarks', 'variant': 'default', 'shards': 1}, - # ], - - 'V8 Linux - debug': [ - {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1}, - {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, - {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1}, - {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1}, - ], - 'V8 Linux - gc stress': [ - {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2}, - ], - 'V8 Linux64': [ - {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, - ], - 'V8 Linux64 - debug': [ - {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], - 'V8 Linux64 ASAN': [ - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], - 'V8 Linux64 TSAN': [ - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], - 'V8 Linux64 - fyi': [ - {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1}, - {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2}, - {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, - {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, - ], - 'V8 Linux64 - debug - fyi': [ - {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, - {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 3}, - {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, - {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, - ], -} diff --git a/deps/v8/infra/testing/tryserver.v8.pyl b/deps/v8/infra/testing/tryserver.v8.pyl deleted file mode 100644 index ee6abae5d533..000000000000 --- a/deps/v8/infra/testing/tryserver.v8.pyl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2017 The V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - ### Example configuration for trybots (please keep as reference). - # 'v8_linux64_rel_ng_triggered': [ - # {'name': 'benchmarks', 'variant': 'default', 'shards': 1}, - # ], - - 'v8_linux64_fyi_rel_ng_triggered': [ - {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, - {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2}, - {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, - {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, - ], - 'v8_linux64_rel_ng_triggered': [ - {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], - 'v8_linux_gc_stress_dbg': [ - {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2}, - ], - 'v8_linux64_asan_rel_ng_triggered': [ - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], - 'v8_linux64_tsan_rel': [ - {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, - ], -} diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 050f91d6d6d9..275595d0d804 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -27,7 +27,8 @@ include_rules = [ "+src/trap-handler/trap-handler.h", "+testing/gtest/include/gtest/gtest_prod.h", "-src/libplatform", - "-include/libplatform" + "-include/libplatform", + "+torque-generated" ] specific_include_rules = { diff --git a/deps/v8/src/accessors.cc b/deps/v8/src/accessors.cc index f292988b8e1e..565c019092b8 100644 --- a/deps/v8/src/accessors.cc +++ b/deps/v8/src/accessors.cc @@ -12,6 +12,7 @@ #include "src/heap/factory.h" #include "src/isolate-inl.h" #include "src/messages.h" +#include "src/objects/api-callbacks.h" #include "src/property-details.h" #include "src/prototype.h" @@ -37,7 +38,7 @@ Handle Accessors::MakeAccessor( info->set_getter(*get); info->set_setter(*set); Address redirected = info->redirected_getter(); - if (redirected != nullptr) { + if (redirected != kNullAddress) { Handle js_get = v8::FromCData(isolate, redirected); info->set_js_getter(*js_get); } @@ -76,12 +77,12 @@ bool Accessors::IsJSObjectFieldAccessor(Handle map, Handle name, } } - -namespace { - -V8_WARN_UNUSED_RESULT MaybeHandle ReplaceAccessorWithDataProperty( - Isolate* isolate, Handle receiver, Handle holder, - Handle name, Handle value) { +V8_WARN_UNUSED_RESULT MaybeHandle +Accessors::ReplaceAccessorWithDataProperty(Isolate* isolate, + Handle receiver, + Handle holder, + Handle name, + Handle value) { LookupIterator it(receiver, name, holder, LookupIterator::OWN_SKIP_INTERCEPTOR); // Skip any access checks we might hit. This accessor should never hit in a @@ -96,7 +97,6 @@ V8_WARN_UNUSED_RESULT MaybeHandle ReplaceAccessorWithDataProperty( return value; } -} // namespace // // Accessors::ReconfigureToDataProperty @@ -113,8 +113,8 @@ void Accessors::ReconfigureToDataProperty( Handle::cast(Utils::OpenHandle(*info.Holder())); Handle name = Utils::OpenHandle(*key); Handle value = Utils::OpenHandle(*val); - MaybeHandle result = - ReplaceAccessorWithDataProperty(isolate, receiver, holder, name, value); + MaybeHandle result = Accessors::ReplaceAccessorWithDataProperty( + isolate, receiver, holder, name, value); if (result.is_null()) { isolate->OptionalRescheduleException(false); } else { @@ -122,17 +122,6 @@ void Accessors::ReconfigureToDataProperty( } } -void Accessors::ReconfigureToDataPropertyGetter( - v8::Local name, const v8::PropertyCallbackInfo& info) { - UNREACHABLE(); -} - -Handle Accessors::MakeReconfigureToDataPropertyInfo( - Isolate* isolate) { - Handle name = isolate->factory()->ReconfigureToDataProperty_string(); - return MakeAccessor(isolate, name, &ReconfigureToDataPropertyGetter, - &ReconfigureToDataProperty); -} // // Accessors::ArgumentsIterator @@ -1194,8 +1183,8 @@ void Accessors::ErrorStackGetter( Utils::OpenHandle(*v8::Local(info.This())); Handle name = Utils::OpenHandle(*key); if (IsAccessor(receiver, name, holder)) { - result = ReplaceAccessorWithDataProperty(isolate, receiver, holder, name, - formatted_stack_trace); + result = Accessors::ReplaceAccessorWithDataProperty( + isolate, receiver, holder, name, formatted_stack_trace); if (result.is_null()) { isolate->OptionalRescheduleException(false); return; diff --git a/deps/v8/src/accessors.h b/deps/v8/src/accessors.h index 1911f92dbf93..4a1a67e93e68 100644 --- a/deps/v8/src/accessors.h +++ b/deps/v8/src/accessors.h @@ -33,7 +33,6 @@ class JavaScriptFrame; V(function_name, FunctionName) \ V(function_length, FunctionLength) \ V(function_prototype, FunctionPrototype) \ - V(reconfigure_to_data_property, ReconfigureToDataProperty) \ V(script_column_offset, ScriptColumnOffset) \ V(script_compilation_type, ScriptCompilationType) \ V(script_context_data, ScriptContextData) \ @@ -110,6 +109,10 @@ class Accessors : public AllStatic { static bool IsJSObjectFieldAccessor(Handle map, Handle name, FieldIndex* field_index); + static MaybeHandle ReplaceAccessorWithDataProperty( + Isolate* isolate, Handle receiver, Handle holder, + Handle name, Handle value); + // Create an AccessorInfo. The setter is optional (can be nullptr). // // Note that the type of setter is AccessorNameBooleanSetterCallback instead diff --git a/deps/v8/src/address-map.h b/deps/v8/src/address-map.h index e2b815daff0a..f3e2770847b1 100644 --- a/deps/v8/src/address-map.h +++ b/deps/v8/src/address-map.h @@ -34,13 +34,21 @@ class PointerToIndexHashMap } private: - static uintptr_t Key(Type value) { - return reinterpret_cast(value); - } + static inline uintptr_t Key(Type value); static uint32_t Hash(uintptr_t key) { return static_cast(key); } }; +template <> +inline uintptr_t PointerToIndexHashMap
::Key(Address value) { + return static_cast(value); +} + +template +inline uintptr_t PointerToIndexHashMap::Key(Type value) { + return reinterpret_cast(value); +} + class AddressToIndexHashMap : public PointerToIndexHashMap
{}; class HeapObjectToIndexHashMap : public PointerToIndexHashMap {}; diff --git a/deps/v8/src/allocation.cc b/deps/v8/src/allocation.cc index f63c2f292f5b..55c68dea8948 100644 --- a/deps/v8/src/allocation.cc +++ b/deps/v8/src/allocation.cc @@ -206,15 +206,15 @@ bool OnCriticalMemoryPressure(size_t length) { return true; } -VirtualMemory::VirtualMemory() : address_(nullptr), size_(0) {} +VirtualMemory::VirtualMemory() : address_(kNullAddress), size_(0) {} VirtualMemory::VirtualMemory(size_t size, void* hint, size_t alignment) - : address_(nullptr), size_(0) { + : address_(kNullAddress), size_(0) { size_t page_size = AllocatePageSize(); size_t alloc_size = RoundUp(size, page_size); - address_ = - AllocatePages(hint, alloc_size, alignment, PageAllocator::kNoAccess); - if (address_ != nullptr) { + address_ = reinterpret_cast
( + AllocatePages(hint, alloc_size, alignment, PageAllocator::kNoAccess)); + if (address_ != kNullAddress) { size_ = alloc_size; } } @@ -226,31 +226,29 @@ VirtualMemory::~VirtualMemory() { } void VirtualMemory::Reset() { - address_ = nullptr; + address_ = kNullAddress; size_ = 0; } -bool VirtualMemory::SetPermissions(void* address, size_t size, +bool VirtualMemory::SetPermissions(Address address, size_t size, PageAllocator::Permission access) { CHECK(InVM(address, size)); bool result = v8::internal::SetPermissions(address, size, access); DCHECK(result); - USE(result); return result; } -size_t VirtualMemory::Release(void* free_start) { +size_t VirtualMemory::Release(Address free_start) { DCHECK(IsReserved()); - DCHECK(IsAddressAligned(static_cast
(free_start), CommitPageSize())); + DCHECK(IsAddressAligned(free_start, CommitPageSize())); // Notice: Order is important here. The VirtualMemory object might live // inside the allocated region. - const size_t free_size = size_ - (reinterpret_cast(free_start) - - reinterpret_cast(address_)); + const size_t free_size = size_ - (free_start - address_); CHECK(InVM(free_start, free_size)); DCHECK_LT(address_, free_start); - DCHECK_LT(free_start, reinterpret_cast( - reinterpret_cast(address_) + size_)); - CHECK(ReleasePages(address_, size_, size_ - free_size)); + DCHECK_LT(free_start, address_ + size_); + CHECK(ReleasePages(reinterpret_cast(address_), size_, + size_ - free_size)); size_ -= free_size; return free_size; } @@ -259,13 +257,14 @@ void VirtualMemory::Free() { DCHECK(IsReserved()); // Notice: Order is important here. The VirtualMemory object might live // inside the allocated region. - void* address = address_; + Address address = address_; size_t size = size_; CHECK(InVM(address, size)); Reset(); // FreePages expects size to be aligned to allocation granularity. Trimming // may leave size at only commit granularity. Align it here. - CHECK(FreePages(address, RoundUp(size, AllocatePageSize()))); + CHECK(FreePages(reinterpret_cast(address), + RoundUp(size, AllocatePageSize()))); } void VirtualMemory::TakeControl(VirtualMemory* from) { diff --git a/deps/v8/src/allocation.h b/deps/v8/src/allocation.h index 13dc3e508f3d..67a510c611c8 100644 --- a/deps/v8/src/allocation.h +++ b/deps/v8/src/allocation.h @@ -126,6 +126,10 @@ V8_WARN_UNUSED_RESULT bool ReleasePages(void* address, size_t size, V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT bool SetPermissions(void* address, size_t size, PageAllocator::Permission access); +inline bool SetPermissions(Address address, size_t size, + PageAllocator::Permission access) { + return SetPermissions(reinterpret_cast(address), size, access); +} // Convenience function that allocates a single system page with read and write // permissions. |address| is a hint. Returns the base address of the memory and @@ -151,14 +155,15 @@ class V8_EXPORT_PRIVATE VirtualMemory { // Construct a virtual memory by assigning it some already mapped address // and size. - VirtualMemory(void* address, size_t size) : address_(address), size_(size) {} + VirtualMemory(Address address, size_t size) + : address_(address), size_(size) {} // Releases the reserved memory, if any, controlled by this VirtualMemory // object. ~VirtualMemory(); // Returns whether the memory has been reserved. - bool IsReserved() const { return address_ != nullptr; } + bool IsReserved() const { return address_ != kNullAddress; } // Initialize or resets an embedded VirtualMemory object. void Reset(); @@ -167,15 +172,14 @@ class V8_EXPORT_PRIVATE VirtualMemory { // If the memory was reserved with an alignment, this address is not // necessarily aligned. The user might need to round it up to a multiple of // the alignment to get the start of the aligned block. - void* address() const { + Address address() const { DCHECK(IsReserved()); return address_; } - void* end() const { + Address end() const { DCHECK(IsReserved()); - return reinterpret_cast(reinterpret_cast(address_) + - size_); + return address_ + size_; } // Returns the size of the reserved memory. The returned value is only @@ -186,11 +190,11 @@ class V8_EXPORT_PRIVATE VirtualMemory { // Sets permissions according to the access argument. address and size must be // multiples of CommitPageSize(). Returns true on success, otherwise false. - bool SetPermissions(void* address, size_t size, + bool SetPermissions(Address address, size_t size, PageAllocator::Permission access); // Releases memory after |free_start|. Returns the number of bytes released. - size_t Release(void* free_start); + size_t Release(Address free_start); // Frees all memory. void Free(); @@ -199,15 +203,12 @@ class V8_EXPORT_PRIVATE VirtualMemory { // The old object is no longer functional (IsReserved() returns false). void TakeControl(VirtualMemory* from); - bool InVM(void* address, size_t size) { - return (reinterpret_cast(address_) <= - reinterpret_cast(address)) && - ((reinterpret_cast(address_) + size_) >= - (reinterpret_cast(address) + size)); + bool InVM(Address address, size_t size) { + return (address_ <= address) && ((address_ + size_) >= (address + size)); } private: - void* address_; // Start address of the virtual memory. + Address address_; // Start address of the virtual memory. size_t size_; // Size of the virtual memory. }; diff --git a/deps/v8/src/api-arguments-inl.h b/deps/v8/src/api-arguments-inl.h index 1cf9662b9499..503cea8dcb65 100644 --- a/deps/v8/src/api-arguments-inl.h +++ b/deps/v8/src/api-arguments-inl.h @@ -7,6 +7,7 @@ #include "src/api-arguments.h" +#include "src/objects/api-callbacks.h" #include "src/tracing/trace-event.h" #include "src/vm-state-inl.h" diff --git a/deps/v8/src/api-natives.cc b/deps/v8/src/api-natives.cc index 981f592f5a08..1b6df15d7a69 100644 --- a/deps/v8/src/api-natives.cc +++ b/deps/v8/src/api-natives.cc @@ -8,6 +8,9 @@ #include "src/isolate-inl.h" #include "src/lookup.h" #include "src/messages.h" +#include "src/objects/api-callbacks.h" +#include "src/objects/hash-table-inl.h" +#include "src/objects/templates.h" namespace v8 { namespace internal { diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 192ad90f83e5..e1a01c2544e9 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -5,10 +5,7 @@ #include "src/api.h" #include // For memcpy, strlen. -#ifdef V8_USE_ADDRESS_SANITIZER -#include -#endif // V8_USE_ADDRESS_SANITIZER -#include // For isnan. +#include // For isnan. #include #include #include "include/v8-profiler.h" @@ -49,6 +46,9 @@ #include "src/json-stringifier.h" #include "src/messages.h" #include "src/objects-inl.h" +#include "src/objects/api-callbacks.h" +#include "src/objects/ordered-hash-table-inl.h" +#include "src/objects/templates.h" #include "src/parsing/parser.h" #include "src/parsing/scanner-character-streams.h" #include "src/pending-compilation-error-handler.h" @@ -79,7 +79,6 @@ #include "src/value-serializer.h" #include "src/version.h" #include "src/vm-state-inl.h" -#include "src/wasm/compilation-manager.h" #include "src/wasm/streaming-decoder.h" #include "src/wasm/wasm-engine.h" #include "src/wasm/wasm-objects-inl.h" @@ -233,10 +232,20 @@ template class CallDepthScope { public: explicit CallDepthScope(i::Isolate* isolate, Local context) - : isolate_(isolate), context_(context), escaped_(false) { + : isolate_(isolate), + context_(context), + escaped_(false), + safe_for_termination_(isolate->next_v8_call_is_safe_for_termination()), + interrupts_scope_(isolate_, i::StackGuard::TERMINATE_EXECUTION, + isolate_->only_terminate_in_safe_scope() + ? (safe_for_termination_ + ? i::InterruptsScope::kRunInterrupts + : i::InterruptsScope::kPostponeInterrupts) + : i::InterruptsScope::kNoop) { // TODO(dcarney): remove this when blink stops crashing. DCHECK(!isolate_->external_caught_exception()); isolate_->handle_scope_implementer()->IncrementCallDepth(); + isolate_->set_next_v8_call_is_safe_for_termination(false); if (!context.IsEmpty()) { i::Handle env = Utils::OpenHandle(*context); i::HandleScopeImplementer* impl = isolate->handle_scope_implementer(); @@ -261,6 +270,7 @@ class CallDepthScope { #ifdef V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY if (do_callback) CheckMicrotasksScopesConsistency(isolate_); #endif + isolate_->set_next_v8_call_is_safe_for_termination(safe_for_termination_); } void Escape() { @@ -277,6 +287,8 @@ class CallDepthScope { Local context_; bool escaped_; bool do_callback_; + bool safe_for_termination_; + i::InterruptsScope interrupts_scope_; }; } // namespace @@ -332,7 +344,9 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, memset(&heap_stats, 0xBADC0DE, sizeof(heap_stats)); // Note that the embedder's oom handler won't be called in this case. We // just crash. - FATAL("API fatal error handler returned after process out of memory"); + FATAL( + "API fatal error handler returned after process out of memory on the " + "background thread"); UNREACHABLE(); } @@ -341,6 +355,10 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, intptr_t start_marker; heap_stats.start_marker = &start_marker; + size_t ro_space_size; + heap_stats.ro_space_size = &ro_space_size; + size_t ro_space_capacity; + heap_stats.ro_space_capacity = &ro_space_capacity; size_t new_space_size; heap_stats.new_space_size = &new_space_size; size_t new_space_capacity; @@ -539,14 +557,15 @@ struct SnapshotCreatorData { } // namespace -SnapshotCreator::SnapshotCreator(const intptr_t* external_references, +SnapshotCreator::SnapshotCreator(Isolate* isolate, + const intptr_t* external_references, StartupData* existing_snapshot) { - i::Isolate* internal_isolate = new i::Isolate(true); - Isolate* isolate = reinterpret_cast(internal_isolate); SnapshotCreatorData* data = new SnapshotCreatorData(isolate); data->isolate_ = isolate; + i::Isolate* internal_isolate = reinterpret_cast(isolate); internal_isolate->set_array_buffer_allocator(&data->allocator_); internal_isolate->set_api_external_references(external_references); + internal_isolate->enable_serializer(); isolate->Enter(); const StartupData* blob = existing_snapshot ? existing_snapshot @@ -560,6 +579,11 @@ SnapshotCreator::SnapshotCreator(const intptr_t* external_references, data_ = data; } +SnapshotCreator::SnapshotCreator(const intptr_t* external_references, + StartupData* existing_snapshot) + : SnapshotCreator(reinterpret_cast(new i::Isolate()), + external_references, existing_snapshot) {} + SnapshotCreator::~SnapshotCreator() { SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); DCHECK(data->created_); @@ -710,6 +734,8 @@ StartupData SnapshotCreator::CreateBlob( i::GarbageCollectionReason::kSnapshotCreator); isolate->heap()->CompactFixedArraysOfWeakCells(); + isolate->heap()->read_only_space()->ClearStringPaddingIfNeeded(); + i::DisallowHeapAllocation no_gc_from_here_on; int num_contexts = num_additional_contexts + 1; @@ -753,7 +779,7 @@ StartupData SnapshotCreator::CreateBlob( if (shared->CanFlushCompiled()) { shared->FlushCompiled(); } - DCHECK(shared->HasCodeObject() || shared->HasBuiltinId() || + DCHECK(shared->HasWasmExportedFunctionData() || shared->HasBuiltinId() || shared->IsApiFunction()); } } @@ -1527,7 +1553,9 @@ i::Handle MakeAccessorInfo( } SET_FIELD_WRAPPED(obj, set_setter, setter); i::Address redirected = obj->redirected_getter(); - if (redirected != nullptr) SET_FIELD_WRAPPED(obj, set_js_getter, redirected); + if (redirected != i::kNullAddress) { + SET_FIELD_WRAPPED(obj, set_js_getter, redirected); + } if (data.IsEmpty()) { data = v8::Undefined(reinterpret_cast(isolate)); } @@ -1694,13 +1722,11 @@ static i::Handle EnsureConstructor( } template -static void TemplateSetAccessor(Template* template_obj, v8::Local name, - Getter getter, Setter setter, Data data, - AccessControl settings, - PropertyAttribute attribute, - v8::Local signature, - bool is_special_data_property, - bool replace_on_access) { +static void TemplateSetAccessor( + Template* template_obj, v8::Local name, Getter getter, Setter setter, + Data data, AccessControl settings, PropertyAttribute attribute, + v8::Local signature, bool is_special_data_property, + bool replace_on_access) { auto info = Utils::OpenHandle(template_obj); auto isolate = info->GetIsolate(); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); @@ -1713,26 +1739,20 @@ static void TemplateSetAccessor(Template* template_obj, v8::Local name, i::ApiNatives::AddNativeDataProperty(isolate, info, accessor_info); } - -void Template::SetNativeDataProperty(v8::Local name, - AccessorGetterCallback getter, - AccessorSetterCallback setter, - v8::Local data, - PropertyAttribute attribute, - v8::Local signature, - AccessControl settings) { +void Template::SetNativeDataProperty( + v8::Local name, AccessorGetterCallback getter, + AccessorSetterCallback setter, v8::Local data, + PropertyAttribute attribute, v8::Local signature, + AccessControl settings) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, signature, true, false); } - -void Template::SetNativeDataProperty(v8::Local name, - AccessorNameGetterCallback getter, - AccessorNameSetterCallback setter, - v8::Local data, - PropertyAttribute attribute, - v8::Local signature, - AccessControl settings) { +void Template::SetNativeDataProperty( + v8::Local name, AccessorNameGetterCallback getter, + AccessorNameSetterCallback setter, v8::Local data, + PropertyAttribute attribute, v8::Local signature, + AccessControl settings) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, signature, true, false); } @@ -1757,7 +1777,6 @@ void Template::SetIntrinsicDataProperty(Local name, Intrinsic intrinsic, static_cast(attribute)); } - void ObjectTemplate::SetAccessor(v8::Local name, AccessorGetterCallback getter, AccessorSetterCallback setter, @@ -1768,7 +1787,6 @@ void ObjectTemplate::SetAccessor(v8::Local name, signature, i::FLAG_disable_old_api_accessors, false); } - void ObjectTemplate::SetAccessor(v8::Local name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter, @@ -2298,6 +2316,15 @@ Local Module::GetModuleNamespace() { return ToApiHandle(module_namespace); } +Local Module::GetUnboundModuleScript() { + Utils::ApiCheck( + GetStatus() < kEvaluating, "v8::Module::GetUnboundScript", + "v8::Module::GetUnboundScript must be used on an unevaluated module"); + i::Handle self = Utils::OpenHandle(this); + return ToApiHandle( + i::Handle(self->GetSharedFunctionInfo())); +} + int Module::GetIdentityHash() const { return Utils::OpenHandle(this)->hash(); } Maybe Module::InstantiateModule(Local context, @@ -2505,8 +2532,10 @@ MaybeLocal ScriptCompiler::CompileFunctionInContext( options == CompileOptions::kNoCompileOptions); i::Handle context = Utils::OpenHandle(*v8_context); - i::Handle outer_info(context->closure()->shared(), - isolate); + + DCHECK(context->IsNativeContext()); + i::Handle outer_info( + context->empty_function()->shared(), isolate); i::Handle fun; i::Handle arguments_list = @@ -2522,9 +2551,8 @@ MaybeLocal ScriptCompiler::CompileFunctionInContext( i::Handle extension = Utils::OpenHandle(*context_extensions[i]); if (!extension->IsJSObject()) return Local(); - i::Handle closure(context->closure(), isolate); context = isolate->factory()->NewWithContext( - closure, context, + context, i::ScopeInfo::CreateForWithScope( isolate, context->IsNativeContext() ? i::Handle::null() @@ -2638,6 +2666,16 @@ ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCache( return i::CodeSerializer::Serialize(shared); } +// static +ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCache( + Local unbound_module_script) { + i::Handle shared = + i::Handle::cast( + Utils::OpenHandle(*unbound_module_script)); + DCHECK(shared->is_toplevel()); + return i::CodeSerializer::Serialize(shared); +} + ScriptCompiler::CachedData* ScriptCompiler::CreateCodeCacheForFunction( Local function, Local source) { return CreateCodeCacheForFunction(function); @@ -5079,9 +5117,15 @@ Local Function::New(Isolate* v8_isolate, FunctionCallback callback, .FromMaybe(Local()); } - MaybeLocal Function::NewInstance(Local context, int argc, v8::Local argv[]) const { + return NewInstanceWithSideEffectType(context, argc, argv, + SideEffectType::kHasSideEffect); +} + +MaybeLocal Function::NewInstanceWithSideEffectType( + Local context, int argc, v8::Local argv[], + SideEffectType side_effect_type) const { auto isolate = reinterpret_cast(context->GetIsolate()); TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); ENTER_V8(isolate, context, Function, NewInstance, MaybeLocal(), @@ -5089,10 +5133,39 @@ MaybeLocal Function::NewInstance(Local context, int argc, i::TimerEventScope timer_scope(isolate); auto self = Utils::OpenHandle(this); STATIC_ASSERT(sizeof(v8::Local) == sizeof(i::Object**)); + bool should_set_has_no_side_effect = + side_effect_type == SideEffectType::kHasNoSideEffect && + isolate->debug_execution_mode() == i::DebugInfo::kSideEffects; + if (should_set_has_no_side_effect) { + CHECK(self->IsJSFunction() && + i::JSFunction::cast(*self)->shared()->IsApiFunction()); + i::Object* obj = + i::JSFunction::cast(*self)->shared()->get_api_func_data()->call_code(); + if (obj->IsCallHandlerInfo()) { + i::CallHandlerInfo* handler_info = i::CallHandlerInfo::cast(obj); + if (!handler_info->IsSideEffectFreeCallHandlerInfo()) { + handler_info->SetNextCallHasNoSideEffect(); + } + } + } i::Handle* args = reinterpret_cast*>(argv); Local result; has_pending_exception = !ToLocal( i::Execution::New(isolate, self, self, argc, args), &result); + if (should_set_has_no_side_effect) { + i::Object* obj = + i::JSFunction::cast(*self)->shared()->get_api_func_data()->call_code(); + if (obj->IsCallHandlerInfo()) { + i::CallHandlerInfo* handler_info = i::CallHandlerInfo::cast(obj); + if (has_pending_exception) { + // Restore the map if an exception prevented restoration. + handler_info->NextCallHasNoSideEffect(); + } else { + DCHECK(handler_info->IsSideEffectCallHandlerInfo() || + handler_info->IsSideEffectFreeCallHandlerInfo()); + } + } + } RETURN_ON_FAILED_EXECUTION(Object); RETURN_ESCAPED(result); } @@ -5403,202 +5476,28 @@ bool String::ContainsOnlyOneByte() const { } -class Utf8LengthHelper : public i::AllStatic { - public: - enum State { - kEndsWithLeadingSurrogate = 1 << 0, - kStartsWithTrailingSurrogate = 1 << 1, - kLeftmostEdgeIsCalculated = 1 << 2, - kRightmostEdgeIsCalculated = 1 << 3, - kLeftmostEdgeIsSurrogate = 1 << 4, - kRightmostEdgeIsSurrogate = 1 << 5 - }; - - static const uint8_t kInitialState = 0; - - static inline bool EndsWithSurrogate(uint8_t state) { - return state & kEndsWithLeadingSurrogate; - } - - static inline bool StartsWithSurrogate(uint8_t state) { - return state & kStartsWithTrailingSurrogate; - } - - class Visitor { - public: - Visitor() : utf8_length_(0), state_(kInitialState) {} - - void VisitOneByteString(const uint8_t* chars, int length) { - int utf8_length = 0; - // Add in length 1 for each non-Latin1 character. - for (int i = 0; i < length; i++) { - utf8_length += *chars++ >> 7; - } - // Add in length 1 for each character. - utf8_length_ = utf8_length + length; - state_ = kInitialState; - } - - void VisitTwoByteString(const uint16_t* chars, int length) { - int utf8_length = 0; - int last_character = unibrow::Utf16::kNoPreviousCharacter; - for (int i = 0; i < length; i++) { - uint16_t c = chars[i]; - utf8_length += unibrow::Utf8::Length(c, last_character); - last_character = c; - } - utf8_length_ = utf8_length; - uint8_t state = 0; - if (unibrow::Utf16::IsTrailSurrogate(chars[0])) { - state |= kStartsWithTrailingSurrogate; - } - if (unibrow::Utf16::IsLeadSurrogate(chars[length-1])) { - state |= kEndsWithLeadingSurrogate; - } - state_ = state; - } - - static i::ConsString* VisitFlat(i::String* string, - int* length, - uint8_t* state) { - Visitor visitor; - i::ConsString* cons_string = i::String::VisitFlat(&visitor, string); - *length = visitor.utf8_length_; - *state = visitor.state_; - return cons_string; - } - - private: - int utf8_length_; - uint8_t state_; - DISALLOW_COPY_AND_ASSIGN(Visitor); - }; - - static inline void MergeLeafLeft(int* length, - uint8_t* state, - uint8_t leaf_state) { - bool edge_surrogate = StartsWithSurrogate(leaf_state); - if (!(*state & kLeftmostEdgeIsCalculated)) { - DCHECK(!(*state & kLeftmostEdgeIsSurrogate)); - *state |= kLeftmostEdgeIsCalculated - | (edge_surrogate ? kLeftmostEdgeIsSurrogate : 0); - } else if (EndsWithSurrogate(*state) && edge_surrogate) { - *length -= unibrow::Utf8::kBytesSavedByCombiningSurrogates; - } - if (EndsWithSurrogate(leaf_state)) { - *state |= kEndsWithLeadingSurrogate; - } else { - *state &= ~kEndsWithLeadingSurrogate; - } - } - - static inline void MergeLeafRight(int* length, - uint8_t* state, - uint8_t leaf_state) { - bool edge_surrogate = EndsWithSurrogate(leaf_state); - if (!(*state & kRightmostEdgeIsCalculated)) { - DCHECK(!(*state & kRightmostEdgeIsSurrogate)); - *state |= (kRightmostEdgeIsCalculated - | (edge_surrogate ? kRightmostEdgeIsSurrogate : 0)); - } else if (edge_surrogate && StartsWithSurrogate(*state)) { - *length -= unibrow::Utf8::kBytesSavedByCombiningSurrogates; - } - if (StartsWithSurrogate(leaf_state)) { - *state |= kStartsWithTrailingSurrogate; - } else { - *state &= ~kStartsWithTrailingSurrogate; - } - } - - static inline void MergeTerminal(int* length, - uint8_t state, - uint8_t* state_out) { - DCHECK((state & kLeftmostEdgeIsCalculated) && - (state & kRightmostEdgeIsCalculated)); - if (EndsWithSurrogate(state) && StartsWithSurrogate(state)) { - *length -= unibrow::Utf8::kBytesSavedByCombiningSurrogates; - } - *state_out = kInitialState | - (state & kLeftmostEdgeIsSurrogate ? kStartsWithTrailingSurrogate : 0) | - (state & kRightmostEdgeIsSurrogate ? kEndsWithLeadingSurrogate : 0); - } - - static int Calculate(i::ConsString* current, uint8_t* state_out) { - using internal::ConsString; - int total_length = 0; - uint8_t state = kInitialState; - while (true) { - i::String* left = current->first(); - i::String* right = current->second(); - uint8_t right_leaf_state; - uint8_t left_leaf_state; - int leaf_length; - ConsString* left_as_cons = - Visitor::VisitFlat(left, &leaf_length, &left_leaf_state); - if (left_as_cons == nullptr) { - total_length += leaf_length; - MergeLeafLeft(&total_length, &state, left_leaf_state); - } - ConsString* right_as_cons = - Visitor::VisitFlat(right, &leaf_length, &right_leaf_state); - if (right_as_cons == nullptr) { - total_length += leaf_length; - MergeLeafRight(&total_length, &state, right_leaf_state); - if (left_as_cons != nullptr) { - // 1 Leaf node. Descend in place. - current = left_as_cons; - continue; - } else { - // Terminal node. - MergeTerminal(&total_length, state, state_out); - return total_length; - } - } else if (left_as_cons == nullptr) { - // 1 Leaf node. Descend in place. - current = right_as_cons; - continue; - } - // Both strings are ConsStrings. - // Recurse on smallest. - if (left->length() < right->length()) { - total_length += Calculate(left_as_cons, &left_leaf_state); - MergeLeafLeft(&total_length, &state, left_leaf_state); - current = right_as_cons; - } else { - total_length += Calculate(right_as_cons, &right_leaf_state); - MergeLeafRight(&total_length, &state, right_leaf_state); - current = left_as_cons; - } - } - UNREACHABLE(); - } - - static inline int Calculate(i::ConsString* current) { - uint8_t state = kInitialState; - return Calculate(current, &state); - } - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(Utf8LengthHelper); -}; - - -static int Utf8Length(i::String* str, i::Isolate* isolate) { - int length = str->length(); - if (length == 0) return 0; - uint8_t state; - i::ConsString* cons_string = - Utf8LengthHelper::Visitor::VisitFlat(str, &length, &state); - if (cons_string == nullptr) return length; - return Utf8LengthHelper::Calculate(cons_string); -} - - int String::Utf8Length() const { i::Handle str = Utils::OpenHandle(this); str = i::String::Flatten(str); - i::Isolate* isolate = str->GetIsolate(); - return v8::Utf8Length(*str, isolate); + int length = str->length(); + if (length == 0) return 0; + i::DisallowHeapAllocation no_gc; + i::String::FlatContent flat = str->GetFlatContent(); + DCHECK(flat.IsFlat()); + int utf8_length = 0; + if (flat.IsOneByte()) { + for (uint8_t c : flat.ToOneByteVector()) { + utf8_length += c >> 7; + } + utf8_length += length; + } else { + int last_character = unibrow::Utf16::kNoPreviousCharacter; + for (uint16_t c : flat.ToUC16Vector()) { + utf8_length += unibrow::Utf8::Length(c, last_character); + last_character = c; + } + } + return utf8_length; } @@ -5823,7 +5722,7 @@ int String::WriteUtf8(char* buffer, if (success) return writer.CompleteWrite(write_null, nchars_ref); } else if (capacity >= string_length) { // First check that the buffer is large enough. - int utf8_bytes = v8::Utf8Length(*str, isolate); + int utf8_bytes = Utf8Length(); if (utf8_bytes <= capacity) { // one-byte fast path. if (utf8_bytes == string_length) { @@ -5843,8 +5742,6 @@ int String::WriteUtf8(char* buffer, return WriteUtf8(buffer, -1, nchars_ref, options); } } - // Recursive slow path can potentially be unreasonable slow. Flatten. - str = i::String::Flatten(str); Utf8WriterVisitor writer(buffer, capacity, false, replace_invalid_utf8); i::String::VisitFlat(&writer, *str); return writer.CompleteWrite(write_null, nchars_ref); @@ -6083,7 +5980,7 @@ static void* ExternalValue(i::Object* obj) { return nullptr; } i::Object* foreign = i::JSObject::cast(obj)->GetEmbedderField(0); - return i::Foreign::cast(foreign)->foreign_address(); + return reinterpret_cast(i::Foreign::cast(foreign)->foreign_address()); } @@ -6120,7 +6017,7 @@ bool V8::TryHandleSignal(int signum, void* info, void* context) { #endif bool V8::RegisterDefaultSignalHandler() { - return v8::internal::trap_handler::RegisterDefaultSignalHandler(); + return v8::internal::trap_handler::RegisterDefaultTrapHandler(); } bool V8::EnableWebAssemblyTrapHandler(bool use_v8_signal_handler) { @@ -6173,7 +6070,8 @@ HeapObjectStatistics::HeapObjectStatistics() object_size_(0) {} HeapCodeStatistics::HeapCodeStatistics() - : code_and_metadata_size_(0), bytecode_and_metadata_size_(0) {} + : code_and_metadata_size_(0), + bytecode_and_metadata_size_(0) {} bool v8::V8::InitializeICU(const char* icu_data_file) { return i::InitializeICU(icu_data_file); @@ -6867,8 +6765,9 @@ bool v8::String::CanMakeExternal() { if (obj->IsExternalString()) return false; // Old space strings should be externalized. - i::Isolate* isolate = obj->GetIsolate(); - return !isolate->heap()->new_space()->Contains(*obj); + i::Heap* heap = obj->GetIsolate()->heap(); + return !heap->new_space()->Contains(*obj) && + !heap->read_only_space()->Contains(*obj); } @@ -7509,9 +7408,7 @@ MaybeLocal Proxy::New(Local context, Local local_target, Local WasmCompiledModule::GetWasmWireBytes() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); - i::Handle compiled_part = - i::handle(obj->compiled_module()); - i::Handle wire_bytes(compiled_part->shared()->module_bytes()); + i::Handle wire_bytes(obj->shared()->module_bytes()); return Local::Cast(Utils::ToLocal(wire_bytes)); } @@ -7550,7 +7447,13 @@ WasmCompiledModule::SerializedModule WasmCompiledModule::Serialize() { i::Handle::cast(Utils::OpenHandle(this)); i::Handle compiled_part = i::handle(i::WasmCompiledModule::cast(obj->compiled_module())); - return i::wasm::SerializeNativeModule(obj->GetIsolate(), compiled_part); + size_t buffer_size = + i::wasm::GetSerializedNativeModuleSize(obj->GetIsolate(), compiled_part); + std::unique_ptr buffer(new uint8_t[buffer_size]); + if (i::wasm::SerializeNativeModule(obj->GetIsolate(), compiled_part, + {buffer.get(), buffer_size})) + return {std::move(buffer), buffer_size}; + return {}; } MaybeLocal WasmCompiledModule::Deserialize( @@ -7558,17 +7461,16 @@ MaybeLocal WasmCompiledModule::Deserialize( const WasmCompiledModule::CallerOwnedBuffer& serialized_module, const WasmCompiledModule::CallerOwnedBuffer& wire_bytes) { i::Isolate* i_isolate = reinterpret_cast(isolate); - i::MaybeHandle maybe_compiled_module = + i::MaybeHandle maybe_module_object = i::wasm::DeserializeNativeModule( i_isolate, {serialized_module.first, serialized_module.second}, {wire_bytes.first, wire_bytes.second}); - i::Handle compiled_module; - if (!maybe_compiled_module.ToHandle(&compiled_module)) { + i::Handle module_object; + if (!maybe_module_object.ToHandle(&module_object)) { return MaybeLocal(); } return Local::Cast( - Utils::ToLocal(i::Handle::cast( - i::WasmModuleObject::New(i_isolate, compiled_module)))); + Utils::ToLocal(i::Handle::cast(module_object))); } MaybeLocal WasmCompiledModule::DeserializeOrCompile( @@ -7607,15 +7509,10 @@ WasmModuleObjectBuilderStreaming::WasmModuleObjectBuilderStreaming( Local resolver = maybe_resolver.ToLocalChecked(); promise_.Reset(isolate, resolver->GetPromise()); - if (i::FLAG_wasm_stream_compilation) { - i::Handle promise = Utils::OpenHandle(*GetPromise()); - i::Isolate* i_isolate = reinterpret_cast(isolate); - streaming_decoder_ = - i_isolate->wasm_engine() - ->compilation_manager() - ->StartStreamingCompilation(i_isolate, handle(i_isolate->context()), - promise); - } + i::Handle promise = Utils::OpenHandle(*GetPromise()); + i::Isolate* i_isolate = reinterpret_cast(isolate); + streaming_decoder_ = i_isolate->wasm_engine()->StartStreamingCompilation( + i_isolate, handle(i_isolate->context()), promise); } Local WasmModuleObjectBuilderStreaming::GetPromise() { @@ -7624,38 +7521,11 @@ Local WasmModuleObjectBuilderStreaming::GetPromise() { void WasmModuleObjectBuilderStreaming::OnBytesReceived(const uint8_t* bytes, size_t size) { - if (i::FLAG_wasm_stream_compilation) { - streaming_decoder_->OnBytesReceived(i::Vector(bytes, size)); - return; - } - std::unique_ptr cloned_bytes(new uint8_t[size]); - memcpy(cloned_bytes.get(), bytes, size); - received_buffers_.push_back( - Buffer(std::unique_ptr( - const_cast(cloned_bytes.release())), - size)); - total_size_ += size; + streaming_decoder_->OnBytesReceived(i::Vector(bytes, size)); } void WasmModuleObjectBuilderStreaming::Finish() { - if (i::FLAG_wasm_stream_compilation) { - streaming_decoder_->Finish(); - return; - } - std::unique_ptr wire_bytes(new uint8_t[total_size_]); - uint8_t* insert_at = wire_bytes.get(); - - for (size_t i = 0; i < received_buffers_.size(); ++i) { - const Buffer& buff = received_buffers_[i]; - memcpy(insert_at, buff.first.get(), buff.second); - insert_at += buff.second; - } - // AsyncCompile makes its own copy of the wire bytes. This inefficiency - // will be resolved when we move to true streaming compilation. - auto i_isolate = reinterpret_cast(isolate_); - i_isolate->wasm_engine()->AsyncCompile( - i_isolate, Utils::OpenHandle(*promise_.Get(isolate_)), - {wire_bytes.get(), wire_bytes.get() + total_size_}, false); + streaming_decoder_->Finish(); } void WasmModuleObjectBuilderStreaming::Abort(MaybeLocal exception) { @@ -7663,7 +7533,7 @@ void WasmModuleObjectBuilderStreaming::Abort(MaybeLocal exception) { // The promise has already been resolved, e.g. because of a compilation // error. if (promise->State() != v8::Promise::kPending) return; - if (i::FLAG_wasm_stream_compilation) streaming_decoder_->Abort(); + streaming_decoder_->Abort(); // If no exception value is provided, we do not reject the promise. This can // happen when streaming compilation gets aborted when no script execution is @@ -8185,7 +8055,7 @@ HeapProfiler* Isolate::GetHeapProfiler() { CpuProfiler* Isolate::GetCpuProfiler() { i::CpuProfiler* cpu_profiler = - reinterpret_cast(this)->cpu_profiler(); + reinterpret_cast(this)->EnsureCpuProfiler(); return reinterpret_cast(cpu_profiler); } @@ -8363,22 +8233,22 @@ Isolate* Isolate::GetCurrent() { return reinterpret_cast(isolate); } - -Isolate* Isolate::New(const Isolate::CreateParams& params) { - i::Isolate* isolate = new i::Isolate(false); - return IsolateNewImpl(isolate, params); +// static +Isolate* Isolate::Allocate() { + return reinterpret_cast(new i::Isolate()); } +// static // This is separate so that tests can provide a different |isolate|. -Isolate* IsolateNewImpl(internal::Isolate* isolate, - const v8::Isolate::CreateParams& params) { - Isolate* v8_isolate = reinterpret_cast(isolate); +void Isolate::Initialize(Isolate* isolate, + const v8::Isolate::CreateParams& params) { + i::Isolate* i_isolate = reinterpret_cast(isolate); CHECK_NOT_NULL(params.array_buffer_allocator); - isolate->set_array_buffer_allocator(params.array_buffer_allocator); + i_isolate->set_array_buffer_allocator(params.array_buffer_allocator); if (params.snapshot_blob != nullptr) { - isolate->set_snapshot_blob(params.snapshot_blob); + i_isolate->set_snapshot_blob(params.snapshot_blob); } else { - isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); + i_isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); } if (params.entry_hook) { #ifdef V8_USE_SNAPSHOT @@ -8387,7 +8257,7 @@ Isolate* IsolateNewImpl(internal::Isolate* isolate, false, "v8::Isolate::New", "Setting a FunctionEntryHook is only supported in no-snapshot builds."); #endif - isolate->set_function_entry_hook(params.entry_hook); + i_isolate->set_function_entry_hook(params.entry_hook); } auto code_event_handler = params.code_event_handler; #ifdef ENABLE_GDB_JIT_INTERFACE @@ -8396,44 +8266,49 @@ Isolate* IsolateNewImpl(internal::Isolate* isolate, } #endif // ENABLE_GDB_JIT_INTERFACE if (code_event_handler) { - isolate->InitializeLoggingAndCounters(); - isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, - code_event_handler); + i_isolate->InitializeLoggingAndCounters(); + i_isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, + code_event_handler); } if (params.counter_lookup_callback) { - v8_isolate->SetCounterFunction(params.counter_lookup_callback); + isolate->SetCounterFunction(params.counter_lookup_callback); } if (params.create_histogram_callback) { - v8_isolate->SetCreateHistogramFunction(params.create_histogram_callback); + isolate->SetCreateHistogramFunction(params.create_histogram_callback); } if (params.add_histogram_sample_callback) { - v8_isolate->SetAddHistogramSampleFunction( + isolate->SetAddHistogramSampleFunction( params.add_histogram_sample_callback); } - isolate->set_api_external_references(params.external_references); - isolate->set_allow_atomics_wait(params.allow_atomics_wait); + i_isolate->set_api_external_references(params.external_references); + i_isolate->set_allow_atomics_wait(params.allow_atomics_wait); - SetResourceConstraints(isolate, params.constraints); + SetResourceConstraints(i_isolate, params.constraints); // TODO(jochen): Once we got rid of Isolate::Current(), we can remove this. - Isolate::Scope isolate_scope(v8_isolate); - if (params.entry_hook || !i::Snapshot::Initialize(isolate)) { + Isolate::Scope isolate_scope(isolate); + if (params.entry_hook || !i::Snapshot::Initialize(i_isolate)) { // If snapshot data was provided and we failed to deserialize it must // have been corrupted. - CHECK_NULL(isolate->snapshot_blob()); + CHECK_NULL(i_isolate->snapshot_blob()); base::ElapsedTimer timer; if (i::FLAG_profile_deserialization) timer.Start(); - isolate->Init(nullptr); + i_isolate->Init(nullptr); if (i::FLAG_profile_deserialization) { double ms = timer.Elapsed().InMillisecondsF(); i::PrintF("[Initializing isolate from scratch took %0.3f ms]\n", ms); } } - return v8_isolate; + i_isolate->set_only_terminate_in_safe_scope(false); } +Isolate* Isolate::New(const Isolate::CreateParams& params) { + Isolate* isolate = Allocate(); + Initialize(isolate, params); + return isolate; +} void Isolate::Dispose() { i::Isolate* isolate = reinterpret_cast(this); @@ -8540,6 +8415,16 @@ Isolate::SuppressMicrotaskExecutionScope::~SuppressMicrotaskExecutionScope() { isolate_->handle_scope_implementer()->DecrementCallDepth(); } +Isolate::SafeForTerminationScope::SafeForTerminationScope(v8::Isolate* isolate) + : isolate_(reinterpret_cast(isolate)), + prev_value_(isolate_->next_v8_call_is_safe_for_termination()) { + isolate_->set_next_v8_call_is_safe_for_termination(true); +} + +Isolate::SafeForTerminationScope::~SafeForTerminationScope() { + isolate_->set_next_v8_call_is_safe_for_termination(prev_value_); +} + i::Object** Isolate::GetDataFromSnapshotOnce(size_t index) { i::Isolate* i_isolate = reinterpret_cast(this); i::FixedArray* list = i_isolate->heap()->serialized_objects(); @@ -8835,7 +8720,7 @@ int Isolate::ContextDisposedNotification(bool dependant_context) { if (!dependant_context) { // We left the current context, we can abort all running WebAssembly // compilations. - isolate->wasm_engine()->compilation_manager()->AbortAllJobs(); + isolate->wasm_engine()->AbortAllCompileJobs(); } // TODO(ahaas): move other non-heap activity out of the heap call. return isolate->heap()->NotifyContextDisposed(dependant_context); @@ -8898,7 +8783,8 @@ void Isolate::SetStackLimit(uintptr_t stack_limit) { void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) { i::Isolate* isolate = reinterpret_cast(this); if (isolate->heap()->memory_allocator()->code_range()->valid()) { - *start = isolate->heap()->memory_allocator()->code_range()->start(); + *start = reinterpret_cast( + isolate->heap()->memory_allocator()->code_range()->start()); *length_in_bytes = isolate->heap()->memory_allocator()->code_range()->size(); } else { @@ -9095,8 +8981,7 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local obj) TryCatch try_catch(isolate); Local str; if (!obj->ToString(context).ToLocal(&str)) return; - i::Handle i_str = Utils::OpenHandle(*str); - length_ = v8::Utf8Length(*i_str, i_isolate); + length_ = str->Utf8Length(); str_ = i::NewArray(length_ + 1); str->WriteUtf8(str_); } @@ -9413,7 +9298,7 @@ bool debug::Script::GetPossibleBreakpoints( i::Handle script = Utils::OpenHandle(this); if (script->type() == i::Script::TYPE_WASM) { i::WasmSharedModuleData* shared = - i::WasmCompiledModule::cast(script->wasm_compiled_module())->shared(); + i::WasmModuleObject::cast(script->wasm_module_object())->shared(); return shared->GetPossibleBreakpoints(start, end, locations); } @@ -9462,7 +9347,7 @@ bool debug::Script::GetPossibleBreakpoints( int debug::Script::GetSourceOffset(const debug::Location& location) const { i::Handle script = Utils::OpenHandle(this); if (script->type() == i::Script::TYPE_WASM) { - return i::WasmCompiledModule::cast(script->wasm_compiled_module()) + return i::WasmModuleObject::cast(script->wasm_module_object()) ->shared() ->GetFunctionOffset(location.GetLineNumber()) + location.GetColumnNumber(); @@ -9522,6 +9407,10 @@ void debug::RemoveBreakpoint(Isolate* v8_isolate, BreakpointId id) { isolate->debug()->RemoveBreakpoint(id); } +v8::Platform* debug::GetCurrentPlatform() { + return i::V8::GetCurrentPlatform(); +} + debug::WasmScript* debug::WasmScript::Cast(debug::Script* script) { CHECK(script->IsWasm()); return static_cast(script); @@ -9531,9 +9420,9 @@ int debug::WasmScript::NumFunctions() const { i::DisallowHeapAllocation no_gc; i::Handle script = Utils::OpenHandle(this); DCHECK_EQ(i::Script::TYPE_WASM, script->type()); - i::WasmCompiledModule* compiled_module = - i::WasmCompiledModule::cast(script->wasm_compiled_module()); - i::wasm::WasmModule* module = compiled_module->shared()->module(); + i::WasmModuleObject* module_object = + i::WasmModuleObject::cast(script->wasm_module_object()); + i::wasm::WasmModule* module = module_object->shared()->module(); DCHECK_GE(i::kMaxInt, module->functions.size()); return static_cast(module->functions.size()); } @@ -9542,9 +9431,9 @@ int debug::WasmScript::NumImportedFunctions() const { i::DisallowHeapAllocation no_gc; i::Handle script = Utils::OpenHandle(this); DCHECK_EQ(i::Script::TYPE_WASM, script->type()); - i::WasmCompiledModule* compiled_module = - i::WasmCompiledModule::cast(script->wasm_compiled_module()); - i::wasm::WasmModule* module = compiled_module->shared()->module(); + i::WasmModuleObject* module_object = + i::WasmModuleObject::cast(script->wasm_module_object()); + i::wasm::WasmModule* module = module_object->shared()->module(); DCHECK_GE(i::kMaxInt, module->num_imported_functions); return static_cast(module->num_imported_functions); } @@ -9554,9 +9443,9 @@ std::pair debug::WasmScript::GetFunctionRange( i::DisallowHeapAllocation no_gc; i::Handle script = Utils::OpenHandle(this); DCHECK_EQ(i::Script::TYPE_WASM, script->type()); - i::WasmCompiledModule* compiled_module = - i::WasmCompiledModule::cast(script->wasm_compiled_module()); - i::wasm::WasmModule* module = compiled_module->shared()->module(); + i::WasmModuleObject* module_object = + i::WasmModuleObject::cast(script->wasm_module_object()); + i::wasm::WasmModule* module = module_object->shared()->module(); DCHECK_LE(0, function_index); DCHECK_GT(module->functions.size(), function_index); i::wasm::WasmFunction& func = module->functions[function_index]; @@ -9570,13 +9459,13 @@ uint32_t debug::WasmScript::GetFunctionHash(int function_index) { i::DisallowHeapAllocation no_gc; i::Handle script = Utils::OpenHandle(this); DCHECK_EQ(i::Script::TYPE_WASM, script->type()); - i::WasmCompiledModule* compiled_module = - i::WasmCompiledModule::cast(script->wasm_compiled_module()); - i::wasm::WasmModule* module = compiled_module->shared()->module(); + i::WasmModuleObject* module_object = + i::WasmModuleObject::cast(script->wasm_module_object()); + i::wasm::WasmModule* module = module_object->shared()->module(); DCHECK_LE(0, function_index); DCHECK_GT(module->functions.size(), function_index); i::wasm::WasmFunction& func = module->functions[function_index]; - i::SeqOneByteString* module_bytes = compiled_module->shared()->module_bytes(); + i::SeqOneByteString* module_bytes = module_object->shared()->module_bytes(); i::wasm::ModuleWireBytes wire_bytes( module_bytes->GetFlatContent().ToOneByteVector()); i::Vector function_bytes = wire_bytes.GetFunctionBytes(&func); @@ -9590,9 +9479,9 @@ debug::WasmDisassembly debug::WasmScript::DisassembleFunction( i::DisallowHeapAllocation no_gc; i::Handle script = Utils::OpenHandle(this); DCHECK_EQ(i::Script::TYPE_WASM, script->type()); - i::WasmCompiledModule* compiled_module = - i::WasmCompiledModule::cast(script->wasm_compiled_module()); - return compiled_module->shared()->DisassembleFunction(function_index); + i::WasmModuleObject* module_object = + i::WasmModuleObject::cast(script->wasm_module_object()); + return module_object->shared()->DisassembleFunction(function_index); } debug::Location::Location(int line_number, int column_number) @@ -9951,15 +9840,7 @@ Local CpuProfileNode::GetFunctionName() const { const i::CodeEntry* entry = node->entry(); i::Handle name = isolate->factory()->InternalizeUtf8String(entry->name()); - if (!entry->has_name_prefix()) { - return ToApiHandle(name); - } else { - // We do not expect this to fail. Change this if it does. - i::Handle cons = isolate->factory()->NewConsString( - isolate->factory()->InternalizeUtf8String(entry->name_prefix()), - name).ToHandleChecked(); - return ToApiHandle(cons); - } + return ToApiHandle(name); } int debug::Coverage::BlockData::StartOffset() const { return block_->start; } @@ -10804,8 +10685,7 @@ void InvokeAccessorGetterCallback( Isolate* isolate = reinterpret_cast(info.GetIsolate()); RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kAccessorGetterCallback); - Address getter_address = reinterpret_cast
(reinterpret_cast( - getter)); + Address getter_address = reinterpret_cast
(getter); VMState state(isolate); ExternalCallbackScope call_scope(isolate, getter_address); getter(property, info); @@ -10817,8 +10697,7 @@ void InvokeFunctionCallback(const v8::FunctionCallbackInfo& info, Isolate* isolate = reinterpret_cast(info.GetIsolate()); RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kInvokeFunctionCallback); - Address callback_address = - reinterpret_cast
(reinterpret_cast(callback)); + Address callback_address = reinterpret_cast
(callback); VMState state(isolate); ExternalCallbackScope call_scope(isolate, callback_address); callback(info); diff --git a/deps/v8/src/api.h b/deps/v8/src/api.h index c67de0482df6..342ab855ac01 100644 --- a/deps/v8/src/api.h +++ b/deps/v8/src/api.h @@ -31,10 +31,14 @@ template inline T ToCData(v8::internal::Object* obj) { STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); if (obj == v8::internal::Smi::kZero) return nullptr; return reinterpret_cast( - reinterpret_cast( - v8::internal::Foreign::cast(obj)->foreign_address())); + v8::internal::Foreign::cast(obj)->foreign_address()); } +template <> +inline v8::internal::Address ToCData(v8::internal::Object* obj) { + if (obj == v8::internal::Smi::kZero) return v8::internal::kNullAddress; + return v8::internal::Foreign::cast(obj)->foreign_address(); +} template inline v8::internal::Handle FromCData( @@ -42,9 +46,17 @@ inline v8::internal::Handle FromCData( STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); if (obj == nullptr) return handle(v8::internal::Smi::kZero, isolate); return isolate->factory()->NewForeign( - reinterpret_cast(reinterpret_cast(obj))); + reinterpret_cast(obj)); } +template <> +inline v8::internal::Handle FromCData( + v8::internal::Isolate* isolate, v8::internal::Address obj) { + if (obj == v8::internal::kNullAddress) { + return handle(v8::internal::Smi::kZero, isolate); + } + return isolate->factory()->NewForeign(obj); +} class ApiFunction { public: @@ -100,6 +112,7 @@ class RegisteredExtension { V(String, String) \ V(Symbol, Symbol) \ V(Script, JSFunction) \ + V(UnboundModuleScript, SharedFunctionInfo) \ V(UnboundScript, SharedFunctionInfo) \ V(Module, Module) \ V(Function, JSReceiver) \ @@ -365,9 +378,6 @@ OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE) #undef MAKE_OPEN_HANDLE #undef OPEN_HANDLE_LIST -extern Isolate* IsolateNewImpl(internal::Isolate* isolate, - const Isolate::CreateParams& params); - namespace internal { class V8_EXPORT_PRIVATE DeferredHandles { diff --git a/deps/v8/src/arm/assembler-arm-inl.h b/deps/v8/src/arm/assembler-arm-inl.h index 280e4ddfae74..4c4eb00ec284 100644 --- a/deps/v8/src/arm/assembler-arm-inl.h +++ b/deps/v8/src/arm/assembler-arm-inl.h @@ -76,7 +76,7 @@ Address RelocInfo::target_address_address() { IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) || IsOffHeapTarget(rmode_)); if (Assembler::IsMovW(Memory::int32_at(pc_))) { - return reinterpret_cast
(pc_); + return pc_; } else { DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(pc_))); return constant_pool_entry_address(); @@ -141,7 +141,7 @@ Address RelocInfo::target_internal_reference() { Address RelocInfo::target_internal_reference_address() { DCHECK(rmode_ == INTERNAL_REFERENCE); - return reinterpret_cast
(pc_); + return pc_; } void RelocInfo::set_wasm_code_table_entry(Address target, @@ -174,9 +174,9 @@ void RelocInfo::WipeOut() { IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || IsInternalReference(rmode_)); if (IsInternalReference(rmode_)) { - Memory::Address_at(pc_) = nullptr; + Memory::Address_at(pc_) = kNullAddress; } else { - Assembler::set_target_address_at(pc_, constant_pool_, nullptr); + Assembler::set_target_address_at(pc_, constant_pool_, kNullAddress); } } @@ -206,7 +206,7 @@ Operand Operand::Zero() { return Operand(static_cast(0)); } Operand::Operand(const ExternalReference& f) : rmode_(RelocInfo::EXTERNAL_REFERENCE) { - value_.immediate = reinterpret_cast(f.address()); + value_.immediate = static_cast(f.address()); } Operand::Operand(Smi* value) : rmode_(RelocInfo::NONE) { @@ -298,6 +298,10 @@ void Assembler::deserialization_set_special_target_at( Memory::Address_at(constant_pool_entry) = target; } +int Assembler::deserialization_special_target_size(Address location) { + return kSpecialTargetSize; +} + void Assembler::deserialization_set_target_internal_reference_at( Address pc, Address target, RelocInfo::Mode mode) { Memory::Address_at(pc) = target; @@ -327,9 +331,8 @@ Address Assembler::target_address_at(Address pc, Address constant_pool) { IsMovT(Memory::int32_at(pc + kInstrSize))); Instruction* movw_instr = Instruction::At(pc); Instruction* movt_instr = Instruction::At(pc + kInstrSize); - return reinterpret_cast
( - (movt_instr->ImmedMovwMovtValue() << 16) | - movw_instr->ImmedMovwMovtValue()); + return static_cast
((movt_instr->ImmedMovwMovtValue() << 16) | + movw_instr->ImmedMovwMovtValue()); } else { // This is an mov / orr immediate load. Return the immediate. DCHECK(IsMovImmed(Memory::int32_at(pc)) && @@ -340,7 +343,7 @@ Address Assembler::target_address_at(Address pc, Address constant_pool) { Instr orr_instr_1 = instr_at(pc + kInstrSize); Instr orr_instr_2 = instr_at(pc + 2 * kInstrSize); Instr orr_instr_3 = instr_at(pc + 3 * kInstrSize); - Address ret = reinterpret_cast
( + Address ret = static_cast
( DecodeShiftImm(mov_instr) | DecodeShiftImm(orr_instr_1) | DecodeShiftImm(orr_instr_2) | DecodeShiftImm(orr_instr_3)); return ret; @@ -367,7 +370,7 @@ void Assembler::set_target_address_at(Address pc, Address constant_pool, DCHECK(IsMovW(Memory::int32_at(pc))); DCHECK(IsMovT(Memory::int32_at(pc + kInstrSize))); uint32_t* instr_ptr = reinterpret_cast(pc); - uint32_t immediate = reinterpret_cast(target); + uint32_t immediate = static_cast(target); instr_ptr[0] = PatchMovwImmediate(instr_ptr[0], immediate & 0xFFFF); instr_ptr[1] = PatchMovwImmediate(instr_ptr[1], immediate >> 16); DCHECK(IsMovW(Memory::int32_at(pc))); diff --git a/deps/v8/src/arm/assembler-arm.cc b/deps/v8/src/arm/assembler-arm.cc index 87acd59e84e9..da5e4663450a 100644 --- a/deps/v8/src/arm/assembler-arm.cc +++ b/deps/v8/src/arm/assembler-arm.cc @@ -374,7 +374,7 @@ Address RelocInfo::js_to_wasm_address() const { Operand::Operand(Handle handle) { rm_ = no_reg; - value_.immediate = reinterpret_cast(handle.address()); + value_.immediate = static_cast(handle.address()); rmode_ = RelocInfo::EMBEDDED_OBJECT; } @@ -491,7 +491,7 @@ void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) { object = request.code_stub()->GetCode(); break; } - Address pc = buffer_ + request.offset(); + Address pc = reinterpret_cast
(buffer_) + request.offset(); Memory::Address_at(constant_pool_entry_address(pc, 0 /* unused */)) = object.address(); } @@ -5152,7 +5152,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { return; } DCHECK_GE(buffer_space(), kMaxRelocSize); // too late to grow buffer here - RelocInfo rinfo(pc_, rmode, data, nullptr); + RelocInfo rinfo(reinterpret_cast
(pc_), rmode, data, nullptr); reloc_info_writer.Write(&rinfo); } @@ -5191,7 +5191,7 @@ void Assembler::ConstantPoolAddEntry(int position, RelocInfo::Mode rmode, value != 0) { // Sharing entries here relies on canonicalized handles - without them, we // will miss the optimisation opportunity. - Address handle_address = reinterpret_cast
(value); + Address handle_address = static_cast
(value); auto existing = handle_to_index_map_.find(handle_address); if (existing != handle_to_index_map_.end()) { int index = existing->second; @@ -5476,9 +5476,7 @@ PatchingAssembler::~PatchingAssembler() { DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_); } -void PatchingAssembler::Emit(Address addr) { - emit(reinterpret_cast(addr)); -} +void PatchingAssembler::Emit(Address addr) { emit(static_cast(addr)); } UseScratchRegisterScope::UseScratchRegisterScope(Assembler* assembler) : assembler_(assembler), diff --git a/deps/v8/src/arm/assembler-arm.h b/deps/v8/src/arm/assembler-arm.h index bbe0ba753e86..4a424ccea22e 100644 --- a/deps/v8/src/arm/assembler-arm.h +++ b/deps/v8/src/arm/assembler-arm.h @@ -689,6 +689,9 @@ class Assembler : public AssemblerBase { inline static void deserialization_set_special_target_at( Address constant_pool_entry, Code* code, Address target); + // Get the size of the special target encoded at 'location'. + inline static int deserialization_special_target_size(Address location); + // This sets the internal reference at the pc. inline static void deserialization_set_target_internal_reference_at( Address pc, Address target, @@ -1496,8 +1499,8 @@ class Assembler : public AssemblerBase { void instr_at_put(int pos, Instr instr) { *reinterpret_cast(buffer_ + pos) = instr; } - static Instr instr_at(byte* pc) { return *reinterpret_cast(pc); } - static void instr_at_put(byte* pc, Instr instr) { + static Instr instr_at(Address pc) { return *reinterpret_cast(pc); } + static void instr_at_put(Address pc, Instr instr) { *reinterpret_cast(pc) = instr; } static Condition GetCondition(Instr instr); diff --git a/deps/v8/src/arm/code-stubs-arm.cc b/deps/v8/src/arm/code-stubs-arm.cc index 814d341f7e55..8267da470303 100644 --- a/deps/v8/src/arm/code-stubs-arm.cc +++ b/deps/v8/src/arm/code-stubs-arm.cc @@ -17,6 +17,7 @@ #include "src/ic/ic.h" #include "src/ic/stub-cache.h" #include "src/isolate.h" +#include "src/objects/api-callbacks.h" #include "src/objects/regexp-match-info.h" #include "src/regexp/jsregexp.h" #include "src/regexp/regexp-macro-assembler.h" @@ -38,355 +39,11 @@ void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kNewArray); } - -void DoubleToIStub::Generate(MacroAssembler* masm) { - Label negate, done; - Register result_reg = destination(); - - UseScratchRegisterScope temps(masm); - Register double_low = GetRegisterThatIsNotOneOf(result_reg); - Register double_high = GetRegisterThatIsNotOneOf(result_reg, double_low); - LowDwVfpRegister double_scratch = temps.AcquireLowD(); - - // Save the old values from these temporary registers on the stack. - __ Push(double_high, double_low); - - // Account for saved regs. - const int kArgumentOffset = 2 * kPointerSize; - - // Load double input. - __ vldr(double_scratch, MemOperand(sp, kArgumentOffset)); - __ vmov(double_low, double_high, double_scratch); - // Try to convert with a FPU convert instruction. This handles all - // non-saturating cases. - __ TryInlineTruncateDoubleToI(result_reg, double_scratch, &done); - - Register scratch = temps.Acquire(); - __ Ubfx(scratch, double_high, HeapNumber::kExponentShift, - HeapNumber::kExponentBits); - // Load scratch with exponent - 1. This is faster than loading - // with exponent because Bias + 1 = 1024 which is an *ARM* immediate value. - STATIC_ASSERT(HeapNumber::kExponentBias + 1 == 1024); - __ sub(scratch, scratch, Operand(HeapNumber::kExponentBias + 1)); - // If exponent is greater than or equal to 84, the 32 less significant - // bits are 0s (2^84 = 1, 52 significant bits, 32 uncoded bits), - // the result is 0. - // Compare exponent with 84 (compare exponent - 1 with 83). If the exponent is - // greater than this, the conversion is out of range, so return zero. - __ cmp(scratch, Operand(83)); - __ mov(result_reg, Operand::Zero(), LeaveCC, ge); - __ b(ge, &done); - - // If we reach this code, 30 <= exponent <= 83. - // `TryInlineTruncateDoubleToI` above will have truncated any double with an - // exponent lower than 30. - if (masm->emit_debug_code()) { - // Scratch is exponent - 1. - __ cmp(scratch, Operand(30 - 1)); - __ Check(ge, AbortReason::kUnexpectedValue); - } - - // We don't have to handle cases where 0 <= exponent <= 20 for which we would - // need to shift right the high part of the mantissa. - // Scratch contains exponent - 1. - // Load scratch with 52 - exponent (load with 51 - (exponent - 1)). - __ rsb(scratch, scratch, Operand(51), SetCC); - - // 52 <= exponent <= 83, shift only double_low. - // On entry, scratch contains: 52 - exponent. - __ rsb(scratch, scratch, Operand::Zero(), LeaveCC, ls); - __ mov(result_reg, Operand(double_low, LSL, scratch), LeaveCC, ls); - __ b(ls, &negate); - - // 21 <= exponent <= 51, shift double_low and double_high - // to generate the result. - __ mov(double_low, Operand(double_low, LSR, scratch)); - // Scratch contains: 52 - exponent. - // We needs: exponent - 20. - // So we use: 32 - scratch = 32 - 52 + exponent = exponent - 20. - __ rsb(scratch, scratch, Operand(32)); - __ Ubfx(result_reg, double_high, 0, HeapNumber::kMantissaBitsInTopWord); - // Set the implicit 1 before the mantissa part in double_high. - __ orr(result_reg, result_reg, - Operand(1 << HeapNumber::kMantissaBitsInTopWord)); - __ orr(result_reg, double_low, Operand(result_reg, LSL, scratch)); - - __ bind(&negate); - // If input was positive, double_high ASR 31 equals 0 and - // double_high LSR 31 equals zero. - // New result = (result eor 0) + 0 = result. - // If the input was negative, we have to negate the result. - // Input_high ASR 31 equals 0xFFFFFFFF and double_high LSR 31 equals 1. - // New result = (result eor 0xFFFFFFFF) + 1 = 0 - result. - __ eor(result_reg, result_reg, Operand(double_high, ASR, 31)); - __ add(result_reg, result_reg, Operand(double_high, LSR, 31)); - - __ bind(&done); - - // Restore registers corrupted in this routine and return. - __ Pop(double_high, double_low); - __ Ret(); -} - - -void MathPowStub::Generate(MacroAssembler* masm) { - const Register exponent = MathPowTaggedDescriptor::exponent(); - DCHECK(exponent == r2); - const LowDwVfpRegister double_base = d0; - const LowDwVfpRegister double_exponent = d1; - const LowDwVfpRegister double_result = d2; - const LowDwVfpRegister double_scratch = d3; - const SwVfpRegister single_scratch = s6; - const Register scratch = r9; - const Register scratch2 = r4; - - Label call_runtime, done, int_exponent; - - // Detect integer exponents stored as double. - __ TryDoubleToInt32Exact(scratch, double_exponent, double_scratch); - __ b(eq, &int_exponent); - - __ push(lr); - { - AllowExternalCallThatCantCauseGC scope(masm); - __ PrepareCallCFunction(0, 2); - __ MovToFloatParameters(double_base, double_exponent); - __ CallCFunction(ExternalReference::power_double_double_function(isolate()), - 0, 2); - } - __ pop(lr); - __ MovFromFloatResult(double_result); - __ b(&done); - - // Calculate power with integer exponent. - __ bind(&int_exponent); - - // Get two copies of exponent in the registers scratch and exponent. - // Exponent has previously been stored into scratch as untagged integer. - __ mov(exponent, scratch); - - __ vmov(double_scratch, double_base); // Back up base. - __ vmov(double_result, Double(1.0), scratch2); - - // Get absolute value of exponent. - __ cmp(scratch, Operand::Zero()); - __ rsb(scratch, scratch, Operand::Zero(), LeaveCC, mi); - - Label while_true; - __ bind(&while_true); - __ mov(scratch, Operand(scratch, LSR, 1), SetCC); - __ vmul(double_result, double_result, double_scratch, cs); - __ vmul(double_scratch, double_scratch, double_scratch, ne); - __ b(ne, &while_true); - - __ cmp(exponent, Operand::Zero()); - __ b(ge, &done); - __ vmov(double_scratch, Double(1.0), scratch); - __ vdiv(double_result, double_scratch, double_result); - // Test whether result is zero. Bail out to check for subnormal result. - // Due to subnormals, x^-y == (1/x)^y does not hold in all cases. - __ VFPCompareAndSetFlags(double_result, 0.0); - __ b(ne, &done); - // double_exponent may not containe the exponent value if the input was a - // smi. We set it with exponent value before bailing out. - __ vmov(single_scratch, exponent); - __ vcvt_f64_s32(double_exponent, single_scratch); - - // Returning or bailing out. - __ push(lr); - { - AllowExternalCallThatCantCauseGC scope(masm); - __ PrepareCallCFunction(0, 2); - __ MovToFloatParameters(double_base, double_exponent); - __ CallCFunction(ExternalReference::power_double_double_function(isolate()), - 0, 2); - } - __ pop(lr); - __ MovFromFloatResult(double_result); - - __ bind(&done); - __ Ret(); -} - -Movability CEntryStub::NeedsImmovableCode() { return kImmovable; } - void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { - CEntryStub::GenerateAheadOfTime(isolate); CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate); StoreFastElementStub::GenerateAheadOfTime(isolate); } - -void CodeStub::GenerateFPStubs(Isolate* isolate) { - // Generate if not already in cache. - SaveFPRegsMode mode = kSaveFPRegs; - CEntryStub(isolate, 1, mode).GetCode(); -} - - -void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { - CEntryStub stub(isolate, 1, kDontSaveFPRegs); - stub.GetCode(); -} - - -void CEntryStub::Generate(MacroAssembler* masm) { - // Called from JavaScript; parameters are on stack as if calling JS function. - // r0: number of arguments including receiver - // r1: pointer to builtin function - // fp: frame pointer (restored after C call) - // sp: stack pointer (restored as callee's sp after C call) - // cp: current context (C callee-saved) - // - // If argv_in_register(): - // r2: pointer to the first argument - ProfileEntryHookStub::MaybeCallEntryHook(masm); - - __ mov(r5, Operand(r1)); - - if (argv_in_register()) { - // Move argv into the correct register. - __ mov(r1, Operand(r2)); - } else { - // Compute the argv pointer in a callee-saved register. - __ add(r1, sp, Operand(r0, LSL, kPointerSizeLog2)); - __ sub(r1, r1, Operand(kPointerSize)); - } - - // Enter the exit frame that transitions from JavaScript to C++. - FrameScope scope(masm, StackFrame::MANUAL); - __ EnterExitFrame(save_doubles(), 0, is_builtin_exit() - ? StackFrame::BUILTIN_EXIT - : StackFrame::EXIT); - - // Store a copy of argc in callee-saved registers for later. - __ mov(r4, Operand(r0)); - - // r0, r4: number of arguments including receiver (C callee-saved) - // r1: pointer to the first argument (C callee-saved) - // r5: pointer to builtin function (C callee-saved) - -#if V8_HOST_ARCH_ARM - int frame_alignment = MacroAssembler::ActivationFrameAlignment(); - int frame_alignment_mask = frame_alignment - 1; - if (FLAG_debug_code) { - if (frame_alignment > kPointerSize) { - Label alignment_as_expected; - DCHECK(base::bits::IsPowerOfTwo(frame_alignment)); - __ tst(sp, Operand(frame_alignment_mask)); - __ b(eq, &alignment_as_expected); - // Don't use Check here, as it will call Runtime_Abort re-entering here. - __ stop("Unexpected alignment"); - __ bind(&alignment_as_expected); - } - } -#endif - - // Call C built-in. - // r0 = argc, r1 = argv, r2 = isolate - __ mov(r2, Operand(ExternalReference::isolate_address(isolate()))); - - // To let the GC traverse the return address of the exit frames, we need to - // know where the return address is. The CEntryStub is unmovable, so - // we can store the address on the stack to be able to find it again and - // we never have to restore it, because it will not change. - // Compute the return address in lr to return to after the jump below. Pc is - // already at '+ 8' from the current instruction but return is after three - // instructions so add another 4 to pc to get the return address. - { - // Prevent literal pool emission before return address. - Assembler::BlockConstPoolScope block_const_pool(masm); - __ add(lr, pc, Operand(4)); - __ str(lr, MemOperand(sp)); - __ Call(r5); - } - - // Result returned in r0 or r1:r0 - do not destroy these registers! - - // Check result for exception sentinel. - Label exception_returned; - __ CompareRoot(r0, Heap::kExceptionRootIndex); - __ b(eq, &exception_returned); - - // Check that there is no pending exception, otherwise we - // should have returned the exception sentinel. - if (FLAG_debug_code) { - Label okay; - ExternalReference pending_exception_address( - IsolateAddressId::kPendingExceptionAddress, isolate()); - __ mov(r3, Operand(pending_exception_address)); - __ ldr(r3, MemOperand(r3)); - __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); - // Cannot use check here as it attempts to generate call into runtime. - __ b(eq, &okay); - __ stop("Unexpected pending exception"); - __ bind(&okay); - } - - // Exit C frame and return. - // r0:r1: result - // sp: stack pointer - // fp: frame pointer - Register argc = argv_in_register() - // We don't want to pop arguments so set argc to no_reg. - ? no_reg - // Callee-saved register r4 still holds argc. - : r4; - __ LeaveExitFrame(save_doubles(), argc); - __ mov(pc, lr); - - // Handling of exception. - __ bind(&exception_returned); - - ExternalReference pending_handler_context_address( - IsolateAddressId::kPendingHandlerContextAddress, isolate()); - ExternalReference pending_handler_entrypoint_address( - IsolateAddressId::kPendingHandlerEntrypointAddress, isolate()); - ExternalReference pending_handler_fp_address( - IsolateAddressId::kPendingHandlerFPAddress, isolate()); - ExternalReference pending_handler_sp_address( - IsolateAddressId::kPendingHandlerSPAddress, isolate()); - - // Ask the runtime for help to determine the handler. This will set r0 to - // contain the current pending exception, don't clobber it. - ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler, - isolate()); - { - FrameScope scope(masm, StackFrame::MANUAL); - __ PrepareCallCFunction(3, 0); - __ mov(r0, Operand(0)); - __ mov(r1, Operand(0)); - __ mov(r2, Operand(ExternalReference::isolate_address(isolate()))); - __ CallCFunction(find_handler, 3); - } - - // Retrieve the handler context, SP and FP. - __ mov(cp, Operand(pending_handler_context_address)); - __ ldr(cp, MemOperand(cp)); - __ mov(sp, Operand(pending_handler_sp_address)); - __ ldr(sp, MemOperand(sp)); - __ mov(fp, Operand(pending_handler_fp_address)); - __ ldr(fp, MemOperand(fp)); - - // If the handler is a JS frame, restore the context to the frame. Note that - // the context will be set to (cp == 0) for non-JS frames. - __ cmp(cp, Operand(0)); - __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne); - - // Reset the masking register. This is done independent of the underlying - // feature flag {FLAG_branch_load_poisoning} to make the snapshot work with - // both configurations. It is safe to always do this, because the underlying - // register is caller-saved and can be arbitrarily clobbered. - __ ResetSpeculationPoisonRegister(); - - // Compute the handler entry address and jump to it. - ConstantPoolUnavailableScope constant_pool_unavailable(masm); - __ mov(r1, Operand(pending_handler_entrypoint_address)); - __ ldr(r1, MemOperand(r1)); - __ Jump(r1); -} - - void JSEntryStub::Generate(MacroAssembler* masm) { // r0: code entry // r1: function @@ -396,19 +53,23 @@ void JSEntryStub::Generate(MacroAssembler* masm) { Label invoke, handler_entry, exit; - ProfileEntryHookStub::MaybeCallEntryHook(masm); + { + NoRootArrayScope no_root_array(masm); + + ProfileEntryHookStub::MaybeCallEntryHook(masm); - // Called from C, so do not pop argc and args on exit (preserve sp) - // No need to save register-passed args - // Save callee-saved registers (incl. cp and fp), sp, and lr - __ stm(db_w, sp, kCalleeSaved | lr.bit()); + // Called from C, so do not pop argc and args on exit (preserve sp) + // No need to save register-passed args + // Save callee-saved registers (incl. cp and fp), sp, and lr + __ stm(db_w, sp, kCalleeSaved | lr.bit()); - // Save callee-saved vfp registers. - __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); - // Set up the reserved register for 0.0. - __ vmov(kDoubleRegZero, Double(0.0)); + // Save callee-saved vfp registers. + __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); + // Set up the reserved register for 0.0. + __ vmov(kDoubleRegZero, Double(0.0)); - __ InitializeRootRegister(); + __ InitializeRootRegister(); + } // Get address of argv, see stm above. // r0: code entry @@ -430,8 +91,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { StackFrame::Type marker = type(); __ mov(r7, Operand(StackFrame::TypeToMarker(marker))); __ mov(r6, Operand(StackFrame::TypeToMarker(marker))); - __ mov(r5, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + __ mov(r5, Operand(ExternalReference::Create( + IsolateAddressId::kCEntryFPAddress, isolate()))); __ ldr(r5, MemOperand(r5)); { UseScratchRegisterScope temps(masm); @@ -449,7 +110,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // If this is the outermost JS call, set js_entry_sp value. Label non_outermost_js; - ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); + ExternalReference js_entry_sp = + ExternalReference::Create(IsolateAddressId::kJSEntrySPAddress, isolate()); __ mov(r5, Operand(ExternalReference(js_entry_sp))); __ ldr(scratch, MemOperand(r5)); __ cmp(scratch, Operand::Zero()); @@ -479,8 +141,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // fp will be invalid because the PushStackHandler below sets it to 0 to // signal the existence of the JSEntry frame. __ mov(scratch, - Operand(ExternalReference(IsolateAddressId::kPendingExceptionAddress, - isolate()))); + Operand(ExternalReference::Create( + IsolateAddressId::kPendingExceptionAddress, isolate()))); } __ str(r0, MemOperand(scratch)); __ LoadRoot(r0, Heap::kExceptionRootIndex); @@ -523,8 +185,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Restore the top frame descriptors from the stack. __ pop(r3); - __ mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + __ mov(scratch, Operand(ExternalReference::Create( + IsolateAddressId::kCEntryFPAddress, isolate()))); __ str(r3, MemOperand(scratch)); // Reset the stack to the callee saved registers. @@ -638,9 +300,8 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) { __ mov(r2, Operand(ExternalReference::isolate_address(isolate()))); ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); - __ mov(scratch, - Operand(ExternalReference( - &dispatcher, ExternalReference::BUILTIN_CALL, isolate()))); + __ mov(scratch, Operand(ExternalReference::Create( + &dispatcher, ExternalReference::BUILTIN_CALL))); #endif __ Call(scratch); } @@ -849,7 +510,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); __ add(r0, r0, Operand(3)); __ Push(r3, r2); - __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate())); + __ JumpToExternalReference(ExternalReference::Create(Runtime::kNewArray)); } @@ -982,8 +643,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, __ PushSafepointRegisters(); __ PrepareCallCFunction(1); __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); - __ CallCFunction(ExternalReference::log_enter_external_function(isolate), - 1); + __ CallCFunction(ExternalReference::log_enter_external_function(), 1); __ PopSafepointRegisters(); } @@ -998,8 +658,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, __ PushSafepointRegisters(); __ PrepareCallCFunction(1); __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); - __ CallCFunction(ExternalReference::log_leave_external_function(isolate), - 1); + __ CallCFunction(ExternalReference::log_leave_external_function(), 1); __ PopSafepointRegisters(); } @@ -1054,8 +713,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, __ mov(r4, r0); __ PrepareCallCFunction(1); __ mov(r0, Operand(ExternalReference::isolate_address(isolate))); - __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), - 1); + __ CallCFunction(ExternalReference::delete_handle_scope_extensions(), 1); __ mov(r0, r4); __ jmp(&leave_exit_frame); } @@ -1131,8 +789,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) { __ mov(scratch0, Operand(argc())); __ str(scratch0, MemOperand(r0, 2 * kPointerSize)); - ExternalReference thunk_ref = - ExternalReference::invoke_function_callback(masm->isolate()); + ExternalReference thunk_ref = ExternalReference::invoke_function_callback(); AllowExternalCallThatCantCauseGC scope(masm); // Stores return the first js argument @@ -1194,7 +851,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) { __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = v8::PropertyCallbackInfo& ExternalReference thunk_ref = - ExternalReference::invoke_accessor_getter_callback(isolate()); + ExternalReference::invoke_accessor_getter_callback(); __ ldr(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset)); __ ldr(api_function_address, diff --git a/deps/v8/src/arm/constants-arm.h b/deps/v8/src/arm/constants-arm.h index 4e52a9173839..02d1c6b1dd2d 100644 --- a/deps/v8/src/arm/constants-arm.h +++ b/deps/v8/src/arm/constants-arm.h @@ -666,7 +666,7 @@ class Instruction { // reference to an instruction is to convert a pointer. There is no way // to allocate or create instances of class Instruction. // Use the At(pc) function to create references to Instruction. - static Instruction* At(byte* pc) { + static Instruction* At(Address pc) { return reinterpret_cast(pc); } diff --git a/deps/v8/src/arm/deoptimizer-arm.cc b/deps/v8/src/arm/deoptimizer-arm.cc index a4a540512d9d..73131d7d1843 100644 --- a/deps/v8/src/arm/deoptimizer-arm.cc +++ b/deps/v8/src/arm/deoptimizer-arm.cc @@ -58,7 +58,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { { UseScratchRegisterScope temps(masm()); Register scratch = temps.Acquire(); - __ mov(scratch, Operand(ExternalReference( + __ mov(scratch, Operand(ExternalReference::Create( IsolateAddressId::kCEntryFPAddress, isolate()))); __ str(fp, MemOperand(scratch)); } @@ -95,7 +95,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { // Call Deoptimizer::New(). { AllowExternalCallThatCantCauseGC scope(masm()); - __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); + __ CallCFunction(ExternalReference::new_deoptimizer_function(), 6); } // Preserve "deoptimizer" object in register r0 and get the input @@ -164,8 +164,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { // Call Deoptimizer::ComputeOutputFrames(). { AllowExternalCallThatCantCauseGC scope(masm()); - __ CallCFunction( - ExternalReference::compute_output_frames_function(isolate()), 1); + __ CallCFunction(ExternalReference::compute_output_frames_function(), 1); } __ pop(r0); // Restore deoptimizer object (class Deoptimizer). diff --git a/deps/v8/src/arm/disasm-arm.cc b/deps/v8/src/arm/disasm-arm.cc index 9459a7e60de8..5dab45888962 100644 --- a/deps/v8/src/arm/disasm-arm.cc +++ b/deps/v8/src/arm/disasm-arm.cc @@ -2592,7 +2592,7 @@ int Decoder::ConstantPoolSizeAt(byte* instr_ptr) { // Disassemble the instruction at *instr_ptr into the output buffer. int Decoder::InstructionDecode(byte* instr_ptr) { - Instruction* instr = Instruction::At(instr_ptr); + Instruction* instr = Instruction::At(reinterpret_cast
(instr_ptr)); // Print raw instruction bytes. out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%08x ", diff --git a/deps/v8/src/arm/interface-descriptors-arm.cc b/deps/v8/src/arm/interface-descriptors-arm.cc index 20ecef6c1cc5..a40b323d831f 100644 --- a/deps/v8/src/arm/interface-descriptors-arm.cc +++ b/deps/v8/src/arm/interface-descriptors-arm.cc @@ -34,7 +34,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(kParameterCount, default_stub_registers); } -const Register FastNewFunctionContextDescriptor::FunctionRegister() { +const Register FastNewFunctionContextDescriptor::ScopeInfoRegister() { return r1; } const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r0; } @@ -254,12 +254,6 @@ void BinaryOpDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(arraysize(registers), registers); } -void StringAddDescriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - Register registers[] = {r1, r0}; - data->InitializePlatformSpecific(arraysize(registers), registers); -} - void ArgumentAdaptorDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { static PlatformInterfaceDescriptor default_descriptor = diff --git a/deps/v8/src/arm/macro-assembler-arm.cc b/deps/v8/src/arm/macro-assembler-arm.cc index e363e0ecfe93..5a013da14104 100644 --- a/deps/v8/src/arm/macro-assembler-arm.cc +++ b/deps/v8/src/arm/macro-assembler-arm.cc @@ -11,7 +11,9 @@ #include "src/base/division-by-constant.h" #include "src/base/utils/random-number-generator.h" #include "src/bootstrapper.h" +#include "src/builtins/constants-table-builder.h" #include "src/callable.h" +#include "src/code-factory.h" #include "src/code-stubs.h" #include "src/counters.h" #include "src/debug/debug.h" @@ -22,6 +24,7 @@ #include "src/objects-inl.h" #include "src/register-configuration.h" #include "src/runtime/runtime.h" +#include "src/snapshot/serializer-common.h" #include "src/arm/macro-assembler-arm.h" @@ -30,14 +33,24 @@ namespace internal { MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size, CodeObjectRequired create_code_object) - : TurboAssembler(isolate, buffer, size, create_code_object) {} + : TurboAssembler(isolate, buffer, size, create_code_object) { + if (create_code_object == CodeObjectRequired::kYes) { + // Unlike TurboAssembler, which can be used off the main thread and may not + // allocate, macro assembler creates its own copy of the self-reference + // marker in order to disambiguate between self-references during nested + // code generation (e.g.: codegen of the current object triggers stub + // compilation through CodeStub::GetCode()). + code_object_ = Handle::New( + *isolate->factory()->NewSelfReferenceMarker(), isolate); + } +} TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size, CodeObjectRequired create_code_object) : Assembler(isolate, buffer, buffer_size), isolate_(isolate) { if (create_code_object == CodeObjectRequired::kYes) { - code_object_ = - Handle::New(isolate->heap()->undefined_value(), isolate); + code_object_ = Handle::New( + isolate->heap()->self_reference_marker(), isolate); } } @@ -122,6 +135,74 @@ int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1, return bytes; } +#ifdef V8_EMBEDDED_BUILTINS +void TurboAssembler::LookupConstant(Register destination, + Handle object) { + CHECK(isolate()->ShouldLoadConstantsFromRootList()); + CHECK(root_array_available_); + + // Ensure the given object is in the builtins constants table and fetch its + // index. + BuiltinsConstantsTableBuilder* builder = + isolate()->builtins_constants_table_builder(); + uint32_t index = builder->AddObject(object); + + // TODO(jgruber): Load builtins from the builtins table. + // TODO(jgruber): Ensure that code generation can recognize constant targets + // in kArchCallCodeObject. + + DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant( + Heap::kBuiltinsConstantsTableRootIndex)); + + // The ldr call below could end up clobbering the destination register when + // the offset does not fit into 12 bits (and thus needs to be loaded from the + // constant pool). In that case, we need to be extra-careful and temporarily + // use another register as the target. + + const uint32_t offset = + FixedArray::kHeaderSize + index * kPointerSize - kHeapObjectTag; + const bool could_clobber_ip = !is_uint12(offset) && destination == ip; + + Register reg = destination; + if (could_clobber_ip) { + Push(r7); + reg = r7; + } + + LoadRoot(reg, Heap::kBuiltinsConstantsTableRootIndex); + ldr(destination, MemOperand(reg, offset)); + + if (could_clobber_ip) { + DCHECK_EQ(reg, r7); + Pop(r7); + } +} + +void TurboAssembler::LookupExternalReference(Register destination, + ExternalReference reference) { + CHECK(reference.address() != + ExternalReference::roots_array_start(isolate()).address()); + CHECK(isolate()->ShouldLoadConstantsFromRootList()); + CHECK(root_array_available_); + + // Encode as an index into the external reference table stored on the isolate. + + ExternalReferenceEncoder encoder(isolate()); + ExternalReferenceEncoder::Value v = encoder.Encode(reference.address()); + CHECK(!v.is_from_api()); + uint32_t index = v.index(); + + // Generate code to load from the external reference table. + + int32_t roots_to_external_reference_offset = + Heap::roots_to_external_reference_table_offset() + + ExternalReferenceTable::OffsetOfEntry(index); + + ldr(destination, + MemOperand(kRootRegister, roots_to_external_reference_offset)); +} +#endif // V8_EMBEDDED_BUILTINS + void TurboAssembler::Jump(Register target, Condition cond) { bx(target, cond); } void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode, @@ -133,14 +214,24 @@ void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode, void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond) { DCHECK(!RelocInfo::IsCodeTarget(rmode)); - Jump(reinterpret_cast(target), rmode, cond); + Jump(static_cast(target), rmode, cond); } void TurboAssembler::Jump(Handle code, RelocInfo::Mode rmode, Condition cond) { DCHECK(RelocInfo::IsCodeTarget(rmode)); +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + UseScratchRegisterScope temps(this); + Register scratch = temps.Acquire(); + LookupConstant(scratch, code); + add(scratch, scratch, Operand(Code::kHeaderSize - kHeapObjectTag)); + Jump(scratch, cond); + return; + } +#endif // V8_EMBEDDED_BUILTINS // 'code' is always generated ARM code, never THUMB code - Jump(reinterpret_cast(code.address()), rmode, cond); + Jump(static_cast(code.address()), rmode, cond); } int TurboAssembler::CallSize(Register target, Condition cond) { @@ -159,7 +250,7 @@ void TurboAssembler::Call(Register target, Condition cond) { int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode, Condition cond) { Instr mov_instr = cond | MOV | LeaveCC; - Operand mov_operand = Operand(reinterpret_cast(target), rmode); + Operand mov_operand = Operand(target, rmode); return kInstrSize + mov_operand.InstructionsRequired(this, mov_instr) * kInstrSize; } @@ -203,7 +294,7 @@ void TurboAssembler::Call(Address target, RelocInfo::Mode rmode, Condition cond, // blx ip // @ return address - mov(ip, Operand(reinterpret_cast(target), rmode)); + mov(ip, Operand(target, rmode)); blx(ip, cond); DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start)); @@ -221,6 +312,16 @@ void TurboAssembler::Call(Handle code, RelocInfo::Mode rmode, Condition cond, TargetAddressStorageMode mode, bool check_constant_pool) { DCHECK(RelocInfo::IsCodeTarget(rmode)); +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + // Use ip directly instead of using UseScratchRegisterScope, as we do not + // preserve scratch registers across calls. + LookupConstant(ip, code); + add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); + Call(ip, cond); + return; + } +#endif // V8_EMBEDDED_BUILTINS // 'code' is always generated ARM code, never THUMB code Call(code.address(), rmode, cond, mode); } @@ -261,9 +362,32 @@ void TurboAssembler::Push(Smi* smi) { void TurboAssembler::Move(Register dst, Smi* smi) { mov(dst, Operand(smi)); } void TurboAssembler::Move(Register dst, Handle value) { +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + Heap::RootListIndex root_index; + if (!isolate()->heap()->IsRootHandle(value, &root_index)) { + LookupConstant(dst, value); + } else { + LoadRoot(dst, root_index); + } + return; + } +#endif // V8_EMBEDDED_BUILTINS mov(dst, Operand(value)); } +void TurboAssembler::Move(Register dst, ExternalReference reference) { +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList() && + reference.address() != + ExternalReference::roots_array_start(isolate()).address()) { + LookupExternalReference(dst, reference); + return; + } +#endif // V8_EMBEDDED_BUILTINS + mov(dst, Operand(reference)); +} + void TurboAssembler::Move(Register dst, Register src, Condition cond) { if (dst != src) { mov(dst, src, LeaveCC, cond); @@ -539,8 +663,7 @@ void TurboAssembler::CallRecordWriteStub( Pop(slot_parameter); Pop(object_parameter); - Move(isolate_parameter, - Operand(ExternalReference::isolate_address(isolate()))); + Move(isolate_parameter, ExternalReference::isolate_address(isolate())); Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action)); Move(fp_mode_parameter, Smi::FromEnum(fp_mode)); Call(callable.code(), RelocInfo::CODE_TARGET); @@ -558,10 +681,12 @@ void MacroAssembler::RecordWrite(Register object, Register address, SmiCheck smi_check) { DCHECK(object != value); if (emit_debug_code()) { - UseScratchRegisterScope temps(this); - Register scratch = temps.Acquire(); - ldr(scratch, MemOperand(address)); - cmp(scratch, value); + { + UseScratchRegisterScope temps(this); + Register scratch = temps.Acquire(); + ldr(scratch, MemOperand(address)); + cmp(scratch, value); + } Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite); } @@ -1100,7 +1225,7 @@ void TurboAssembler::EnterFrame(StackFrame::Type type, mov(scratch, Operand(StackFrame::TypeToMarker(type))); PushCommonFrame(scratch); if (type == StackFrame::INTERNAL) { - mov(scratch, Operand(CodeObject())); + Move(scratch, CodeObject()); push(scratch); } } @@ -1137,15 +1262,15 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, mov(scratch, Operand::Zero()); str(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset)); } - mov(scratch, Operand(CodeObject())); + Move(scratch, CodeObject()); str(scratch, MemOperand(fp, ExitFrameConstants::kCodeOffset)); // Save the frame pointer and the context in top. - mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + Move(scratch, ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, + isolate())); str(fp, MemOperand(scratch)); - mov(scratch, - Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); + Move(scratch, + ExternalReference::Create(IsolateAddressId::kContextAddress, isolate())); str(cp, MemOperand(scratch)); // Optionally save all double registers. @@ -1204,18 +1329,18 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, // Clear top frame. mov(r3, Operand::Zero()); - mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + Move(scratch, ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, + isolate())); str(r3, MemOperand(scratch)); // Restore current context from top and clear it in debug mode. - mov(scratch, - Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); + Move(scratch, + ExternalReference::Create(IsolateAddressId::kContextAddress, isolate())); ldr(cp, MemOperand(scratch)); #ifdef DEBUG mov(r3, Operand(Context::kInvalidContext)); - mov(scratch, - Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); + Move(scratch, + ExternalReference::Create(IsolateAddressId::kContextAddress, isolate())); str(r3, MemOperand(scratch)); #endif @@ -1372,14 +1497,21 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, const ParameterCount& actual) { Label skip_hook; - ExternalReference debug_hook_avtive = + ExternalReference debug_hook_active = ExternalReference::debug_hook_on_function_call_address(isolate()); - mov(r4, Operand(debug_hook_avtive)); + Move(r4, debug_hook_active); ldrsb(r4, MemOperand(r4)); cmp(r4, Operand(0)); b(eq, &skip_hook); { + // Load receiver to pass it later to DebugOnFunctionCall hook. + if (actual.is_reg()) { + mov(r4, actual.reg()); + } else { + mov(r4, Operand(actual.immediate())); + } + ldr(r4, MemOperand(sp, r4, LSL, kPointerSizeLog2)); FrameScope frame(this, has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); if (expected.is_reg()) { @@ -1395,6 +1527,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, } Push(fun); Push(fun); + Push(r4); CallRuntime(Runtime::kDebugOnFunctionCall); Pop(fun); if (new_target.is_valid()) { @@ -1494,7 +1627,7 @@ void MacroAssembler::MaybeDropFrames() { // Check whether we need to drop frames to restart a function on the stack. ExternalReference restart_fp = ExternalReference::debug_restart_fp_address(isolate()); - mov(r1, Operand(restart_fp)); + Move(r1, restart_fp); ldr(r1, MemOperand(r1)); tst(r1, r1); Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET, @@ -1508,8 +1641,8 @@ void MacroAssembler::PushStackHandler() { Push(Smi::kZero); // Padding. // Link the current handler as the next handler. - mov(r6, - Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); + mov(r6, Operand(ExternalReference::Create(IsolateAddressId::kHandlerAddress, + isolate()))); ldr(r5, MemOperand(r6)); push(r5); // Set this new handler as the current one. @@ -1522,8 +1655,8 @@ void MacroAssembler::PopStackHandler() { Register scratch = temps.Acquire(); STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); pop(r1); - mov(scratch, - Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate()))); + mov(scratch, Operand(ExternalReference::Create( + IsolateAddressId::kHandlerAddress, isolate()))); str(r1, MemOperand(scratch)); add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); } @@ -1639,8 +1772,9 @@ void TurboAssembler::TryInlineTruncateDoubleToI(Register result, b(lt, done); } -void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result, - DwVfpRegister double_input) { +void TurboAssembler::TruncateDoubleToI(Isolate* isolate, Zone* zone, + Register result, + DwVfpRegister double_input) { Label done; TryInlineTruncateDoubleToI(result, double_input, &done); @@ -1650,7 +1784,8 @@ void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result, sub(sp, sp, Operand(kDoubleSize)); // Put input on stack. vstr(double_input, MemOperand(sp, 0)); - CallStubDelayed(new (zone) DoubleToIStub(nullptr, result)); + Call(BUILTIN_CODE(isolate, DoubleToI), RelocInfo::CODE_TARGET); + ldr(result, MemOperand(sp, 0)); add(sp, sp, Operand(kDoubleSize)); pop(lr); @@ -1666,8 +1801,10 @@ void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid, // should remove this need and make the runtime routine entry code // smarter. mov(r0, Operand(f->nargs)); - mov(r1, Operand(ExternalReference(f, isolate()))); - CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles)); + Move(r1, ExternalReference::Create(f)); + Handle code = + CodeFactory::CEntry(isolate(), f->result_size, save_doubles); + Call(code, RelocInfo::CODE_TARGET); } void MacroAssembler::CallRuntime(const Runtime::Function* f, @@ -1685,9 +1822,10 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // should remove this need and make the runtime routine entry code // smarter. mov(r0, Operand(num_arguments)); - mov(r1, Operand(ExternalReference(f, isolate()))); - CEntryStub stub(isolate(), 1, save_doubles); - CallStub(&stub); + Move(r1, ExternalReference::Create(f)); + Handle code = + CodeFactory::CEntry(isolate(), f->result_size, save_doubles); + Call(code, RelocInfo::CODE_TARGET); } void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { @@ -1700,24 +1838,23 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { // smarter. mov(r0, Operand(function->nargs)); } - JumpToExternalReference(ExternalReference(fid, isolate())); + JumpToExternalReference(ExternalReference::Create(fid)); } void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, bool builtin_exit_frame) { #if defined(__thumb__) // Thumb mode builtin. - DCHECK_EQ(reinterpret_cast(builtin.address()) & 1, 1); + DCHECK_EQ(builtin.address() & 1, 1); #endif - mov(r1, Operand(builtin)); - CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack, - builtin_exit_frame); - Jump(stub.GetCode(), RelocInfo::CODE_TARGET); + Move(r1, builtin); + Handle code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs, + kArgvOnStack, builtin_exit_frame); + Jump(code, RelocInfo::CODE_TARGET); } void MacroAssembler::JumpToInstructionStream(Address entry) { - mov(kOffHeapTrampolineRegister, - Operand(reinterpret_cast(entry), RelocInfo::OFF_HEAP_TARGET)); + mov(kOffHeapTrampolineRegister, Operand(entry, RelocInfo::OFF_HEAP_TARGET)); Jump(kOffHeapTrampolineRegister); } @@ -1733,7 +1870,7 @@ void MacroAssembler::IncrementCounter(StatsCounter* counter, int value, Register scratch1, Register scratch2) { DCHECK_GT(value, 0); if (FLAG_native_code_counters && counter->Enabled()) { - mov(scratch2, Operand(ExternalReference(counter))); + Move(scratch2, ExternalReference::Create(counter)); ldr(scratch1, MemOperand(scratch2)); add(scratch1, scratch1, Operand(value)); str(scratch1, MemOperand(scratch2)); @@ -1745,7 +1882,7 @@ void MacroAssembler::DecrementCounter(StatsCounter* counter, int value, Register scratch1, Register scratch2) { DCHECK_GT(value, 0); if (FLAG_native_code_counters && counter->Enabled()) { - mov(scratch2, Operand(ExternalReference(counter))); + Move(scratch2, ExternalReference::Create(counter)); ldr(scratch1, MemOperand(scratch2)); sub(scratch1, scratch1, Operand(value)); str(scratch1, MemOperand(scratch2)); @@ -1965,7 +2102,7 @@ void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, void TurboAssembler::CheckFor32DRegs(Register scratch) { - mov(scratch, Operand(ExternalReference::cpu_features(isolate()))); + Move(scratch, ExternalReference::cpu_features()); ldr(scratch, MemOperand(scratch)); tst(scratch, Operand(1u << VFP32DREGS)); } @@ -2197,7 +2334,7 @@ void TurboAssembler::CallCFunction(ExternalReference function, int num_double_arguments) { UseScratchRegisterScope temps(this); Register scratch = temps.Acquire(); - mov(scratch, Operand(function)); + Move(scratch, function); CallCFunctionHelper(scratch, num_reg_arguments, num_double_arguments); } diff --git a/deps/v8/src/arm/macro-assembler-arm.h b/deps/v8/src/arm/macro-assembler-arm.h index af8b449de6db..51ef552a921b 100644 --- a/deps/v8/src/arm/macro-assembler-arm.h +++ b/deps/v8/src/arm/macro-assembler-arm.h @@ -28,9 +28,10 @@ constexpr Register kInterpreterDispatchTableRegister = r8; constexpr Register kJavaScriptCallArgCountRegister = r0; constexpr Register kJavaScriptCallCodeStartRegister = r2; constexpr Register kJavaScriptCallNewTargetRegister = r3; -constexpr Register kOffHeapTrampolineRegister = r6; +constexpr Register kOffHeapTrampolineRegister = ip; constexpr Register kRuntimeCallFunctionRegister = r1; constexpr Register kRuntimeCallArgCountRegister = r0; +constexpr Register kWasmInstanceRegister = r3; // ---------------------------------------------------------------------------- // Static helper functions @@ -320,6 +321,12 @@ class TurboAssembler : public Assembler { void AsrPair(Register dst_low, Register dst_high, Register src_low, Register src_high, uint32_t shift); +#ifdef V8_EMBEDDED_BUILTINS + void LookupConstant(Register destination, Handle object); + void LookupExternalReference(Register destination, + ExternalReference reference); +#endif // V8_EMBEDDED_BUILTINS + // Returns the size of a call in instructions. Note, the value returned is // only valid as long as no entries are added to the constant pool between // checking the call size and emitting the actual call. @@ -331,6 +338,7 @@ class TurboAssembler : public Assembler { int CallStubSize(); void CallStubDelayed(CodeStub* stub); + // TODO(jgruber): Remove in favor of MacroAssembler::CallRuntime. void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid, SaveFPRegsMode save_doubles = kDontSaveFPRegs); @@ -465,6 +473,7 @@ class TurboAssembler : public Assembler { // Register move. May do nothing if the registers are identical. void Move(Register dst, Smi* smi); void Move(Register dst, Handle value); + void Move(Register dst, ExternalReference reference); void Move(Register dst, Register src, Condition cond = al); void Move(Register dst, const Operand& src, SBit sbit = LeaveCC, Condition cond = al) { @@ -520,8 +529,8 @@ class TurboAssembler : public Assembler { // Performs a truncating conversion of a floating point number as used by // the JS bitwise operations. See ECMA-262 9.5: ToInt32. // Exits with 'result' holding the answer. - void TruncateDoubleToIDelayed(Zone* zone, Register result, - DwVfpRegister double_input); + void TruncateDoubleToI(Isolate* isolate, Zone* zone, Register result, + DwVfpRegister double_input); // EABI variant for double arguments in use. bool use_eabi_hardfloat() { @@ -540,11 +549,17 @@ class TurboAssembler : public Assembler { void ResetSpeculationPoisonRegister(); + bool root_array_available() const { return root_array_available_; } + void set_root_array_available(bool v) { root_array_available_ = v; } + + protected: + // This handle will be patched with the code object on installation. + Handle code_object_; + private: bool has_frame_ = false; + bool root_array_available_ = true; Isolate* const isolate_; - // This handle will be patched with the code object on installation. - Handle code_object_; // Compare single values and then load the fpscr flags to a register. void VFPCompareAndLoadFlags(const SwVfpRegister src1, diff --git a/deps/v8/src/arm/simulator-arm.cc b/deps/v8/src/arm/simulator-arm.cc index 6a735fcef6f8..e8eb4740900c 100644 --- a/deps/v8/src/arm/simulator-arm.cc +++ b/deps/v8/src/arm/simulator-arm.cc @@ -1666,17 +1666,18 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { case ExternalReference::BUILTIN_FP_FP_CALL: case ExternalReference::BUILTIN_COMPARE_CALL: PrintF("Call to host function at %p with args %f, %f", - static_cast(FUNCTION_ADDR(generic_target)), dval0, - dval1); + reinterpret_cast(FUNCTION_ADDR(generic_target)), + dval0, dval1); break; case ExternalReference::BUILTIN_FP_CALL: PrintF("Call to host function at %p with arg %f", - static_cast(FUNCTION_ADDR(generic_target)), dval0); + reinterpret_cast(FUNCTION_ADDR(generic_target)), + dval0); break; case ExternalReference::BUILTIN_FP_INT_CALL: PrintF("Call to host function at %p with args %f, %d", - static_cast(FUNCTION_ADDR(generic_target)), dval0, - ival); + reinterpret_cast(FUNCTION_ADDR(generic_target)), + dval0, ival); break; default: UNREACHABLE(); @@ -1803,8 +1804,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { PrintF( "Call to host function at %p " "args %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x", - static_cast(FUNCTION_ADDR(target)), arg0, arg1, arg2, arg3, - arg4, arg5, arg6, arg7, arg8); + reinterpret_cast(FUNCTION_ADDR(target)), arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8); if (!stack_aligned) { PrintF(" with unaligned stack %08x\n", get_register(sp)); } @@ -3651,6 +3652,8 @@ int VFPConversionSaturate(double val, bool unsigned_res) { int32_t Simulator::ConvertDoubleToInt(double val, bool unsigned_integer, VFPRoundingMode mode) { + // TODO(jkummerow): These casts are undefined behavior if the integral + // part of {val} does not fit into the destination type. int32_t result = unsigned_integer ? static_cast(val) : static_cast(val); @@ -5731,13 +5734,12 @@ void Simulator::Execute() { } } - -void Simulator::CallInternal(byte* entry) { +void Simulator::CallInternal(Address entry) { // Adjust JS-based stack limit to C-based stack limit. isolate_->stack_guard()->AdjustStackLimitForSimulator(); // Prepare to execute the code at entry - set_register(pc, reinterpret_cast(entry)); + set_register(pc, static_cast(entry)); // Put down marker for end of simulation. The simulator will stop simulation // when the PC reaches this value. By saving the "end simulation" value into // the LR the simulation stops when returning to this call point. @@ -5791,7 +5793,7 @@ void Simulator::CallInternal(byte* entry) { set_register(r11, r11_val); } -intptr_t Simulator::CallImpl(byte* entry, int argument_count, +intptr_t Simulator::CallImpl(Address entry, int argument_count, const intptr_t* arguments) { // Set up arguments @@ -5823,7 +5825,7 @@ intptr_t Simulator::CallImpl(byte* entry, int argument_count, return get_register(r0); } -intptr_t Simulator::CallFPImpl(byte* entry, double d0, double d1) { +intptr_t Simulator::CallFPImpl(Address entry, double d0, double d1) { if (use_eabi_hardfloat()) { set_d_register_from_double(0, d0); set_d_register_from_double(1, d1); diff --git a/deps/v8/src/arm/simulator-arm.h b/deps/v8/src/arm/simulator-arm.h index 46a84ff4b44e..6eb3cf6c6be5 100644 --- a/deps/v8/src/arm/simulator-arm.h +++ b/deps/v8/src/arm/simulator-arm.h @@ -148,9 +148,7 @@ class Simulator : public SimulatorBase { void set_pc(int32_t value); int32_t get_pc() const; - Address get_sp() const { - return reinterpret_cast
(static_cast(get_register(sp))); - } + Address get_sp() const { return static_cast
(get_register(sp)); } // Accessor to the internal simulator stack area. uintptr_t StackLimit(uintptr_t c_limit) const; @@ -159,13 +157,13 @@ class Simulator : public SimulatorBase { void Execute(); template - Return Call(byte* entry, Args... args) { + Return Call(Address entry, Args... args) { return VariadicCall(this, &Simulator::CallImpl, entry, args...); } // Alternative: call a 2-argument double function. template - Return CallFP(byte* entry, double d0, double d1) { + Return CallFP(Address entry, double d0, double d1) { return ConvertReturn(CallFPImpl(entry, d0, d1)); } @@ -212,9 +210,9 @@ class Simulator : public SimulatorBase { end_sim_pc = -2 }; - V8_EXPORT_PRIVATE intptr_t CallImpl(byte* entry, int argument_count, + V8_EXPORT_PRIVATE intptr_t CallImpl(Address entry, int argument_count, const intptr_t* arguments); - intptr_t CallFPImpl(byte* entry, double d0, double d1); + intptr_t CallFPImpl(Address entry, double d0, double d1); // Unsupported instructions use Format to print an error and stop execution. void Format(Instruction* instr, const char* format); @@ -344,7 +342,7 @@ class Simulator : public SimulatorBase { void SetSpecialRegister(SRegisterFieldMask reg_and_mask, uint32_t value); uint32_t GetFromSpecialRegister(SRegister reg); - void CallInternal(byte* entry); + void CallInternal(Address entry); // Architecture state. // Saturating instructions require a Q flag to indicate saturation. diff --git a/deps/v8/src/arm64/assembler-arm64-inl.h b/deps/v8/src/arm64/assembler-arm64-inl.h index 52f552270a7d..0c43fbe0e1ee 100644 --- a/deps/v8/src/arm64/assembler-arm64-inl.h +++ b/deps/v8/src/arm64/assembler-arm64-inl.h @@ -18,12 +18,20 @@ bool CpuFeatures::SupportsOptimizer() { return true; } bool CpuFeatures::SupportsWasmSimd128() { return true; } void RelocInfo::apply(intptr_t delta) { - // On arm64 only internal references need extra work. - DCHECK(RelocInfo::IsInternalReference(rmode_)); - - // Absolute code pointer inside code object moves with the code object. - intptr_t* p = reinterpret_cast(pc_); - *p += delta; // Relocate entry. + // On arm64 only internal references and immediate branches need extra work. + if (RelocInfo::IsInternalReference(rmode_)) { + // Absolute code pointer inside code object moves with the code object. + intptr_t* p = reinterpret_cast(pc_); + *p += delta; // Relocate entry. + } else { + Instruction* instr = reinterpret_cast(pc_); + if (instr->IsBranchAndLink() || instr->IsUnconditionalBranch()) { + Address old_target = + reinterpret_cast
(instr->ImmPCOffsetTarget()); + Address new_target = old_target - delta; + instr->SetBranchImmTarget(reinterpret_cast(new_target)); + } + } } @@ -222,7 +230,7 @@ struct ImmediateInitializer { return RelocInfo::EXTERNAL_REFERENCE; } static inline int64_t immediate_for(ExternalReference t) {; - return reinterpret_cast(t.address()); + return static_cast(t.address()); } }; @@ -348,6 +356,10 @@ int64_t Operand::ImmediateValue() const { return immediate_.value(); } +RelocInfo::Mode Operand::ImmediateRMode() const { + DCHECK(IsImmediate() || IsHeapObjectRequest()); + return immediate_.rmode(); +} Register Operand::reg() const { DCHECK(IsShiftedRegister() || IsExtendedRegister()); @@ -523,9 +535,39 @@ Address Assembler::target_pointer_address_at(Address pc) { // Read/Modify the code target address in the branch/call instruction at pc. Address Assembler::target_address_at(Address pc, Address constant_pool) { - return Memory::Address_at(target_pointer_address_at(pc)); + Instruction* instr = reinterpret_cast(pc); + if (instr->IsLdrLiteralX()) { + return Memory::Address_at(target_pointer_address_at(pc)); + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + return reinterpret_cast
(instr->ImmPCOffsetTarget()); + } } +Handle Assembler::code_target_object_handle_at(Address pc) { + Instruction* instr = reinterpret_cast(pc); + if (instr->IsLdrLiteralX()) { + return Handle(reinterpret_cast( + Assembler::target_address_at(pc, 0 /* unused */))); + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + DCHECK_GE(instr->ImmPCOffset(), 0); + DCHECK_EQ(instr->ImmPCOffset() % kInstructionSize, 0); + DCHECK_LT(instr->ImmPCOffset() >> kInstructionSizeLog2, + code_targets_.size()); + return code_targets_[instr->ImmPCOffset() >> kInstructionSizeLog2]; + } +} + +Address Assembler::runtime_entry_at(Address pc) { + Instruction* instr = reinterpret_cast(pc); + if (instr->IsLdrLiteralX()) { + return Assembler::target_address_at(pc, 0 /* unused */); + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + return instr->ImmPCOffset() + isolate_data().code_range_start_; + } +} Address Assembler::target_address_from_return_address(Address pc) { // Returns the address of the call target from the return address that will @@ -540,45 +582,37 @@ Address Assembler::target_address_from_return_address(Address pc) { return candidate; } - -Address Assembler::return_address_from_call_start(Address pc) { - // The call, generated by MacroAssembler::Call, is one of two possible - // sequences: - // - // Without relocation: - // movz temp, #(target & 0x000000000000ffff) - // movk temp, #(target & 0x00000000ffff0000) - // movk temp, #(target & 0x0000ffff00000000) - // blr temp - // - // With relocation: - // ldr temp, =target - // blr temp - // - // The return address is immediately after the blr instruction in both cases, - // so it can be found by adding the call size to the address at the start of - // the call sequence. - STATIC_ASSERT(Assembler::kCallSizeWithoutRelocation == 4 * kInstructionSize); - STATIC_ASSERT(Assembler::kCallSizeWithRelocation == 2 * kInstructionSize); - - Instruction* instr = reinterpret_cast(pc); - if (instr->IsMovz()) { - // Verify the instruction sequence. - DCHECK(instr->following(1)->IsMovk()); - DCHECK(instr->following(2)->IsMovk()); - DCHECK(instr->following(3)->IsBranchAndLinkToRegister()); - return pc + Assembler::kCallSizeWithoutRelocation; +int Assembler::deserialization_special_target_size(Address location) { + Instruction* instr = reinterpret_cast(location); + if (instr->IsBranchAndLink() || instr->IsUnconditionalBranch()) { + return kSpecialTargetSize; } else { - // Verify the instruction sequence. - DCHECK(instr->IsLdrLiteralX()); - DCHECK(instr->following(1)->IsBranchAndLinkToRegister()); - return pc + Assembler::kCallSizeWithRelocation; + DCHECK_EQ(instr->InstructionBits(), 0); + return kPointerSize; } } -void Assembler::deserialization_set_special_target_at( - Address constant_pool_entry, Code* code, Address target) { - Memory::Address_at(constant_pool_entry) = target; +void Assembler::deserialization_set_special_target_at(Address location, + Code* code, + Address target) { + Instruction* instr = reinterpret_cast(location); + if (instr->IsBranchAndLink() || instr->IsUnconditionalBranch()) { + if (target == 0) { + // We are simply wiping the target out for serialization. Set the offset + // to zero instead. + target = location; + } + instr->SetBranchImmTarget(reinterpret_cast(target)); + Assembler::FlushICache(location, kInstructionSize); + } else { + DCHECK_EQ(instr->InstructionBits(), 0); + Memory::Address_at(location) = target; + // Intuitively, we would think it is necessary to always flush the + // instruction cache after patching a target address in the code. However, + // in this case, only the constant pool contents change. The instruction + // accessing the constant pool remains unchanged, so a flush is not + // required. + } } void Assembler::deserialization_set_target_internal_reference_at( @@ -589,20 +623,35 @@ void Assembler::deserialization_set_target_internal_reference_at( void Assembler::set_target_address_at(Address pc, Address constant_pool, Address target, ICacheFlushMode icache_flush_mode) { - Memory::Address_at(target_pointer_address_at(pc)) = target; - // Intuitively, we would think it is necessary to always flush the - // instruction cache after patching a target address in the code as follows: - // Assembler::FlushICache(pc, sizeof(target)); - // However, on ARM, an instruction is actually patched in the case of - // embedded constants of the form: - // ldr ip, [pc, #...] - // since the instruction accessing this address in the constant pool remains - // unchanged, a flush is not required. + Instruction* instr = reinterpret_cast(pc); + if (instr->IsLdrLiteralX()) { + Memory::Address_at(target_pointer_address_at(pc)) = target; + // Intuitively, we would think it is necessary to always flush the + // instruction cache after patching a target address in the code. However, + // in this case, only the constant pool contents change. The instruction + // accessing the constant pool remains unchanged, so a flush is not + // required. + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + if (target == 0) { + // We are simply wiping the target out for serialization. Set the offset + // to zero instead. + target = pc; + } + instr->SetBranchImmTarget(reinterpret_cast(target)); + if (icache_flush_mode != SKIP_ICACHE_FLUSH) { + Assembler::FlushICache(pc, kInstructionSize); + } + } } - int RelocInfo::target_address_size() { - return kPointerSize; + if (IsCodedSpecially()) { + return Assembler::kSpecialTargetSize; + } else { + DCHECK(reinterpret_cast(pc_)->IsLdrLiteralX()); + return kPointerSize; + } } @@ -615,7 +664,26 @@ Address RelocInfo::target_address_address() { DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) || IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) || IsOffHeapTarget(rmode_)); - return Assembler::target_pointer_address_at(pc_); + Instruction* instr = reinterpret_cast(pc_); + // Read the address of the word containing the target_address in an + // instruction stream. + // The only architecture-independent user of this function is the serializer. + // The serializer uses it to find out how many raw bytes of instruction to + // output before the next target. + // For an instruction like B/BL, where the target bits are mixed into the + // instruction bits, the size of the target will be zero, indicating that the + // serializer should not step forward in memory after a target is resolved + // and written. + // For LDR literal instructions, we can skip up to the constant pool entry + // address. We make sure that RelocInfo is ordered by the + // target_address_address so that we do not skip over any relocatable + // instruction sequences. + if (instr->IsLdrLiteralX()) { + return constant_pool_entry_address(); + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + return reinterpret_cast
(pc_); + } } @@ -631,9 +699,13 @@ HeapObject* RelocInfo::target_object() { } Handle RelocInfo::target_object_handle(Assembler* origin) { - DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); - return Handle(reinterpret_cast( - Assembler::target_address_at(pc_, constant_pool_))); + if (rmode_ == EMBEDDED_OBJECT) { + return Handle(reinterpret_cast( + Assembler::target_address_at(pc_, constant_pool_))); + } else { + DCHECK(IsCodeTarget(rmode_)); + return origin->code_target_object_handle_at(pc_); + } } void RelocInfo::set_target_object(HeapObject* target, @@ -671,7 +743,7 @@ Address RelocInfo::target_internal_reference() { Address RelocInfo::target_internal_reference_address() { DCHECK(rmode_ == INTERNAL_REFERENCE); - return reinterpret_cast
(pc_); + return pc_; } void RelocInfo::set_wasm_code_table_entry(Address target, @@ -683,7 +755,7 @@ void RelocInfo::set_wasm_code_table_entry(Address target, Address RelocInfo::target_runtime_entry(Assembler* origin) { DCHECK(IsRuntimeEntry(rmode_)); - return target_address(); + return origin->runtime_entry_at(pc_); } void RelocInfo::set_target_runtime_entry(Address target, @@ -705,9 +777,9 @@ void RelocInfo::WipeOut() { IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || IsInternalReference(rmode_)); if (IsInternalReference(rmode_)) { - Memory::Address_at(pc_) = nullptr; + Memory::Address_at(pc_) = kNullAddress; } else { - Assembler::set_target_address_at(pc_, constant_pool_, nullptr); + Assembler::set_target_address_at(pc_, constant_pool_, kNullAddress); } } diff --git a/deps/v8/src/arm64/assembler-arm64.cc b/deps/v8/src/arm64/assembler-arm64.cc index fe81147d768a..121c15aac9ca 100644 --- a/deps/v8/src/arm64/assembler-arm64.cc +++ b/deps/v8/src/arm64/assembler-arm64.cc @@ -157,14 +157,20 @@ CPURegList CPURegList::GetSafepointSavedRegisters() { // ----------------------------------------------------------------------------- // Implementation of RelocInfo -const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE; - +const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | + 1 << RelocInfo::RUNTIME_ENTRY | + 1 << RelocInfo::INTERNAL_REFERENCE; bool RelocInfo::IsCodedSpecially() { // The deserializer needs to know whether a pointer is specially coded. Being - // specially coded on ARM64 means that it is a movz/movk sequence. We don't - // generate those for relocatable pointers. - return false; + // specially coded on ARM64 means that it is an immediate branch. + Instruction* instr = reinterpret_cast(pc_); + if (instr->IsLdrLiteralX()) { + return false; + } else { + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + return true; + } } @@ -174,7 +180,7 @@ bool RelocInfo::IsInConstantPool() { } Address RelocInfo::embedded_address() const { - return Memory::Address_at(Assembler::target_pointer_address_at(pc_)); + return Assembler::target_address_at(pc_, constant_pool_); } uint32_t RelocInfo::embedded_size() const { @@ -290,7 +296,7 @@ bool AreConsecutive(const VRegister& reg1, const VRegister& reg2, } void Immediate::InitializeHandle(Handle handle) { - value_ = reinterpret_cast(handle.address()); + value_ = static_cast(handle.address()); rmode_ = RelocInfo::EMBEDDED_OBJECT; } @@ -570,8 +576,8 @@ void Assembler::Reset() { memset(buffer_, 0, pc_ - buffer_); #endif pc_ = buffer_; - reloc_info_writer.Reposition(reinterpret_cast(buffer_ + buffer_size_), - reinterpret_cast(pc_)); + code_targets_.reserve(64); + reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); constpool_.Clear(); next_constant_pool_check_ = 0; next_veneer_pool_check_ = kMaxInt; @@ -580,19 +586,27 @@ void Assembler::Reset() { void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) { for (auto& request : heap_object_requests_) { - Handle object; + Address pc = reinterpret_cast
(buffer_) + request.offset(); switch (request.kind()) { - case HeapObjectRequest::kHeapNumber: - object = isolate->factory()->NewHeapNumber(request.heap_number(), - IMMUTABLE, TENURED); + case HeapObjectRequest::kHeapNumber: { + Handle object = isolate->factory()->NewHeapNumber( + request.heap_number(), IMMUTABLE, TENURED); + set_target_address_at(pc, 0 /* unused */, object.address()); break; - case HeapObjectRequest::kCodeStub: + } + case HeapObjectRequest::kCodeStub: { request.code_stub()->set_isolate(isolate); - object = request.code_stub()->GetCode(); + Instruction* instr = reinterpret_cast(pc); + DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch()); + DCHECK_GE(instr->ImmPCOffset(), 0); + DCHECK_EQ(instr->ImmPCOffset() % kInstructionSize, 0); + DCHECK_LT(instr->ImmPCOffset() >> kInstructionSizeLog2, + code_targets_.size()); + code_targets_[instr->ImmPCOffset() >> kInstructionSizeLog2] = + request.code_stub()->GetCode(); break; + } } - Address pc = buffer_ + request.offset(); - Memory::Address_at(target_pointer_address_at(pc)) = object.address(); } } @@ -4722,7 +4736,7 @@ void Assembler::GrowBuffer() { DeleteArray(buffer_); buffer_ = desc.buffer; buffer_size_ = desc.buffer_size; - pc_ = reinterpret_cast(pc_) + pc_delta; + pc_ = pc_ + pc_delta; reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta, reloc_info_writer.last_pc() + pc_delta); @@ -4739,13 +4753,13 @@ void Assembler::GrowBuffer() { // Pending relocation entries are also relative, no need to relocate. } - -void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { +void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data, + ConstantPoolMode constant_pool_mode) { // Non-relocatable constants should not end up in the literal pool. DCHECK(!RelocInfo::IsNone(rmode)); // We do not try to reuse pool constants. - RelocInfo rinfo(reinterpret_cast(pc_), rmode, data, nullptr); + RelocInfo rinfo(reinterpret_cast
(pc_), rmode, data, nullptr); bool write_reloc_info = true; if ((rmode == RelocInfo::COMMENT) || @@ -4760,12 +4774,14 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { RelocInfo::IsInternalReference(rmode) || RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode)); // These modes do not need an entry in the constant pool. - } else { + } else if (constant_pool_mode == NEEDS_POOL_ENTRY) { write_reloc_info = constpool_.RecordEntry(data, rmode); // Make sure the constant pool is not emitted in place of the next // instruction for which we just recorded relocation info. BlockConstPoolFor(1); } + // For modes that cannot use the constant pool, a different sequence of + // instructions will be emitted by this function's caller. if (!RelocInfo::IsNone(rmode) && write_reloc_info) { // Don't record external references unless the heap will be serialized. @@ -4778,6 +4794,34 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { } } +int Assembler::GetCodeTargetIndex(Handle target) { + int current = static_cast(code_targets_.size()); + if (current > 0 && !target.is_null() && + code_targets_.back().address() == target.address()) { + // Optimization if we keep jumping to the same code target. + return (current - 1); + } else { + code_targets_.push_back(target); + return current; + } +} + +void Assembler::near_jump(int offset, RelocInfo::Mode rmode) { + if (!RelocInfo::IsNone(rmode)) RecordRelocInfo(rmode, offset, NO_POOL_ENTRY); + b(offset); +} + +void Assembler::near_call(int offset, RelocInfo::Mode rmode) { + if (!RelocInfo::IsNone(rmode)) RecordRelocInfo(rmode, offset, NO_POOL_ENTRY); + bl(offset); +} + +void Assembler::near_call(HeapObjectRequest request) { + RequestHeapObject(request); + int index = GetCodeTargetIndex(Handle()); + RecordRelocInfo(RelocInfo::CODE_TARGET, index, NO_POOL_ENTRY); + bl(index); +} void Assembler::BlockConstPoolFor(int instructions) { int pc_limit = pc_offset() + instructions * kInstructionSize; @@ -4858,8 +4902,8 @@ bool Assembler::ShouldEmitVeneer(int max_reachable_pc, int margin) { void Assembler::RecordVeneerPool(int location_offset, int size) { - RelocInfo rinfo(buffer_ + location_offset, RelocInfo::VENEER_POOL, - static_cast(size), nullptr); + RelocInfo rinfo(reinterpret_cast
(buffer_) + location_offset, + RelocInfo::VENEER_POOL, static_cast(size), nullptr); reloc_info_writer.Write(&rinfo); } @@ -4965,8 +5009,7 @@ void Assembler::CheckVeneerPool(bool force_emit, bool require_jump, int Assembler::buffer_space() const { - return static_cast(reloc_info_writer.pos() - - reinterpret_cast(pc_)); + return static_cast(reloc_info_writer.pos() - pc_); } @@ -5009,6 +5052,15 @@ void PatchingAssembler::PatchAdrFar(int64_t target_offset) { add(rd, rd, scratch); } +void PatchingAssembler::PatchSubSp(uint32_t immediate) { + // The code at the current instruction should be: + // sub sp, sp, #0 + + // Verify the expected code. + Instruction* expected_adr = InstructionAt(0); + CHECK(expected_adr->IsAddSubImmediate()); + sub(sp, sp, immediate); +} } // namespace internal } // namespace v8 diff --git a/deps/v8/src/arm64/assembler-arm64.h b/deps/v8/src/arm64/assembler-arm64.h index 94122e393911..431b52081128 100644 --- a/deps/v8/src/arm64/assembler-arm64.h +++ b/deps/v8/src/arm64/assembler-arm64.h @@ -124,10 +124,6 @@ class CPURegister : public RegisterBase { } RegisterType type() const { return reg_type_; } - RegList bit() const { - DCHECK(static_cast(reg_code_) < (sizeof(RegList) * kBitsPerByte)); - return IsValid() ? 1UL << reg_code_ : 0; - } int SizeInBits() const { DCHECK(IsValid()); return reg_size_; @@ -445,7 +441,7 @@ ALIAS_REGISTER(Register, ip1, x17); ALIAS_REGISTER(Register, wip0, w16); ALIAS_REGISTER(Register, wip1, w17); // Root register. -ALIAS_REGISTER(Register, root, x26); +ALIAS_REGISTER(Register, kRootRegister, x26); ALIAS_REGISTER(Register, rr, x26); // Context pointer register. ALIAS_REGISTER(Register, cp, x27); @@ -485,14 +481,11 @@ bool AreAliased(const CPURegister& reg1, // same size, and are of the same type. The system stack pointer may be // specified. Arguments set to NoReg are ignored, as are any subsequent // arguments. At least one argument (reg1) must be valid (not NoCPUReg). -bool AreSameSizeAndType(const CPURegister& reg1, - const CPURegister& reg2, - const CPURegister& reg3 = NoCPUReg, - const CPURegister& reg4 = NoCPUReg, - const CPURegister& reg5 = NoCPUReg, - const CPURegister& reg6 = NoCPUReg, - const CPURegister& reg7 = NoCPUReg, - const CPURegister& reg8 = NoCPUReg); +bool AreSameSizeAndType( + const CPURegister& reg1, const CPURegister& reg2 = NoCPUReg, + const CPURegister& reg3 = NoCPUReg, const CPURegister& reg4 = NoCPUReg, + const CPURegister& reg5 = NoCPUReg, const CPURegister& reg6 = NoCPUReg, + const CPURegister& reg7 = NoCPUReg, const CPURegister& reg8 = NoCPUReg); // AreSameFormat returns true if all of the specified VRegisters have the same // vector format. Arguments set to NoVReg are ignored, as are any subsequent @@ -517,12 +510,12 @@ typedef VRegister Simd128Register; // Lists of registers. class CPURegList { public: - explicit CPURegList(CPURegister reg1, CPURegister reg2 = NoCPUReg, - CPURegister reg3 = NoCPUReg, CPURegister reg4 = NoCPUReg) - : list_(reg1.bit() | reg2.bit() | reg3.bit() | reg4.bit()), - size_(reg1.SizeInBits()), - type_(reg1.type()) { - DCHECK(AreSameSizeAndType(reg1, reg2, reg3, reg4)); + template + explicit CPURegList(CPURegister reg0, CPURegisters... regs) + : list_(CPURegister::ListOf(reg0, regs...)), + size_(reg0.SizeInBits()), + type_(reg0.type()) { + DCHECK(AreSameSizeAndType(reg0, regs...)); DCHECK(IsValid()); } @@ -646,8 +639,8 @@ class CPURegList { CPURegister::RegisterType type_; bool IsValid() const { - const RegList kValidRegisters = 0x8000000ffffffff; - const RegList kValidVRegisters = 0x0000000ffffffff; + constexpr RegList kValidRegisters{0x8000000ffffffff}; + constexpr RegList kValidVRegisters{0x0000000ffffffff}; switch (type_) { case CPURegister::kRegister: return (list_ & kValidRegisters) == list_; @@ -751,6 +744,7 @@ class Operand { inline Immediate immediate() const; inline int64_t ImmediateValue() const; + inline RelocInfo::Mode ImmediateRMode() const; inline Register reg() const; inline Shift shift() const; inline Extend extend() const; @@ -950,7 +944,22 @@ class Assembler : public AssemblerBase { // RelocInfo and pools ------------------------------------------------------ // Record relocation information for current pc_. - void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); + enum ConstantPoolMode { NEEDS_POOL_ENTRY, NO_POOL_ENTRY }; + void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0, + ConstantPoolMode constant_pool_mode = NEEDS_POOL_ENTRY); + + // Generate a B immediate instruction with the corresponding relocation info. + // 'offset' is the immediate to encode in the B instruction (so it is the + // difference between the target and the PC of the instruction, divided by + // the instruction size). + void near_jump(int offset, RelocInfo::Mode rmode); + // Generate a BL immediate instruction with the corresponding relocation info. + // As for near_jump, 'offset' is the immediate to encode in the BL + // instruction. + void near_call(int offset, RelocInfo::Mode rmode); + // Generate a BL immediate instruction with the corresponding relocation info + // for the input HeapObjectRequest. + void near_call(HeapObjectRequest request); // Return the address in the constant pool of the code target address used by // the branch/call instruction at pc. @@ -963,42 +972,59 @@ class Assembler : public AssemblerBase { Address pc, Address constant_pool, Address target, ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); + // Add 'target' to the code_targets_ vector, if necessary, and return the + // offset at which it is stored. + int GetCodeTargetIndex(Handle target); + + // Returns the handle for the code object called at 'pc'. + // This might need to be temporarily encoded as an offset into code_targets_. + inline Handle code_target_object_handle_at(Address pc); + + // Returns the target address for a runtime function for the call encoded + // at 'pc'. + // Runtime entries can be temporarily encoded as the offset between the + // runtime function entrypoint and the code range start (stored in the + // code_range_start_ field), in order to be encodable as we generate the code, + // before it is moved into the code space. + inline Address runtime_entry_at(Address pc); + // Return the code target address at a call site from the return address of // that call in the instruction stream. inline static Address target_address_from_return_address(Address pc); - // Given the address of the beginning of a call, return the address in the - // instruction stream that call will return from. - inline static Address return_address_from_call_start(Address pc); - - // This sets the branch destination (which is in the constant pool on ARM). + // This sets the branch destination. 'location' here can be either the pc of + // an immediate branch or the address of an entry in the constant pool. // This is for calls and branches within generated code. - inline static void deserialization_set_special_target_at( - Address constant_pool_entry, Code* code, Address target); + inline static void deserialization_set_special_target_at(Address location, + Code* code, + Address target); + + // Get the size of the special target encoded at 'location'. + inline static int deserialization_special_target_size(Address location); // This sets the internal reference at the pc. inline static void deserialization_set_target_internal_reference_at( Address pc, Address target, RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); - // All addresses in the constant pool are the same size as pointers. - static constexpr int kSpecialTargetSize = kPointerSize; + // This value is used in the serialization process and must be zero for + // ARM64, as the code target is split across multiple instructions and does + // not exist separately in the code, so the serializer should not step + // forwards in memory after a target is resolved and written. + static constexpr int kSpecialTargetSize = 0; // The sizes of the call sequences emitted by MacroAssembler::Call. // Wherever possible, use MacroAssembler::CallSize instead of these constants, // as it will choose the correct value for a given relocation mode. // - // Without relocation: - // movz temp, #(target & 0x000000000000ffff) - // movk temp, #(target & 0x00000000ffff0000) - // movk temp, #(target & 0x0000ffff00000000) - // blr temp + // A "near" call is encoded in a BL immediate instruction: + // bl target // - // With relocation: - // ldr temp, =target - // blr temp - static constexpr int kCallSizeWithoutRelocation = 4 * kInstructionSize; - static constexpr int kCallSizeWithRelocation = 2 * kInstructionSize; + // whereas a "far" call will be encoded like this: + // ldr temp, =target + // blr temp + static constexpr int kNearCallSize = 1 * kInstructionSize; + static constexpr int kFarCallSize = 2 * kInstructionSize; // Size of the generated code in bytes uint64_t SizeOfGeneratedCode() const { @@ -1021,7 +1047,7 @@ class Assembler : public AssemblerBase { // change things to be consistent. void AssertSizeOfCodeGeneratedSince(const Label* label, ptrdiff_t size) { DCHECK_GE(size, 0); - DCHECK(static_cast(size) == SizeOfCodeGeneratedSince(label)); + DCHECK_EQ(static_cast(size), SizeOfCodeGeneratedSince(label)); } // Return the number of instructions generated from label to the @@ -3431,8 +3457,6 @@ class Assembler : public AssemblerBase { // Verify that a label's link chain is intact. void CheckLabelLinkChain(Label const * label); - void RecordLiteral(int64_t imm, unsigned size); - // Postpone the generation of the constant pool for the specified number of // instructions. void BlockConstPoolFor(int instructions); @@ -3522,6 +3546,14 @@ class Assembler : public AssemblerBase { // are already bound. std::deque internal_reference_positions_; + // Before we copy code into the code space, we cannot encode calls to code + // targets as we normally would, as the difference between the instruction's + // location in the temporary buffer and the call target is not guaranteed to + // fit in the offset field. We keep track of the code handles we encounter + // in calls in this vector, and encode the index of the code handle in the + // vector instead. + std::vector> code_targets_; + // Relocation info records are also used during code generation as temporary // containers for constants and code target addresses until they are emitted // to the constant pool. These pending relocation info records are temporarily @@ -3666,6 +3698,7 @@ class PatchingAssembler : public Assembler { static constexpr int kAdrFarPatchableNNops = 2; static constexpr int kAdrFarPatchableNInstrs = kAdrFarPatchableNNops + 2; void PatchAdrFar(int64_t target_offset); + void PatchSubSp(uint32_t immediate); }; diff --git a/deps/v8/src/arm64/code-stubs-arm64.cc b/deps/v8/src/arm64/code-stubs-arm64.cc index c1cb3025a1fc..cca4c302696e 100644 --- a/deps/v8/src/arm64/code-stubs-arm64.cc +++ b/deps/v8/src/arm64/code-stubs-arm64.cc @@ -16,6 +16,7 @@ #include "src/ic/ic.h" #include "src/ic/stub-cache.h" #include "src/isolate.h" +#include "src/objects/api-callbacks.h" #include "src/objects/regexp-match-info.h" #include "src/regexp/jsregexp.h" #include "src/regexp/regexp-macro-assembler.h" @@ -36,437 +37,13 @@ void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) { __ TailCallRuntime(Runtime::kNewArray); } - -void DoubleToIStub::Generate(MacroAssembler* masm) { - Label done; - Register result = destination(); - - DCHECK(result.Is64Bits()); - - UseScratchRegisterScope temps(masm); - Register scratch1 = temps.AcquireX(); - Register scratch2 = temps.AcquireX(); - DoubleRegister double_scratch = temps.AcquireD(); - - __ Peek(double_scratch, 0); - // Try to convert with a FPU convert instruction. This handles all - // non-saturating cases. - __ TryConvertDoubleToInt64(result, double_scratch, &done); - __ Fmov(result, double_scratch); - - // If we reach here we need to manually convert the input to an int32. - - // Extract the exponent. - Register exponent = scratch1; - __ Ubfx(exponent, result, HeapNumber::kMantissaBits, - HeapNumber::kExponentBits); - - // It the exponent is >= 84 (kMantissaBits + 32), the result is always 0 since - // the mantissa gets shifted completely out of the int32_t result. - __ Cmp(exponent, HeapNumber::kExponentBias + HeapNumber::kMantissaBits + 32); - __ CzeroX(result, ge); - __ B(ge, &done); - - // The Fcvtzs sequence handles all cases except where the conversion causes - // signed overflow in the int64_t target. Since we've already handled - // exponents >= 84, we can guarantee that 63 <= exponent < 84. - - if (masm->emit_debug_code()) { - __ Cmp(exponent, HeapNumber::kExponentBias + 63); - // Exponents less than this should have been handled by the Fcvt case. - __ Check(ge, AbortReason::kUnexpectedValue); - } - - // Isolate the mantissa bits, and set the implicit '1'. - Register mantissa = scratch2; - __ Ubfx(mantissa, result, 0, HeapNumber::kMantissaBits); - __ Orr(mantissa, mantissa, 1UL << HeapNumber::kMantissaBits); - - // Negate the mantissa if necessary. - __ Tst(result, kXSignMask); - __ Cneg(mantissa, mantissa, ne); - - // Shift the mantissa bits in the correct place. We know that we have to shift - // it left here, because exponent >= 63 >= kMantissaBits. - __ Sub(exponent, exponent, - HeapNumber::kExponentBias + HeapNumber::kMantissaBits); - __ Lsl(result, mantissa, exponent); - - __ Bind(&done); - __ Ret(); -} - - -void MathPowStub::Generate(MacroAssembler* masm) { - // Stack on entry: - // sp[0]: Exponent (as a tagged value). - // sp[1]: Base (as a tagged value). - // - // The (tagged) result will be returned in x0, as a heap number. - - Register exponent_tagged = MathPowTaggedDescriptor::exponent(); - DCHECK(exponent_tagged.is(x11)); - Register exponent_integer = MathPowIntegerDescriptor::exponent(); - DCHECK(exponent_integer.is(x12)); - Register saved_lr = x19; - VRegister result_double = d0; - VRegister base_double = d0; - VRegister exponent_double = d1; - VRegister base_double_copy = d2; - VRegister scratch1_double = d6; - VRegister scratch0_double = d7; - - // A fast-path for integer exponents. - Label exponent_is_smi, exponent_is_integer; - // Allocate a heap number for the result, and return it. - Label done; - - // Unpack the inputs. - - // Handle double (heap number) exponents. - // Detect integer exponents stored as doubles and handle those in the - // integer fast-path. - __ TryRepresentDoubleAsInt64(exponent_integer, exponent_double, - scratch0_double, &exponent_is_integer); - - { - AllowExternalCallThatCantCauseGC scope(masm); - __ Mov(saved_lr, lr); - __ CallCFunction(ExternalReference::power_double_double_function(isolate()), - 0, 2); - __ Mov(lr, saved_lr); - __ B(&done); - } - - // Handle SMI exponents. - __ Bind(&exponent_is_smi); - // x10 base_tagged The tagged base (input). - // x11 exponent_tagged The tagged exponent (input). - // d1 base_double The base as a double. - __ SmiUntag(exponent_integer, exponent_tagged); - - __ Bind(&exponent_is_integer); - // x10 base_tagged The tagged base (input). - // x11 exponent_tagged The tagged exponent (input). - // x12 exponent_integer The exponent as an integer. - // d1 base_double The base as a double. - - // Find abs(exponent). For negative exponents, we can find the inverse later. - Register exponent_abs = x13; - __ Cmp(exponent_integer, 0); - __ Cneg(exponent_abs, exponent_integer, mi); - // x13 exponent_abs The value of abs(exponent_integer). - - // Repeatedly multiply to calculate the power. - // result = 1.0; - // For each bit n (exponent_integer{n}) { - // if (exponent_integer{n}) { - // result *= base; - // } - // base *= base; - // if (remaining bits in exponent_integer are all zero) { - // break; - // } - // } - Label power_loop, power_loop_entry, power_loop_exit; - __ Fmov(scratch1_double, base_double); - __ Fmov(base_double_copy, base_double); - __ Fmov(result_double, 1.0); - __ B(&power_loop_entry); - - __ Bind(&power_loop); - __ Fmul(scratch1_double, scratch1_double, scratch1_double); - __ Lsr(exponent_abs, exponent_abs, 1); - __ Cbz(exponent_abs, &power_loop_exit); - - __ Bind(&power_loop_entry); - __ Tbz(exponent_abs, 0, &power_loop); - __ Fmul(result_double, result_double, scratch1_double); - __ B(&power_loop); - - __ Bind(&power_loop_exit); - - // If the exponent was positive, result_double holds the result. - __ Tbz(exponent_integer, kXSignBit, &done); - - // The exponent was negative, so find the inverse. - __ Fmov(scratch0_double, 1.0); - __ Fdiv(result_double, scratch0_double, result_double); - // ECMA-262 only requires Math.pow to return an 'implementation-dependent - // approximation' of base^exponent. However, mjsunit/math-pow uses Math.pow - // to calculate the subnormal value 2^-1074. This method of calculating - // negative powers doesn't work because 2^1074 overflows to infinity. To - // catch this corner-case, we bail out if the result was 0. (This can only - // occur if the divisor is infinity or the base is zero.) - __ Fcmp(result_double, 0.0); - __ B(&done, ne); - - AllowExternalCallThatCantCauseGC scope(masm); - __ Mov(saved_lr, lr); - __ Fmov(base_double, base_double_copy); - __ Scvtf(exponent_double, exponent_integer); - __ CallCFunction(ExternalReference::power_double_double_function(isolate()), - 0, 2); - __ Mov(lr, saved_lr); - __ Bind(&done); - __ Ret(); -} - void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { // It is important that the following stubs are generated in this order // because pregenerated stubs can only call other pregenerated stubs. - CEntryStub::GenerateAheadOfTime(isolate); CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate); StoreFastElementStub::GenerateAheadOfTime(isolate); } - -void CodeStub::GenerateFPStubs(Isolate* isolate) { - // Floating-point code doesn't get special handling in ARM64, so there's - // nothing to do here. - USE(isolate); -} - -Movability CEntryStub::NeedsImmovableCode() { - // CEntryStub stores the return address on the stack before calling into - // C++ code. In some cases, the VM accesses this address, but it is not used - // when the C++ code returns to the stub because LR holds the return address - // in AAPCS64. If the stub is moved (perhaps during a GC), we could end up - // returning to dead code. - // TODO(jbramley): Whilst this is the only analysis that makes sense, I can't - // find any comment to confirm this, and I don't hit any crashes whatever - // this function returns. The anaylsis should be properly confirmed. - return kImmovable; -} - - -void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { - CEntryStub stub(isolate, 1, kDontSaveFPRegs); - stub.GetCode(); - CEntryStub stub_fp(isolate, 1, kSaveFPRegs); - stub_fp.GetCode(); -} - - -void CEntryStub::Generate(MacroAssembler* masm) { - // The Abort mechanism relies on CallRuntime, which in turn relies on - // CEntryStub, so until this stub has been generated, we have to use a - // fall-back Abort mechanism. - // - // Note that this stub must be generated before any use of Abort. - MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); - - ASM_LOCATION("CEntryStub::Generate entry"); - ProfileEntryHookStub::MaybeCallEntryHook(masm); - - // Register parameters: - // x0: argc (including receiver, untagged) - // x1: target - // If argv_in_register(): - // x11: argv (pointer to first argument) - // - // The stack on entry holds the arguments and the receiver, with the receiver - // at the highest address: - // - // sp]argc-1]: receiver - // sp[argc-2]: arg[argc-2] - // ... ... - // sp[1]: arg[1] - // sp[0]: arg[0] - // - // The arguments are in reverse order, so that arg[argc-2] is actually the - // first argument to the target function and arg[0] is the last. - const Register& argc_input = x0; - const Register& target_input = x1; - - // Calculate argv, argc and the target address, and store them in - // callee-saved registers so we can retry the call without having to reload - // these arguments. - // TODO(jbramley): If the first call attempt succeeds in the common case (as - // it should), then we might be better off putting these parameters directly - // into their argument registers, rather than using callee-saved registers and - // preserving them on the stack. - const Register& argv = x21; - const Register& argc = x22; - const Register& target = x23; - - // Derive argv from the stack pointer so that it points to the first argument - // (arg[argc-2]), or just below the receiver in case there are no arguments. - // - Adjust for the arg[] array. - Register temp_argv = x11; - if (!argv_in_register()) { - __ SlotAddress(temp_argv, x0); - // - Adjust for the receiver. - __ Sub(temp_argv, temp_argv, 1 * kPointerSize); - } - - // Reserve three slots to preserve x21-x23 callee-saved registers. - int extra_stack_space = 3; - // Enter the exit frame. - FrameScope scope(masm, StackFrame::MANUAL); - __ EnterExitFrame( - save_doubles(), x10, extra_stack_space, - is_builtin_exit() ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT); - - // Poke callee-saved registers into reserved space. - __ Poke(argv, 1 * kPointerSize); - __ Poke(argc, 2 * kPointerSize); - __ Poke(target, 3 * kPointerSize); - - // We normally only keep tagged values in callee-saved registers, as they - // could be pushed onto the stack by called stubs and functions, and on the - // stack they can confuse the GC. However, we're only calling C functions - // which can push arbitrary data onto the stack anyway, and so the GC won't - // examine that part of the stack. - __ Mov(argc, argc_input); - __ Mov(target, target_input); - __ Mov(argv, temp_argv); - - // x21 : argv - // x22 : argc - // x23 : call target - // - // The stack (on entry) holds the arguments and the receiver, with the - // receiver at the highest address: - // - // argv[8]: receiver - // argv -> argv[0]: arg[argc-2] - // ... ... - // argv[...]: arg[1] - // argv[...]: arg[0] - // - // Immediately below (after) this is the exit frame, as constructed by - // EnterExitFrame: - // fp[8]: CallerPC (lr) - // fp -> fp[0]: CallerFP (old fp) - // fp[-8]: Space reserved for SPOffset. - // fp[-16]: CodeObject() - // sp[...]: Saved doubles, if saved_doubles is true. - // sp[32]: Alignment padding, if necessary. - // sp[24]: Preserved x23 (used for target). - // sp[16]: Preserved x22 (used for argc). - // sp[8]: Preserved x21 (used for argv). - // sp -> sp[0]: Space reserved for the return address. - // - // After a successful call, the exit frame, preserved registers (x21-x23) and - // the arguments (including the receiver) are dropped or popped as - // appropriate. The stub then returns. - // - // After an unsuccessful call, the exit frame and suchlike are left - // untouched, and the stub either throws an exception by jumping to one of - // the exception_returned label. - - // Prepare AAPCS64 arguments to pass to the builtin. - __ Mov(x0, argc); - __ Mov(x1, argv); - __ Mov(x2, ExternalReference::isolate_address(isolate())); - - Label return_location; - __ Adr(x12, &return_location); - __ Poke(x12, 0); - - if (__ emit_debug_code()) { - // Verify that the slot below fp[kSPOffset]-8 points to the return location - // (currently in x12). - UseScratchRegisterScope temps(masm); - Register temp = temps.AcquireX(); - __ Ldr(temp, MemOperand(fp, ExitFrameConstants::kSPOffset)); - __ Ldr(temp, MemOperand(temp, -static_cast(kXRegSize))); - __ Cmp(temp, x12); - __ Check(eq, AbortReason::kReturnAddressNotFoundInFrame); - } - - // Call the builtin. - __ Blr(target); - __ Bind(&return_location); - - // Result returned in x0 or x1:x0 - do not destroy these registers! - - // x0 result0 The return code from the call. - // x1 result1 For calls which return ObjectPair. - // x21 argv - // x22 argc - // x23 target - const Register& result = x0; - - // Check result for exception sentinel. - Label exception_returned; - __ CompareRoot(result, Heap::kExceptionRootIndex); - __ B(eq, &exception_returned); - - // The call succeeded, so unwind the stack and return. - - // Restore callee-saved registers x21-x23. - __ Mov(x11, argc); - - __ Peek(argv, 1 * kPointerSize); - __ Peek(argc, 2 * kPointerSize); - __ Peek(target, 3 * kPointerSize); - - __ LeaveExitFrame(save_doubles(), x10, x9); - if (!argv_in_register()) { - // Drop the remaining stack slots and return from the stub. - __ DropArguments(x11); - } - __ AssertFPCRState(); - __ Ret(); - - // Handling of exception. - __ Bind(&exception_returned); - - ExternalReference pending_handler_context_address( - IsolateAddressId::kPendingHandlerContextAddress, isolate()); - ExternalReference pending_handler_entrypoint_address( - IsolateAddressId::kPendingHandlerEntrypointAddress, isolate()); - ExternalReference pending_handler_fp_address( - IsolateAddressId::kPendingHandlerFPAddress, isolate()); - ExternalReference pending_handler_sp_address( - IsolateAddressId::kPendingHandlerSPAddress, isolate()); - - // Ask the runtime for help to determine the handler. This will set x0 to - // contain the current pending exception, don't clobber it. - ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler, - isolate()); - { - FrameScope scope(masm, StackFrame::MANUAL); - __ Mov(x0, 0); // argc. - __ Mov(x1, 0); // argv. - __ Mov(x2, ExternalReference::isolate_address(isolate())); - __ CallCFunction(find_handler, 3); - } - - // Retrieve the handler context, SP and FP. - __ Mov(cp, Operand(pending_handler_context_address)); - __ Ldr(cp, MemOperand(cp)); - { - UseScratchRegisterScope temps(masm); - Register scratch = temps.AcquireX(); - __ Mov(scratch, Operand(pending_handler_sp_address)); - __ Ldr(scratch, MemOperand(scratch)); - __ Mov(sp, scratch); - } - __ Mov(fp, Operand(pending_handler_fp_address)); - __ Ldr(fp, MemOperand(fp)); - - // If the handler is a JS frame, restore the context to the frame. Note that - // the context will be set to (cp == 0) for non-JS frames. - Label not_js_frame; - __ Cbz(cp, ¬_js_frame); - __ Str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); - __ Bind(¬_js_frame); - - // Reset the masking register. This is done independent of the underlying - // feature flag {FLAG_branch_load_poisoning} to make the snapshot work with - // both configurations. It is safe to always do this, because the underlying - // register is caller-saved and can be arbitrarily clobbered. - __ ResetSpeculationPoisonRegister(); - - // Compute the handler entry address and jump to it. - __ Mov(x10, Operand(pending_handler_entrypoint_address)); - __ Ldr(x10, MemOperand(x10)); - __ Br(x10); -} - // This is the entry point from C++. 5 arguments are provided in x0-x4. // See use of the JSEntryFunction for example in src/execution.cc. // Input: @@ -478,30 +55,35 @@ void CEntryStub::Generate(MacroAssembler* masm) { // Output: // x0: result. void JSEntryStub::Generate(MacroAssembler* masm) { + Label invoke, handler_entry, exit; + Register code_entry = x0; - // Enable instruction instrumentation. This only works on the simulator, and - // will have no effect on the model or real hardware. - __ EnableInstrumentation(); + { + NoRootArrayScope no_root_array(masm); - Label invoke, handler_entry, exit; + // Enable instruction instrumentation. This only works on the simulator, and + // will have no effect on the model or real hardware. + __ EnableInstrumentation(); - __ PushCalleeSavedRegisters(); + __ PushCalleeSavedRegisters(); - ProfileEntryHookStub::MaybeCallEntryHook(masm); + ProfileEntryHookStub::MaybeCallEntryHook(masm); - // Set up the reserved register for 0.0. - __ Fmov(fp_zero, 0.0); + // Set up the reserved register for 0.0. + __ Fmov(fp_zero, 0.0); - // Initialize the root array register - __ InitializeRootRegister(); + // Initialize the root array register + __ InitializeRootRegister(); + } // Build an entry frame (see layout below). StackFrame::Type marker = type(); int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. __ Mov(x13, bad_frame_pointer); __ Mov(x12, StackFrame::TypeToMarker(marker)); - __ Mov(x11, ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())); + __ Mov(x11, ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, + isolate())); __ Ldr(x10, MemOperand(x11)); __ Push(x13, x12, xzr, x10); @@ -511,8 +93,9 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // Push the JS entry frame marker. Also set js_entry_sp if this is the // outermost JS call. Label non_outermost_js, done; - ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate()); - __ Mov(x10, ExternalReference(js_entry_sp)); + ExternalReference js_entry_sp = + ExternalReference::Create(IsolateAddressId::kJSEntrySPAddress, isolate()); + __ Mov(x10, js_entry_sp); __ Ldr(x11, MemOperand(x10)); // Select between the inner and outermost frame marker, based on the JS entry @@ -552,7 +135,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { // field in the JSEnv and return a failure sentinel. Coming in here the // fp will be invalid because the PushTryHandler below sets it to 0 to // signal the existence of the JSEntry frame. - __ Mov(x10, Operand(ExternalReference( + __ Mov(x10, Operand(ExternalReference::Create( IsolateAddressId::kPendingExceptionAddress, isolate()))); } __ Str(code_entry, MemOperand(x10)); @@ -569,7 +152,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { "Unexpected offset for StackHandlerConstants::kNextOffset"); // Link the current handler as the next handler. - __ Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate())); + __ Mov(x11, ExternalReference::Create(IsolateAddressId::kHandlerAddress, + isolate())); __ Ldr(x10, MemOperand(x11)); __ Push(padreg, x10); @@ -602,7 +186,8 @@ void JSEntryStub::Generate(MacroAssembler* masm) { static_assert(StackHandlerConstants::kNextOffset == 0 * kPointerSize, "Unexpected offset for StackHandlerConstants::kNextOffset"); __ Pop(x10, padreg); - __ Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate())); + __ Mov(x11, ExternalReference::Create(IsolateAddressId::kHandlerAddress, + isolate())); __ Drop(StackHandlerConstants::kSlotCount - 2); __ Str(x10, MemOperand(x11)); @@ -624,13 +209,13 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ PeekPair(x10, c_entry_fp, 1 * kPointerSize); __ Cmp(x10, StackFrame::OUTERMOST_JSENTRY_FRAME); __ B(ne, &non_outermost_js_2); - __ Mov(x12, ExternalReference(js_entry_sp)); + __ Mov(x12, js_entry_sp); __ Str(xzr, MemOperand(x12)); __ Bind(&non_outermost_js_2); // Restore the top frame descriptors from the stack. - __ Mov(x12, - ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())); + __ Mov(x12, ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, + isolate())); __ Str(c_entry_fp, MemOperand(x12)); } @@ -643,9 +228,9 @@ void JSEntryStub::Generate(MacroAssembler* masm) { __ Ret(); } -// The entry hook is a Push (stp) instruction, followed by a call. +// The entry hook is a Push (stp) instruction, followed by a near call. static const unsigned int kProfileEntryHookCallSize = - (1 * kInstructionSize) + Assembler::kCallSizeWithRelocation; + (1 * kInstructionSize) + Assembler::kNearCallSize; void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm, Zone* zone) { @@ -700,9 +285,8 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) { // Under the simulator we need to indirect the entry hook through a trampoline // function at a known address. ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); - __ Mov(x10, Operand(ExternalReference(&dispatcher, - ExternalReference::BUILTIN_CALL, - isolate()))); + __ Mov(x10, Operand(ExternalReference::Create( + &dispatcher, ExternalReference::BUILTIN_CALL))); // It additionally takes an isolate as a third parameter __ Mov(x2, ExternalReference::isolate_address(isolate())); #endif @@ -735,12 +319,9 @@ void DirectCEntryStub::Generate(MacroAssembler* masm) { void DirectCEntryStub::GenerateCall(MacroAssembler* masm, Register target) { - intptr_t code = - reinterpret_cast(GetCode().location()); - __ Mov(lr, Operand(code, RelocInfo::CODE_TARGET)); - __ Mov(x10, target); // Branch to the stub. - __ Blr(lr); + __ Mov(x10, target); + __ Call(GetCode(), RelocInfo::CODE_TARGET); } template @@ -967,7 +548,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { __ Poke(constructor, Operand(x0, LSL, kPointerSizeLog2)); __ Add(x0, x0, Operand(3)); __ Push(new_target, allocation_site); - __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate())); + __ JumpToExternalReference(ExternalReference::Create(Runtime::kNewArray)); } @@ -1131,8 +712,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, FrameScope frame(masm, StackFrame::MANUAL); __ PushSafepointRegisters(); __ Mov(x0, ExternalReference::isolate_address(isolate)); - __ CallCFunction(ExternalReference::log_enter_external_function(isolate), - 1); + __ CallCFunction(ExternalReference::log_enter_external_function(), 1); __ PopSafepointRegisters(); } @@ -1146,8 +726,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, FrameScope frame(masm, StackFrame::MANUAL); __ PushSafepointRegisters(); __ Mov(x0, ExternalReference::isolate_address(isolate)); - __ CallCFunction(ExternalReference::log_leave_external_function(isolate), - 1); + __ CallCFunction(ExternalReference::log_leave_external_function(), 1); __ PopSafepointRegisters(); } @@ -1203,8 +782,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, Register saved_result = x19; __ Mov(saved_result, x0); __ Mov(x0, ExternalReference::isolate_address(isolate)); - __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate), - 1); + __ CallCFunction(ExternalReference::delete_handle_scope_extensions(), 1); __ Mov(x0, saved_result); __ B(&leave_exit_frame); } @@ -1275,8 +853,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) { __ Mov(x10, argc()); __ Str(x10, MemOperand(x0, 2 * kPointerSize)); - ExternalReference thunk_ref = - ExternalReference::invoke_function_callback(masm->isolate()); + ExternalReference thunk_ref = ExternalReference::invoke_function_callback(); AllowExternalCallThatCantCauseGC scope(masm); // Stores return the first js argument @@ -1354,7 +931,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) { // x1 = v8::PropertyCallbackInfo& ExternalReference thunk_ref = - ExternalReference::invoke_accessor_getter_callback(isolate()); + ExternalReference::invoke_accessor_getter_callback(); Register api_function_address = x2; Register js_getter = x4; diff --git a/deps/v8/src/arm64/deoptimizer-arm64.cc b/deps/v8/src/arm64/deoptimizer-arm64.cc index a81621b6a9a2..397f4cb36d45 100644 --- a/deps/v8/src/arm64/deoptimizer-arm64.cc +++ b/deps/v8/src/arm64/deoptimizer-arm64.cc @@ -115,8 +115,8 @@ void Deoptimizer::TableEntryGenerator::Generate() { DCHECK_EQ(saved_registers.Count() % 2, 0); __ PushCPURegList(saved_registers); - __ Mov(x3, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + __ Mov(x3, Operand(ExternalReference::Create( + IsolateAddressId::kCEntryFPAddress, isolate()))); __ Str(fp, MemOperand(x3)); const int kSavedRegistersAreaSize = @@ -165,7 +165,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { { // Call Deoptimizer::New(). AllowExternalCallThatCantCauseGC scope(masm()); - __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); + __ CallCFunction(ExternalReference::new_deoptimizer_function(), 6); } // Preserve "deoptimizer" object in register x0. @@ -212,8 +212,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { { // Call Deoptimizer::ComputeOutputFrames(). AllowExternalCallThatCantCauseGC scope(masm()); - __ CallCFunction( - ExternalReference::compute_output_frames_function(isolate()), 1); + __ CallCFunction(ExternalReference::compute_output_frames_function(), 1); } __ Pop(x4, padreg); // Restore deoptimizer object (class Deoptimizer). diff --git a/deps/v8/src/arm64/instructions-arm64.h b/deps/v8/src/arm64/instructions-arm64.h index 499023ebb2b7..b1c488eb6540 100644 --- a/deps/v8/src/arm64/instructions-arm64.h +++ b/deps/v8/src/arm64/instructions-arm64.h @@ -354,6 +354,12 @@ class Instruction { return (high16 << 16) | low16; } + bool IsUnconditionalBranch() const { + return Mask(UnconditionalBranchMask) == B; + } + + bool IsBranchAndLink() const { return Mask(UnconditionalBranchMask) == BL; } + bool IsBranchAndLinkToRegister() const { return Mask(UnconditionalBranchToRegisterMask) == BLR; } diff --git a/deps/v8/src/arm64/interface-descriptors-arm64.cc b/deps/v8/src/arm64/interface-descriptors-arm64.cc index bcbe5d97dce3..89c7b98f5115 100644 --- a/deps/v8/src/arm64/interface-descriptors-arm64.cc +++ b/deps/v8/src/arm64/interface-descriptors-arm64.cc @@ -34,7 +34,7 @@ void RecordWriteDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(kParameterCount, default_stub_registers); } -const Register FastNewFunctionContextDescriptor::FunctionRegister() { +const Register FastNewFunctionContextDescriptor::ScopeInfoRegister() { return x1; } const Register FastNewFunctionContextDescriptor::SlotsRegister() { return x0; } @@ -260,14 +260,6 @@ void BinaryOpDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(arraysize(registers), registers); } -void StringAddDescriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - // x1: left operand - // x0: right operand - Register registers[] = {x1, x0}; - data->InitializePlatformSpecific(arraysize(registers), registers); -} - void ArgumentAdaptorDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { static PlatformInterfaceDescriptor default_descriptor = diff --git a/deps/v8/src/arm64/macro-assembler-arm64-inl.h b/deps/v8/src/arm64/macro-assembler-arm64-inl.h index f96d4b20b827..20533362bc79 100644 --- a/deps/v8/src/arm64/macro-assembler-arm64-inl.h +++ b/deps/v8/src/arm64/macro-assembler-arm64-inl.h @@ -1039,7 +1039,7 @@ void TurboAssembler::Uxtw(const Register& rd, const Register& rn) { void TurboAssembler::InitializeRootRegister() { ExternalReference roots_array_start = ExternalReference::roots_array_start(isolate()); - Mov(root, Operand(roots_array_start)); + Mov(kRootRegister, Operand(roots_array_start)); } diff --git a/deps/v8/src/arm64/macro-assembler-arm64.cc b/deps/v8/src/arm64/macro-assembler-arm64.cc index 5bbf71e28cf0..784ffbb27511 100644 --- a/deps/v8/src/arm64/macro-assembler-arm64.cc +++ b/deps/v8/src/arm64/macro-assembler-arm64.cc @@ -8,7 +8,9 @@ #include "src/base/bits.h" #include "src/base/division-by-constant.h" #include "src/bootstrapper.h" +#include "src/builtins/constants-table-builder.h" #include "src/callable.h" +#include "src/code-factory.h" #include "src/code-stubs.h" #include "src/debug/debug.h" #include "src/external-reference-table.h" @@ -18,6 +20,7 @@ #include "src/instruction-stream.h" #include "src/register-configuration.h" #include "src/runtime/runtime.h" +#include "src/snapshot/serializer-common.h" #include "src/arm64/macro-assembler-arm64-inl.h" #include "src/arm64/macro-assembler-arm64.h" // Cannot be the first include @@ -28,7 +31,17 @@ namespace internal { MacroAssembler::MacroAssembler(Isolate* isolate, byte* buffer, unsigned buffer_size, CodeObjectRequired create_code_object) - : TurboAssembler(isolate, buffer, buffer_size, create_code_object) {} + : TurboAssembler(isolate, buffer, buffer_size, create_code_object) { + if (create_code_object == CodeObjectRequired::kYes) { + // Unlike TurboAssembler, which can be used off the main thread and may not + // allocate, macro assembler creates its own copy of the self-reference + // marker in order to disambiguate between self-references during nested + // code generation (e.g.: codegen of the current object triggers stub + // compilation through CodeStub::GetCode()). + code_object_ = Handle::New( + *isolate->factory()->NewSelfReferenceMarker(), isolate); + } +} CPURegList TurboAssembler::DefaultTmpList() { return CPURegList(ip0, ip1); } @@ -47,8 +60,8 @@ TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size, fptmp_list_(DefaultFPTmpList()), use_real_aborts_(true) { if (create_code_object == CodeObjectRequired::kYes) { - code_object_ = - Handle::New(isolate->heap()->undefined_value(), isolate); + code_object_ = Handle::New( + isolate->heap()->self_reference_marker(), isolate); } } @@ -310,7 +323,6 @@ void TurboAssembler::Mov(const Register& rd, const Operand& operand, if (operand.NeedsRelocation(this)) { Ldr(dst, operand); - } else if (operand.IsImmediate()) { // Call the macro assembler for generic immediates. Mov(dst, operand.ImmediateValue()); @@ -352,6 +364,16 @@ void TurboAssembler::Mov(const Register& rd, const Operand& operand, } } +void TurboAssembler::Mov(const Register& rd, ExternalReference reference) { +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + LookupExternalReference(rd, reference); + return; + } +#endif // V8_EMBEDDED_BUILTINS + Mov(rd, Operand(reference)); +} + void TurboAssembler::Movi16bitHelper(const VRegister& vd, uint64_t imm) { DCHECK(is_uint16(imm)); int byte1 = (imm & 0xFF); @@ -1355,8 +1377,7 @@ void TurboAssembler::Poke(const CPURegister& src, const Operand& offset) { Str(src, MemOperand(sp, offset)); } - -void MacroAssembler::Peek(const CPURegister& dst, const Operand& offset) { +void TurboAssembler::Peek(const CPURegister& dst, const Operand& offset) { if (offset.IsImmediate()) { DCHECK_GE(offset.ImmediateValue(), 0); } else if (emit_debug_code()) { @@ -1552,7 +1573,7 @@ void TurboAssembler::LoadRoot(CPURegister destination, Heap::RootListIndex index) { // TODO(jbramley): Most root values are constants, and can be synthesized // without a load. Refer to the ARM back end for details. - Ldr(destination, MemOperand(root, index << kPointerSizeLog2)); + Ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2)); } @@ -1566,7 +1587,17 @@ void MacroAssembler::LoadObject(Register result, Handle object) { } void TurboAssembler::Move(Register dst, Register src) { Mov(dst, src); } -void TurboAssembler::Move(Register dst, Handle x) { Mov(dst, x); } + +void TurboAssembler::Move(Register dst, Handle x) { +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + LookupConstant(dst, x); + return; + } +#endif // V8_EMBEDDED_BUILTINS + Mov(dst, x); +} + void TurboAssembler::Move(Register dst, Smi* src) { Mov(dst, src); } void TurboAssembler::Swap(Register lhs, Register rhs) { @@ -1718,12 +1749,10 @@ void TurboAssembler::CallStubDelayed(CodeStub* stub) { Label start_call; Bind(&start_call); #endif - UseScratchRegisterScope temps(this); - Register temp = temps.AcquireX(); - Ldr(temp, Operand::EmbeddedCode(stub)); - Blr(temp); + Operand operand = Operand::EmbeddedCode(stub); + near_call(operand.heap_object_request()); #ifdef DEBUG - AssertSizeOfCodeGeneratedSince(&start_call, kCallSizeWithRelocation); + AssertSizeOfCodeGeneratedSince(&start_call, kNearCallSize); #endif } @@ -1744,8 +1773,10 @@ void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid, // should remove this need and make the runtime routine entry code // smarter. Mov(x0, f->nargs); - Mov(x1, ExternalReference(f, isolate())); - CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles)); + Mov(x1, ExternalReference::Create(f)); + Handle code = + CodeFactory::CEntry(isolate(), f->result_size, save_doubles); + Call(code, RelocInfo::CODE_TARGET); } void MacroAssembler::CallRuntime(const Runtime::Function* f, @@ -1760,23 +1791,23 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // Place the necessary arguments. Mov(x0, num_arguments); - Mov(x1, ExternalReference(f, isolate())); + Mov(x1, ExternalReference::Create(f)); - CEntryStub stub(isolate(), 1, save_doubles); - CallStub(&stub); + Handle code = + CodeFactory::CEntry(isolate(), f->result_size, save_doubles); + Call(code, RelocInfo::CODE_TARGET); } void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, bool builtin_exit_frame) { Mov(x1, builtin); - CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack, - builtin_exit_frame); - Jump(stub.GetCode(), RelocInfo::CODE_TARGET); + Handle code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs, + kArgvOnStack, builtin_exit_frame); + Jump(code, RelocInfo::CODE_TARGET); } void MacroAssembler::JumpToInstructionStream(Address entry) { - Mov(kOffHeapTrampolineRegister, - Operand(reinterpret_cast(entry), RelocInfo::OFF_HEAP_TARGET)); + Mov(kOffHeapTrampolineRegister, Operand(entry, RelocInfo::OFF_HEAP_TARGET)); Br(kOffHeapTrampolineRegister); } @@ -1790,7 +1821,7 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { // smarter. Mov(x0, function->nargs); } - JumpToExternalReference(ExternalReference(fid, isolate())); + JumpToExternalReference(ExternalReference::Create(fid)); } int TurboAssembler::ActivationFrameAlignment() { @@ -1852,30 +1883,124 @@ void TurboAssembler::CallCFunction(Register function, int num_of_reg_args, } } -void TurboAssembler::Jump(Register target) { Br(target); } +#ifdef V8_EMBEDDED_BUILTINS +void TurboAssembler::LookupConstant(Register destination, + Handle object) { + CHECK(isolate()->ShouldLoadConstantsFromRootList()); + CHECK(root_array_available_); -void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode, - Condition cond) { + // Ensure the given object is in the builtins constants table and fetch its + // index. + BuiltinsConstantsTableBuilder* builder = + isolate()->builtins_constants_table_builder(); + uint32_t index = builder->AddObject(object); + + // TODO(jgruber): Load builtins from the builtins table. + // TODO(jgruber): Ensure that code generation can recognize constant targets + // in kArchCallCodeObject. + + DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant( + Heap::kBuiltinsConstantsTableRootIndex)); + + LoadRoot(destination, Heap::kBuiltinsConstantsTableRootIndex); + Ldr(destination, FieldMemOperand(destination, FixedArray::kHeaderSize + + index * kPointerSize)); +} + +void TurboAssembler::LookupExternalReference(Register destination, + ExternalReference reference) { + CHECK(reference.address() != + ExternalReference::roots_array_start(isolate()).address()); + CHECK(isolate()->ShouldLoadConstantsFromRootList()); + CHECK(root_array_available_); + + // Encode as an index into the external reference table stored on the isolate. + + ExternalReferenceEncoder encoder(isolate()); + ExternalReferenceEncoder::Value v = encoder.Encode(reference.address()); + CHECK(!v.is_from_api()); + uint32_t index = v.index(); + + // Generate code to load from the external reference table. + + int32_t roots_to_external_reference_offset = + Heap::roots_to_external_reference_table_offset() + + ExternalReferenceTable::OffsetOfEntry(index); + + Ldr(destination, + MemOperand(kRootRegister, roots_to_external_reference_offset)); +} +#endif // V8_EMBEDDED_BUILTINS + +void TurboAssembler::Jump(Register target, Condition cond) { + if (cond == nv) return; + Label done; + if (cond != al) B(NegateCondition(cond), &done); + Br(target); + Bind(&done); +} + +void TurboAssembler::JumpHelper(int64_t offset, RelocInfo::Mode rmode, + Condition cond) { if (cond == nv) return; - UseScratchRegisterScope temps(this); - Register temp = temps.AcquireX(); Label done; if (cond != al) B(NegateCondition(cond), &done); - Mov(temp, Operand(target, rmode)); - Br(temp); + if (CanUseNearCallOrJump(rmode)) { + DCHECK(IsNearCallOffset(offset)); + near_jump(static_cast(offset), rmode); + } else { + UseScratchRegisterScope temps(this); + Register temp = temps.AcquireX(); + uint64_t imm = reinterpret_cast(pc_) + offset * kInstructionSize; + Mov(temp, Immediate(imm, rmode)); + Br(temp); + } Bind(&done); } +namespace { + +// The calculated offset is either: +// * the 'target' input unmodified if this is a WASM call, or +// * the offset of the target from the current PC, in instructions, for any +// other type of call. +static int64_t CalculateTargetOffset(Address target, RelocInfo::Mode rmode, + byte* pc) { + int64_t offset = static_cast(target); + // The target of WebAssembly calls is still an index instead of an actual + // address at this point, and needs to be encoded as-is. + if (rmode != RelocInfo::WASM_CALL) { + offset -= reinterpret_cast(pc); + DCHECK_EQ(offset % kInstructionSize, 0); + offset = offset / static_cast(kInstructionSize); + } + return offset; +} +} // namespace + void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond) { - DCHECK(!RelocInfo::IsCodeTarget(rmode)); - Jump(reinterpret_cast(target), rmode, cond); + JumpHelper(CalculateTargetOffset(target, rmode, pc_), rmode, cond); } void TurboAssembler::Jump(Handle code, RelocInfo::Mode rmode, Condition cond) { DCHECK(RelocInfo::IsCodeTarget(rmode)); - Jump(reinterpret_cast(code.address()), rmode, cond); +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + UseScratchRegisterScope temps(this); + Register scratch = temps.AcquireX(); + LookupConstant(scratch, code); + Add(scratch, scratch, Operand(Code::kHeaderSize - kHeapObjectTag)); + Jump(scratch, cond); + return; + } +#endif // V8_EMBEDDED_BUILTINS + if (CanUseNearCallOrJump(rmode)) { + JumpHelper(static_cast(GetCodeTargetIndex(code)), rmode, cond); + } else { + Jump(code.address(), rmode, cond); + } } void TurboAssembler::Call(Register target) { @@ -1892,20 +2017,6 @@ void TurboAssembler::Call(Register target) { #endif } -void TurboAssembler::Call(Label* target) { - BlockPoolsScope scope(this); -#ifdef DEBUG - Label start_call; - Bind(&start_call); -#endif - - Bl(target); - -#ifdef DEBUG - AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target)); -#endif -} - // TurboAssembler::CallSize is sensitive to changes in this function, as it // requires to know how many instructions are used to branch to the target. void TurboAssembler::Call(Address target, RelocInfo::Mode rmode) { @@ -1915,33 +2026,40 @@ void TurboAssembler::Call(Address target, RelocInfo::Mode rmode) { Bind(&start_call); #endif - UseScratchRegisterScope temps(this); - Register temp = temps.AcquireX(); - - if (RelocInfo::IsNone(rmode)) { - // Addresses are 48 bits so we never need to load the upper 16 bits. - uint64_t imm = reinterpret_cast(target); - // If we don't use ARM tagged addresses, the 16 higher bits must be 0. - DCHECK_EQ((imm >> 48) & 0xFFFF, 0); - movz(temp, (imm >> 0) & 0xFFFF, 0); - movk(temp, (imm >> 16) & 0xFFFF, 16); - movk(temp, (imm >> 32) & 0xFFFF, 32); + if (CanUseNearCallOrJump(rmode)) { + int64_t offset = CalculateTargetOffset(target, rmode, pc_); + DCHECK(IsNearCallOffset(offset)); + near_call(static_cast(offset), rmode); } else { - Ldr(temp, Immediate(reinterpret_cast(target), rmode)); + IndirectCall(target, rmode); } - Blr(temp); #ifdef DEBUG AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode)); #endif } void TurboAssembler::Call(Handle code, RelocInfo::Mode rmode) { + BlockPoolsScope scope(this); #ifdef DEBUG Label start_call; Bind(&start_call); #endif - Call(code.address(), rmode); +#ifdef V8_EMBEDDED_BUILTINS + if (root_array_available_ && isolate()->ShouldLoadConstantsFromRootList()) { + UseScratchRegisterScope temps(this); + Register scratch = temps.AcquireX(); + LookupConstant(scratch, code); + Add(scratch, scratch, Operand(Code::kHeaderSize - kHeapObjectTag)); + Call(scratch); + return; + } +#endif // V8_EMBEDDED_BUILTINS + if (CanUseNearCallOrJump(rmode)) { + near_call(GetCodeTargetIndex(code), rmode); + } else { + IndirectCall(code.address(), rmode); + } #ifdef DEBUG // Check the size of the code generated. @@ -1954,10 +2072,21 @@ void TurboAssembler::Call(ExternalReference target) { Register temp = temps.AcquireX(); // Immediate is in charge of setting the relocation mode to // EXTERNAL_REFERENCE. - Ldr(temp, Immediate(target)); + Mov(temp, Immediate(target)); Call(temp); } +void TurboAssembler::IndirectCall(Address target, RelocInfo::Mode rmode) { + UseScratchRegisterScope temps(this); + Register temp = temps.AcquireX(); + Mov(temp, Immediate(target, rmode)); + Blr(temp); +} + +bool TurboAssembler::IsNearCallOffset(int64_t offset) { + return is_int26(offset); +} + void TurboAssembler::CallForDeoptimization(Address target, RelocInfo::Mode rmode) { DCHECK_EQ(rmode, RelocInfo::RUNTIME_ENTRY); @@ -1972,12 +2101,20 @@ void TurboAssembler::CallForDeoptimization(Address target, // Deoptimisation table entries require the call address to be in x16, in // order to compute the entry id. + // TODO(all): Put the entry id back in the table now that we are using + // a direct branch for the call and do not need to set up x16. DCHECK(temp.Is(x16)); - Ldr(temp, Immediate(reinterpret_cast(target), rmode)); - Blr(temp); + Mov(temp, Immediate(target, rmode)); + + int64_t offset = static_cast(target) - + static_cast(isolate_data().code_range_start_); + DCHECK_EQ(offset % kInstructionSize, 0); + offset = offset / static_cast(kInstructionSize); + DCHECK(IsNearCallOffset(offset)); + near_call(static_cast(offset), rmode); #ifdef DEBUG - AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode)); + AssertSizeOfCodeGeneratedSince(&start_call, kNearCallSize + kInstructionSize); #endif } @@ -1986,23 +2123,14 @@ int TurboAssembler::CallSize(Register target) { return kInstructionSize; } -int TurboAssembler::CallSize(Label* target) { - USE(target); - return kInstructionSize; -} - int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode) { USE(target); - - return RelocInfo::IsNone(rmode) ? kCallSizeWithoutRelocation - : kCallSizeWithRelocation; + return CanUseNearCallOrJump(rmode) ? kNearCallSize : kFarCallSize; } int TurboAssembler::CallSize(Handle code, RelocInfo::Mode rmode) { USE(code); - - return RelocInfo::IsNone(rmode) ? kCallSizeWithoutRelocation - : kCallSizeWithRelocation; + return CanUseNearCallOrJump(rmode) ? kNearCallSize : kFarCallSize; } void MacroAssembler::TryRepresentDoubleAsInt(Register as_int, VRegister value, @@ -2161,13 +2289,16 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, const ParameterCount& actual) { Label skip_hook; - ExternalReference debug_hook_active = - ExternalReference::debug_hook_on_function_call_address(isolate()); - Mov(x4, Operand(debug_hook_active)); + Mov(x4, ExternalReference::debug_hook_on_function_call_address(isolate())); Ldrsb(x4, MemOperand(x4)); Cbz(x4, &skip_hook); { + // Load receiver to pass it later to DebugOnFunctionCall hook. + Operand actual_op = actual.is_immediate() ? Operand(actual.immediate()) + : Operand(actual.reg()); + Mov(x4, actual_op); + Ldr(x4, MemOperand(sp, x4, LSL, kPointerSizeLog2)); FrameScope frame(this, has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); @@ -2181,8 +2312,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, SmiTag(expected_reg); SmiTag(actual_reg); Push(expected_reg, actual_reg, new_target, fun); - - PushArgument(fun); + Push(fun, x4); CallRuntime(Runtime::kDebugOnFunctionCall); // Restore values from stack. @@ -2304,8 +2434,9 @@ void TurboAssembler::TryConvertDoubleToInt64(Register result, B(vc, done); } -void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result, - DoubleRegister double_input) { +void TurboAssembler::TruncateDoubleToI(Isolate* isolate, Zone* zone, + Register result, + DoubleRegister double_input) { Label done; // Try to convert the double to an int64. If successful, the bottom 32 bits @@ -2315,9 +2446,9 @@ void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result, // If we fell through then inline version didn't succeed - call stub instead. Push(lr, double_input); - auto stub = new (zone) DoubleToIStub(nullptr, result); - // DoubleToIStub preserves any registers it needs to clobber. - CallStubDelayed(stub); + // DoubleToI preserves any registers it needs to clobber. + Call(BUILTIN_CODE(isolate, DoubleToI), RelocInfo::CODE_TARGET); + Ldr(result, MemOperand(sp, 0)); DCHECK_EQ(xzr.SizeInBytes(), double_input.SizeInBytes()); Pop(xzr, lr); // xzr to drop the double input on the stack. @@ -2334,12 +2465,12 @@ void TurboAssembler::Prologue() { void TurboAssembler::EnterFrame(StackFrame::Type type) { UseScratchRegisterScope temps(this); - Register type_reg = temps.AcquireX(); - Register code_reg = temps.AcquireX(); if (type == StackFrame::INTERNAL) { + Register code_reg = temps.AcquireX(); + Move(code_reg, CodeObject()); + Register type_reg = temps.AcquireX(); Mov(type_reg, StackFrame::TypeToMarker(type)); - Mov(code_reg, Operand(CodeObject())); Push(lr, fp, type_reg, code_reg); Add(fp, sp, InternalFrameConstants::kFixedFrameSizeFromFp); // sp[4] : lr @@ -2347,6 +2478,7 @@ void TurboAssembler::EnterFrame(StackFrame::Type type) { // sp[1] : type // sp[0] : [code object] } else if (type == StackFrame::WASM_COMPILED) { + Register type_reg = temps.AcquireX(); Mov(type_reg, StackFrame::TypeToMarker(type)); Push(lr, fp); Mov(fp, sp); @@ -2357,6 +2489,7 @@ void TurboAssembler::EnterFrame(StackFrame::Type type) { // sp[0] : for alignment } else { DCHECK_EQ(type, StackFrame::CONSTRUCT); + Register type_reg = temps.AcquireX(); Mov(type_reg, StackFrame::TypeToMarker(type)); // Users of this frame type push a context pointer after the type field, @@ -2418,7 +2551,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, const Register& scratch, Mov(fp, sp); Mov(scratch, StackFrame::TypeToMarker(frame_type)); Push(scratch, xzr); - Mov(scratch, Operand(CodeObject())); + Move(scratch, CodeObject()); Push(scratch, padreg); // fp[8]: CallerPC (lr) // fp -> fp[0]: CallerFP (old fp) @@ -2434,11 +2567,11 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, const Register& scratch, STATIC_ASSERT((-4 * kPointerSize) == ExitFrameConstants::kPaddingOffset); // Save the frame pointer and context pointer in the top frame. - Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + Mov(scratch, + ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, isolate())); Str(fp, MemOperand(scratch)); Mov(scratch, - Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); + ExternalReference::Create(IsolateAddressId::kContextAddress, isolate())); Str(cp, MemOperand(scratch)); STATIC_ASSERT((-4 * kPointerSize) == ExitFrameConstants::kLastExitFrameField); @@ -2481,19 +2614,19 @@ void MacroAssembler::LeaveExitFrame(bool restore_doubles, // Restore the context pointer from the top frame. Mov(scratch, - Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate()))); + ExternalReference::Create(IsolateAddressId::kContextAddress, isolate())); Ldr(cp, MemOperand(scratch)); if (emit_debug_code()) { // Also emit debug code to clear the cp in the top frame. Mov(scratch2, Operand(Context::kInvalidContext)); - Mov(scratch, Operand(ExternalReference(IsolateAddressId::kContextAddress, - isolate()))); + Mov(scratch, ExternalReference::Create(IsolateAddressId::kContextAddress, + isolate())); Str(scratch2, MemOperand(scratch)); } // Clear the frame pointer from the top frame. - Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, - isolate()))); + Mov(scratch, + ExternalReference::Create(IsolateAddressId::kCEntryFPAddress, isolate())); Str(xzr, MemOperand(scratch)); // Pop the exit frame. @@ -2515,7 +2648,7 @@ void MacroAssembler::IncrementCounter(StatsCounter* counter, int value, Register scratch1, Register scratch2) { DCHECK_NE(value, 0); if (FLAG_native_code_counters && counter->Enabled()) { - Mov(scratch2, ExternalReference(counter)); + Mov(scratch2, ExternalReference::Create(counter)); Ldr(scratch1.W(), MemOperand(scratch2)); Add(scratch1.W(), scratch1.W(), value); Str(scratch1.W(), MemOperand(scratch2)); @@ -2530,9 +2663,7 @@ void MacroAssembler::DecrementCounter(StatsCounter* counter, int value, void MacroAssembler::MaybeDropFrames() { // Check whether we need to drop frames to restart a function on the stack. - ExternalReference restart_fp = - ExternalReference::debug_restart_fp_address(isolate()); - Mov(x1, Operand(restart_fp)); + Mov(x1, ExternalReference::debug_restart_fp_address(isolate())); Ldr(x1, MemOperand(x1)); Tst(x1, x1); Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET, @@ -2890,6 +3021,10 @@ void TurboAssembler::Assert(Condition cond, AbortReason reason) { } } +void TurboAssembler::AssertUnreachable(AbortReason reason) { + if (emit_debug_code()) Abort(reason); +} + void MacroAssembler::AssertRegisterIsRoot(Register reg, Heap::RootListIndex index, AbortReason reason) { @@ -3115,7 +3250,7 @@ void TurboAssembler::CallPrintf(int arg_count, const CPURegister* args) { dc32(arg_pattern_list); // kPrintfArgPatternListOffset } #else - Call(ExternalReference::printf_function(isolate())); + Call(ExternalReference::printf_function()); #endif } diff --git a/deps/v8/src/arm64/macro-assembler-arm64.h b/deps/v8/src/arm64/macro-assembler-arm64.h index 6b1b8957cb5d..16aa006b2f46 100644 --- a/deps/v8/src/arm64/macro-assembler-arm64.h +++ b/deps/v8/src/arm64/macro-assembler-arm64.h @@ -58,6 +58,7 @@ namespace internal { #define kOffHeapTrampolineRegister ip0 #define kRuntimeCallFunctionRegister x1 #define kRuntimeCallArgCountRegister x0 +#define kWasmInstanceRegister x7 #define LS_MACRO_LIST(V) \ V(Ldrb, Register&, rt, LDRB_w) \ @@ -182,10 +183,10 @@ class TurboAssembler : public Assembler { CodeObjectRequired create_code_object); // The Abort method should call a V8 runtime function, but the CallRuntime - // mechanism depends on CEntryStub. If use_real_aborts is false, Abort will - // use a simpler abort mechanism that doesn't depend on CEntryStub. + // mechanism depends on CEntry. If use_real_aborts is false, Abort will + // use a simpler abort mechanism that doesn't depend on CEntry. // - // The purpose of this is to allow Aborts to be compiled whilst CEntryStub is + // The purpose of this is to allow Aborts to be compiled whilst CEntry is // being generated. bool use_real_aborts() const { return use_real_aborts_; } @@ -219,6 +220,14 @@ class TurboAssembler : public Assembler { bool allow_macro_instructions() const { return allow_macro_instructions_; } #endif + // We should not use near calls or jumps for JS->WASM calls and calls to + // external references, since the code spaces are not guaranteed to be close + // to each other. + bool CanUseNearCallOrJump(RelocInfo::Mode rmode) { + return rmode != RelocInfo::JS_TO_WASM_CALL && + rmode != RelocInfo::EXTERNAL_REFERENCE; + } + // Activation support. void EnterFrame(StackFrame::Type type); void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) { @@ -231,6 +240,7 @@ class TurboAssembler : public Assembler { void Mov(const Register& rd, const Operand& operand, DiscardMoveMode discard_mode = kDontDiscardForSameWReg); + void Mov(const Register& rd, ExternalReference reference); void Mov(const Register& rd, uint64_t imm); inline void Mov(const Register& rd, const Register& rm); void Mov(const VRegister& vd, int vd_index, const VRegister& vn, @@ -563,6 +573,7 @@ class TurboAssembler : public Assembler { bool AllowThisStubCall(CodeStub* stub); void CallStubDelayed(CodeStub* stub); + // TODO(jgruber): Remove in favor of MacroAssembler::CallRuntime. void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid, SaveFPRegsMode save_doubles = kDontSaveFPRegs); @@ -582,6 +593,10 @@ class TurboAssembler : public Assembler { // Use --debug_code to enable. void Assert(Condition cond, AbortReason reason); + // Like Assert(), but without condition. + // Use --debug_code to enable. + void AssertUnreachable(AbortReason reason); + void AssertSmi(Register object, AbortReason reason = AbortReason::kOperandIsNotASmi); @@ -867,26 +882,32 @@ class TurboAssembler : public Assembler { int shift_amount = 0); void Movi(const VRegister& vd, uint64_t hi, uint64_t lo); - void Jump(Register target); +#ifdef V8_EMBEDDED_BUILTINS + void LookupConstant(Register destination, Handle object); + void LookupExternalReference(Register destination, + ExternalReference reference); +#endif // V8_EMBEDDED_BUILTINS + + void Jump(Register target, Condition cond = al); void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al); void Jump(Handle code, RelocInfo::Mode rmode, Condition cond = al); - void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); void Call(Register target); - void Call(Label* target); void Call(Address target, RelocInfo::Mode rmode); void Call(Handle code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET); void Call(ExternalReference target); + // Generate an indirect call (for when a direct call's range is not adequate). + void IndirectCall(Address target, RelocInfo::Mode rmode); + void CallForDeoptimization(Address target, RelocInfo::Mode rmode); // For every Call variant, there is a matching CallSize function that returns // the size (in bytes) of the call sequence. static int CallSize(Register target); - static int CallSize(Label* target); - static int CallSize(Address target, RelocInfo::Mode rmode); - static int CallSize(Handle code, - RelocInfo::Mode rmode = RelocInfo::CODE_TARGET); + int CallSize(Address target, RelocInfo::Mode rmode); + int CallSize(Handle code, + RelocInfo::Mode rmode = RelocInfo::CODE_TARGET); // Calls a C function. // The called function is not allowed to trigger a @@ -902,8 +923,8 @@ class TurboAssembler : public Assembler { // Performs a truncating conversion of a floating point number as used by // the JS bitwise operations. See ECMA-262 9.5: ToInt32. // Exits with 'result' holding the answer. - void TruncateDoubleToIDelayed(Zone* zone, Register result, - DoubleRegister double_input); + void TruncateDoubleToI(Isolate* isolate, Zone* zone, Register result, + DoubleRegister double_input); inline void Mul(const Register& rd, const Register& rn, const Register& rm); @@ -984,6 +1005,10 @@ class TurboAssembler : public Assembler { // be 16 byte aligned. void Poke(const CPURegister& src, const Operand& offset); + // Peek at a value on the stack, and put it in 'dst'. The offset is in bytes. + // The stack pointer must be aligned to 16 bytes. + void Peek(const CPURegister& dst, const Operand& offset); + // Poke 'src1' and 'src2' onto the stack. The values written will be adjacent // with 'src2' at a higher address than 'src1'. The offset is in bytes. The // stack pointer must be 16 byte aligned. @@ -1206,6 +1231,9 @@ class TurboAssembler : public Assembler { void ResetSpeculationPoisonRegister(); + bool root_array_available() const { return root_array_available_; } + void set_root_array_available(bool v) { root_array_available_ = v; } + protected: // The actual Push and Pop implementations. These don't generate any code // other than that required for the push or pop. This allows @@ -1238,8 +1266,12 @@ class TurboAssembler : public Assembler { // have mixed types. The format string (x0) should not be included. void CallPrintf(int arg_count = 0, const CPURegister* args = nullptr); + // This handle will be patched with the code object on installation. + Handle code_object_; + private: bool has_frame_ = false; + bool root_array_available_ = true; Isolate* const isolate_; #if DEBUG // Tell whether any of the macro instruction can be used. When false the @@ -1247,8 +1279,7 @@ class TurboAssembler : public Assembler { // of instructions is called. bool allow_macro_instructions_; #endif - // This handle will be patched with the code object on installation. - Handle code_object_; + // Scratch registers available for use by the MacroAssembler. CPURegList tmp_list_; @@ -1276,6 +1307,9 @@ class TurboAssembler : public Assembler { void LoadStorePairMacro(const CPURegister& rt, const CPURegister& rt2, const MemOperand& addr, LoadStorePairOp op); + + static bool IsNearCallOffset(int64_t offset); + void JumpHelper(int64_t offset, RelocInfo::Mode rmode, Condition cond = al); }; class MacroAssembler : public TurboAssembler { @@ -1606,10 +1640,6 @@ class MacroAssembler : public TurboAssembler { std::vector queued_; }; - // Peek at a value on the stack, and put it in 'dst'. The offset is in bytes. - // The stack pointer must be aligned to 16 bytes. - void Peek(const CPURegister& dst, const Operand& offset); - // Peek at two values on the stack, and put them in 'dst1' and 'dst2'. The // values peeked will be adjacent, with the value in 'dst2' being from a // higher address than 'dst1'. The offset is in bytes. The stack pointer must diff --git a/deps/v8/src/arm64/simulator-arm64.cc b/deps/v8/src/arm64/simulator-arm64.cc index 290be13cd6a8..839c4edda6f0 100644 --- a/deps/v8/src/arm64/simulator-arm64.cc +++ b/deps/v8/src/arm64/simulator-arm64.cc @@ -117,7 +117,7 @@ Simulator* Simulator::current(Isolate* isolate) { return sim; } -void Simulator::CallImpl(byte* entry, CallArgument* args) { +void Simulator::CallImpl(Address entry, CallArgument* args) { int index_x = 0; int index_d = 0; diff --git a/deps/v8/src/arm64/simulator-arm64.h b/deps/v8/src/arm64/simulator-arm64.h index 8cd1e02b6f87..4bd9294c2f27 100644 --- a/deps/v8/src/arm64/simulator-arm64.h +++ b/deps/v8/src/arm64/simulator-arm64.h @@ -719,7 +719,7 @@ class Simulator : public DecoderVisitor, public SimulatorBase { // Call an arbitrary function taking an arbitrary number of arguments. template - Return Call(byte* entry, Args... args) { + Return Call(Address entry, Args... args) { // Convert all arguments to CallArgument. CallArgument call_args[] = {CallArgument(args)..., CallArgument::End()}; CallImpl(entry, call_args); @@ -2279,7 +2279,7 @@ class Simulator : public DecoderVisitor, public SimulatorBase { private: void Init(FILE* stream); - V8_EXPORT_PRIVATE void CallImpl(byte* entry, CallArgument* args); + V8_EXPORT_PRIVATE void CallImpl(Address entry, CallArgument* args); // Read floating point return values. template diff --git a/deps/v8/src/asan.h b/deps/v8/src/asan.h new file mode 100644 index 000000000000..fc0add016e1c --- /dev/null +++ b/deps/v8/src/asan.h @@ -0,0 +1,30 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// AddressSanitizer support. + +#ifndef V8_ASAN_H_ +#define V8_ASAN_H_ + +#include "src/base/macros.h" +#include "src/globals.h" + +#ifdef V8_USE_ADDRESS_SANITIZER + +#include + +#else // !V8_USE_ADDRESS_SANITIZER + +#define ASAN_POISON_MEMORY_REGION(start, size) \ + static_assert( \ + (std::is_pointer::value || \ + std::is_same::value) && \ + std::is_convertible::value, \ + "static type violation") +#define ASAN_UNPOISON_MEMORY_REGION(start, size) \ + ASAN_POISON_MEMORY_REGION(start, size) + +#endif // V8_USE_ADDRESS_SANITIZER + +#endif // V8_ASAN_H_ diff --git a/deps/v8/src/asmjs/asm-parser.cc b/deps/v8/src/asmjs/asm-parser.cc index f210b42a62e0..1fca56b0fc84 100644 --- a/deps/v8/src/asmjs/asm-parser.cc +++ b/deps/v8/src/asmjs/asm-parser.cc @@ -1345,7 +1345,8 @@ void AsmJsParser::ValidateCase() { FAIL("Numeric literal out of range"); } int32_t value = static_cast(uvalue); - if (negate) { + DCHECK_IMPLIES(negate && uvalue == 0x80000000, value == kMinInt); + if (negate && value != kMinInt) { value = -value; } EXPECT_TOKEN(':'); @@ -1406,7 +1407,6 @@ AsmType* AsmJsParser::NumericLiteral() { current_function_builder_->EmitI32Const(static_cast(uvalue)); return AsmType::FixNum(); } else { - DCHECK_LE(uvalue, 0xFFFFFFFF); current_function_builder_->EmitI32Const(static_cast(uvalue)); return AsmType::Unsigned(); } @@ -2501,18 +2501,16 @@ void AsmJsParser::GatherCases(ZoneVector* cases) { } } else if (depth == 1 && Peek(TOK(case))) { scanner_.Next(); - int32_t value; uint32_t uvalue; - if (Check('-')) { - if (!CheckForUnsigned(&uvalue)) { - break; - } - value = -static_cast(uvalue); - } else { - if (!CheckForUnsigned(&uvalue)) { - break; - } - value = static_cast(uvalue); + bool negate = false; + if (Check('-')) negate = true; + if (!CheckForUnsigned(&uvalue)) { + break; + } + int32_t value = static_cast(uvalue); + DCHECK_IMPLIES(negate && uvalue == 0x80000000, value == kMinInt); + if (negate && value != kMinInt) { + value = -value; } cases->push_back(value); } else if (Peek(AsmJsScanner::kEndOfInput) || diff --git a/deps/v8/src/assembler-arch.h b/deps/v8/src/assembler-arch.h new file mode 100644 index 000000000000..5858907537c4 --- /dev/null +++ b/deps/v8/src/assembler-arch.h @@ -0,0 +1,30 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_ASSEMBLER_ARCH_H_ +#define V8_ASSEMBLER_ARCH_H_ + +#include "src/assembler.h" + +#if V8_TARGET_ARCH_IA32 +#include "src/ia32/assembler-ia32.h" +#elif V8_TARGET_ARCH_X64 +#include "src/x64/assembler-x64.h" +#elif V8_TARGET_ARCH_ARM64 +#include "src/arm64/assembler-arm64.h" +#elif V8_TARGET_ARCH_ARM +#include "src/arm/assembler-arm.h" +#elif V8_TARGET_ARCH_PPC +#include "src/ppc/assembler-ppc.h" +#elif V8_TARGET_ARCH_MIPS +#include "src/mips/assembler-mips.h" +#elif V8_TARGET_ARCH_MIPS64 +#include "src/mips64/assembler-mips64.h" +#elif V8_TARGET_ARCH_S390 +#include "src/s390/assembler-s390.h" +#else +#error Unknown architecture. +#endif + +#endif // V8_ASSEMBLER_ARCH_H_ diff --git a/deps/v8/src/assembler.cc b/deps/v8/src/assembler.cc index 48d10418c0ac..799f08a4d893 100644 --- a/deps/v8/src/assembler.cc +++ b/deps/v8/src/assembler.cc @@ -54,7 +54,7 @@ const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; AssemblerBase::IsolateData::IsolateData(Isolate* isolate) : serializer_enabled_(isolate->serializer_enabled()) -#if V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 , code_range_start_( isolate->heap()->memory_allocator()->code_range()->start()) @@ -96,7 +96,7 @@ void AssemblerBase::FlushICache(void* start, size_t size) { void AssemblerBase::Print(Isolate* isolate) { OFStream os(stdout); - v8::internal::Disassembler::Decode(isolate, &os, buffer_, pc_, nullptr); + v8::internal::Disassembler::Decode(isolate, &os, buffer_, pc_); } // ----------------------------------------------------------------------------- @@ -313,9 +313,10 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) { byte* begin_pos = pos_; #endif DCHECK(rinfo->rmode() < RelocInfo::NUMBER_OF_MODES); - DCHECK_GE(rinfo->pc() - last_pc_, 0); + DCHECK_GE(rinfo->pc() - reinterpret_cast
(last_pc_), 0); // Use unsigned delta-encoding for pc. - uint32_t pc_delta = static_cast(rinfo->pc() - last_pc_); + uint32_t pc_delta = + static_cast(rinfo->pc() - reinterpret_cast
(last_pc_)); // The two most common modes are given small tags, and usually fit in a byte. if (rmode == RelocInfo::EMBEDDED_OBJECT) { @@ -337,7 +338,7 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) { WriteIntData(static_cast(rinfo->data())); } } - last_pc_ = rinfo->pc(); + last_pc_ = reinterpret_cast(rinfo->pc()); #ifdef DEBUG DCHECK_LE(begin_pos - pos_, kMaxSize); #endif @@ -450,38 +451,39 @@ void RelocIterator::next() { } RelocIterator::RelocIterator(Code* code, int mode_mask) - : mode_mask_(mode_mask) { - rinfo_.host_ = code; - rinfo_.pc_ = code->raw_instruction_start(); - rinfo_.data_ = 0; - rinfo_.constant_pool_ = code->constant_pool(); - // Relocation info is read backwards. - pos_ = code->relocation_start() + code->relocation_size(); - end_ = code->relocation_start(); - if (mode_mask_ == 0) pos_ = end_; - next(); -} + : RelocIterator(code, code->raw_instruction_start(), code->constant_pool(), + code->relocation_end(), code->relocation_start(), + mode_mask) {} + +RelocIterator::RelocIterator(const CodeReference code_reference, int mode_mask) + : RelocIterator(nullptr, code_reference.instruction_start(), + code_reference.constant_pool(), + code_reference.relocation_end(), + code_reference.relocation_start(), mode_mask) {} RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) - : mode_mask_(mode_mask) { - rinfo_.pc_ = desc.buffer; - // Relocation info is read backwards. - pos_ = desc.buffer + desc.buffer_size; - end_ = pos_ - desc.reloc_size; - if (mode_mask_ == 0) pos_ = end_; - next(); -} + : RelocIterator(nullptr, reinterpret_cast
(desc.buffer), 0, + desc.buffer + desc.buffer_size, + desc.buffer + desc.buffer_size - desc.reloc_size, + mode_mask) {} RelocIterator::RelocIterator(Vector instructions, Vector reloc_info, Address const_pool, int mode_mask) - : mode_mask_(mode_mask) { - rinfo_.pc_ = instructions.start(); - rinfo_.constant_pool_ = const_pool; + : RelocIterator(nullptr, reinterpret_cast
(instructions.start()), + const_pool, reloc_info.start() + reloc_info.size(), + reloc_info.start(), mode_mask) { rinfo_.flags_ = RelocInfo::kInNativeWasmCode; +} + +RelocIterator::RelocIterator(Code* host, Address pc, Address constant_pool, + const byte* pos, const byte* end, int mode_mask) + : pos_(pos), end_(end), mode_mask_(mode_mask) { // Relocation info is read backwards. - pos_ = reloc_info.start() + reloc_info.size(); - end_ = reloc_info.start(); + DCHECK_GE(pos_, end_); + rinfo_.host_ = host; + rinfo_.pc_ = pc; + rinfo_.constant_pool_ = constant_pool; if (mode_mask_ == 0) pos_ = end_; next(); } @@ -551,7 +553,7 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { } void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT - os << static_cast(pc_) << " " << RelocModeName(rmode_); + os << reinterpret_cast(pc_) << " " << RelocModeName(rmode_); if (IsComment(rmode_)) { os << " (" << reinterpret_cast(data_) << ")"; } else if (rmode_ == DEOPT_SCRIPT_OFFSET || rmode_ == DEOPT_INLINING_ID) { @@ -565,7 +567,7 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT ExternalReferenceEncoder ref_encoder(isolate); os << " (" << ref_encoder.NameOfAddress(isolate, target_external_reference()) - << ") (" << static_cast(target_external_reference()) + << ") (" << reinterpret_cast(target_external_reference()) << ")"; } else if (IsCodeTarget(rmode_)) { const Address code_target = target_address(); @@ -582,7 +584,7 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT } os << ") "; } - os << " (" << static_cast(target_address()) << ")"; + os << " (" << reinterpret_cast(target_address()) << ")"; } else if (IsRuntimeEntry(rmode_) && isolate->deoptimizer_data() != nullptr) { // Depotimization bailouts are stored as runtime entries. int id = Deoptimizer::GetDeoptimizationId( @@ -607,7 +609,7 @@ void RelocInfo::Verify(Isolate* isolate) { case CODE_TARGET: { // convert inline target address to code object Address addr = target_address(); - CHECK_NOT_NULL(addr); + CHECK_NE(addr, kNullAddress); // Check that we can find the right code object. Code* code = Code::GetCodeFromTargetAddress(addr); Object* found = isolate->FindCodeObject(addr); @@ -626,7 +628,7 @@ void RelocInfo::Verify(Isolate* isolate) { } case OFF_HEAP_TARGET: { Address addr = target_off_heap_target(); - CHECK_NOT_NULL(addr); + CHECK_NE(addr, kNullAddress); CHECK_NOT_NULL(InstructionStream::TryLookupCode(isolate, addr)); break; } diff --git a/deps/v8/src/assembler.h b/deps/v8/src/assembler.h index e79f4cc86933..35f6147053a5 100644 --- a/deps/v8/src/assembler.h +++ b/deps/v8/src/assembler.h @@ -40,6 +40,7 @@ #include #include "src/allocation.h" +#include "src/code-reference.h" #include "src/contexts.h" #include "src/deoptimize-reason.h" #include "src/double.h" @@ -98,7 +99,7 @@ class AssemblerBase: public Malloced { IsolateData(const IsolateData&) = default; bool serializer_enabled_; -#if V8_TARGET_ARCH_X64 +#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 Address code_range_start_; #endif }; @@ -162,6 +163,9 @@ class AssemblerBase: public Malloced { static const int kMinimalBufferSize = 4*KB; static void FlushICache(void* start, size_t size); + static void FlushICache(Address start, size_t size) { + return FlushICache(reinterpret_cast(start), size); + } protected: // The buffer into which code and relocation info are generated. It could @@ -180,6 +184,7 @@ class AssemblerBase: public Malloced { } // The program counter, which points into the buffer above and moves forward. + // TODO(jkummerow): This should probably have type {Address}. byte* pc_; private: @@ -315,11 +320,6 @@ class CpuFeatures : public AllStatic { DISALLOW_COPY_AND_ASSIGN(CpuFeatures); }; - -enum SaveFPRegsMode { kDontSaveFPRegs, kSaveFPRegs }; - -enum ArgvMode { kArgvOnStack, kArgvInRegister }; - // Specifies whether to perform icache flush operations on RelocInfo updates. // If FLUSH_ICACHE_IF_NEEDED, the icache will always be flushed if an // instruction was modified. If SKIP_ICACHE_FLUSH the flush will always be @@ -414,7 +414,7 @@ class RelocInfo { RelocInfo() = default; - RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) + RelocInfo(Address pc, Mode rmode, intptr_t data, Code* host) : pc_(pc), rmode_(rmode), data_(data), host_(host) {} static inline bool IsRealRelocMode(Mode mode) { @@ -476,8 +476,7 @@ class RelocInfo { static constexpr int ModeMask(Mode mode) { return 1 << mode; } // Accessors - byte* pc() const { return pc_; } - void set_pc(byte* pc) { pc_ = pc; } + Address pc() const { return pc_; } Mode rmode() const { return rmode_; } intptr_t data() const { return data_; } Code* host() const { return host_; } @@ -613,15 +612,13 @@ class RelocInfo { uint32_t embedded_size() const; Address embedded_address() const; - // On ARM, note that pc_ is the address of the constant pool entry - // to be relocated and not the address of the instruction - // referencing the constant pool entry (except when rmode_ == - // comment). - byte* pc_; + // On ARM/ARM64, note that pc_ is the address of the instruction referencing + // the constant pool and not the address of the constant pool entry. + Address pc_; Mode rmode_; intptr_t data_ = 0; Code* host_; - Address constant_pool_ = nullptr; + Address constant_pool_ = kNullAddress; Flags flags_; friend class RelocIterator; }; @@ -683,6 +680,8 @@ class RelocIterator: public Malloced { // iteration iff bit k of mode_mask is set. explicit RelocIterator(Code* code, int mode_mask = -1); explicit RelocIterator(const CodeDesc& desc, int mode_mask = -1); + explicit RelocIterator(const CodeReference code_reference, + int mode_mask = -1); explicit RelocIterator(Vector instructions, Vector reloc_info, Address const_pool, int mode_mask = -1); @@ -700,6 +699,9 @@ class RelocIterator: public Malloced { } private: + RelocIterator(Code* host, Address pc, Address constant_pool, const byte* pos, + const byte* end, int mode_mask); + // Advance* moves the position before/after reading. // *Read* reads from current byte(s) into rinfo_. // *Get* just reads and returns info on current byte. @@ -958,8 +960,8 @@ class RegisterBase { } template - static constexpr int bit() { - return 1 << code(); + static constexpr RegList bit() { + return RegList{1} << code(); } static SubType from_code(int code) { @@ -968,11 +970,18 @@ class RegisterBase { return SubType{code}; } + // Constexpr version (pass registers as template parameters). template static constexpr RegList ListOf() { return CombineRegLists(RegisterBase::bit()...); } + // Non-constexpr version (pass registers as method parameters). + template + static RegList ListOf(Register... regs) { + return CombineRegLists(regs.bit()...); + } + bool is_valid() const { return reg_code_ != kCode_no_reg; } int code() const { @@ -980,7 +989,7 @@ class RegisterBase { return reg_code_; } - int bit() const { return 1 << code(); } + RegList bit() const { return RegList{1} << code(); } inline constexpr bool operator==(SubType other) const { return reg_code_ == other.reg_code_; diff --git a/deps/v8/src/ast/ast-value-factory.cc b/deps/v8/src/ast/ast-value-factory.cc index 458afb8bc1d6..5efecc5375a3 100644 --- a/deps/v8/src/ast/ast-value-factory.cc +++ b/deps/v8/src/ast/ast-value-factory.cc @@ -223,7 +223,6 @@ AstRawString* AstValueFactory::GetOneByteStringInternal( return GetString(hash_field, true, literal); } - AstRawString* AstValueFactory::GetTwoByteStringInternal( Vector literal) { uint32_t hash_field = StringHasher::HashSequentialString( @@ -231,7 +230,6 @@ AstRawString* AstValueFactory::GetTwoByteStringInternal( return GetString(hash_field, false, Vector::cast(literal)); } - const AstRawString* AstValueFactory::GetString(Handle literal) { AstRawString* result = nullptr; DisallowHeapAllocation no_gc; @@ -280,7 +278,6 @@ void AstValueFactory::Internalize(Isolate* isolate) { ResetStrings(); } - AstRawString* AstValueFactory::GetString(uint32_t hash_field, bool is_one_byte, Vector literal_bytes) { // literal_bytes here points to whatever the user passed, and this is OK diff --git a/deps/v8/src/ast/ast.cc b/deps/v8/src/ast/ast.cc index 392af8a5013a..15b8bff61b69 100644 --- a/deps/v8/src/ast/ast.cc +++ b/deps/v8/src/ast/ast.cc @@ -276,7 +276,9 @@ std::unique_ptr FunctionLiteral::GetDebugName() const { AllowHandleDereference allow_deref; return inferred_name_->ToCString(); } else { - return std::unique_ptr(new char{'\0'}); + char* empty_str = new char[1]; + empty_str[0] = 0; + return std::unique_ptr(empty_str); } // TODO(rmcilroy): Deal with two-character strings. diff --git a/deps/v8/src/ast/ast.h b/deps/v8/src/ast/ast.h index b95d54abb9bd..35dede266b37 100644 --- a/deps/v8/src/ast/ast.h +++ b/deps/v8/src/ast/ast.h @@ -1429,6 +1429,8 @@ class ArrayLiteral final : public AggregateLiteral { ZoneList* values() const { return values_; } + int first_spread_index() const { return first_spread_index_; } + bool is_empty() const; // Populate the depth field and flags, returns the depth. @@ -1453,16 +1455,6 @@ class ArrayLiteral final : public AggregateLiteral { return AggregateLiteral::ComputeFlags(disable_mementos); } - // Provide a mechanism for iterating through values to rewrite spreads. - ZoneList::iterator FirstSpreadOrEndValue() const { - return (first_spread_index_ >= 0) ? values_->begin() + first_spread_index_ - : values_->end(); - } - ZoneList::iterator BeginValue() const { - return values_->begin(); - } - ZoneList::iterator EndValue() const { return values_->end(); } - private: friend class AstNodeFactory; diff --git a/deps/v8/src/ast/prettyprinter.cc b/deps/v8/src/ast/prettyprinter.cc index 2ca75e3c31e8..4f9029810a04 100644 --- a/deps/v8/src/ast/prettyprinter.cc +++ b/deps/v8/src/ast/prettyprinter.cc @@ -1325,7 +1325,7 @@ void AstPrinter::VisitCompareOperation(CompareOperation* node) { void AstPrinter::VisitSpread(Spread* node) { - IndentedScope indent(this, "...", node->position()); + IndentedScope indent(this, "SPREAD", node->position()); Visit(node->expression()); } diff --git a/deps/v8/src/ast/scopes.cc b/deps/v8/src/ast/scopes.cc index 2c1355ead141..42affeea2c9d 100644 --- a/deps/v8/src/ast/scopes.cc +++ b/deps/v8/src/ast/scopes.cc @@ -2234,6 +2234,8 @@ void Scope::AllocateNonParameterLocal(Variable* var) { if (var->IsUnallocated() && MustAllocate(var)) { if (MustAllocateInContext(var)) { AllocateHeapSlot(var); + DCHECK_IMPLIES(is_catch_scope(), + var->index() == Context::THROWN_OBJECT_INDEX); } else { AllocateStackSlot(var); } diff --git a/deps/v8/src/base/adapters.h b/deps/v8/src/base/adapters.h index f04391e2b22c..6eeaed140bf0 100644 --- a/deps/v8/src/base/adapters.h +++ b/deps/v8/src/base/adapters.h @@ -8,6 +8,8 @@ #ifndef V8_BASE_ADAPTERS_H_ #define V8_BASE_ADAPTERS_H_ +#include + #include "src/base/macros.h" namespace v8 { @@ -17,13 +19,15 @@ namespace base { template class ReversedAdapter { public: - typedef decltype(static_cast(nullptr)->rbegin()) Iterator; + using Iterator = + std::reverse_iterator()))>; explicit ReversedAdapter(T& t) : t_(t) {} - ReversedAdapter(const ReversedAdapter& ra) : t_(ra.t_) {} + ReversedAdapter(const ReversedAdapter& ra) = default; - Iterator begin() const { return t_.rbegin(); } - Iterator end() const { return t_.rend(); } + // TODO(clemensh): Use std::rbegin/std::rend once we have C++14 support. + Iterator begin() const { return Iterator(std::end(t_)); } + Iterator end() const { return Iterator(std::begin(t_)); } private: T& t_; diff --git a/deps/v8/src/base/atomic-utils.h b/deps/v8/src/base/atomic-utils.h index 5ba1ad424606..7787e4ff5279 100644 --- a/deps/v8/src/base/atomic-utils.h +++ b/deps/v8/src/base/atomic-utils.h @@ -14,6 +14,7 @@ namespace v8 { namespace base { +// Deprecated. Use std::atomic for new code. template class AtomicNumber { public: diff --git a/deps/v8/src/base/ieee754.cc b/deps/v8/src/base/ieee754.cc index 95b84cf32802..7a1cc175cb73 100644 --- a/deps/v8/src/base/ieee754.cc +++ b/deps/v8/src/base/ieee754.cc @@ -51,6 +51,7 @@ namespace { /* * A union which permits us to convert between a double and two 32 bit * ints. + * TODO(jkummerow): This is undefined behavior. Use bit_cast instead. */ #if V8_TARGET_LITTLE_ENDIAN diff --git a/deps/v8/src/base/logging.cc b/deps/v8/src/base/logging.cc index e58fdba09f54..64f7fed413e3 100644 --- a/deps/v8/src/base/logging.cc +++ b/deps/v8/src/base/logging.cc @@ -135,7 +135,7 @@ class FailureMessage { static const uintptr_t kStartMarker = 0xdecade10; static const uintptr_t kEndMarker = 0xdecade11; - static const int kMessageBufferSize = 1024; + static const int kMessageBufferSize = 512; uintptr_t start_marker_ = kStartMarker; char message_[kMessageBufferSize]; @@ -154,6 +154,7 @@ void V8_Fatal(const char* file, int line, const char* format, ...) { fflush(stdout); fflush(stderr); + // Print the formatted message to stdout without cropping the output. v8::base::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file, line); diff --git a/deps/v8/src/base/macros.h b/deps/v8/src/base/macros.h index db2f19459168..3437309bc7ee 100644 --- a/deps/v8/src/base/macros.h +++ b/deps/v8/src/base/macros.h @@ -43,7 +43,6 @@ template char (&ArraySizeHelper(const T (&array)[N]))[N]; #endif - // bit_cast is a template function that implements the // equivalent of "*reinterpret_cast(&source)". We need this in // very low-level functions like the protobuf library and fast math @@ -150,20 +149,27 @@ V8_INLINE Dest bit_cast(Source const& source) { #define INLINE(declarator) V8_INLINE declarator #define NO_INLINE(declarator) V8_NOINLINE declarator -// Define V8_USE_ADDRESS_SANITIZER macros. +// Define V8_USE_ADDRESS_SANITIZER macro. #if defined(__has_feature) #if __has_feature(address_sanitizer) #define V8_USE_ADDRESS_SANITIZER 1 #endif #endif -// Define DISABLE_ASAN macros. +// Define DISABLE_ASAN macro. #ifdef V8_USE_ADDRESS_SANITIZER #define DISABLE_ASAN __attribute__((no_sanitize_address)) #else #define DISABLE_ASAN #endif +// Define V8_USE_MEMORY_SANITIZER macro. +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define V8_USE_MEMORY_SANITIZER 1 +#endif +#endif + // Helper macro to define no_sanitize attributes only with clang. #if defined(__clang__) && defined(__has_attribute) #if __has_attribute(no_sanitize) @@ -271,6 +277,14 @@ struct Use { } // namespace base } // namespace v8 +// implicit_cast(x) triggers an implicit cast from {x} to type {A}. This is +// useful in situations where static_cast(x) would do too much. +// Only use this for cheap-to-copy types, or use move semantics explicitly. +template +V8_INLINE A implicit_cast(A x) { + return x; +} + // Define our own macros for writing 64-bit constants. This is less fragile // than defining __STDC_CONSTANT_MACROS before including , and it // works on compilers that don't have it (like MSVC). @@ -296,6 +310,14 @@ struct Use { #define V8PRIdPTR V8_PTR_PREFIX "d" #define V8PRIuPTR V8_PTR_PREFIX "u" +#ifdef V8_TARGET_ARCH_64_BIT +#define V8_PTR_HEX_DIGITS 12 +#define V8PRIxPTR_FMT "0x%012" V8PRIxPTR +#else +#define V8_PTR_HEX_DIGITS 8 +#define V8PRIxPTR_FMT "0x%08" V8PRIxPTR +#endif + // ptrdiff_t is 't' according to the standard, but MSVC uses 'I'. #if V8_CC_MSVC #define V8PRIxPTRDIFF "Ix" diff --git a/deps/v8/src/base/platform/mutex.h b/deps/v8/src/base/platform/mutex.h index 59b653d6cd90..6b4158f079e3 100644 --- a/deps/v8/src/base/platform/mutex.h +++ b/deps/v8/src/base/platform/mutex.h @@ -203,11 +203,21 @@ typedef LazyStaticInstance +// Controls whether a LockGuard always requires a valid Mutex or will just +// ignore it if it's nullptr. +enum class NullBehavior { kRequireNotNull, kIgnoreIfNull }; + +template class LockGuard final { public: - explicit LockGuard(Mutex* mutex) : mutex_(mutex) { mutex_->Lock(); } - ~LockGuard() { mutex_->Unlock(); } + explicit LockGuard(Mutex* mutex) : mutex_(mutex) { + if (Behavior == NullBehavior::kRequireNotNull || mutex_ != nullptr) { + mutex_->Lock(); + } + } + ~LockGuard() { + if (mutex_ != nullptr) mutex_->Unlock(); + } private: Mutex* mutex_; diff --git a/deps/v8/src/base/platform/platform-cygwin.cc b/deps/v8/src/base/platform/platform-cygwin.cc index ddcdc1a2d380..c5d94fc6ba55 100644 --- a/deps/v8/src/base/platform/platform-cygwin.cc +++ b/deps/v8/src/base/platform/platform-cygwin.cc @@ -34,6 +34,8 @@ DWORD GetProtectionFromMemoryPermission(OS::MemoryPermission access) { switch (access) { case OS::MemoryPermission::kNoAccess: return PAGE_NOACCESS; + case OS::MemoryPermission::kRead: + return PAGE_READONLY; case OS::MemoryPermission::kReadWrite: return PAGE_READWRITE; case OS::MemoryPermission::kReadWriteExecute: diff --git a/deps/v8/src/base/platform/platform-fuchsia.cc b/deps/v8/src/base/platform/platform-fuchsia.cc index bba3f1baba95..3a9d65a12d39 100644 --- a/deps/v8/src/base/platform/platform-fuchsia.cc +++ b/deps/v8/src/base/platform/platform-fuchsia.cc @@ -19,6 +19,8 @@ uint32_t GetProtectionFromMemoryPermission(OS::MemoryPermission access) { switch (access) { case OS::MemoryPermission::kNoAccess: return 0; // no permissions + case OS::MemoryPermission::kRead: + return ZX_VM_FLAG_PERM_READ; case OS::MemoryPermission::kReadWrite: return ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE; case OS::MemoryPermission::kReadWriteExecute: diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index fee67589b6b4..d21107d6f785 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -112,6 +112,8 @@ int GetProtectionFromMemoryPermission(OS::MemoryPermission access) { switch (access) { case OS::MemoryPermission::kNoAccess: return PROT_NONE; + case OS::MemoryPermission::kRead: + return PROT_READ; case OS::MemoryPermission::kReadWrite: return PROT_READ | PROT_WRITE; case OS::MemoryPermission::kReadWriteExecute: @@ -352,6 +354,18 @@ bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) { if (ret == 0 && access == OS::MemoryPermission::kNoAccess) { ret = ReclaimInaccessibleMemory(address, size); } + +// For accounting purposes, we want to call MADV_FREE_REUSE on macOS after +// changing permissions away from OS::MemoryPermission::kNoAccess. Since this +// state is not kept at this layer, we always call this if access != kNoAccess. +// The cost is a syscall that effectively no-ops. +// TODO(erikchen): Fix this to only call MADV_FREE_REUSE when necessary. +// https://crbug.com/823915 +#if defined(OS_MACOSX) + if (access != OS::MemoryPermission::kNoAccess) + madvise(address, size, MADV_FREE_REUSE); +#endif + return ret == 0; } diff --git a/deps/v8/src/base/platform/platform-win32.cc b/deps/v8/src/base/platform/platform-win32.cc index d4aa44f8a7d9..f618c65fb645 100644 --- a/deps/v8/src/base/platform/platform-win32.cc +++ b/deps/v8/src/base/platform/platform-win32.cc @@ -758,6 +758,8 @@ DWORD GetProtectionFromMemoryPermission(OS::MemoryPermission access) { switch (access) { case OS::MemoryPermission::kNoAccess: return PAGE_NOACCESS; + case OS::MemoryPermission::kRead: + return PAGE_READONLY; case OS::MemoryPermission::kReadWrite: return PAGE_READWRITE; case OS::MemoryPermission::kReadWriteExecute: diff --git a/deps/v8/src/base/platform/platform.h b/deps/v8/src/base/platform/platform.h index 4fbc87c4aaa5..5d015eeeac37 100644 --- a/deps/v8/src/base/platform/platform.h +++ b/deps/v8/src/base/platform/platform.h @@ -159,6 +159,7 @@ class V8_BASE_EXPORT OS { // v8::PageAllocator. enum class MemoryPermission { kNoAccess, + kRead, kReadWrite, // TODO(hpayer): Remove this flag. Memory should never be rwx. kReadWriteExecute, diff --git a/deps/v8/src/base/template-utils.h b/deps/v8/src/base/template-utils.h index 07356346ec80..cbbe7e3cbf2d 100644 --- a/deps/v8/src/base/template-utils.h +++ b/deps/v8/src/base/template-utils.h @@ -56,13 +56,6 @@ std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } -// implicit_cast(x) triggers an implicit cast from {x} to type {A}. This is -// useful in situations where static_cast(x) would do too much. -template -A implicit_cast(A x) { - return x; -} - // Helper to determine how to pass values: Pass scalars and arrays by value, // others by const reference (even if it was a non-const ref before; this is // disallowed by the style guide anyway). diff --git a/deps/v8/src/bootstrapper.cc b/deps/v8/src/bootstrapper.cc index bbb374918a96..548ef5109a9a 100644 --- a/deps/v8/src/bootstrapper.cc +++ b/deps/v8/src/bootstrapper.cc @@ -19,15 +19,18 @@ #include "src/extensions/trigger-failure-extension.h" #include "src/heap/heap.h" #include "src/isolate-inl.h" +#include "src/objects/api-callbacks.h" +#ifdef V8_INTL_SUPPORT +#include "src/objects/intl-objects.h" +#include "src/objects/js-locale.h" +#endif // V8_INTL_SUPPORT +#include "src/objects/hash-table-inl.h" #include "src/objects/js-regexp.h" +#include "src/objects/templates.h" #include "src/snapshot/natives.h" #include "src/snapshot/snapshot.h" #include "src/wasm/wasm-js.h" -#if V8_INTL_SUPPORT -#include "src/objects/intl-objects.h" -#endif // V8_INTL_SUPPORT - namespace v8 { namespace internal { @@ -161,7 +164,7 @@ class Genesis BASE_EMBEDDED { // Creates some basic objects. Used for creating a context from scratch. void CreateRoots(); // Creates the empty function. Used for creating a context from scratch. - Handle CreateEmptyFunction(Isolate* isolate); + Handle CreateEmptyFunction(); // Returns the %ThrowTypeError% intrinsic function. // See ES#sec-%throwtypeerror% for details. Handle GetThrowTypeErrorIntrinsic(); @@ -357,10 +360,11 @@ void Bootstrapper::DetachGlobal(Handle env) { namespace { V8_NOINLINE Handle SimpleCreateSharedFunctionInfo( - Isolate* isolate, Builtins::Name builtin_id, Handle name, int len) { + Isolate* isolate, Builtins::Name builtin_id, Handle name, int len, + FunctionKind kind = FunctionKind::kNormalFunction) { Handle shared = isolate->factory()->NewSharedFunctionInfoForBuiltin(name, builtin_id, - kNormalFunction); + kind); shared->set_internal_formal_parameter_count(len); shared->set_length(len); return shared; @@ -589,29 +593,33 @@ V8_NOINLINE void InstallSpeciesGetter(Handle constructor) { } // namespace -Handle Genesis::CreateEmptyFunction(Isolate* isolate) { - Factory* factory = isolate->factory(); - +Handle Genesis::CreateEmptyFunction() { // Allocate the function map first and then patch the prototype later. - Handle empty_function_map = factory->CreateSloppyFunctionMap( + Handle empty_function_map = factory()->CreateSloppyFunctionMap( FUNCTION_WITHOUT_PROTOTYPE, MaybeHandle()); empty_function_map->set_is_prototype_map(true); DCHECK(!empty_function_map->is_dictionary_map()); + // Allocate ScopeInfo for the empty function. + Handle scope_info = ScopeInfo::CreateForEmptyFunction(isolate()); + // Allocate the empty function as the prototype for function according to // ES#sec-properties-of-the-function-prototype-object NewFunctionArgs args = NewFunctionArgs::ForBuiltin( - factory->empty_string(), empty_function_map, Builtins::kEmptyFunction); - Handle empty_function = factory->NewFunction(args); + factory()->empty_string(), empty_function_map, Builtins::kEmptyFunction); + Handle empty_function = factory()->NewFunction(args); + native_context()->set_empty_function(*empty_function); // --- E m p t y --- - Handle source = factory->NewStringFromStaticChars("() {}"); - Handle - - + + - diff --git a/deps/v8/tools/turbolizer/node.js b/deps/v8/tools/turbolizer/node.js index b718cdc4dfee..237b4d2b2d20 100644 --- a/deps/v8/tools/turbolizer/node.js +++ b/deps/v8/tools/turbolizer/node.js @@ -57,7 +57,11 @@ var Node = { } else { propsString = "[" + this.properties + "]"; } - return this.title + "\n" + propsString + "\n" + this.opinfo; + let title = this.title + "\n" + propsString + "\n" + this.opinfo; + if (this.origin) { + title += `\nOrigin: #${this.origin.nodeId} in phase ${this.origin.phase}/${this.origin.reducer}`; + } + return title; }, getDisplayLabel: function() { var result = this.id + ":" + this.label; diff --git a/deps/v8/tools/turbolizer/schedule-view.js b/deps/v8/tools/turbolizer/schedule-view.js index ef4789211d3c..0864fceea736 100644 --- a/deps/v8/tools/turbolizer/schedule-view.js +++ b/deps/v8/tools/turbolizer/schedule-view.js @@ -5,124 +5,159 @@ "use strict"; class ScheduleView extends TextView { - constructor(id, broker) { - super(id, broker, null, false); - let view = this; - let BLOCK_STYLE = { - css: 'tag' - }; - const BLOCK_HEADER_STYLE = { - css: 'com', - block_id: -1, - location: function(text) { - let matches = /\d+/.exec(text); - if (!matches) return undefined; - BLOCK_HEADER_STYLE.block_id = Number(matches[0]); - return { - block_id: BLOCK_HEADER_STYLE.block_id - }; - }, - }; - const BLOCK_LINK_STYLE = { - css: 'tag', - link: function(text) { - let id = Number(text.substr(1)); - view.select(function(location) { return location.block_id == id; }, true, true); - } - }; - const ID_STYLE = { - css: 'tag', - location: function(text) { - let matches = /\d+/.exec(text); - return { - node_id: Number(matches[0]), - block_id: BLOCK_HEADER_STYLE.block_id - }; - }, - }; - const ID_LINK_STYLE = { - css: 'tag', - link: function(text) { - let id = Number(text); - view.select(function(location) { return location.node_id == id; }, true, true); + + createViewElement() { + const pane = document.createElement('div'); + pane.setAttribute('id', "schedule"); + pane.innerHTML = + `
+       
    +
+
`; + return pane; + } + + constructor(parentId, broker) { + super(parentId, broker, null, false); + } + + attachSelection(s) { + const view = this; + if (!(s instanceof Set)) return; + view.selectionHandler.clear(); + view.blockSelectionHandler.clear(); + view.sourcePositionSelectionHandler.clear(); + const selected = new Array(); + for (const key of s) selected.push(key); + view.selectionHandler.select(selected, true); + } + + createElementFromString(htmlString) { + var div = document.createElement('div'); + div.innerHTML = htmlString.trim(); + return div.firstChild; + } + + + elementForBlock(block) { + const view = this; + function createElement(tag, cls, content) { + const el = document.createElement(tag); + if (isIterable(cls)) { + for (const c of cls) el.classList.add(c); + } else { + el.classList.add(cls); } - }; - const NODE_STYLE = { css: 'kwd' }; - const GOTO_STYLE = { css: 'kwd', - goto_id: -2, - location: function(text) { - return { - node_id: GOTO_STYLE.goto_id--, - block_id: BLOCK_HEADER_STYLE.block_id - }; + if (content != undefined) el.innerHTML = content; + return el; + } + + function mkNodeLinkHandler(nodeId) { + return function (e) { + e.stopPropagation(); + if (!e.shiftKey) { + view.selectionHandler.clear(); + } + view.selectionHandler.select([nodeId], true); + }; + } + + function createElementForNode(node) { + const nodeEl = createElement("div", "node"); + const node_id = createElement("div", ["node-id", "tag", "clickable"], node.id); + node_id.onclick = mkNodeLinkHandler(node.id); + view.addHtmlElementForNodeId(node.id, node_id); + nodeEl.appendChild(node_id); + const node_label = createElement("div", "node-label", node.label); + nodeEl.appendChild(node_label); + if (node.inputs.length > 0) { + const node_parameters = createElement("div", ["parameter-list", "comma-sep-list"]); + for (const param of node.inputs) { + const paramEl = createElement("div", ["parameter", "tag", "clickable"], param); + node_parameters.appendChild(paramEl); + paramEl.onclick = mkNodeLinkHandler(param); + view.addHtmlElementForNodeId(param, paramEl); + } + nodeEl.appendChild(node_parameters); } + return nodeEl; } - const ARROW_STYLE = { css: 'kwd' }; - let patterns = [ - [ - [/^--- BLOCK B\d+/, BLOCK_HEADER_STYLE, 1], - [/^\s+\d+: /, ID_STYLE, 2], - [/^\s+Goto/, GOTO_STYLE, 6], - [/^.*/, null, -1] - ], - [ - [/^ +/, null], - [/^\(deferred\)/, BLOCK_HEADER_STYLE], - [/^B\d+/, BLOCK_LINK_STYLE], - [/^<-/, ARROW_STYLE], - [/^->/, ARROW_STYLE], - [/^,/, null], - [/^---/, BLOCK_HEADER_STYLE, -1] - ], - // Parse opcode including [] - [ - [/^[A-Za-z0-9_]+(\[.*\])?$/, NODE_STYLE, -1], - [/^[A-Za-z0-9_]+(\[(\[.*?\]|.)*?\])?/, NODE_STYLE, 3] - ], - // Parse optional parameters - [ - [/^ /, null, 4], - [/^\(/, null], - [/^\d+/, ID_LINK_STYLE], - [/^, /, null], - [/^\)$/, null, -1], - [/^\)/, null, 4], - ], - [ - [/^ -> /, ARROW_STYLE, 5], - [/^.*/, null, -1] - ], - [ - [/^B\d+$/, BLOCK_LINK_STYLE, -1], - [/^B\d+/, BLOCK_LINK_STYLE], - [/^, /, null] - ], - [ - [/^ -> /, ARROW_STYLE], - [/^B\d+$/, BLOCK_LINK_STYLE, -1] - ] - ]; - this.setPatterns(patterns); + + function mkBlockLinkHandler(blockId) { + return function (e) { + e.stopPropagation(); + if (!e.shiftKey) { + view.blockSelectionHandler.clear(); + } + view.blockSelectionHandler.select(["" + blockId], true); + }; + } + + const schedule_block = createElement("div", "schedule-block"); + const block_id = createElement("div", ["block-id", "com", "clickable"], block.id); + block_id.onclick = mkBlockLinkHandler(block.id); + schedule_block.appendChild(block_id); + const block_pred = createElement("div", ["predecessor-list", "block-list", "comma-sep-list"]); + for (const pred of block.pred) { + const predEl = createElement("div", ["block-id", "com", "clickable"], pred); + predEl.onclick = mkBlockLinkHandler(pred); + block_pred.appendChild(predEl); + } + if (block.pred.length) schedule_block.appendChild(block_pred); + const nodes = createElement("div", "nodes"); + for (const node of block.nodes) { + nodes.appendChild(createElementForNode(node, block.id)); + } + schedule_block.appendChild(nodes); + const block_succ = createElement("div", ["successor-list", "block-list", "comma-sep-list"]); + for (const succ of block.succ) { + const succEl = createElement("div", ["block-id", "com", "clickable"], succ); + succEl.onclick = mkBlockLinkHandler(succ); + block_succ.appendChild(succEl); + } + if (block.succ.length) schedule_block.appendChild(block_succ); + this.addHtmlElementForBlockId(block.id, schedule_block); + return schedule_block; } - initializeContent(data, rememberedSelection) { - super.initializeContent(data, rememberedSelection); - var graph = this; - var locations = []; - for (var id of rememberedSelection) { - locations.push({ node_id : id }); + addBlocks(blocks) { + for (const block of blocks) { + const blockEl = this.elementForBlock(block); + this.divNode.appendChild(blockEl); } - this.selectLocations(locations, true, true); + } + + initializeContent(data, rememberedSelection) { + this.clearText(); + this.schedule = data.schedule + this.addBlocks(data.schedule.blocks); + this.attachSelection(rememberedSelection); } detachSelection() { - var selection = this.selection.detachSelection(); - var s = new Set(); - for (var i of selection) { - if (i.location.node_id != undefined && i.location.node_id > 0) { - s.add(i.location.node_id); + this.blockSelection.clear(); + this.sourcePositionSelection.clear(); + return this.selection.detachSelection(); + } + + lineString(node) { + return `${node.id}: ${node.label}(${node.inputs.join(", ")})` + } + + searchInputAction(view, searchBar) { + d3.event.stopPropagation(); + this.selectionHandler.clear(); + const query = searchBar.value; + if (query.length == 0) return; + const select = []; + window.sessionStorage.setItem("lastSearch", query); + const reg = new RegExp(query); + for (const node of this.schedule.nodes) { + if (node === undefined) continue; + if (reg.exec(this.lineString(node)) != null) { + select.push(node.id) } - }; - return s; + } + this.selectionHandler.select(select, true); } } diff --git a/deps/v8/tools/turbolizer/selection-broker.js b/deps/v8/tools/turbolizer/selection-broker.js index 822cf1ce1f62..0ae006aa0151 100644 --- a/deps/v8/tools/turbolizer/selection-broker.js +++ b/deps/v8/tools/turbolizer/selection-broker.js @@ -2,98 +2,72 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var SelectionBroker = function() { - this.brokers = []; - this.dispatching = false; - this.lastDispatchingHandler = null; - this.nodePositionMap = []; - this.sortedPositionList = []; - this.positionNodeMap = []; -}; +class SelectionBroker { + constructor(sourceResolver) { + this.sourcePositionHandlers = []; + this.nodeHandlers = []; + this.blockHandlers = []; + this.sourceResolver = sourceResolver; + }; -SelectionBroker.prototype.addSelectionHandler = function(handler) { - this.brokers.push(handler); -} + addSourcePositionHandler(handler) { + this.sourcePositionHandlers.push(handler); + } -SelectionBroker.prototype.setNodePositionMap = function(map) { - let broker = this; - if (!map) return; - broker.nodePositionMap = map; - broker.positionNodeMap = []; - broker.sortedPositionList = []; - let next = 0; - for (let i in broker.nodePositionMap) { - broker.sortedPositionList[next] = Number(broker.nodePositionMap[i]); - broker.positionNodeMap[next++] = i; + addNodeHandler(handler) { + this.nodeHandlers.push(handler); } - broker.sortedPositionList = sortUnique(broker.sortedPositionList, - function(a,b) { return a - b; }); - this.positionNodeMap.sort(function(a,b) { - let result = broker.nodePositionMap[a] - broker.nodePositionMap[b]; - if (result != 0) return result; - return a - b; - }); -} -SelectionBroker.prototype.select = function(from, locations, selected) { - let broker = this; - if (!broker.dispatching) { - broker.lastDispatchingHandler = from; - try { - broker.dispatching = true; - let enrichLocations = function(locations) { - result = []; - for (let location of locations) { - let newLocation = {}; - if (location.pos_start != undefined) { - newLocation.pos_start = location.pos_start; - } - if (location.pos_end != undefined) { - newLocation.pos_end = location.pos_end; - } - if (location.node_id != undefined) { - newLocation.node_id = location.node_id; - } - if (location.block_id != undefined) { - newLocation.block_id = location.block_id; - } - if (newLocation.pos_start == undefined && - newLocation.pos_end == undefined && - newLocation.node_id != undefined) { - if (broker.nodePositionMap && broker.nodePositionMap[location.node_id]) { - newLocation.pos_start = broker.nodePositionMap[location.node_id]; - newLocation.pos_end = location.pos_start + 1; - } - } - result.push(newLocation); - } - return result; - } - locations = enrichLocations(locations); - for (var b of this.brokers) { - if (b != from) { - b.brokeredSelect(locations, selected); - } + addBlockHandler(handler) { + this.blockHandlers.push(handler); + } + + broadcastSourcePositionSelect(from, sourcePositions, selected) { + let broker = this; + sourcePositions = sourcePositions.filter((l) => { + if (typeof l.scriptOffset == 'undefined' + || typeof l.inliningId == 'undefined') { + console.log("Warning: invalid source position"); + return false; } + return true; + }); + for (var b of this.sourcePositionHandlers) { + if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected); } - finally { - broker.dispatching = false; + const nodes = this.sourceResolver.sourcePositionsToNodeIds(sourcePositions); + for (var b of this.nodeHandlers) { + if (b != from) b.brokeredNodeSelect(nodes, selected); } } -} -SelectionBroker.prototype.clear = function(from) { - this.lastDispatchingHandler = null; - if (!this.dispatching) { - try { - this.dispatching = true; - this.brokers.forEach(function(b) { - if (b != from) { - b.brokeredClear(); - } - }); - } finally { - this.dispatching = false; + broadcastNodeSelect(from, nodes, selected) { + let broker = this; + for (var b of this.nodeHandlers) { + if (b != from) b.brokeredNodeSelect(nodes, selected); } + const sourcePositions = this.sourceResolver.nodeIdsToSourcePositions(nodes); + for (var b of this.sourcePositionHandlers) { + if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected); + } + } + + broadcastBlockSelect(from, blocks, selected) { + let broker = this; + for (var b of this.blockHandlers) { + if (b != from) b.brokeredBlockSelect(blocks, selected); + } + } + + broadcastClear(from) { + this.sourcePositionHandlers.forEach(function (b) { + if (b != from) b.brokeredClear(); + }); + this.nodeHandlers.forEach(function (b) { + if (b != from) b.brokeredClear(); + }); + this.blockHandlers.forEach(function (b) { + if (b != from) b.brokeredClear(); + }); } } diff --git a/deps/v8/tools/turbolizer/selection.js b/deps/v8/tools/turbolizer/selection.js index 26f1bde19726..9bd937c84a59 100644 --- a/deps/v8/tools/turbolizer/selection.js +++ b/deps/v8/tools/turbolizer/selection.js @@ -2,107 +2,59 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var Selection = function(handler) { - this.handler = handler; - this.selectionBase = null; - this.lastSelection = null; - this.selection = new Set(); -} - - -Selection.prototype.isEmpty = function() { - return this.selection.size == 0; -} - - -Selection.prototype.clear = function() { - var handler = this.handler; - this.selectionBase = null; - this.lastSelection = null; - handler.select(this.selection, false); - handler.clear(); - this.selection = new Set(); -} +class Selection { + constructor(stringKeyFnc) { + this.selection = new Map(); + this.stringKey = stringKeyFnc; + } + isEmpty() { + return this.selection.size == 0; + } -count = 0; + clear() { + this.selection = new Map(); + } -Selection.prototype.select = function(s, isSelected) { - var handler = this.handler; - if (!(Symbol.iterator in Object(s))) { s = [s]; } - if (isSelected) { - let first = true; - for (let i of s) { - if (first) { - this.selectionBase = i; - this.lastSelection = i; - first = false; + select(s, isSelected) { + if (!isIterable(s)) { s = [s]; } + for (const i of s) { + if (!i) continue; + if (isSelected == undefined) { + isSelected = !this.selection.has(this.stringKey(i)); } - this.selection.add(i); - } - handler.select(this.selection, true); - } else { - let unselectSet = new Set(); - for (let i of s) { - if (this.selection.has(i)) { - unselectSet.add(i); - this.selection.delete(i); + if (isSelected) { + this.selection.set(this.stringKey(i), i); + } else { + this.selection.delete(this.stringKey(i)); } } - handler.select(unselectSet, false); } -} + isSelected(i) { + return this.selection.has(this.stringKey(i)); + } -Selection.prototype.extendTo = function(pos) { - if (pos == this.lastSelection || this.lastSelection === null) return; + isKeySelected(key) { + return this.selection.has(key); + } - var handler = this.handler; - var pos_diff = handler.selectionDifference(pos, true, this.lastSelection, false); - var unselect_diff = []; - if (pos_diff.length == 0) { - pos_diff = handler.selectionDifference(this.selectionBase, false, pos, true); - if (pos_diff.length != 0) { - unselect_diff = handler.selectionDifference(this.lastSelection, true, this.selectionBase, false); - this.selection = new Set(); - this.selection.add(this.selectionBase); - for (var d of pos_diff) { - this.selection.add(d); - } - } else { - unselect_diff = handler.selectionDifference(this.lastSelection, true, pos, false); - for (var d of unselect_diff) { - this.selection.delete(d); - } - } - } else { - unselect_diff = handler.selectionDifference(this.selectionBase, false, this.lastSelection, true); - if (unselect_diff != 0) { - pos_diff = handler.selectionDifference(pos, true, this.selectionBase, false); - if (pos_diff.length == 0) { - unselect_diff = handler.selectionDifference(pos, false, this.lastSelection, true); - } - for (var d of unselect_diff) { - this.selection.delete(d); - } - } - if (pos_diff.length != 0) { - for (var d of pos_diff) { - this.selection.add(d); - } + selectedKeys() { + var result = new Set(); + for (var i of this.selection.keys()) { + result.add(i); } + return result; } - handler.select(unselect_diff, false); - handler.select(pos_diff, true); - this.lastSelection = pos; -} - -Selection.prototype.detachSelection = function() { - var result = new Set(); - for (var i of this.selection) { - result.add(i); + detachSelection() { + var result = new Set(); + for (var i of this.selection.keys()) { + result.add(i); + } + this.clear(); + return result; } - this.clear(); - return result; + + [Symbol.iterator]() { return this.selection.values() } } diff --git a/deps/v8/tools/turbolizer/source-resolver.js b/deps/v8/tools/turbolizer/source-resolver.js new file mode 100644 index 000000000000..dd3732ad5695 --- /dev/null +++ b/deps/v8/tools/turbolizer/source-resolver.js @@ -0,0 +1,326 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function sourcePositionLe(a, b) { + if (a.inliningId == b.inliningId) { + return a.scriptOffset - b.scriptOffset; + } + return a.inliningId - b.inliningId; +} + +function sourcePositionEq(a, b) { + return a.inliningId == b.inliningId && + a.scriptOffset == b.scriptOffset; +} + +function sourcePositionToStringKey(sourcePosition) { + if (!sourcePosition) return "undefined"; + return "" + sourcePosition.inliningId + ":" + sourcePosition.scriptOffset; +} + +class SourceResolver { + constructor() { + // Maps node ids to source positions. + this.nodePositionMap = []; + // Maps source ids to source objects. + this.sources = []; + // Maps inlining ids to inlining objects. + this.inlinings = []; + // Maps source position keys to inlinings. + this.inliningsMap = new Map(); + // Maps source position keys to node ids. + this.positionToNodes = new Map(); + // Maps phase ids to phases. + this.phases = []; + // Maps phase names to phaseIds. + this.phaseNames = new Map(); + // The disassembly phase is stored separately. + this.disassemblyPhase = undefined; + } + + setSources(sources, mainBackup) { + if (sources) { + for (let [sourceId, source] of Object.entries(sources)) { + this.sources[sourceId] = source; + this.sources[sourceId].sourcePositions = []; + } + } + // This is a fallback if the JSON is incomplete (e.g. due to compiler crash). + if (!this.sources[-1]) { + this.sources[-1] = mainBackup; + this.sources[-1].sourcePositions = []; + } + } + + setInlinings(inlinings) { + if (inlinings) { + for (const [inliningId, inlining] of Object.entries(inlinings)) { + this.inlinings[inliningId] = inlining; + this.inliningsMap.set(sourcePositionToStringKey(inlining.inliningPosition), inlining); + } + } + // This is a default entry for the script itself that helps + // keep other code more uniform. + this.inlinings[-1] = { sourceId: -1 }; + } + + setNodePositionMap(map) { + if (!map) return; + if (typeof map[0] != 'object') { + const alternativeMap = {}; + for (const [nodeId, scriptOffset] of Object.entries(map)) { + alternativeMap[nodeId] = { scriptOffset: scriptOffset, inliningId: -1 }; + } + map = alternativeMap; + }; + + for (const [nodeId, sourcePosition] of Object.entries(map)) { + if (sourcePosition == undefined) { + console.log("Warning: undefined source position ", sourcePosition, " for nodeId ", nodeId); + } + const inliningId = sourcePosition.inliningId; + const inlining = this.inlinings[inliningId]; + if (inlining) { + const sourceId = inlining.sourceId; + this.sources[sourceId].sourcePositions.push(sourcePosition); + } + this.nodePositionMap[nodeId] = sourcePosition; + let key = sourcePositionToStringKey(sourcePosition); + if (!this.positionToNodes.has(key)) { + this.positionToNodes.set(key, []); + } + this.positionToNodes.get(key).push(nodeId); + } + for (const [sourceId, source] of Object.entries(this.sources)) { + source.sourcePositions = sortUnique(source.sourcePositions, + sourcePositionLe, sourcePositionEq); + } + } + + sourcePositionsToNodeIds(sourcePositions) { + const nodeIds = new Set(); + for (const sp of sourcePositions) { + let key = sourcePositionToStringKey(sp); + let nodeIdsForPosition = this.positionToNodes.get(key); + if (!nodeIdsForPosition) continue; + for (const nodeId of nodeIdsForPosition) { + nodeIds.add(nodeId); + } + } + return nodeIds; + } + + nodeIdsToSourcePositions(nodeIds) { + const sourcePositions = new Map(); + for (const nodeId of nodeIds) { + let sp = this.nodePositionMap[nodeId]; + let key = sourcePositionToStringKey(sp); + sourcePositions.set(key, sp); + } + const sourcePositionArray = []; + for (const sp of sourcePositions.values()) { + sourcePositionArray.push(sp); + } + return sourcePositionArray; + } + + forEachSource(f) { + this.sources.forEach(f); + } + + translateToSourceId(sourceId, location) { + for (const position of this.getInlineStack(location)) { + let inlining = this.inlinings[position.inliningId]; + if (!inlining) continue; + if (inlining.sourceId == sourceId) { + return position; + } + } + return location; + } + + addInliningPositions(sourcePosition, locations) { + let inlining = this.inliningsMap.get(sourcePositionToStringKey(sourcePosition)); + if (!inlining) return; + let sourceId = inlining.sourceId + const source = this.sources[sourceId]; + for (const sp of source.sourcePositions) { + locations.push(sp); + this.addInliningPositions(sp, locations); + } + } + + getInliningForPosition(sourcePosition) { + return this.inliningsMap.get(sourcePositionToStringKey(sourcePosition)); + } + + getSource(sourceId) { + return this.sources[sourceId]; + } + + getSourceName(sourceId) { + const source = this.sources[sourceId]; + return `${source.sourceName}:${source.functionName}`; + } + + sourcePositionFor(sourceId, scriptOffset) { + if (!this.sources[sourceId]) { + return null; + } + const list = this.sources[sourceId].sourcePositions; + for (let i = 0; i < list.length; i++) { + const sourcePosition = list[i] + const position = sourcePosition.scriptOffset; + const nextPosition = list[Math.min(i + 1, list.length - 1)].scriptOffset; + if ((position <= scriptOffset && scriptOffset < nextPosition)) { + return sourcePosition; + } + } + return null; + } + + sourcePositionsInRange(sourceId, start, end) { + if (!this.sources[sourceId]) return []; + const res = []; + const list = this.sources[sourceId].sourcePositions; + for (let i = 0; i < list.length; i++) { + const sourcePosition = list[i] + if (start <= sourcePosition.scriptOffset && sourcePosition.scriptOffset < end) { + res.push(sourcePosition); + } + } + return res; + } + + getInlineStack(sourcePosition) { + if (!sourcePosition) { + return []; + } + let inliningStack = []; + let cur = sourcePosition; + while (cur && cur.inliningId != -1) { + inliningStack.push(cur); + let inlining = this.inlinings[cur.inliningId]; + if (!inlining) { + break; + } + cur = inlining.inliningPosition; + } + if (cur && cur.inliningId == -1) { + inliningStack.push(cur); + } + return inliningStack; + } + + parsePhases(phases) { + for (const [phaseId, phase] of Object.entries(phases)) { + if (phase.type == 'disassembly') { + this.disassemblyPhase = phase; + } else if (phase.type == 'schedule') { + this.phases.push(this.parseSchedule(phase)) + this.phaseNames.set(phase.name, this.phases.length); + } else { + this.phases.push(phase); + this.phaseNames.set(phase.name, this.phases.length); + } + } + } + + repairPhaseId(anyPhaseId) { + return Math.max(0, Math.min(anyPhaseId, this.phases.length - 1)) + } + + getPhase(phaseId) { + return this.phases[phaseId]; + } + + getPhaseIdByName(phaseName) { + return this.phaseNames.get(phaseName); + } + + forEachPhase(f) { + this.phases.forEach(f); + } + + parseSchedule(phase) { + function createNode(state, match) { + let inputs = []; + if (match.groups.args) { + const nodeIdsString = match.groups.args.replace(/\s/g, ''); + const nodeIdStrings = nodeIdsString.split(','); + inputs = nodeIdStrings.map((n) => Number.parseInt(n, 10)); + } + const node = {id: Number.parseInt(match.groups.id, 10), + label: match.groups.label, + inputs: inputs}; + if (match.groups.blocks) { + const nodeIdsString = match.groups.blocks.replace(/\s/g, '').replace(/B/g,''); + const nodeIdStrings = nodeIdsString.split(','); + const successors = nodeIdStrings.map((n) => Number.parseInt(n, 10)); + state.currentBlock.succ = successors; + } + state.nodes[node.id] = node; + state.currentBlock.nodes.push(node); + } + function createBlock(state, match) { + let predecessors = []; + if (match.groups.in) { + const blockIdsString = match.groups.in.replace(/\s/g, '').replace(/B/g, ''); + const blockIdStrings = blockIdsString.split(','); + predecessors = blockIdStrings.map((n) => Number.parseInt(n, 10)); + } + const block = {id: Number.parseInt(match.groups.id, 10), + isDeferred: match.groups.deferred != undefined, + pred: predecessors.sort(), + succ: [], + nodes: []}; + state.blocks[block.id] = block; + state.currentBlock = block; + } + function setGotoSuccessor(state, match) { + state.currentBlock.succ = [Number.parseInt(match.groups.successor.replace(/\s/g, ''), 10)]; + } + const rules = [ + { + lineRegexps: + [ /^\s*(?\d+):\ (?
### DEP0004: CryptoStream.prototype.readyState -Type: Documentation-only +Type: End-of-Life -The `CryptoStream.prototype.readyState` property is deprecated and should not -be used. +The `CryptoStream.prototype.readyState` property was removed. ### DEP0005: Buffer() constructor @@ -377,9 +376,9 @@ The `NODE_REPL_HISTORY_FILE` environment variable was removed. Please use ### DEP0042: tls.CryptoStream -Type: Documentation-only +Type: End-of-Life -The [`tls.CryptoStream`][] class is deprecated. Please use +The [`tls.CryptoStream`][] class was removed. Please use [`tls.TLSSocket`][] instead. @@ -929,6 +928,9 @@ Type: Documentation-only (supports [`--pending-deprecation`][]) Using `process.binding()` in general should be avoided. The type checking methods in particular can be replaced by using [`util.types`][]. +This deprecation has been superseded by the deprecation of the +`process.binding()` API ([DEP0111](#DEP0111)). + ### DEP0104: process.env string coercion @@ -957,9 +959,9 @@ Type: Documentation-only Using [`crypto.createCipher()`][] and [`crypto.createDecipher()`][] should be avoided as they use a weak key derivation function (MD5 with no salt) and static initialization vectors. It is recommended to derive a key using -[`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] and -[`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][] -objects respectively. +[`crypto.pbkdf2()`][] or [`crypto.scrypt()`][] and to use +[`crypto.createCipheriv()`][] and [`crypto.createDecipheriv()`][] to obtain the +[`Cipher`][] and [`Decipher`][] objects respectively. ### DEP0107: tls.convertNPNProtocols() @@ -987,6 +989,14 @@ Type: Documentation-only The option `produceCachedData` has been deprecated. Use [`script.createCachedData()`][] instead. + +### DEP0111: process.binding() + +Type: Documentation-only + +The `process.binding()` API is intended for use by Node.js internal code +only. Use of `process.binding()` by userland code is unsupported. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array @@ -1014,6 +1024,7 @@ The option `produceCachedData` has been deprecated. Use [`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding [`crypto.fips`]: crypto.html#crypto_crypto_fips [`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback +[`crypto.scrypt()`]: crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback [`decipher.final()`]: crypto.html#crypto_decipher_final_outputencoding [`decipher.setAuthTag()`]: crypto.html#crypto_decipher_setauthtag_buffer [`domain`]: domain.html diff --git a/doc/api/dgram.md b/doc/api/dgram.md index f4db86d5ea8b..50fd5db5a671 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -208,6 +208,7 @@ socket.bind({ +* `callback` {Function} Called when the socket has been closed. Close the underlying socket and stop listening for data on it. If a callback is provided, it is added as a listener for the [`'close'`][] event. diff --git a/doc/api/dns.md b/doc/api/dns.md index 82ee2442a03d..1d988d8b574e 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -134,8 +134,8 @@ changes: pr-url: https://github.com/nodejs/node/pull/744 description: The `all` option is supported now. --> -- `hostname` {string} -- `options` {integer | Object} +* `hostname` {string} +* `options` {integer | Object} - `family` {integer} The record family. Must be `4` or `6`. IPv4 and IPv6 addresses are both returned by default. - `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple @@ -148,7 +148,7 @@ changes: **Default:** currently `false` (addresses are reordered) but this is expected to change in the not too distant future. New code should use `{ verbatim: true }`. -- `callback` {Function} +* `callback` {Function} - `err` {Error} - `address` {string} A string representation of an IPv4 or IPv6 address. - `family` {integer} `4` or `6`, denoting the family of `address`. @@ -213,9 +213,9 @@ on some operating systems (e.g FreeBSD 10.1). -- `address` {string} -- `port` {number} -- `callback` {Function} +* `address` {string} +* `port` {number} +* `callback` {Function} - `err` {Error} - `hostname` {string} e.g. `example.com` - `service` {string} e.g. `http` @@ -244,9 +244,9 @@ If this method is invoked as its [`util.promisify()`][]ed version, it returns a -- `hostname` {string} Hostname to resolve. -- `rrtype` {string} Resource record type. **Default:** `'A'`. -- `callback` {Function} +* `hostname` {string} Hostname to resolve. +* `rrtype` {string} Resource record type. **Default:** `'A'`. +* `callback` {Function} - `err` {Error} - `records` {string[] | Object[] | Object} @@ -281,13 +281,13 @@ changes: description: This method now supports passing `options`, specifically `options.ttl`. --> -- `hostname` {string} Hostname to resolve. -- `options` {Object} +* `hostname` {string} Hostname to resolve. +* `options` {Object} - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. -- `callback` {Function} +* `callback` {Function} - `err` {Error} - `addresses` {string[] | Object[]} @@ -305,13 +305,13 @@ changes: description: This method now supports passing `options`, specifically `options.ttl`. --> -- `hostname` {string} Hostname to resolve. -- `options` {Object} +* `hostname` {string} Hostname to resolve. +* `options` {Object} - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. -- `callback` {Function} +* `callback` {Function} - `err` {Error} - `addresses` {string[] | Object[]} @@ -321,8 +321,8 @@ will contain an array of IPv6 addresses. ## dns.resolveAny(hostname, callback) -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `ret` {Object[]} @@ -368,8 +368,8 @@ Here is an example of the `ret` object passed to the callback: -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {string[]} @@ -382,8 +382,8 @@ will contain an array of canonical name records available for the `hostname` -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {Object[]} @@ -396,8 +396,8 @@ property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {Object[]} @@ -428,8 +428,8 @@ function will contain an array of objects with the following properties: -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {string[]} @@ -442,8 +442,8 @@ contain an array of name server records available for `hostname` -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {string[]} @@ -455,8 +455,8 @@ be an array of strings containing the reply records. -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `address` {Object} @@ -489,8 +489,8 @@ be an object with the following properties: -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `addresses` {Object[]} @@ -517,8 +517,8 @@ be an array of objects with the following properties: -- `hostname` {string} -- `callback` {Function} +* `hostname` {string} +* `callback` {Function} - `err` {Error} - `records` {string[][]} @@ -533,8 +533,8 @@ treated separately. -- `ip` {string} -- `callback` {Function} +* `ip` {string} +* `callback` {Function} - `err` {Error} - `hostnames` {string[]} @@ -548,7 +548,7 @@ one of the [DNS error codes][]. -- `servers` {string[]} array of [rfc5952][] formatted addresses +* `servers` {string[]} array of [rfc5952][] formatted addresses Sets the IP address and port of servers to be used when performing DNS resolution. The `servers` argument is an array of [rfc5952][] formatted @@ -654,8 +654,8 @@ section if a custom port is used. -- `hostname` {string} -- `options` {integer | Object} +* `hostname` {string} +* `options` {integer | Object} - `family` {integer} The record family. Must be `4` or `6`. IPv4 and IPv6 addresses are both returned by default. - `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple @@ -717,8 +717,8 @@ dnsPromises.lookup('example.com', options).then((result) => { -- `address` {string} -- `port` {number} +* `address` {string} +* `port` {number} Resolves the given `address` and `port` into a hostname and service using the operating system's underlying `getnameinfo` implementation. @@ -742,8 +742,8 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => { -- `hostname` {string} Hostname to resolve. -- `rrtype` {string} Resource record type. **Default:** `'A'`. +* `hostname` {string} Hostname to resolve. +* `rrtype` {string} Resource record type. **Default:** `'A'`. Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array of the resource records. When successful, the `Promise` is resolved with an @@ -771,8 +771,8 @@ is one of the [DNS error codes](#dns_error_codes). -- `hostname` {string} Hostname to resolve. -- `options` {Object} +* `hostname` {string} Hostname to resolve. +* `options` {Object} - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, @@ -786,8 +786,8 @@ addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). -- `hostname` {string} Hostname to resolve. -- `options` {Object} +* `hostname` {string} Hostname to resolve. +* `options` {Object} - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of @@ -801,7 +801,7 @@ addresses. -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). On success, the `Promise` is resolved with an array containing various types of @@ -845,7 +845,7 @@ Here is an example of the result object: -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, the `Promise` is resolved with an array of canonical name records available for @@ -855,7 +855,7 @@ the `hostname` (e.g. `['bar.example.com']`). -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects @@ -866,7 +866,7 @@ containing both a `priority` and `exchange` property (e.g. -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve regular expression based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array @@ -895,7 +895,7 @@ of objects with the following properties: -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server @@ -906,7 +906,7 @@ records available for `hostname` (e.g. -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings @@ -916,7 +916,7 @@ containing the reply records. -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve a start of authority record (`SOA` record) for the `hostname`. On success, the `Promise` is resolved with an object with the @@ -947,7 +947,7 @@ following properties: -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with @@ -972,7 +972,7 @@ the following properties: -- `hostname` {string} +* `hostname` {string} Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array @@ -985,7 +985,7 @@ treated separately. -- `ip` {string} +* `ip` {string} Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of hostnames. @@ -997,7 +997,7 @@ is one of the [DNS error codes](#dns_error_codes). -- `servers` {string[]} array of [rfc5952][] formatted addresses +* `servers` {string[]} array of [rfc5952][] formatted addresses Sets the IP address and port of servers to be used when performing DNS resolution. The `servers` argument is an array of [rfc5952][] formatted diff --git a/doc/api/errors.md b/doc/api/errors.md index adf9ebdcd49e..036754afc132 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -956,6 +956,12 @@ required to send an acknowledgment that it has received and applied the new be sent at any given time. This error code is used when that limit has been reached. + +### ERR_HTTP2_NESTED_PUSH + +An attempt was made to initiate a new push stream from within a push stream. +Nested push streams are not permitted. + ### ERR_HTTP2_NO_SOCKET_MANIPULATION @@ -1569,12 +1575,6 @@ or a pipeline ends non gracefully with no explicit error. An attempt was made to call [`stream.push()`][] after a `null`(EOF) had been pushed to the stream. - -### ERR_STREAM_READ_NOT_IMPLEMENTED - -An attempt was made to use a readable stream that did not implement -[`readable._read()`][]. - ### ERR_STREAM_UNSHIFT_AFTER_END_EVENT @@ -1777,11 +1777,6 @@ The V8 `BreakIterator` API was used but the full ICU data set is not installed. While using the Performance Timing API (`perf_hooks`), no valid performance entry types were found. - -### ERR_VALUE_OUT_OF_RANGE - -Superseded by `ERR_OUT_OF_RANGE`. - ### ERR_VM_MODULE_ALREADY_LINKED @@ -1874,7 +1869,6 @@ A module file could not be resolved while attempting a [`require()`][] or [`new URLSearchParams(iterable)`]: url.html#url_constructor_new_urlsearchparams_iterable [`process.send()`]: process.html#process_process_send_message_sendhandle_options_callback [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn -[`readable._read()`]: stream.html#stream_readable_read_size_1 [`require()`]: modules.html#modules_require [`require('crypto').setEngine()`]: crypto.html#crypto_crypto_setengine_engine_flags [`server.listen()`]: net.html#net_server_listen diff --git a/doc/api/events.md b/doc/api/events.md index bf57572f594d..edb4daa2fbc3 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -228,6 +228,8 @@ The `'removeListener'` event is emitted *after* the `listener` is removed. added: v0.9.12 deprecated: v4.0.0 --> +* `emitter` {EventEmitter} The emitter to query +* `eventName` {string|symbol} The event name > Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. @@ -286,8 +288,8 @@ Its `name` property is set to `'MaxListenersExceededWarning'`. -- `eventName` {string|symbol} -- `listener` {Function} +* `eventName` {string|symbol} +* `listener` {Function} Alias for `emitter.on(eventName, listener)`. @@ -295,9 +297,9 @@ Alias for `emitter.on(eventName, listener)`. -- `eventName` {string|symbol} +* `eventName` {string|symbol} - `...args` {any} -- Returns: {boolean} +* Returns: {boolean} Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments @@ -310,7 +312,7 @@ Returns `true` if the event had listeners, `false` otherwise. added: v6.0.0 --> -- Returns: {Array} +* Returns: {Array} Returns an array listing the events for which the emitter has registered listeners. The values in the array will be strings or `Symbol`s. @@ -333,7 +335,7 @@ console.log(myEE.eventNames()); added: v1.0.0 --> -- Returns: {integer} +* Returns: {integer} Returns the current max listener value for the `EventEmitter` which is either set by [`emitter.setMaxListeners(n)`][] or defaults to @@ -358,8 +360,8 @@ changes: description: For listeners attached using `.once()` this returns the original listeners instead of wrapper functions now. --> -- `eventName` {string|symbol} -- Returns: {Function[]} +* `eventName` {string|symbol} +* Returns: {Function[]} Returns a copy of the array of listeners for the event named `eventName`. @@ -501,8 +503,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {string|symbol} -- Returns: {EventEmitter} +* `eventName` {string|symbol} +* Returns: {EventEmitter} Removes all listeners, or those of the specified `eventName`. @@ -516,9 +518,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {string|symbol} -- `listener` {Function} -- Returns: {EventEmitter} +* `eventName` {string|symbol} +* `listener` {Function} +* Returns: {EventEmitter} Removes the specified `listener` from the listener array for the event named `eventName`. @@ -585,8 +587,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `n` {integer} -- Returns: {EventEmitter} +* `n` {integer} +* Returns: {EventEmitter} By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding @@ -601,8 +603,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {string|symbol} -- Returns: {Function[]} +* `eventName` {string|symbol} +* Returns: {Function[]} Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once()`). diff --git a/doc/api/http.md b/doc/api/http.md index e83c507bf2ee..8b1274f06d29 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1777,14 +1777,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/15752 description: The `options` argument is supported now. --> -- `options` {Object} +* `options` {Object} * `IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. **Default:** `IncomingMessage`. * `ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. **Default:** `ServerResponse`. -- `requestListener` {Function} +* `requestListener` {Function} * Returns: {http.Server} @@ -1794,15 +1794,20 @@ The `requestListener` is a function which is automatically added to the [`'request'`][] event. ## http.get(options[, callback]) +## http.get(url[, options][, callback]) -* `options` {Object | string | URL} Accepts the same `options` as +* `url` {string | URL} +* `options` {Object} Accepts the same `options` as [`http.request()`][], with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. * `callback` {Function} @@ -1866,15 +1871,20 @@ Global instance of `Agent` which is used as the default for all HTTP client requests. ## http.request(options[, callback]) +## http.request(url[, options][, callback]) -* `options` {Object | string | URL} +* `url` {string | URL} +* `options` {Object} * `protocol` {string} Protocol to use. **Default:** `'http:'`. * `host` {string} A domain name or IP address of the server to issue the request to. **Default:** `'localhost'`. @@ -1916,10 +1926,13 @@ changes: Node.js maintains several connections per server to make HTTP requests. This function allows one to transparently issue requests. -`options` can be an object, a string, or a [`URL`][] object. If `options` is a +`url` can be a string or a [`URL`][] object. If `url` is a string, it is automatically parsed with [`url.parse()`][]. If it is a [`URL`][] object, it will be automatically converted to an ordinary `options` object. +If both `url` and `options` are specified, the objects are merged, with the +`options` properties taking precedence. + The optional `callback` parameter will be added as a one-time listener for the [`'response'`][] event. diff --git a/doc/api/http2.md b/doc/api/http2.md index f24e13eeb033..34a53e33b7f2 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -108,7 +108,12 @@ have occasion to work with the `Http2Session` object directly, with most actions typically taken through interactions with either the `Http2Server` or `Http2Stream` objects. -#### `Http2Session` and Sockets +User code will not create `Http2Session` instances directly. Server-side +`Http2Session` instances are created by the `Http2Server` instance when a +new HTTP/2 connection is received. Client-side `Http2Session` instances are +created using the `http2.connect()` method. + +#### Http2Session and Sockets Every `Http2Session` instance is associated with exactly one [`net.Socket`][] or [`tls.TLSSocket`][] when it is created. When either the `Socket` or the @@ -1251,6 +1256,9 @@ Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. +Calling `http2stream.pushStream()` from within a pushed stream is not permitted +and will throw an error. + #### http2stream.respond([headers[, options]]) - -If a `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here. -The stream will already be destroyed when this event is triggered. - #### Event: 'stream' -- `callback` {Function} +* `callback` {Function} Stops the server from accepting new connections. See [`net.Server.close()`][]. @@ -1629,6 +1629,10 @@ added: v8.4.0 * Extends: {tls.Server} +Instances of `Http2SecureServer` are created using the +`http2.createSecureServer()` function. The `Http2SecureServer` class is not +exported directly by the `http2` module. + #### Event: 'checkContinue' -- `callback` {Function} +* `callback` {Function} Stops the server from accepting new connections. See [`tls.Server.close()`][]. @@ -3145,6 +3149,8 @@ will result in a [`TypeError`][] being thrown. +* `headers` {HTTP/2 Headers Object} An object describing the headers +* `callback` {Function} Call [`http2stream.pushStream()`][] with the given headers, and wraps the given newly created [`Http2Stream`] on `Http2ServerResponse`. diff --git a/doc/api/https.md b/doc/api/https.md index 160967d1eb60..51b65ffeedc1 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -27,7 +27,7 @@ This class is a subclass of `tls.Server` and emits events same as -- `callback` {Function} +* `callback` {Function} See [`server.close()`][`http.close()`] from the HTTP module for details. @@ -47,8 +47,8 @@ See [`http.Server#maxHeadersCount`][]. -- `msecs` {number} **Default:** `120000` (2 minutes) -- `callback` {Function} +* `msecs` {number} **Default:** `120000` (2 minutes) +* `callback` {Function} See [`http.Server#setTimeout()`][]. @@ -72,9 +72,9 @@ See [`http.Server#keepAliveTimeout`][]. -- `options` {Object} Accepts `options` from [`tls.createServer()`][], +* `options` {Object} Accepts `options` from [`tls.createServer()`][], [`tls.createSecureContext()`][] and [`http.createServer()`][]. -- `requestListener` {Function} A listener to be added to the `'request'` event. +* `requestListener` {Function} A listener to be added to the `'request'` event. Example: @@ -112,16 +112,21 @@ https.createServer(options, (req, res) => { ``` ## https.get(options[, callback]) +## https.get(url[, options][, callback]) -- `options` {Object | string | URL} Accepts the same `options` as +* `url` {string | URL} +* `options` {Object | string | URL} Accepts the same `options` as [`https.request()`][], with the `method` always set to `GET`. -- `callback` {Function} +* `callback` {Function} Like [`http.get()`][] but for HTTPS. @@ -155,9 +160,13 @@ added: v0.5.9 Global instance of [`https.Agent`][] for all HTTPS client requests. ## https.request(options[, callback]) +## https.request(url[, options][, callback]) -- `options` {Object | string | URL} Accepts all `options` from +* `url` {string | URL} +* `options` {Object | string | URL} Accepts all `options` from [`http.request()`][], with some differences in default values: - `protocol` **Default:** `'https:'` - `port` **Default:** `443` - `agent` **Default:** `https.globalAgent` -- `callback` {Function} +* `callback` {Function} Makes a request to a secure web server. diff --git a/doc/api/intl.md b/doc/api/intl.md index cce6661521c8..1d844500cceb 100644 --- a/doc/api/intl.md +++ b/doc/api/intl.md @@ -133,7 +133,7 @@ through either: ICU is able to automatically find and load a variety of data formats, but the data must be appropriate for the ICU version, and the file correctly named. -The most common name for the data file is `icudt5X[bl].dat`, where `5X` denotes +The most common name for the data file is `icudt6X[bl].dat`, where `6X` denotes the intended ICU version, and `b` or `l` indicates the system's endianness. Check ["ICU Data"][] article in the ICU User Guide for other supported formats and more details on ICU data in general. diff --git a/doc/api/net.md b/doc/api/net.md index f1e41b46c47d..428ac172142d 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -64,10 +64,12 @@ This class is used to create a TCP or [IPC][] server. ### new net.Server([options][, connectionListener]) +* `options` {Object} See + [`net.createServer([options][, connectionListener])`][`net.createServer()`]. +* `connectionListener` {Function} Automatically set as a listener for the + [`'connection'`][] event. * Returns: {net.Server} -See [`net.createServer([options][, connectionListener])`][`net.createServer()`]. - `net.Server` is an [`EventEmitter`][] with the following events: ### Event: 'close' @@ -112,7 +114,7 @@ Emitted when the server has been bound after calling [`server.listen()`][]. added: v0.1.90 --> -* Returns: {Object} +* Returns: {Object|string} Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening on an IP socket @@ -145,6 +147,7 @@ Don't call `server.address()` until the `'listening'` event has been emitted. added: v0.1.90 --> +* `callback` {Function} Called when the server is closed * Returns: {net.Server} Stops the server from accepting new connections and keeps existing @@ -173,6 +176,7 @@ connections use asynchronous [`server.getConnections()`][] instead. added: v0.9.7 --> +* `callback` {Function} * Returns: {net.Server} Asynchronously get the number of concurrent connections on the server. Works @@ -394,8 +398,6 @@ it to interact with the client. added: v0.3.4 --> -Creates a new socket object. - * `options` {Object} Available options are: * `fd` {number} If specified, wrap around an existing socket with the given file descriptor, otherwise a new socket will be created. @@ -408,6 +410,8 @@ Creates a new socket object. otherwise ignored. **Default:** `false`. * Returns: {net.Socket} +Creates a new socket object. + The newly created socket can be either a TCP socket or a streaming [IPC][] endpoint, depending on what it [`connect()`][`socket.connect()`] to. @@ -668,6 +672,7 @@ callback. added: v0.1.90 --> +* `exception` {Object} * Returns: {net.Socket} Ensures that no more I/O activity happens on this socket. Only necessary in @@ -686,6 +691,8 @@ listeners for that event will receive `exception` as an argument. added: v0.1.90 --> +* `data` {string|Buffer|Uint8Array} +* `encoding` {string} Only used when data is `string`. **Default:** `'utf8'`. * Returns: {net.Socket} The socket itself. Half-closes the socket. i.e., it sends a FIN packet. It is possible the @@ -765,6 +772,7 @@ Resumes reading after a call to [`socket.pause()`][]. added: v0.1.90 --> +* `encoding` {string} * Returns: {net.Socket} The socket itself. Set the encoding for the socket as a [Readable Stream][]. See @@ -804,6 +812,8 @@ algorithm, they buffer data before sending it off. Setting `true` for added: v0.1.90 --> +* `timeout` {number} +* `callback` {Function} * Returns: {net.Socket} The socket itself. Sets the socket to timeout after `timeout` milliseconds of inactivity on @@ -877,6 +887,8 @@ Possible signatures: +* `options` {Object} +* `connectListener` {Function} Alias to [`net.createConnection(options[, connectListener])`][`net.createConnection(options)`]. @@ -884,6 +896,8 @@ Alias to +* `path` {string} +* `connectListener` {Function} Alias to [`net.createConnection(path[, connectListener])`][`net.createConnection(path)`]. @@ -892,6 +906,9 @@ Alias to +* `port` {number} +* `host` {string} +* `connectListener` {Function} Alias to [`net.createConnection(port[, host][, connectListener])`][`net.createConnection(port, host)`]. @@ -1014,6 +1031,8 @@ then returns the `net.Socket` that starts the connection. +* `options` {Object} +* `connectionListener` {Function} Creates a new TCP or [IPC][] server. @@ -1089,6 +1108,7 @@ $ nc -U /tmp/echo.sock added: v0.3.0 --> +* `input` {string} * Returns: {integer} Tests if input is an IP address. Returns `0` for invalid strings, @@ -1100,6 +1120,7 @@ addresses. added: v0.3.0 --> +* `input` {string} * Returns: {boolean} Returns `true` if input is a version 4 IP address, otherwise returns `false`. @@ -1109,6 +1130,7 @@ Returns `true` if input is a version 4 IP address, otherwise returns `false`. added: v0.3.0 --> +* `input` {string} * Returns: {boolean} Returns `true` if input is a version 6 IP address, otherwise returns `false`. diff --git a/doc/api/process.md b/doc/api/process.md index dd0314cf6c3c..0c35007103c2 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1695,6 +1695,7 @@ This feature is not available in [`Worker`][] threads. +* `id` {integer | string} The `process.setuid(id)` method sets the user identity of the process. (See setuid(2).) The `id` can be passed as either a numeric ID or a username string. diff --git a/doc/api/stream.md b/doc/api/stream.md index 5ca713a27b6e..d87748db9ebe 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -363,6 +363,7 @@ See also: [`writable.uncork()`][]. added: v8.0.0 --> +* `error` {Error} * Returns: {this} Destroy the stream, and emit the passed `'error'` and a `'close'` event. @@ -1285,6 +1286,7 @@ Examples of `Transform` streams include: +* `error` {Error} Destroy the stream, and emit `'error'`. After this call, the transform stream would release any internal resources. diff --git a/doc/api/tracing.md b/doc/api/tracing.md index ca91b8aac78c..e067760643a1 100644 --- a/doc/api/tracing.md +++ b/doc/api/tracing.md @@ -18,12 +18,14 @@ The available categories are: The [`async_hooks`] events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. * `node.bootstrap` - Enables capture of Node.js bootstrap milestones. +* `node.fs.sync` - Enables capture of trace data for file system sync methods. * `node.perf` - Enables capture of [Performance API] measurements. * `node.perf.usertiming` - Enables capture of only Performance API User Timing measures and marks. * `node.perf.timerify` - Enables capture of only Performance API timerify measurements. -* `node.fs.sync` - Enables capture of trace data for file system sync methods. +* `node.promises.rejections` - Enables capture of trace data tracking the number + of unhandled Promise rejections and handled-after-rejections. * `node.vm.script` - Enables capture of trace data for the `vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. * `v8` - The [V8] events are GC, compiling, and execution related. diff --git a/doc/api/tty.md b/doc/api/tty.md index 91bca8284d93..cc95bfa9ae86 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -60,6 +60,11 @@ A `boolean` that is always `true` for `tty.ReadStream` instances. added: v0.7.7 --> +* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a + raw device. If `false`, configures the `tty.ReadStream` to operate in its + default mode. The `readStream.isRaw` property will be set to the resulting + mode. + Allows configuration of `tty.ReadStream` so that it operates as a raw device. When in raw mode, input is always available character-by-character, not @@ -67,11 +72,6 @@ including modifiers. Additionally, all special processing of characters by the terminal is disabled, including echoing input characters. Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode. -* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a - raw device. If `false`, configures the `tty.ReadStream` to operate in its - default mode. The `readStream.isRaw` property will be set to the resulting - mode. - ## Class: tty.WriteStream +* `constructor` {Function} +* `superConstructor` {Function} + Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note that the two styles are [semantically incompatible][]. -* `constructor` {Function} -* `superConstructor` {Function} - Inherit the prototype methods from one [constructor][] into another. The prototype of `constructor` will be set to a new object created from `superConstructor`. @@ -944,6 +944,7 @@ useful for addon developers who prefer to do type checking in JavaScript. added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`ArrayBuffer`][] or @@ -964,6 +965,7 @@ util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an `arguments` object. @@ -982,6 +984,7 @@ function foo() { added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`ArrayBuffer`][] instance. @@ -1000,6 +1003,7 @@ util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an [async function][]. @@ -1019,6 +1023,7 @@ util.types.isAsyncFunction(async function foo() {}); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a `BigInt64Array` instance. The @@ -1038,6 +1043,7 @@ util.types.isBigInt64Array(new BigUint64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a `BigUint64Array` instance. The @@ -1057,6 +1063,7 @@ util.types.isBigUint64Array(new BigUint64Array()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a boolean object, e.g. created @@ -1078,6 +1085,7 @@ util.types.isBooleanObject(Boolean(true)); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`DataView`][] instance. @@ -1097,6 +1105,7 @@ See also [`ArrayBuffer.isView()`][]. added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Date`][] instance. @@ -1112,6 +1121,7 @@ util.types.isDate(new Date()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a native `External` value. @@ -1121,6 +1131,7 @@ Returns `true` if the value is a native `External` value. added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Float32Array`][] instance. @@ -1138,6 +1149,7 @@ util.types.isFloat32Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Float64Array`][] instance. @@ -1155,6 +1167,7 @@ util.types.isFloat64Array(new Float64Array()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a generator function. @@ -1174,6 +1187,7 @@ util.types.isGeneratorFunction(function* foo() {}); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a generator object as returned from a @@ -1195,6 +1209,7 @@ util.types.isGeneratorObject(generator); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Int8Array`][] instance. @@ -1212,6 +1227,7 @@ util.types.isInt8Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Int16Array`][] instance. @@ -1229,6 +1245,7 @@ util.types.isInt16Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Int32Array`][] instance. @@ -1246,6 +1263,7 @@ util.types.isInt32Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Map`][] instance. @@ -1261,6 +1279,7 @@ util.types.isMap(new Map()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an iterator returned for a built-in @@ -1281,6 +1300,7 @@ util.types.isMapIterator(map[Symbol.iterator]()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an instance of a [Module Namespace Object][]. @@ -1299,6 +1319,7 @@ util.types.isModuleNamespaceObject(ns); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an instance of a built-in [`Error`][] type. @@ -1316,6 +1337,7 @@ util.types.isNativeError(new RangeError()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a number object, e.g. created @@ -1333,6 +1355,7 @@ util.types.isNumberObject(new Number(0)); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Promise`][]. @@ -1348,6 +1371,7 @@ util.types.isPromise(Promise.resolve(42)); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a [`Proxy`][] instance. @@ -1366,6 +1390,7 @@ util.types.isProxy(proxy); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a regular expression object. @@ -1382,6 +1407,7 @@ util.types.isRegExp(new RegExp('abc')); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Set`][] instance. @@ -1397,6 +1423,7 @@ util.types.isSet(new Set()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is an iterator returned for a built-in @@ -1417,6 +1444,7 @@ util.types.isSetIterator(set[Symbol.iterator]()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`SharedArrayBuffer`][] instance. @@ -1435,6 +1463,7 @@ util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a string object, e.g. created @@ -1452,6 +1481,7 @@ util.types.isStringObject(new String('foo')); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a symbol object, created @@ -1470,6 +1500,7 @@ util.types.isSymbolObject(Object(symbol)); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`TypedArray`][] instance. @@ -1489,6 +1520,7 @@ See also [`ArrayBuffer.isView()`][]. added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Uint8Array`][] instance. @@ -1506,6 +1538,7 @@ util.types.isUint8Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Uint8ClampedArray`][] instance. @@ -1523,6 +1556,7 @@ util.types.isUint8ClampedArray(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Uint16Array`][] instance. @@ -1540,6 +1574,7 @@ util.types.isUint16Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`Uint32Array`][] instance. @@ -1557,6 +1592,7 @@ util.types.isUint32Array(new Float64Array()); // Returns false added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`WeakMap`][] instance. @@ -1572,6 +1608,7 @@ util.types.isWeakMap(new WeakMap()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`WeakSet`][] instance. @@ -1587,6 +1624,7 @@ util.types.isWeakSet(new WeakSet()); // Returns true added: v10.0.0 --> +* `value` {any} * Returns: {boolean} Returns `true` if the value is a built-in [`WebAssembly.Module`][] instance. @@ -1608,6 +1646,8 @@ applications and modules should be updated to find alternative approaches. added: v0.7.5 deprecated: v6.0.0 --> +* `target` {Object} +* `source` {Object} > Stability: 0 - Deprecated: Use [`Object.assign()`] instead. diff --git a/doc/api/v8.md b/doc/api/v8.md index c9afa93f89d4..6536451e3a31 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -175,6 +175,7 @@ changes to the API or wire format) may occur until this warning is removed. added: v8.0.0 --> +* `value` {any} * Returns: {Buffer} Uses a [`DefaultSerializer`][] to serialize `value` into a buffer. @@ -203,6 +204,8 @@ Writes out a header, which includes the serialization format version. #### serializer.writeValue(value) +* `value` {any} + Serializes a JavaScript value and adds the serialized representation to the internal buffer. @@ -362,6 +365,7 @@ For use inside of a custom [`deserializer._readHostObject()`][]. #### deserializer.readRawBytes(length) +* `length` {integer} * Returns: {Buffer} Read raw bytes from the deserializer’s internal buffer. The `length` parameter diff --git a/doc/api/zlib.md b/doc/api/zlib.md index e6c5504bff5d..7a850373a82e 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -428,6 +428,8 @@ as appropriate for the derived class). added: v0.9.4 --> +* `callback` {Function} + Close the underlying handle. ### zlib.flush([kind], callback) @@ -436,6 +438,7 @@ added: v0.5.8 --> * `kind` **Default:** `zlib.constants.Z_FULL_FLUSH` +* `callback` {Function} Flush pending data. Don't call this frivolously, premature flushes negatively impact the effectiveness of the compression algorithm. @@ -450,6 +453,10 @@ writes and will only produce output when data is being read from the stream. added: v0.11.4 --> +* `level` {integer} +* `strategy` {integer} +* `callback` {Function} + Dynamically update the compression level and compression strategy. Only applicable to deflate algorithm. @@ -473,14 +480,18 @@ Provides an object enumerating Zlib-related constants. added: v0.5.8 --> -Creates and returns a new [`Deflate`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`Deflate`][] object. ## zlib.createDeflateRaw([options]) -Creates and returns a new [`DeflateRaw`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`DeflateRaw`][] object. An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits` is set to 8 for raw deflate streams. zlib would automatically set `windowBits` @@ -494,35 +505,45 @@ that effectively uses an 8-bit window only. added: v0.5.8 --> -Creates and returns a new [`Gunzip`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`Gunzip`][] object. ## zlib.createGzip([options]) -Creates and returns a new [`Gzip`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`Gzip`][] object. ## zlib.createInflate([options]) -Creates and returns a new [`Inflate`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`Inflate`][] object. ## zlib.createInflateRaw([options]) -Creates and returns a new [`InflateRaw`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`InflateRaw`][] object. ## zlib.createUnzip([options]) -Creates and returns a new [`Unzip`][] object with the given [`options`][]. +* `options` {Object} + +Creates and returns a new [`Unzip`][] object. ## Convenience Methods @@ -550,6 +571,10 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.deflateSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Compress a chunk of data with [`Deflate`][]. @@ -580,6 +606,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.deflateRawSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Compress a chunk of data with [`DeflateRaw`][]. @@ -613,6 +645,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.gunzipSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Decompress a chunk of data with [`Gunzip`][]. @@ -646,6 +684,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.gzipSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Compress a chunk of data with [`Gzip`][]. @@ -679,6 +723,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.inflateSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Decompress a chunk of data with [`Inflate`][]. @@ -712,6 +762,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.inflateRawSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Decompress a chunk of data with [`InflateRaw`][]. @@ -745,6 +801,11 @@ changes: pr-url: https://github.com/nodejs/node/pull/12001 description: The `buffer` parameter can be an `Uint8Array` now. --> + +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} +* `callback` {Function} + ### zlib.unzipSync(buffer[, options]) -- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} +* `options` {Object} Decompress a chunk of data with [`Unzip`][]. @@ -778,7 +840,6 @@ Decompress a chunk of data with [`Unzip`][]. [`InflateRaw`]: #zlib_class_zlib_inflateraw [`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray [`Unzip`]: #zlib_class_zlib_unzip -[`options`]: #zlib_class_options [`zlib.bytesWritten`]: #zlib_zlib_byteswritten [Memory Usage Tuning]: #zlib_memory_usage_tuning [pool size]: cli.html#cli_uv_threadpool_size_size diff --git a/doc/changelogs/CHANGELOG_V10.md b/doc/changelogs/CHANGELOG_V10.md index d4b9d3b036c1..bde29d35b95c 100644 --- a/doc/changelogs/CHANGELOG_V10.md +++ b/doc/changelogs/CHANGELOG_V10.md @@ -9,6 +9,8 @@ +10.9.0
+10.8.0
10.7.0
10.6.0
10.5.0
@@ -35,6 +37,198 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2018-08-15, Version 10.9.0 (Current), @rvagg + +This is a security release. All Node.js users should consult the security release summary at: + + https://nodejs.org/en/blog/vulnerability/august-2018-security-releases/ + +for details on patched vulnerabilities. + +Fixes for the following CVEs are included in this release: + + * CVE-2018-0732 (OpenSSL) + * CVE-2018-7166 (Node.js) + * CVE-2018-12115 (Node.js) + +### Notable Changes + +* **buffer**: + * Fix out-of-bounds (OOB) write in `Buffer.write()` for UCS-2 encoding (CVE-2018-12115) + * Fix unintentional exposure of uninitialized memory in `Buffer.alloc()` (CVE-2018-7166) +* **deps**: + * Upgrade to OpenSSL 1.1.0i, fixing: + - Client DoS due to large DH parameter (CVE-2018-0732) + - ECDSA key extraction via local side-channel (CVE not assigned) + * Upgrade V8 from 6.7 to 6.8 (Michaël Zasso) [#21079](https://github.com/nodejs/node/pull/21079) + - Memory reduction and performance improvements, details at: https://v8project.blogspot.com/2018/06/v8-release-68.html +* **http**: `http.get()` and `http.request()` (and `https` variants) can now accept three arguments to allow for a `URL` _and_ an `options` object (Sam Ruby) [#21616](https://github.com/nodejs/node/pull/21616) +* Added new collaborators + * Sam Ruby (https://github.com/rubys) + * George Adams (https://github.com/gdams) + +### Commits + +* [[`58a9ae118e`](https://github.com/nodejs/node/commit/58a9ae118e)] - **assert**: fix loose assert with map and set (Ruben Bridgewater) [#22145](https://github.com/nodejs/node/pull/22145) +* [[`1c577016b8`](https://github.com/nodejs/node/commit/1c577016b8)] - **benchmark**: improve assert benchmarks (Ruben Bridgewater) [#22211](https://github.com/nodejs/node/pull/22211) +* [[`734323d9eb`](https://github.com/nodejs/node/commit/734323d9eb)] - **buffer**: stop alloc() uninitialized memory return (cjihrig) [nodejs-private/node-private#137](https://github.com/nodejs-private/node-private/pull/137) +* [[`2c4c17b708`](https://github.com/nodejs/node/commit/2c4c17b708)] - **buffer**: avoid overrun on UCS-2 string write (Rod Vagg) [nodejs-private/node-private#138](https://github.com/nodejs-private/node-private/pull/138) +* [[`6622ac798d`](https://github.com/nodejs/node/commit/6622ac798d)] - **buffer**: use FastBuffer when fill is set to 0 (Сковорода Никита Андреевич) [#21989](https://github.com/nodejs/node/pull/21989) +* [[`f506a5f46e`](https://github.com/nodejs/node/commit/f506a5f46e)] - **build**: make --shared-\[...\]-path work on Windows (Jeremy Apthorp) [#21530](https://github.com/nodejs/node/pull/21530) +* [[`1be6fb93c8`](https://github.com/nodejs/node/commit/1be6fb93c8)] - **build**: add CONFIG\_FLAGS to with-code-cache target (Daniel Bevenius) [#22207](https://github.com/nodejs/node/pull/22207) +* [[`4520bb8a73`](https://github.com/nodejs/node/commit/4520bb8a73)] - **build**: make tools/doc/node\_modules non-phony (Daniel Bevenius) [#22189](https://github.com/nodejs/node/pull/22189) +* [[`c42ff4ebd8`](https://github.com/nodejs/node/commit/c42ff4ebd8)] - **build**: add crypto check to build targets (Daniel Bevenius) [#22148](https://github.com/nodejs/node/pull/22148) +* [[`cdb8c1b44d`](https://github.com/nodejs/node/commit/cdb8c1b44d)] - **build**: extract common parts from addon .buildstamp (Daniel Bevenius) [#22171](https://github.com/nodejs/node/pull/22171) +* [[`1e7a8c3016`](https://github.com/nodejs/node/commit/1e7a8c3016)] - **build**: reset embedder string to "-node.0" (Michaël Zasso) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`86ab2c041e`](https://github.com/nodejs/node/commit/86ab2c041e)] - **crypto**: remove unused SSLWrap handle methods (Jon Moss) [#22216](https://github.com/nodejs/node/pull/22216) +* [[`9212875406`](https://github.com/nodejs/node/commit/9212875406)] - **crypto**: simplify state failure handling (Tobias Nießen) [#22131](https://github.com/nodejs/node/pull/22131) +* [[`916a1d59f0`](https://github.com/nodejs/node/commit/916a1d59f0)] - **crypto**: simplify Hmac::HmacUpdate (Tobias Nießen) [#22132](https://github.com/nodejs/node/pull/22132) +* [[`2dc7f17e8b`](https://github.com/nodejs/node/commit/2dc7f17e8b)] - **(SEMVER-MINOR)** **crypto**: add better scrypt option aliases (Anna Henningsen) [#21525](https://github.com/nodejs/node/pull/21525) +* [[`fcf422e921`](https://github.com/nodejs/node/commit/fcf422e921)] - **deps**: backport c608122b from upstream (Ruben Bridgewater) [#22210](https://github.com/nodejs/node/pull/22210) +* [[`a07ccaeb19`](https://github.com/nodejs/node/commit/a07ccaeb19)] - **deps**: update archs files for OpenSSL-1.1.0i (Shigeki Ohtsu) [#22318](https://github.com/nodejs/node/pull/22318) +* [[`473996c90f`](https://github.com/nodejs/node/commit/473996c90f)] - **deps**: add s390 asm rules for OpenSSL-1.1.0 (Shigeki Ohtsu) [#19794](https://github.com/nodejs/node/pull/19794) +* [[`05e48fd018`](https://github.com/nodejs/node/commit/05e48fd018)] - **deps**: upgrade openssl sources to 1.1.0i (Shigeki Ohtsu) [#22318](https://github.com/nodejs/node/pull/22318) +* [[`f8bc5d6320`](https://github.com/nodejs/node/commit/f8bc5d6320)] - **deps**: cherry-pick 09bca09 from upstream V8 (Matheus Marchini) [#22068](https://github.com/nodejs/node/pull/22068) +* [[`c69fdc9d5f`](https://github.com/nodejs/node/commit/c69fdc9d5f)] - **(SEMVER-MINOR)** **deps**: remove thread\_local to fix V8 compilation (Peter Marshall) [#21668](https://github.com/nodejs/node/pull/21668) +* [[`981fff714e`](https://github.com/nodejs/node/commit/981fff714e)] - **deps**: refactor v8.gyp (Michaël Zasso) [#22017](https://github.com/nodejs/node/pull/22017) +* [[`5fa3ffad20`](https://github.com/nodejs/node/commit/5fa3ffad20)] - **(SEMVER-MINOR)** **deps**: patch the V8 API to be backwards compatible with 6.7 (Peter Marshall) [#21668](https://github.com/nodejs/node/pull/21668) +* [[`6eed40acbb`](https://github.com/nodejs/node/commit/6eed40acbb)] - **deps**: cherry-pick 804a693 from upstream V8 (Matheus Marchini) [#21855](https://github.com/nodejs/node/pull/21855) +* [[`7eccaf86d6`](https://github.com/nodejs/node/commit/7eccaf86d6)] - **deps**: V8: Backport of 0dd3390 from upstream (James M Snell) [#21899](https://github.com/nodejs/node/pull/21899) +* [[`328c89925a`](https://github.com/nodejs/node/commit/328c89925a)] - **deps**: cherry-pick 907d7bc from upstream V8 (Michaël Zasso) [#21838](https://github.com/nodejs/node/pull/21838) +* [[`afacfd2992`](https://github.com/nodejs/node/commit/afacfd2992)] - **deps**: cherry-pick 2075910 from upstream V8 (Michaël Zasso) [#21838](https://github.com/nodejs/node/pull/21838) +* [[`4f24256274`](https://github.com/nodejs/node/commit/4f24256274)] - **deps**: cherry-pick 555c811 from upstream V8 (Anna Henningsen) [#21741](https://github.com/nodejs/node/pull/21741) +* [[`7b4272a14d`](https://github.com/nodejs/node/commit/7b4272a14d)] - **deps**: cherry-pick 477df06 from upstream v8 (Gus Caplan) [#21644](https://github.com/nodejs/node/pull/21644) +* [[`a0bf7aa07c`](https://github.com/nodejs/node/commit/a0bf7aa07c)] - **deps**: cherry-pick 70c4340 from upstream V8 (Matheus Marchini) [#21126](https://github.com/nodejs/node/pull/21126) +* [[`4994ac65b0`](https://github.com/nodejs/node/commit/4994ac65b0)] - **deps**: cherry-pick acc336c from upstream V8 (Matheus Marchini) [#21126](https://github.com/nodejs/node/pull/21126) +* [[`be569f82f1`](https://github.com/nodejs/node/commit/be569f82f1)] - **deps**: cherry-pick b20faff from upstream V8 (Matheus Marchini) [#21126](https://github.com/nodejs/node/pull/21126) +* [[`6df5feb13f`](https://github.com/nodejs/node/commit/6df5feb13f)] - **deps**: cherry-pick aa6ce3e from upstream V8 (Michaël Zasso) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`8b9a956f9e`](https://github.com/nodejs/node/commit/8b9a956f9e)] - **deps**: cherry-pick 5dd3395 from upstream V8 (Matheus Marchini) [#21386](https://github.com/nodejs/node/pull/21386) +* [[`548008a6f6`](https://github.com/nodejs/node/commit/548008a6f6)] - **deps**: update v8.gyp and run Torque (Michaël Zasso) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`9c74271a96`](https://github.com/nodejs/node/commit/9c74271a96)] - **deps**: update V8 to 6.8.275.24 (Michaël Zasso) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`a3f3c40966`](https://github.com/nodejs/node/commit/a3f3c40966)] - **doc**: simplify urlObject.hash text (Rich Trott) [#22326](https://github.com/nodejs/node/pull/22326) +* [[`d2848697dc`](https://github.com/nodejs/node/commit/d2848697dc)] - **doc**: simplify urlObject.hash description (Rich Trott) [#22326](https://github.com/nodejs/node/pull/22326) +* [[`6d29986f4d`](https://github.com/nodejs/node/commit/6d29986f4d)] - **doc**: simplify format description of urlObject.auth (Rich Trott) [#22324](https://github.com/nodejs/node/pull/22324) +* [[`a658a4df34`](https://github.com/nodejs/node/commit/a658a4df34)] - **doc**: remove redundant explanation of format (Rich Trott) [#22324](https://github.com/nodejs/node/pull/22324) +* [[`3236697c0b`](https://github.com/nodejs/node/commit/3236697c0b)] - **doc**: use italics for words-as-words (Rich Trott) [#22324](https://github.com/nodejs/node/pull/22324) +* [[`da76b61f59`](https://github.com/nodejs/node/commit/da76b61f59)] - **doc**: bump ICU version to avoid confusion (Csaba Palfi) [#22313](https://github.com/nodejs/node/pull/22313) +* [[`e04b0532bf`](https://github.com/nodejs/node/commit/e04b0532bf)] - **doc**: document 'inherit' option for stdio (non-shorthand) (James Bromwell) [#22309](https://github.com/nodejs/node/pull/22309) +* [[`882c2c017a`](https://github.com/nodejs/node/commit/882c2c017a)] - **doc**: clarify http2 docs around class exports (James M Snell) [#22247](https://github.com/nodejs/node/pull/22247) +* [[`dd96ba5b89`](https://github.com/nodejs/node/commit/dd96ba5b89)] - **doc**: add multiple issue templates for GitHub (Tobias Nießen) [#22215](https://github.com/nodejs/node/pull/22215) +* [[`d95a22c304`](https://github.com/nodejs/node/commit/d95a22c304)] - **doc**: declare all parameter types (Sam Ruby) [#21782](https://github.com/nodejs/node/pull/21782) +* [[`9e25028981`](https://github.com/nodejs/node/commit/9e25028981)] - **doc**: add missing option for child\_process.spawnSync() (James Bromwell) [#22231](https://github.com/nodejs/node/pull/22231) +* [[`ef8d0fc490`](https://github.com/nodejs/node/commit/ef8d0fc490)] - **doc**: list encodings supported by buffer.transcode (James M Snell) [#22263](https://github.com/nodejs/node/pull/22263) +* [[`1b41cd44b5`](https://github.com/nodejs/node/commit/1b41cd44b5)] - **doc**: discuss special protocol handling (James M Snell) [#22261](https://github.com/nodejs/node/pull/22261) +* [[`cea8d4f4e9`](https://github.com/nodejs/node/commit/cea8d4f4e9)] - **doc**: replace \_WG\_ with \_team\_ (Rich Trott) [#22183](https://github.com/nodejs/node/pull/22183) +* [[`fafdae4ce1`](https://github.com/nodejs/node/commit/fafdae4ce1)] - **doc**: add subprocess.ref() and subprocess.unref() (Thomas Hunter II) [#22220](https://github.com/nodejs/node/pull/22220) +* [[`d4f3615aaf`](https://github.com/nodejs/node/commit/d4f3615aaf)] - **doc**: add gdams to collaborators (George Adams) [#22236](https://github.com/nodejs/node/pull/22236) +* [[`e75885f2e6`](https://github.com/nodejs/node/commit/e75885f2e6)] - **doc**: specify `options` parameter type in zlib.md (Vse Mozhet Byt) [#21920](https://github.com/nodejs/node/pull/21920) +* [[`40af9767a2`](https://github.com/nodejs/node/commit/40af9767a2)] - **doc**: declare all parameter types (Sam Ruby) [#21782](https://github.com/nodejs/node/pull/21782) +* [[`38dd407c83`](https://github.com/nodejs/node/commit/38dd407c83)] - **doc**: remove unused error codes from errors.md (Сковорода Никита Андреевич) [#21491](https://github.com/nodejs/node/pull/21491) +* [[`6c7733f58a`](https://github.com/nodejs/node/commit/6c7733f58a)] - **doc**: update recommendations for createCipher (Tobias Nießen) [#22087](https://github.com/nodejs/node/pull/22087) +* [[`34300aaaa4`](https://github.com/nodejs/node/commit/34300aaaa4)] - **doc**: correct crypto.randomFill() and randomFillSync() (Gerhard Stoebich) [#21550](https://github.com/nodejs/node/pull/21550) +* [[`28870a46ac`](https://github.com/nodejs/node/commit/28870a46ac)] - **doc**: add rubys to collaborators (Sam Ruby) [#22109](https://github.com/nodejs/node/pull/22109) +* [[`d2ad9a2c13`](https://github.com/nodejs/node/commit/d2ad9a2c13)] - **doc**: fix return type of server.address() (Weijia Wang) [#22043](https://github.com/nodejs/node/pull/22043) +* [[`168abb5801`](https://github.com/nodejs/node/commit/168abb5801)] - **doc**: rename stackStartFunction in assert.md (Eugene Y. Q. Shen) [#22077](https://github.com/nodejs/node/pull/22077) +* [[`d364f9c8e7`](https://github.com/nodejs/node/commit/d364f9c8e7)] - **doc**: fix changelog for v10.8.0 (Michaël Zasso) [#22072](https://github.com/nodejs/node/pull/22072) +* [[`abac0c56b8`](https://github.com/nodejs/node/commit/abac0c56b8)] - **doc**: mark DEP0004 and DEP0042 as End-of-Life (Jon Moss) [#22033](https://github.com/nodejs/node/pull/22033) +* [[`c6a56ae23e`](https://github.com/nodejs/node/commit/c6a56ae23e)] - **doc**: correct grammatical error in BUILDING.md (Brandon Lee) [#22067](https://github.com/nodejs/node/pull/22067) +* [[`29bc55320c`](https://github.com/nodejs/node/commit/29bc55320c)] - **doc**: fixup process.binding deprecation code (James M Snell) [#22062](https://github.com/nodejs/node/pull/22062) +* [[`ec9d529a32`](https://github.com/nodejs/node/commit/ec9d529a32)] - **doc**: documentation deprecation of process.binding (James M Snell) [#22004](https://github.com/nodejs/node/pull/22004) +* [[`37369eba38`](https://github.com/nodejs/node/commit/37369eba38)] - **(SEMVER-MINOR)** **http**: allow url and options to be passed to http\*.request and http\*.get (Sam Ruby) [#21616](https://github.com/nodejs/node/pull/21616) +* [[`1ca46ab6f4`](https://github.com/nodejs/node/commit/1ca46ab6f4)] - **http,tls**: name anonymous callbacks (Marco Levrero) [#21412](https://github.com/nodejs/node/pull/21412) +* [[`8d226c6a79`](https://github.com/nodejs/node/commit/8d226c6a79)] - **http2**: correcting the heading format (Anto Aravinth) [#22262](https://github.com/nodejs/node/pull/22262) +* [[`7223a91a50`](https://github.com/nodejs/node/commit/7223a91a50)] - **http2**: explicitly disallow nested push streams (James M Snell) [#22245](https://github.com/nodejs/node/pull/22245) +* [[`cee78bf7a2`](https://github.com/nodejs/node/commit/cee78bf7a2)] - **http2**: avoid race condition in OnHeaderCallback (James M Snell) [#22256](https://github.com/nodejs/node/pull/22256) +* [[`fcca2f7e49`](https://github.com/nodejs/node/commit/fcca2f7e49)] - **http2**: remove `streamError` from docs (James M Snell) [#22246](https://github.com/nodejs/node/pull/22246) +* [[`2bf9a4a09e`](https://github.com/nodejs/node/commit/2bf9a4a09e)] - **https**: allow url and options to be passed to https.request (Sam Ruby) [#22003](https://github.com/nodejs/node/pull/22003) +* [[`4c5dc6e012`](https://github.com/nodejs/node/commit/4c5dc6e012)] - **inspector**: tie objects lifetime to the thread they belong to (Eugene Ostroukhov) [#22242](https://github.com/nodejs/node/pull/22242) +* [[`1afcea107e`](https://github.com/nodejs/node/commit/1afcea107e)] - **inspector**: unmark tests as flaky (Eugene Ostroukhov) [#22253](https://github.com/nodejs/node/pull/22253) +* [[`39898695b6`](https://github.com/nodejs/node/commit/39898695b6)] - **inspector**: add inspector\_protocol as a direct dependency (Andrey Lushnikov) [#21975](https://github.com/nodejs/node/pull/21975) +* [[`311ec12702`](https://github.com/nodejs/node/commit/311ec12702)] - **inspector**: fixed V8InspectorClient::currentTimeMS (Aleksey Kozyatinskiy) [#21917](https://github.com/nodejs/node/pull/21917) +* [[`8f7e37337f`](https://github.com/nodejs/node/commit/8f7e37337f)] - **lib**: remove unused filterInternalStackFrames param (MaleDong) [#22267](https://github.com/nodejs/node/pull/22267) +* [[`3f729aac20`](https://github.com/nodejs/node/commit/3f729aac20)] - **lib**: extract validateString validator (Jon Moss) [#22101](https://github.com/nodejs/node/pull/22101) +* [[`f570c19c89`](https://github.com/nodejs/node/commit/f570c19c89)] - **perf_hooks**: avoid memory leak on gc observer (James M Snell) [#22241](https://github.com/nodejs/node/pull/22241) +* [[`76a65921d3`](https://github.com/nodejs/node/commit/76a65921d3)] - **readline,zlib**: named anonymous functions (Anto Aravinth) [#21792](https://github.com/nodejs/node/pull/21792) +* [[`e4f346892c`](https://github.com/nodejs/node/commit/e4f346892c)] - **repl**: support mult-line string-keyed objects (Sam Ruby) [#21805](https://github.com/nodejs/node/pull/21805) +* [[`d0b0ea971a`](https://github.com/nodejs/node/commit/d0b0ea971a)] - **src**: remove unnecessary writes in tls\_wrap.cc (Anna Henningsen) [#21984](https://github.com/nodejs/node/pull/21984) +* [[`b2ac7a750f`](https://github.com/nodejs/node/commit/b2ac7a750f)] - **src**: avoid possible race during NodeBIO initialization (Anna Henningsen) [#21984](https://github.com/nodejs/node/pull/21984) +* [[`d85b0a3c10`](https://github.com/nodejs/node/commit/d85b0a3c10)] - **src**: use smart pointers for NodeBIO (Anna Henningsen) [#21984](https://github.com/nodejs/node/pull/21984) +* [[`82e71dd8bd`](https://github.com/nodejs/node/commit/82e71dd8bd)] - **src**: fix integer overflow in GetNow (Anatoli Papirovski) [#22214](https://github.com/nodejs/node/pull/22214) +* [[`2737b46e16`](https://github.com/nodejs/node/commit/2737b46e16)] - **src**: add READONLY\_STRING\_PROPERTY and simplify config (Jon Moss) [#22222](https://github.com/nodejs/node/pull/22222) +* [[`8b5485dcf5`](https://github.com/nodejs/node/commit/8b5485dcf5)] - **src**: fix up doc comment for experimental-worker bool (Anna Henningsen) [#22165](https://github.com/nodejs/node/pull/22165) +* [[`e90e56f4ca`](https://github.com/nodejs/node/commit/e90e56f4ca)] - **src**: remove calls to deprecated v8 functions (NumberValue) (Ujjwal Sharma) [#22094](https://github.com/nodejs/node/pull/22094) +* [[`c09872b749`](https://github.com/nodejs/node/commit/c09872b749)] - **src**: remove unused env-\>vm\_parsing\_context\_symbol (Jon Moss) [#22034](https://github.com/nodejs/node/pull/22034) +* [[`6ca00d7044`](https://github.com/nodejs/node/commit/6ca00d7044)] - **src**: remove unused env strings (Jon Moss) [#22137](https://github.com/nodejs/node/pull/22137) +* [[`0ca831a0ed`](https://github.com/nodejs/node/commit/0ca831a0ed)] - **src**: clean up PackageConfig pseudo-boolean fields (Anna Henningsen) [#21987](https://github.com/nodejs/node/pull/21987) +* [[`00c33a5131`](https://github.com/nodejs/node/commit/00c33a5131)] - **src**: clean up agent loop when exiting through destructor (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`ba480d33ce`](https://github.com/nodejs/node/commit/ba480d33ce)] - **src**: use only one tracing write fs req at a time (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`6b58746b2e`](https://github.com/nodejs/node/commit/6b58746b2e)] - **src**: use unique\_ptr for internal JSON trace writer (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`ce48936077`](https://github.com/nodejs/node/commit/ce48936077)] - **src**: plug trace file file descriptor leak (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`89e23021fb`](https://github.com/nodejs/node/commit/89e23021fb)] - **src**: initialize file trace writer on tracing thread (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`56edd5fc5b`](https://github.com/nodejs/node/commit/56edd5fc5b)] - **src**: close tracing event loop (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`4c9c1bbc45`](https://github.com/nodejs/node/commit/4c9c1bbc45)] - **src**: fix tracing if cwd or file path is inaccessible (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`c101b396aa`](https://github.com/nodejs/node/commit/c101b396aa)] - **src**: refactor default trace writer out of agent (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`daafe6c195`](https://github.com/nodejs/node/commit/daafe6c195)] - **src**: refactor tracing agent code (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`4379140dbf`](https://github.com/nodejs/node/commit/4379140dbf)] - **src**: minor refactor of node\_trace\_events.cc (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`cde0e5f396`](https://github.com/nodejs/node/commit/cde0e5f396)] - **src**: reduce unnecessary includes (Anna Henningsen) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`31e3e6f1f8`](https://github.com/nodejs/node/commit/31e3e6f1f8)] - **stream**: fix readable behavior for highWaterMark === 0 (Denys Otrishko) [#21690](https://github.com/nodejs/node/pull/21690) +* [[`9d89b3c7ec`](https://github.com/nodejs/node/commit/9d89b3c7ec)] - **test**: rename some allegories (Vse Mozhet Byt) [#22307](https://github.com/nodejs/node/pull/22307) +* [[`1d15f33277`](https://github.com/nodejs/node/commit/1d15f33277)] - **test**: call gc() explicitly to avoid OOM (Refael Ackermann) [#22301](https://github.com/nodejs/node/pull/22301) +* [[`a7dad4565b`](https://github.com/nodejs/node/commit/a7dad4565b)] - **test**: move test-http-client-timeout-option-with-agent to sequential (Ouyang Yadong) [#22083](https://github.com/nodejs/node/pull/22083) +* [[`a414b0757a`](https://github.com/nodejs/node/commit/a414b0757a)] - **test**: add test-http2-large-file sequential test (James M Snell) [#22254](https://github.com/nodejs/node/pull/22254) +* [[`01fe2cee5b`](https://github.com/nodejs/node/commit/01fe2cee5b)] - **test**: fix error messages for OpenSSL-1.1.0i (Shigeki Ohtsu) [#22318](https://github.com/nodejs/node/pull/22318) +* [[`c145690aad`](https://github.com/nodejs/node/commit/c145690aad)] - **test**: improve test coverage for comparisons (Ruben Bridgewater) [#22212](https://github.com/nodejs/node/pull/22212) +* [[`bdc644f2ec`](https://github.com/nodejs/node/commit/bdc644f2ec)] - **test**: remove common.fileExists() (Rich Trott) [#22151](https://github.com/nodejs/node/pull/22151) +* [[`bc1cb7b7fc`](https://github.com/nodejs/node/commit/bc1cb7b7fc)] - **test**: handle errors correctly in GC http test (Ouyang Yadong) [#22185](https://github.com/nodejs/node/pull/22185) +* [[`cefc4a03cc`](https://github.com/nodejs/node/commit/cefc4a03cc)] - **test**: remove second arg from assert.ifError() (Musa Hamwala) [#22190](https://github.com/nodejs/node/pull/22190) +* [[`b1cbbbc7af`](https://github.com/nodejs/node/commit/b1cbbbc7af)] - **test**: move require of https to after crypto check (Daniel Bevenius) [#22148](https://github.com/nodejs/node/pull/22148) +* [[`a6ab19a96a`](https://github.com/nodejs/node/commit/a6ab19a96a)] - **test**: move require of http2 to after crypto check (Daniel Bevenius) [#22148](https://github.com/nodejs/node/pull/22148) +* [[`7a4c7e6c82`](https://github.com/nodejs/node/commit/7a4c7e6c82)] - **test**: don't mask descriptor.enumerable (Thomas Leah) [#22172](https://github.com/nodejs/node/pull/22172) +* [[`5018661a85`](https://github.com/nodejs/node/commit/5018661a85)] - **test**: remove common.fileExists() (Richard Lau) [#22200](https://github.com/nodejs/node/pull/22200) +* [[`77ce40fa03`](https://github.com/nodejs/node/commit/77ce40fa03)] - **test**: remove unused argument in assertion (yahavfuchs) [#22113](https://github.com/nodejs/node/pull/22113) +* [[`ca0fb3acce`](https://github.com/nodejs/node/commit/ca0fb3acce)] - **test**: check arg type for dnsPromises.resolve (Masashi Hirano) [#22000](https://github.com/nodejs/node/pull/22000) +* [[`6daa4f8797`](https://github.com/nodejs/node/commit/6daa4f8797)] - **test**: update postmortem metadata test (cjihrig) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`16a929b867`](https://github.com/nodejs/node/commit/16a929b867)] - **test**: fix scriptParsed event expectations (Ingvar Stepanyan) [#21079](https://github.com/nodejs/node/pull/21079) +* [[`e58c17b849`](https://github.com/nodejs/node/commit/e58c17b849)] - **test**: update certificates and private keys (Fedor Indutny) [#22184](https://github.com/nodejs/node/pull/22184) +* [[`d38ccaa421`](https://github.com/nodejs/node/commit/d38ccaa421)] - **test**: fix n-api addon build warnings (Kyle Farnung) [#21808](https://github.com/nodejs/node/pull/21808) +* [[`d66e52fb8e`](https://github.com/nodejs/node/commit/d66e52fb8e)] - **test**: run ESM tests in parallel (Michaël Zasso) [#21919](https://github.com/nodejs/node/pull/21919) +* [[`6cff57e98d`](https://github.com/nodejs/node/commit/6cff57e98d)] - **test**: fix incorrect file mode check (Timothy Gu) [#22023](https://github.com/nodejs/node/pull/22023) +* [[`dafaff3a5e`](https://github.com/nodejs/node/commit/dafaff3a5e)] - **test**: remove unused config (Benjamin Gruenbaum) [#21985](https://github.com/nodejs/node/pull/21985) +* [[`a569ae4b44`](https://github.com/nodejs/node/commit/a569ae4b44)] - **test**: remove third argument from assert.strictEqual() (Rishabh Singh) [#22051](https://github.com/nodejs/node/pull/22051) +* [[`a60060b499`](https://github.com/nodejs/node/commit/a60060b499)] - **test**: remove third argument from call to assert.strictEqual() (Michael Sommer) [#22047](https://github.com/nodejs/node/pull/22047) +* [[`246a94f301`](https://github.com/nodejs/node/commit/246a94f301)] - **test**: see value of "hadError" in tls test (Oryan Moshe) [#22069](https://github.com/nodejs/node/pull/22069) +* [[`a40ee213b3`](https://github.com/nodejs/node/commit/a40ee213b3)] - **test**: improve reliability in http2-session-timeout (Rich Trott) [#22026](https://github.com/nodejs/node/pull/22026) +* [[`e2d97eeb65`](https://github.com/nodejs/node/commit/e2d97eeb65)] - **test**: remove outdated documentation (Jon Moss) [#22009](https://github.com/nodejs/node/pull/22009) +* [[`94746d6a47`](https://github.com/nodejs/node/commit/94746d6a47)] - **test**: remove outdated, non-functioning test (Anatoli Papirovski) [#20894](https://github.com/nodejs/node/pull/20894) +* [[`0beffc0f3b`](https://github.com/nodejs/node/commit/0beffc0f3b)] - **test**: remove test/gc, integrate into parallel (Anna Henningsen) [#22001](https://github.com/nodejs/node/pull/22001) +* [[`c2372eac16`](https://github.com/nodejs/node/commit/c2372eac16)] - **test**: add tracing crash regression test (Eugene Ostroukhov) [#21867](https://github.com/nodejs/node/pull/21867) +* [[`7e23080d45`](https://github.com/nodejs/node/commit/7e23080d45)] - **test**: pass through stderr in benchmark tests (Anna Henningsen) [#21860](https://github.com/nodejs/node/pull/21860) +* [[`52020dc09a`](https://github.com/nodejs/node/commit/52020dc09a)] - **test**: refactor test-http2-compat-serverresponse-finished.js (Anto Aravinth) [#21929](https://github.com/nodejs/node/pull/21929) +* [[`88665b3cef`](https://github.com/nodejs/node/commit/88665b3cef)] - **test,doc**: fix async-hooks coverage doc for md lint (Rod Vagg) [#22296](https://github.com/nodejs/node/pull/22296) +* [[`d60b017135`](https://github.com/nodejs/node/commit/d60b017135)] - **test,doc**: adjust markdown table for linting (Rich Trott) [#22221](https://github.com/nodejs/node/pull/22221) +* [[`8f56cc0321`](https://github.com/nodejs/node/commit/8f56cc0321)] - **test,doc**: adjust async-hooks coverage doc for lint (Rich Trott) [#22221](https://github.com/nodejs/node/pull/22221) +* [[`5c41caa1cc`](https://github.com/nodejs/node/commit/5c41caa1cc)] - **test,doc**: wrap common module md doc at 80 chars (Rich Trott) [#22221](https://github.com/nodejs/node/pull/22221) +* [[`21883be05d`](https://github.com/nodejs/node/commit/21883be05d)] - **test,doc**: fix lint error in test fixtures (Rich Trott) [#22221](https://github.com/nodejs/node/pull/22221) +* [[`ec2209dc8b`](https://github.com/nodejs/node/commit/ec2209dc8b)] - **tls**: change var to const (Eugen Cazacu) [#22219](https://github.com/nodejs/node/pull/22219) +* [[`2d1c1853e9`](https://github.com/nodejs/node/commit/2d1c1853e9)] - **tls**: remove SLAB\_BUFFER\_SIZE (Anatoli Papirovski) [#21199](https://github.com/nodejs/node/pull/21199) +* [[`f989681e34`](https://github.com/nodejs/node/commit/f989681e34)] - **tls**: preallocate SSL cipher array (Tobias Nießen) [#22136](https://github.com/nodejs/node/pull/22136) +* [[`6cd2d1dddc`](https://github.com/nodejs/node/commit/6cd2d1dddc)] - **tools**: fix header escaping regression (Sam Ruby) [#22084](https://github.com/nodejs/node/pull/22084) +* [[`80dd0445c6`](https://github.com/nodejs/node/commit/80dd0445c6)] - **tools**: add no-misleading-character-class ESLint rule (Vse Mozhet Byt) [#22278](https://github.com/nodejs/node/pull/22278) +* [[`bc35f17b7b`](https://github.com/nodejs/node/commit/bc35f17b7b)] - **tools**: do not autolink section to itself (Vse Mozhet Byt) [#22138](https://github.com/nodejs/node/pull/22138) +* [[`950a4a9b91`](https://github.com/nodejs/node/commit/950a4a9b91)] - **tools**: update ESLint to 5.3.0 (Rich Trott) [#22134](https://github.com/nodejs/node/pull/22134) +* [[`0c67d326dc`](https://github.com/nodejs/node/commit/0c67d326dc)] - **tools**: convert addon-verify to remark (Sam Ruby) [#21978](https://github.com/nodejs/node/pull/21978) +* [[`c85d00b786`](https://github.com/nodejs/node/commit/c85d00b786)] - **tools**: produce JSON documentation using unified/remark/rehype (Sam Ruby) [#21697](https://github.com/nodejs/node/pull/21697) +* [[`f0c871b0c7`](https://github.com/nodejs/node/commit/f0c871b0c7)] - **tools**: add `make format-cpp` to run clang-format on C++ diffs (Joyee Cheung) [#21997](https://github.com/nodejs/node/pull/21997) +* [[`5a4abbadfe`](https://github.com/nodejs/node/commit/5a4abbadfe)] - **tools**: update to using dmn 1.0.11 (Rich Trott) [#22035](https://github.com/nodejs/node/pull/22035) +* [[`7a7c194f4e`](https://github.com/nodejs/node/commit/7a7c194f4e)] - **tools**: fix docs and run known\_issues by default (Jon Moss) [#21910](https://github.com/nodejs/node/pull/21910) +* [[`4995b28a11`](https://github.com/nodejs/node/commit/4995b28a11)] - **tools,build**: apply markdown linting to test dir (Rich Trott) [#22221](https://github.com/nodejs/node/pull/22221) +* [[`ad46cca104`](https://github.com/nodejs/node/commit/ad46cca104)] - **trace_events**: add node.promises category, rejection counter (James M Snell) [#22124](https://github.com/nodejs/node/pull/22124) +* [[`b171fa2530`](https://github.com/nodejs/node/commit/b171fa2530)] - **util**: improve display of iterators and weak entries (Ruben Bridgewater) [#20961](https://github.com/nodejs/node/pull/20961) +* [[`f1c22eaa56`](https://github.com/nodejs/node/commit/f1c22eaa56)] - **util,assert**: fix boxed primitives bug (Ruben Bridgewater) [#22243](https://github.com/nodejs/node/pull/22243) +* [[`677d10cdd1`](https://github.com/nodejs/node/commit/677d10cdd1)] - **worker**: fix deadlock when calling terminate from exit handler (Anna Henningsen) [#22073](https://github.com/nodejs/node/pull/22073) +* [[`4b0d2de5f4`](https://github.com/nodejs/node/commit/4b0d2de5f4)] - **zlib**: remove unused parameters (MaleDong) [#22115](https://github.com/nodejs/node/pull/22115) + ## 2018-08-01, Version 10.8.0 (Current), @targos diff --git a/doc/guides/adding-new-napi-api.md b/doc/guides/adding-new-napi-api.md index 08133eda2a63..aad0e6ba7ab9 100644 --- a/doc/guides/adding-new-napi-api.md +++ b/doc/guides/adding-new-napi-api.md @@ -23,9 +23,9 @@ N-API API. * There **should** be at least one test case per interesting use of the API. * There **should** be a sample provided that operates in a realistic way (operating how a real addon would be written). -* A new API **should** be discussed at the N-API working group meeting. +* A new API **should** be discussed at the N-API team meeting. * A new API addition **must** be signed off by at least two members of - the N-API WG. + the N-API team. * A new API addition **should** be simultaneously implemented in at least one other VM implementation of Node.js. * A new API **must** be considered experimental for at least one minor @@ -39,8 +39,7 @@ N-API API. following: * A new PR **must** be opened in `nodejs/node` to remove experimental status. This PR **must** be tagged as **n-api** and **semver-minor**. - * Exiting an API from experimental **must** be signed off by the - working group. + * Exiting an API from experimental **must** be signed off by the team. * If a backport is merited, an API **must** have a down-level implementation. * The API **should** be used by a published real-world module. Use of diff --git a/lib/_http_client.js b/lib/_http_client.js index 0612f5822a30..462245174ed6 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -60,22 +60,31 @@ function validateHost(host, name) { return host; } -function ClientRequest(options, cb) { +function ClientRequest(input, options, cb) { OutgoingMessage.call(this); - if (typeof options === 'string') { - options = url.parse(options); - if (!options.hostname) { + if (typeof input === 'string') { + input = url.parse(input); + if (!input.hostname) { throw new ERR_INVALID_DOMAIN_NAME(); } - } else if (options && options[searchParamsSymbol] && - options[searchParamsSymbol][searchParamsSymbol]) { + } else if (input && input[searchParamsSymbol] && + input[searchParamsSymbol][searchParamsSymbol]) { // url.URL instance - options = urlToOptions(options); + input = urlToOptions(input); } else { - options = util._extend({}, options); + cb = options; + options = input; + input = null; } + if (typeof options === 'function') { + cb = options; + options = null; + } + + options = util._extend(input || {}, options || {}); + var agent = options.agent; var defaultAgent = options._defaultAgent || Agent.globalAgent; if (agent === false) { diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 913935048680..7fe4e2133b46 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -45,6 +45,7 @@ const { ERR_STREAM_CANNOT_PIPE, ERR_STREAM_WRITE_AFTER_END } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { CRLF, debug } = common; @@ -183,7 +184,7 @@ OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { } if (!this.socket) { - this.once('socket', function(socket) { + this.once('socket', function socketSetTimeoutOnConnect(socket) { socket.setTimeout(msecs); }); } else { @@ -200,7 +201,7 @@ OutgoingMessage.prototype.destroy = function destroy(error) { if (this.socket) { this.socket.destroy(error); } else { - this.once('socket', function(socket) { + this.once('socket', function socketDestroyOnConnect(socket) { socket.destroy(error); }); } @@ -480,9 +481,7 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value) { OutgoingMessage.prototype.getHeader = function getHeader(name) { - if (typeof name !== 'string') { - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - } + validateString(name, 'name'); const headers = this[outHeadersKey]; if (headers === null) @@ -516,19 +515,14 @@ OutgoingMessage.prototype.getHeaders = function getHeaders() { OutgoingMessage.prototype.hasHeader = function hasHeader(name) { - if (typeof name !== 'string') { - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - } - + validateString(name, 'name'); return this[outHeadersKey] !== null && !!this[outHeadersKey][name.toLowerCase()]; }; OutgoingMessage.prototype.removeHeader = function removeHeader(name) { - if (typeof name !== 'string') { - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - } + validateString(name, 'name'); if (this._header) { throw new ERR_HTTP_HEADERS_SENT('remove'); diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 0b5cac6b8376..029faaa6142d 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -383,7 +383,10 @@ Readable.prototype.read = function(n) { // the 'readable' event and move on. if (n === 0 && state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { + ((state.highWaterMark !== 0 ? + state.length >= state.highWaterMark : + state.length > 0) || + state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this); @@ -808,6 +811,7 @@ Readable.prototype.on = function(ev, fn) { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; + debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { diff --git a/lib/_tls_common.js b/lib/_tls_common.js index d8f6afed0bd8..de96fa687dcc 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -240,7 +240,7 @@ exports.translatePeerCertificate = function translatePeerCertificate(c) { c.infoAccess = Object.create(null); // XXX: More key validation? - info.replace(/([^\n:]*):([^\n]*)(?:\n|$)/g, function(all, key, val) { + info.replace(/([^\n:]*):([^\n]*)(?:\n|$)/g, (all, key, val) => { if (key in c.infoAccess) c.infoAccess[key].push(val); else diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 775bdbefdb20..57eb3e728722 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -50,6 +50,7 @@ const { ERR_TLS_SESSION_ATTACK, ERR_TLS_SNI_FROM_SERVER } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const kConnectOptions = Symbol('connect-options'); const kDisableRenegotiation = Symbol('disable-renegotiation'); const kErrorEmitted = Symbol('error-emitted'); @@ -645,9 +646,7 @@ TLSSocket.prototype._start = function() { }; TLSSocket.prototype.setServername = function(name) { - if (typeof name !== 'string') { - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - } + validateString(name, 'name'); if (this._tlsOptions.isServer) { throw new ERR_TLS_SNI_FROM_SERVER(); diff --git a/lib/async_hooks.js b/lib/async_hooks.js index 345b003e5499..7d160707415a 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -2,9 +2,9 @@ const { ERR_ASYNC_CALLBACK, - ERR_INVALID_ARG_TYPE, ERR_INVALID_ASYNC_ID } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const internal_async_hooks = require('internal/async_hooks'); // Get functions @@ -140,8 +140,7 @@ function showEmitBeforeAfterWarning() { class AsyncResource { constructor(type, opts = {}) { - if (typeof type !== 'string') - throw new ERR_INVALID_ARG_TYPE('type', 'string', type); + validateString(type, 'type'); if (typeof opts === 'number') { opts = { triggerAsyncId: opts, requireManualDestroy: false }; diff --git a/lib/buffer.js b/lib/buffer.js index 061ff7ebe440..43d9d4d5822b 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -69,6 +69,7 @@ const { ERR_NO_LONGER_SUPPORTED, ERR_UNKNOWN_ENCODING } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const internalBuffer = require('internal/buffer'); @@ -276,8 +277,9 @@ function assertSize(size) { */ Buffer.alloc = function alloc(size, fill, encoding) { assertSize(size); - if (fill !== undefined && size > 0) { - return _fill(createUnsafeBuffer(size), fill, encoding); + if (fill !== undefined && fill !== 0 && size > 0) { + const buf = createUnsafeBuffer(size); + return _fill(buf, fill, 0, buf.length, encoding); } return new FastBuffer(size); }; @@ -841,9 +843,7 @@ function _fill(buf, val, start, end, encoding) { const normalizedEncoding = normalizeEncoding(encoding); if (normalizedEncoding === undefined) { - if (typeof encoding !== 'string') { - throw new ERR_INVALID_ARG_TYPE('encoding', 'string', encoding); - } + validateString(encoding, 'encoding'); throw new ERR_UNKNOWN_ENCODING(encoding); } diff --git a/lib/child_process.js b/lib/child_process.js index d816bbf5f091..5452effbabaa 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -37,6 +37,7 @@ const { ERR_INVALID_OPT_VALUE, ERR_OUT_OF_RANGE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const child_process = require('internal/child_process'); const { _validateStdio, @@ -390,8 +391,7 @@ function _convertCustomFds(options) { } function normalizeSpawnArguments(file, args, options) { - if (typeof file !== 'string') - throw new ERR_INVALID_ARG_TYPE('file', 'string', file); + validateString(file, 'file'); if (file.length === 0) throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty'); diff --git a/lib/console.js b/lib/console.js index 98ab0c35712d..7fef9e0a7297 100644 --- a/lib/console.js +++ b/lib/console.js @@ -360,8 +360,11 @@ Console.prototype.table = function(tabularData, properties) { const mapIter = isMapIterator(tabularData); let isKeyValue = false; let i = 0; - if (mapIter) - [ tabularData, isKeyValue ] = previewEntries(tabularData); + if (mapIter) { + const res = previewEntries(tabularData, true); + tabularData = res[0]; + isKeyValue = res[1]; + } if (isKeyValue || isMap(tabularData)) { const keys = []; @@ -391,7 +394,7 @@ Console.prototype.table = function(tabularData, properties) { const setIter = isSetIterator(tabularData); if (setIter) - [ tabularData ] = previewEntries(tabularData); + tabularData = previewEntries(tabularData); const setlike = setIter || (mapIter && !isKeyValue) || isSet(tabularData); if (setlike) { diff --git a/lib/dgram.js b/lib/dgram.js index 292f7daf876c..2db146886575 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -37,6 +37,7 @@ const { ERR_SOCKET_CANNOT_SEND, ERR_SOCKET_DGRAM_NOT_RUNNING } = errors.codes; +const { validateString } = require('internal/validators'); const { Buffer } = require('buffer'); const util = require('util'); const { isUint8Array } = require('internal/util/types'); @@ -269,9 +270,7 @@ Socket.prototype.sendto = function(buffer, throw new ERR_INVALID_ARG_TYPE('port', 'number', port); } - if (typeof address !== 'string') { - throw new ERR_INVALID_ARG_TYPE('address', 'string', address); - } + validateString(address, 'address'); this.send(buffer, offset, length, port, address, callback); }; @@ -570,11 +569,7 @@ Socket.prototype.setMulticastLoopback = function(arg) { Socket.prototype.setMulticastInterface = function(interfaceAddress) { healthCheck(this); - - if (typeof interfaceAddress !== 'string') { - throw new ERR_INVALID_ARG_TYPE( - 'interfaceAddress', 'string', interfaceAddress); - } + validateString(interfaceAddress, 'interfaceAddress'); const err = this[kStateSymbol].handle.setMulticastInterface(interfaceAddress); if (err) { diff --git a/lib/dns.js b/lib/dns.js index 195a0189504b..7059ed91ddcc 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -39,6 +39,7 @@ const { ERR_MISSING_ARGS, ERR_SOCKET_BAD_PORT } = errors.codes; +const { validateString } = require('internal/validators'); const { GetAddrInfoReqWrap, @@ -206,9 +207,8 @@ function resolver(bindingName) { callback = arguments[2]; } - if (typeof name !== 'string') { - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - } else if (typeof callback !== 'function') { + validateString(name, 'name'); + if (typeof callback !== 'function') { throw new ERR_INVALID_CALLBACK(); } diff --git a/lib/http.js b/lib/http.js index 9ed6b3d1de87..660de78650f4 100644 --- a/lib/http.js +++ b/lib/http.js @@ -37,12 +37,12 @@ function createServer(opts, requestListener) { return new Server(opts, requestListener); } -function request(options, cb) { - return new ClientRequest(options, cb); +function request(url, options, cb) { + return new ClientRequest(url, options, cb); } -function get(options, cb) { - var req = request(options, cb); +function get(url, options, cb) { + var req = request(url, options, cb); req.end(); return req; } diff --git a/lib/https.js b/lib/https.js index 195a33fb0de4..15970c182ea5 100644 --- a/lib/https.js +++ b/lib/https.js @@ -255,25 +255,33 @@ Agent.prototype._evictSession = function _evictSession(key) { const globalAgent = new Agent(); -function request(options, cb) { - if (typeof options === 'string') { - options = url.parse(options); +function request(...args) { + let options = {}; + + if (typeof args[0] === 'string') { + const urlStr = args.shift(); + options = url.parse(urlStr); if (!options.hostname) { throw new ERR_INVALID_DOMAIN_NAME(); } - } else if (options && options[searchParamsSymbol] && - options[searchParamsSymbol][searchParamsSymbol]) { + } else if (args[0] && args[0][searchParamsSymbol] && + args[0][searchParamsSymbol][searchParamsSymbol]) { // url.URL instance - options = urlToOptions(options); - } else { - options = util._extend({}, options); + options = urlToOptions(args.shift()); + } + + if (args[0] && typeof args[0] !== 'function') { + options = util._extend(options, args.shift()); } + options._defaultAgent = globalAgent; - return new ClientRequest(options, cb); + args.unshift(options); + + return new ClientRequest(...args); } -function get(options, cb) { - const req = request(options, cb); +function get(input, options, cb) { + const req = request(input, options, cb); req.end(); return req; } diff --git a/lib/inspector.js b/lib/inspector.js index f4e365b774be..8827158757e1 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -9,6 +9,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_CALLBACK } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const util = require('util'); const { Connection, open, url } = process.binding('inspector'); const { originalConsole } = require('internal/process/per_thread'); @@ -58,9 +59,7 @@ class Session extends EventEmitter { } post(method, params, callback) { - if (typeof method !== 'string') { - throw new ERR_INVALID_ARG_TYPE('method', 'string', method); - } + validateString(method, 'method'); if (!callback && util.isFunction(params)) { callback = params; params = null; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index d22009505a45..f0a54ab6a18a 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -14,6 +14,7 @@ const { ERR_MISSING_ARGS } } = require('internal/errors'); +const { validateString } = require('internal/validators'); const EventEmitter = require('events'); const net = require('net'); const dgram = require('dgram'); @@ -317,9 +318,7 @@ ChildProcess.prototype.spawn = function(options) { options.envPairs.push('NODE_CHANNEL_FD=' + ipcFd); } - if (typeof options.file !== 'string') { - throw new ERR_INVALID_ARG_TYPE('options.file', 'string', options.file); - } + validateString(options.file, 'options.file'); this.spawnfile = options.file; if (Array.isArray(options.args)) diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 4a5234738046..d876010cf991 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -10,6 +10,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_OPT_VALUE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { getDefaultEncoding, @@ -83,9 +84,7 @@ function createCipherBase(cipher, credential, options, decipher, iv) { } function createCipher(cipher, password, options, decipher) { - if (typeof cipher !== 'string') - throw new ERR_INVALID_ARG_TYPE('cipher', 'string', cipher); - + validateString(cipher, 'cipher'); password = toBuf(password); if (!isArrayBufferView(password)) { throw new ERR_INVALID_ARG_TYPE( @@ -99,9 +98,7 @@ function createCipher(cipher, password, options, decipher) { } function createCipherWithIV(cipher, key, options, decipher, iv) { - if (typeof cipher !== 'string') - throw new ERR_INVALID_ARG_TYPE('cipher', 'string', cipher); - + validateString(cipher, 'cipher'); key = toBuf(key); if (!isArrayBufferView(key)) { throw new ERR_INVALID_ARG_TYPE( @@ -184,7 +181,7 @@ Cipher.prototype.final = function final(outputEncoding) { Cipher.prototype.setAutoPadding = function setAutoPadding(ap) { - if (this._handle.setAutoPadding(ap) === false) + if (!this._handle.setAutoPadding(ap)) throw new ERR_CRYPTO_INVALID_STATE('setAutoPadding'); return this; }; @@ -203,10 +200,7 @@ Cipher.prototype.setAuthTag = function setAuthTag(tagbuf) { ['Buffer', 'TypedArray', 'DataView'], tagbuf); } - // Do not do a normal falsy check because the method returns - // undefined if it succeeds. Returns false specifically if it - // errored - if (this._handle.setAuthTag(tagbuf) === false) + if (!this._handle.setAuthTag(tagbuf)) throw new ERR_CRYPTO_INVALID_STATE('setAuthTag'); return this; }; @@ -219,7 +213,7 @@ Cipher.prototype.setAAD = function setAAD(aadbuf, options) { } const plaintextLength = getUIntOption(options, 'plaintextLength'); - if (this._handle.setAAD(aadbuf, plaintextLength) === false) + if (!this._handle.setAAD(aadbuf, plaintextLength)) throw new ERR_CRYPTO_INVALID_STATE('setAAD'); return this; }; diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index dad7a903b26a..1daf5df905f8 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -6,6 +6,7 @@ const { ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY, ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { isArrayBufferView } = require('internal/util/types'); const { getDefaultEncoding, @@ -167,9 +168,7 @@ function ECDH(curve) { if (!(this instanceof ECDH)) return new ECDH(curve); - if (typeof curve !== 'string') - throw new ERR_INVALID_ARG_TYPE('curve', 'string', curve); - + validateString(curve, 'curve'); this._handle = new _ECDH(curve); } @@ -200,9 +199,7 @@ ECDH.convertKey = function convertKey(key, curve, inEnc, outEnc, format) { ); } - if (typeof curve !== 'string') { - throw new ERR_INVALID_ARG_TYPE('curve', 'string', curve); - } + validateString(curve, 'curve'); const encoding = getDefaultEncoding(); inEnc = inEnc || encoding; diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index d172a6a3c8e9..7127d4d7efb1 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -18,6 +18,7 @@ const { ERR_CRYPTO_HASH_UPDATE_FAILED, ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { inherits } = require('util'); const { normalizeEncoding } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); @@ -28,8 +29,7 @@ const kFinalized = Symbol('finalized'); function Hash(algorithm, options) { if (!(this instanceof Hash)) return new Hash(algorithm, options); - if (typeof algorithm !== 'string') - throw new ERR_INVALID_ARG_TYPE('algorithm', 'string', algorithm); + validateString(algorithm, 'algorithm'); this._handle = new _Hash(algorithm); this[kState] = { [kFinalized]: false @@ -83,8 +83,7 @@ Hash.prototype.digest = function digest(outputEncoding) { function Hmac(hmac, key, options) { if (!(this instanceof Hmac)) return new Hmac(hmac, key, options); - if (typeof hmac !== 'string') - throw new ERR_INVALID_ARG_TYPE('hmac', 'string', hmac); + validateString(hmac, 'hmac'); if (typeof key !== 'string' && !isArrayBufferView(key)) { throw new ERR_INVALID_ARG_TYPE('key', ['string', 'TypedArray', 'DataView'], key); diff --git a/lib/internal/crypto/scrypt.js b/lib/internal/crypto/scrypt.js index fedf7f5b107b..edfe522be47a 100644 --- a/lib/internal/crypto/scrypt.js +++ b/lib/internal/crypto/scrypt.js @@ -80,13 +80,26 @@ function check(password, salt, keylen, options, callback) { let { N, r, p, maxmem } = defaults; if (options && options !== defaults) { - if (options.hasOwnProperty('N')) + let has_N, has_r, has_p; + if (has_N = (options.N !== undefined)) N = validateInt32(options.N, 'N', 0, INT_MAX); - if (options.hasOwnProperty('r')) + if (options.cost !== undefined) { + if (has_N) throw new ERR_CRYPTO_SCRYPT_INVALID_PARAMETER(); + N = validateInt32(options.cost, 'cost', 0, INT_MAX); + } + if (has_r = (options.r !== undefined)) r = validateInt32(options.r, 'r', 0, INT_MAX); - if (options.hasOwnProperty('p')) + if (options.blockSize !== undefined) { + if (has_r) throw new ERR_CRYPTO_SCRYPT_INVALID_PARAMETER(); + r = validateInt32(options.blockSize, 'blockSize', 0, INT_MAX); + } + if (has_p = (options.p !== undefined)) p = validateInt32(options.p, 'p', 0, INT_MAX); - if (options.hasOwnProperty('maxmem')) + if (options.parallelization !== undefined) { + if (has_p) throw new ERR_CRYPTO_SCRYPT_INVALID_PARAMETER(); + p = validateInt32(options.parallelization, 'parallelization', 0, INT_MAX); + } + if (options.maxmem !== undefined) maxmem = validateInt32(options.maxmem, 'maxmem', 0, INT_MAX); if (N === 0) N = defaults.N; if (r === 0) r = defaults.r; diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index 8aff73547354..ebd852402eb3 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -2,9 +2,9 @@ const { ERR_CRYPTO_SIGN_KEY_REQUIRED, - ERR_INVALID_ARG_TYPE, ERR_INVALID_OPT_VALUE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { Sign: _Sign, Verify: _Verify @@ -24,8 +24,7 @@ const { inherits } = require('util'); function Sign(algorithm, options) { if (!(this instanceof Sign)) return new Sign(algorithm, options); - if (typeof algorithm !== 'string') - throw new ERR_INVALID_ARG_TYPE('algorithm', 'string', algorithm); + validateString(algorithm, 'algorithm'); this._handle = new _Sign(); this._handle.init(algorithm); @@ -94,8 +93,7 @@ Sign.prototype.sign = function sign(options, encoding) { function Verify(algorithm, options) { if (!(this instanceof Verify)) return new Verify(algorithm, options); - if (typeof algorithm !== 'string') - throw new ERR_INVALID_ARG_TYPE('algorithm', 'string', algorithm); + validateString(algorithm, 'algorithm'); this._handle = new _Verify(); this._handle.init(algorithm); diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index 32c9eb7f6a12..9283e80df4e2 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -17,6 +17,7 @@ const { ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH, ERR_INVALID_ARG_TYPE, } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { Buffer } = require('buffer'); const { cachedResult, @@ -53,9 +54,7 @@ const getHashes = cachedResult(() => filterDuplicateStrings(_getHashes())); const getCurves = cachedResult(() => filterDuplicateStrings(_getCurves())); function setEngine(id, flags) { - if (typeof id !== 'string') - throw new ERR_INVALID_ARG_TYPE('id', 'string', id); - + validateString(id, 'id'); if (flags && typeof flags !== 'number') throw new ERR_INVALID_ARG_TYPE('flags', 'number', flags); flags = flags >>> 0; diff --git a/lib/internal/errors.js b/lib/internal/errors.js index aef05489b48c..c70ca2db7b4d 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -568,6 +568,8 @@ E('ERR_HTTP2_INVALID_SETTING_VALUE', E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed', Error); E('ERR_HTTP2_MAX_PENDING_SETTINGS_ACK', 'Maximum number of pending settings acknowledgements', Error); +E('ERR_HTTP2_NESTED_PUSH', + 'A push stream cannot initiate another push stream.', Error); E('ERR_HTTP2_NO_SOCKET_MANIPULATION', 'HTTP/2 sockets should not be directly manipulated (e.g. read and written)', Error); diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 4a006107b2fc..33f636f69bf5 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -12,11 +12,11 @@ const { ERR_HTTP2_NO_SOCKET_MANIPULATION, ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED, ERR_HTTP2_STATUS_INVALID, - ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_INVALID_CALLBACK, ERR_INVALID_HTTP_TOKEN } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const { kSocket } = require('internal/http2/util'); const kBeginSend = Symbol('begin-send'); @@ -115,9 +115,7 @@ function onStreamError(error) { // // errors in compatibility mode are // not forwarded to the request - // and response objects. However, - // they are forwarded to 'streamError' - // on the server by Http2Stream + // and response objects. } function onRequestPause() { @@ -342,8 +340,7 @@ class Http2ServerRequest extends Readable { } set method(method) { - if (typeof method !== 'string') - throw new ERR_INVALID_ARG_TYPE('method', 'string', method); + validateString(method, 'method'); if (method.trim() === '') throw new ERR_INVALID_ARG_VALUE('method', method); @@ -482,9 +479,7 @@ class Http2ServerResponse extends Stream { } setTrailer(name, value) { - if (typeof name !== 'string') - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - + validateString(name, 'name'); name = name.trim().toLowerCase(); assertValidHeader(name, value); this[kTrailers][name] = value; @@ -500,9 +495,7 @@ class Http2ServerResponse extends Stream { } getHeader(name) { - if (typeof name !== 'string') - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - + validateString(name, 'name'); name = name.trim().toLowerCase(); return this[kHeaders][name]; } @@ -516,17 +509,13 @@ class Http2ServerResponse extends Stream { } hasHeader(name) { - if (typeof name !== 'string') - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - + validateString(name, 'name'); name = name.trim().toLowerCase(); return Object.prototype.hasOwnProperty.call(this[kHeaders], name); } removeHeader(name) { - if (typeof name !== 'string') - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - + validateString(name, 'name'); if (this[kStream].headersSent) throw new ERR_HTTP2_HEADERS_SENT(); @@ -535,9 +524,7 @@ class Http2ServerResponse extends Stream { } setHeader(name, value) { - if (typeof name !== 'string') - throw new ERR_INVALID_ARG_TYPE('name', 'string', name); - + validateString(name, 'name'); if (this[kStream].headersSent) throw new ERR_HTTP2_HEADERS_SENT(); diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 18c0c4ce4c1f..30c401774f10 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -47,6 +47,7 @@ const { ERR_HTTP2_INVALID_SETTING_VALUE, ERR_HTTP2_INVALID_STREAM, ERR_HTTP2_MAX_PENDING_SETTINGS_ACK, + ERR_HTTP2_NESTED_PUSH, ERR_HTTP2_NO_SOCKET_MANIPULATION, ERR_HTTP2_OUT_OF_STREAMS, ERR_HTTP2_PAYLOAD_FORBIDDEN, @@ -2158,6 +2159,8 @@ class ServerHttp2Stream extends Http2Stream { pushStream(headers, options, callback) { if (!this.pushAllowed) throw new ERR_HTTP2_PUSH_DISABLED(); + if (this[kID] % 2 === 0) + throw new ERR_HTTP2_NESTED_PUSH(); const session = this[kSession]; diff --git a/lib/internal/repl/recoverable.js b/lib/internal/repl/recoverable.js new file mode 100644 index 000000000000..465d77451a5b --- /dev/null +++ b/lib/internal/repl/recoverable.js @@ -0,0 +1,79 @@ +'use strict'; + +const acorn = require('internal/deps/acorn/dist/acorn'); +const { tokTypes: tt } = acorn; + +// If the error is that we've unexpectedly ended the input, +// then let the user try to recover by adding more input. +// Note: `e` (the original exception) is not used by the current implemention, +// but may be needed in the future. +function isRecoverableError(e, code) { + let recoverable = false; + + // Determine if the point of the any error raised is at the end of the input. + // There are two cases to consider: + // + // 1. Any error raised after we have encountered the 'eof' token. + // This prevents us from declaring partial tokens (like '2e') as + // recoverable. + // + // 2. Three cases where tokens can legally span lines. This is + // template, comment, and strings with a backslash at the end of + // the line, indicating a continuation. Note that we need to look + // for the specific errors of 'unterminated' kind (not, for example, + // a syntax error in a ${} expression in a template), and the only + // way to do that currently is to look at the message. Should Acorn + // change these messages in the future, this will lead to a test + // failure, indicating that this code needs to be updated. + // + acorn.plugins.replRecoverable = (parser) => { + parser.extend('nextToken', (nextToken) => { + return function() { + Reflect.apply(nextToken, this, []); + + if (this.type === tt.eof) recoverable = true; + }; + }); + + parser.extend('raise', (raise) => { + return function(pos, message) { + switch (message) { + case 'Unterminated template': + case 'Unterminated comment': + recoverable = true; + break; + + case 'Unterminated string constant': + const token = this.input.slice(this.lastTokStart, this.pos); + // see https://www.ecma-international.org/ecma-262/#sec-line-terminators + recoverable = /\\(?:\r\n?|\n|\u2028|\u2029)$/.test(token); + } + + Reflect.apply(raise, this, [pos, message]); + }; + }); + }; + + // For similar reasons as `defaultEval`, wrap expressions starting with a + // curly brace with parenthesis. Note: only the open parenthesis is added + // here as the point is to test for potentially valid but incomplete + // expressions. + if (/^\s*\{/.test(code) && isRecoverableError(e, `(${code}`)) return true; + + // Try to parse the code with acorn. If the parse fails, ignore the acorn + // error and return the recoverable status. + try { + acorn.parse(code, { plugins: { replRecoverable: true } }); + + // Odd case: the underlying JS engine (V8, Chakra) rejected this input + // but Acorn detected no issue. Presume that additional text won't + // address this issue. + return false; + } catch { + return recoverable; + } +} + +module.exports = { + isRecoverableError +}; diff --git a/lib/internal/tls.js b/lib/internal/tls.js index 6d367dbf285f..4e468a2dd72a 100644 --- a/lib/internal/tls.js +++ b/lib/internal/tls.js @@ -3,13 +3,13 @@ // Example: // C=US\nST=CA\nL=SF\nO=Joyent\nOU=Node.js\nCN=ca1\nemailAddress=ry@clouds.org function parseCertString(s) { - var out = Object.create(null); - var parts = s.split('\n'); + const out = Object.create(null); + const parts = s.split('\n'); for (var i = 0, len = parts.length; i < len; i++) { - var sepIndex = parts[i].indexOf('='); + const sepIndex = parts[i].indexOf('='); if (sepIndex > 0) { - var key = parts[i].slice(0, sepIndex); - var value = parts[i].slice(sepIndex + 1); + const key = parts[i].slice(0, sepIndex); + const value = parts[i].slice(sepIndex + 1); if (key in out) { if (!Array.isArray(out[key])) { out[key] = [out[key]]; diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index f4491f070f18..0e58ea2cb4e0 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -120,6 +120,9 @@ function strictDeepEqual(val1, val2, memos) { const val1Value = val1.valueOf(); // Note: Boxed string keys are going to be compared again by Object.keys if (val1Value !== val1) { + if (typeof val2.valueOf !== 'function') { + return false; + } if (!innerDeepEqual(val1Value, val2.valueOf(), true)) return false; // Fast path for boxed primitives @@ -354,29 +357,38 @@ function setEquiv(a, b, strict, memo) { return true; } +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using function findLooseMatchingPrimitives(prim) { - var values, number; switch (typeof prim) { case 'number': - values = ['' + prim]; - if (prim === 1 || prim === 0) - values.push(Boolean(prim)); - return values; + if (prim === 0) { + return ['', '0', false]; + } + if (prim === 1) { + return ['1', true]; + } + return ['' + prim]; case 'string': - number = +prim; + if (prim === '' || prim === '0') { + return [0, false]; + } + if (prim === '1') { + return [1, true]; + } + const number = +prim; if ('' + number === prim) { - values = [number]; - if (number === 1 || number === 0) - values.push(Boolean(number)); + return [number]; } - return values; + return; case 'undefined': return [null]; case 'object': // Only pass in null as object! return [undefined]; case 'boolean': - number = +prim; - return [number, '' + number]; + if (prim === false) { + return ['', '0', 0]; + } + return ['1', 1]; } } diff --git a/lib/internal/validators.js b/lib/internal/validators.js index ab8643b9af67..85e69e61255d 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -120,11 +120,17 @@ function validateUint32(value, name, positive) { return value; } +function validateString(value, name) { + if (typeof value !== 'string') + throw new ERR_INVALID_ARG_TYPE(name, 'string', value); +} + module.exports = { isInt32, isUint32, validateMode, validateInteger, validateInt32, - validateUint32 + validateUint32, + validateString }; diff --git a/lib/net.js b/lib/net.js index 889f28b0aa70..4b19f6b63686 100644 --- a/lib/net.js +++ b/lib/net.js @@ -75,7 +75,7 @@ const { ERR_SOCKET_BAD_PORT, ERR_SOCKET_CLOSED } = errors.codes; -const { validateInt32 } = require('internal/validators'); +const { validateInt32, validateString } = require('internal/validators'); const kLastWriteQueueSize = Symbol('lastWriteQueueSize'); // Lazy loaded to improve startup performance. @@ -980,9 +980,7 @@ Socket.prototype.connect = function(...args) { this.writable = true; if (pipe) { - if (typeof path !== 'string') { - throw new ERR_INVALID_ARG_TYPE('options.path', 'string', path); - } + validateString(path, 'options.path'); defaultTriggerAsyncIdScope( this[async_id_symbol], internalConnect, this, path ); diff --git a/lib/readline.js b/lib/readline.js index 89dd1b84f2dd..cec88845d12c 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -845,7 +845,7 @@ Interface.prototype._ttyWrite = function(s, key) { if (this.listenerCount('SIGTSTP') > 0) { this.emit('SIGTSTP'); } else { - process.once('SIGCONT', (function(self) { + process.once('SIGCONT', (function continueProcess(self) { return function() { // Don't raise events if stream has already been abandoned. if (!self.paused) { diff --git a/lib/repl.js b/lib/repl.js index 92c90de7bb16..9530d57a3474 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -73,6 +73,7 @@ const { } = require('internal/errors').codes; const { sendInspectorCommand } = require('internal/util/inspector'); const { experimentalREPLAwait } = process.binding('config'); +const { isRecoverableError } = require('internal/repl/recoverable'); // Lazy-loaded. let processTopLevelAwait; @@ -227,7 +228,8 @@ function REPLServer(prompt, // It's confusing for `{ a : 1 }` to be interpreted as a block // statement rather than an object literal. So, we first try // to wrap it in parentheses, so that it will be interpreted as - // an expression. + // an expression. Note that if the above condition changes, + // lib/internal/repl/recoverable.js needs to be changed to match. code = `(${code.trim()})\n`; wrappedCmd = true; } @@ -492,7 +494,7 @@ function REPLServer(prompt, self.writer.options = Object.assign({}, writer.options, { colors: true }); } - function filterInternalStackFrames(error, structuredStack) { + function filterInternalStackFrames(structuredStack) { // Search from the bottom of the call stack to // find the first frame with a null function name if (typeof structuredStack !== 'object') @@ -507,7 +509,7 @@ function REPLServer(prompt, function prepareStackTrace(fn) { return (error, stackFrames) => { - const frames = filterInternalStackFrames(error, stackFrames); + const frames = filterInternalStackFrames(stackFrames); if (fn) { return fn(error, frames); } @@ -1505,76 +1507,6 @@ function regexpEscape(s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); } -// If the error is that we've unexpectedly ended the input, -// then let the user try to recover by adding more input. -function isRecoverableError(e, code) { - if (e && e.name === 'SyntaxError') { - var message = e.message; - if (message === 'Unterminated template literal' || - message === 'Unexpected end of input') { - return true; - } - - if (message === 'missing ) after argument list') { - const frames = e.stack.split(/\r?\n/); - const pos = frames.findIndex((f) => f.match(/^\s*\^+$/)); - return pos > 0 && frames[pos - 1].length === frames[pos].length; - } - - if (message === 'Invalid or unexpected token') - return isCodeRecoverable(code); - } - return false; -} - -// Check whether a code snippet should be forced to fail in the REPL. -function isCodeRecoverable(code) { - var current, previous, stringLiteral; - var isBlockComment = false; - var isSingleComment = false; - var isRegExpLiteral = false; - var lastChar = code.charAt(code.length - 2); - var prevTokenChar = null; - - for (var i = 0; i < code.length; i++) { - previous = current; - current = code[i]; - - if (previous === '\\' && (stringLiteral || isRegExpLiteral)) { - current = null; - } else if (stringLiteral) { - if (stringLiteral === current) { - stringLiteral = null; - } - } else if (isRegExpLiteral && current === '/') { - isRegExpLiteral = false; - } else if (isBlockComment && previous === '*' && current === '/') { - isBlockComment = false; - } else if (isSingleComment && current === '\n') { - isSingleComment = false; - } else if (!isBlockComment && !isRegExpLiteral && !isSingleComment) { - if (current === '/' && previous === '/') { - isSingleComment = true; - } else if (previous === '/') { - if (current === '*') { - isBlockComment = true; - // Distinguish between a division operator and the start of a regex - // by examining the non-whitespace character that precedes the / - } else if ([null, '(', '[', '{', '}', ';'].includes(prevTokenChar)) { - isRegExpLiteral = true; - } - } else { - if (current.trim()) prevTokenChar = current; - if (current === '\'' || current === '"') { - stringLiteral = current; - } - } - } - } - - return stringLiteral ? lastChar === '\\' : isBlockComment; -} - function Recoverable(err) { this.err = err; } diff --git a/lib/tls.js b/lib/tls.js index ddc84aab8bb0..ad752071418f 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -44,8 +44,6 @@ const _tls_wrap = require('_tls_wrap'); exports.CLIENT_RENEG_LIMIT = 3; exports.CLIENT_RENEG_WINDOW = 600; -exports.SLAB_BUFFER_SIZE = 10 * 1024 * 1024; - exports.DEFAULT_CIPHERS = process.binding('constants').crypto.defaultCipherList; diff --git a/lib/util.js b/lib/util.js index 8160d802b033..b427895ebd5c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -115,6 +115,10 @@ const meta = [ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '\\\\' ]; +// Constants to map the iterator state. +const kWeak = 0; +const kIterator = 1; +const kMapEntries = 2; const escapeFn = (str) => meta[str.charCodeAt(0)]; @@ -982,77 +986,83 @@ function formatMap(ctx, value, recurseTimes, keys) { return output; } -function formatWeakSet(ctx, value, recurseTimes, keys) { +function formatSetIterInner(ctx, value, recurseTimes, keys, entries, state) { const maxArrayLength = Math.max(ctx.maxArrayLength, 0); - const [ entries ] = previewEntries(value).slice(0, maxArrayLength + 1); const maxLength = Math.min(maxArrayLength, entries.length); let output = new Array(maxLength); for (var i = 0; i < maxLength; ++i) output[i] = formatValue(ctx, entries[i], recurseTimes); - // Sort all entries to have a halfway reliable output (if more entries than - // retrieved ones exist, we can not reliably return the same output). - output = output.sort(); - if (entries.length > maxArrayLength) - output.push('... more items'); + if (state === kWeak) { + // Sort all entries to have a halfway reliable output (if more entries than + // retrieved ones exist, we can not reliably return the same output). + output = output.sort(); + } + const remaining = entries.length - maxLength; + if (remaining > 0) { + output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); + } for (i = 0; i < keys.length; i++) output.push(formatProperty(ctx, value, recurseTimes, keys[i], 0)); return output; } -function formatWeakMap(ctx, value, recurseTimes, keys) { +function formatMapIterInner(ctx, value, recurseTimes, keys, entries, state) { const maxArrayLength = Math.max(ctx.maxArrayLength, 0); - const [ entries ] = previewEntries(value).slice(0, (maxArrayLength + 1) * 2); // Entries exist as [key1, val1, key2, val2, ...] - const remainder = entries.length / 2 > maxArrayLength; - const len = entries.length / 2 - (remainder ? 1 : 0); + const len = entries.length / 2; + const remaining = len - maxArrayLength; const maxLength = Math.min(maxArrayLength, len); let output = new Array(maxLength); - for (var i = 0; i < maxLength; i++) { + let start = ''; + let end = ''; + let middle = ' => '; + let i = 0; + if (state === kMapEntries) { + start = '[ '; + end = ' ]'; + middle = ', '; + } + for (; i < maxLength; i++) { const pos = i * 2; - output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ` + - formatValue(ctx, entries[pos + 1], recurseTimes); + output[i] = `${start}${formatValue(ctx, entries[pos], recurseTimes)}` + + `${middle}${formatValue(ctx, entries[pos + 1], recurseTimes)}${end}`; + } + if (state === kWeak) { + // Sort all entries to have a halfway reliable output (if more entries + // than retrieved ones exist, we can not reliably return the same output). + output = output.sort(); + } + if (remaining > 0) { + output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); } - // Sort all entries to have a halfway reliable output (if more entries than - // retrieved ones exist, we can not reliably return the same output). - output = output.sort(); - if (remainder > 0) - output.push('... more items'); for (i = 0; i < keys.length; i++) output.push(formatProperty(ctx, value, recurseTimes, keys[i], 0)); return output; } -function zip2(list) { - const ret = Array(list.length / 2); - for (var i = 0; i < ret.length; ++i) - ret[i] = [list[2 * i], list[2 * i + 1]]; - return ret; +function formatWeakSet(ctx, value, recurseTimes, keys) { + const entries = previewEntries(value); + return formatSetIterInner(ctx, value, recurseTimes, keys, entries, kWeak); } -function formatCollectionIterator(ctx, value, recurseTimes, keys) { - const output = []; - var [ entries, isKeyValue ] = previewEntries(value); - if (isKeyValue) - entries = zip2(entries); - for (const entry of entries) { - if (ctx.maxArrayLength === output.length) { - output.push('... more items'); - break; - } - output.push(formatValue(ctx, entry, recurseTimes)); - } - for (var n = 0; n < keys.length; n++) { - output.push(formatProperty(ctx, value, recurseTimes, keys[n], 0)); - } - return output; +function formatWeakMap(ctx, value, recurseTimes, keys) { + const entries = previewEntries(value); + return formatMapIterInner(ctx, value, recurseTimes, keys, entries, kWeak); } -function formatMapIterator(ctx, value, recurseTimes, keys) { - return formatCollectionIterator(ctx, value, recurseTimes, keys); +function formatSetIterator(ctx, value, recurseTimes, keys) { + const entries = previewEntries(value); + return formatSetIterInner(ctx, value, recurseTimes, keys, entries, kIterator); } -function formatSetIterator(ctx, value, recurseTimes, keys) { - return formatCollectionIterator(ctx, value, recurseTimes, keys); +function formatMapIterator(ctx, value, recurseTimes, keys) { + const [entries, isKeyValue] = previewEntries(value, true); + if (isKeyValue) { + return formatMapIterInner( + ctx, value, recurseTimes, keys, entries, kMapEntries); + } + + return formatSetIterInner(ctx, value, recurseTimes, keys, entries, kIterator); } function formatPromise(ctx, value, recurseTimes, keys) { diff --git a/lib/vm.js b/lib/vm.js index aece4e625dc2..9461ce6c6d0f 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -23,16 +23,15 @@ const { ContextifyScript, - kParsingContext, makeContext, isContext: _isContext, } = process.binding('contextify'); - const { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE } = require('internal/errors').codes; const { isUint8Array } = require('internal/util/types'); +const kParsingContext = Symbol('script parsing context'); class Script extends ContextifyScript { constructor(code, options = {}) { diff --git a/lib/zlib.js b/lib/zlib.js index d8a1cb57c5a8..ca5f05884ad3 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -198,12 +198,12 @@ function checkFiniteNumber(number, name) { throw err; } -// 1. Returns def for undefined and NaN +// 1. Returns def for number when it's undefined or NaN // 2. Returns number for finite numbers >= lower and <= upper // 3. Throws ERR_INVALID_ARG_TYPE for non-numbers // 4. Throws ERR_OUT_OF_RANGE for infinite numbers or numbers > upper or < lower function checkRangesOrGetDefault(number, name, lower, upper, def) { - if (!checkFiniteNumber(number, name, lower, upper)) { + if (!checkFiniteNumber(number, name)) { return def; } if (number < lower || number > upper) { @@ -473,7 +473,7 @@ function processChunkSync(self, chunk, flushFlag) { var chunkSize = self._chunkSize; var error; - self.on('error', function(er) { + self.on('error', function onError(er) { error = er; }); @@ -691,11 +691,11 @@ inherits(Unzip, Zlib); function createConvenienceMethod(ctor, sync) { if (sync) { - return function(buffer, opts) { + return function syncBufferWrapper(buffer, opts) { return zlibBufferSync(new ctor(opts), buffer); }; } else { - return function(buffer, opts, callback) { + return function asyncBufferWrapper(buffer, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; diff --git a/node.gyp b/node.gyp index 82dfadd8e883..125afa8c268d 100644 --- a/node.gyp +++ b/node.gyp @@ -146,6 +146,7 @@ 'lib/internal/readline.js', 'lib/internal/repl.js', 'lib/internal/repl/await.js', + 'lib/internal/repl/recoverable.js', 'lib/internal/socket_list.js', 'lib/internal/test/binding.js', 'lib/internal/test/heap.js', @@ -1043,7 +1044,7 @@ }], # end aix section [ 'v8_enable_inspector==1', { 'variables': { - 'protocol_path': 'deps/v8/third_party/inspector_protocol', + 'protocol_path': 'tools/inspector_protocol', 'node_inspector_path': 'src/inspector', 'node_inspector_generated_sources': [ '<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Forward.h', @@ -1103,7 +1104,7 @@ ], 'action': [ 'python', - 'deps/v8/third_party/inspector_protocol/ConvertProtocolToJSON.py', + 'tools/inspector_protocol/ConvertProtocolToJSON.py', '<@(_inputs)', '<@(_outputs)', ], @@ -1158,7 +1159,7 @@ ], 'action': [ 'python', - 'deps/v8/third_party/inspector_protocol/ConvertProtocolToJSON.py', + 'tools/inspector_protocol/ConvertProtocolToJSON.py', '<@(_inputs)', '<@(_outputs)', ], @@ -1174,7 +1175,7 @@ ], 'action': [ 'python', - 'deps/v8/third_party/inspector_protocol/ConcatenateProtocols.py', + 'tools/inspector_protocol/ConcatenateProtocols.py', '<@(_inputs)', '<@(_outputs)', ], diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 7ef3dafdf992..46d63694dee1 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -410,7 +410,8 @@ void AsyncWrap::PopAsyncIds(const FunctionCallbackInfo& args) { void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { AsyncWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - double execution_async_id = args[0]->IsNumber() ? args[0]->NumberValue() : -1; + double execution_async_id = + args[0]->IsNumber() ? args[0].As()->Value() : -1; wrap->AsyncReset(execution_async_id); } @@ -418,7 +419,8 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { void AsyncWrap::QueueDestroyAsyncId(const FunctionCallbackInfo& args) { CHECK(args[0]->IsNumber()); AsyncWrap::EmitDestroy( - Environment::GetCurrent(args), args[0]->NumberValue()); + Environment::GetCurrent(args), + args[0].As()->Value()); } void AsyncWrap::AddWrapMethods(Environment* env, diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 5f40d62a82fd..94bb9413772d 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -3,6 +3,8 @@ #include "node_internals.h" #include "v8.h" +#include + namespace node { using v8::Array; @@ -51,6 +53,9 @@ void SetupNextTick(const FunctionCallbackInfo& args) { } void PromiseRejectCallback(PromiseRejectMessage message) { + static std::atomic unhandledRejections{0}; + static std::atomic rejectionsHandledAfter{0}; + Local promise = message.GetPromise(); Isolate* isolate = promise->GetIsolate(); PromiseRejectEvent event = message.GetEvent(); @@ -65,13 +70,23 @@ void PromiseRejectCallback(PromiseRejectMessage message) { if (value.IsEmpty()) value = Undefined(isolate); + + unhandledRejections++; } else if (event == v8::kPromiseHandlerAddedAfterReject) { callback = env->promise_reject_handled_function(); value = Undefined(isolate); + + rejectionsHandledAfter++; } else { return; } + TRACE_COUNTER2(TRACING_CATEGORY_NODE2(promises, rejections), + "rejections", + "unhandled", unhandledRejections, + "handledAfter", rejectionsHandledAfter); + + Local args[] = { promise, value }; MaybeLocal ret = callback->Call(env->context(), Undefined(isolate), diff --git a/src/env-inl.h b/src/env-inl.h index 5c359c04d907..542cfb6400c0 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -32,7 +32,6 @@ #include "v8.h" #include "node_perf_common.h" #include "node_context_data.h" -#include "tracing/agent.h" #include "node_worker.h" #include @@ -334,8 +333,8 @@ inline v8::Isolate* Environment::isolate() const { return isolate_; } -inline tracing::Agent* Environment::tracing_agent() const { - return tracing_agent_; +inline tracing::AgentWriterHandle* Environment::tracing_agent_writer() const { + return tracing_agent_writer_; } inline Environment* Environment::from_immediate_check_handle( diff --git a/src/env.cc b/src/env.cc index 76d1b6dd86d4..0e9a8772fb28 100644 --- a/src/env.cc +++ b/src/env.cc @@ -103,10 +103,10 @@ void InitThreadLocalOnce() { Environment::Environment(IsolateData* isolate_data, Local context, - tracing::Agent* tracing_agent) + tracing::AgentWriterHandle* tracing_agent_writer) : isolate_(context->GetIsolate()), isolate_data_(isolate_data), - tracing_agent_(tracing_agent), + tracing_agent_writer_(tracing_agent_writer), immediate_info_(context->GetIsolate()), tick_info_(context->GetIsolate()), timer_base_(uv_now(isolate_data->event_loop())), @@ -536,7 +536,7 @@ Local Environment::GetNow() { CHECK_GE(now, timer_base()); now -= timer_base(); if (now <= 0xffffffff) - return Integer::New(isolate(), static_cast(now)); + return Integer::NewFromUnsigned(isolate(), static_cast(now)); else return Number::New(isolate(), static_cast(now)); } diff --git a/src/env.h b/src/env.h index ede221400b49..fa9ac7a1adb3 100644 --- a/src/env.h +++ b/src/env.h @@ -35,7 +35,6 @@ #include "v8.h" #include "node.h" #include "node_http2_state.h" -#include "tracing/agent.h" #include #include @@ -55,6 +54,10 @@ namespace performance { class performance_state; } +namespace tracing { +class AgentWriterHandle; +} + namespace worker { class Worker; } @@ -62,23 +65,15 @@ class Worker; namespace loader { class ModuleWrap; -struct Exists { - enum Bool { Yes, No }; -}; - -struct IsValid { - enum Bool { Yes, No }; -}; - -struct HasMain { - enum Bool { Yes, No }; -}; - struct PackageConfig { - const Exists::Bool exists; - const IsValid::Bool is_valid; - const HasMain::Bool has_main; - const std::string main; + enum class Exists { Yes, No }; + enum class IsValid { Yes, No }; + enum class HasMain { Yes, No }; + + Exists exists; + IsValid is_valid; + HasMain has_main; + std::string main; }; } // namespace loader @@ -155,7 +150,6 @@ struct PackageConfig { V(emit_warning_string, "emitWarning") \ V(exchange_string, "exchange") \ V(encoding_string, "encoding") \ - V(enter_string, "enter") \ V(entries_string, "entries") \ V(env_pairs_string, "envPairs") \ V(errno_string, "errno") \ @@ -195,8 +189,6 @@ struct PackageConfig { V(mac_string, "mac") \ V(main_string, "main") \ V(max_buffer_string, "maxBuffer") \ - V(max_semi_space_size_string, "maxSemiSpaceSize") \ - V(max_old_space_size_string, "maxOldSpaceSize") \ V(message_string, "message") \ V(message_port_string, "messagePort") \ V(message_port_constructor_string, "MessagePort") \ @@ -231,7 +223,6 @@ struct PackageConfig { V(onsettings_string, "onsettings") \ V(onshutdown_string, "onshutdown") \ V(onsignal_string, "onsignal") \ - V(onstop_string, "onstop") \ V(onstreamclose_string, "onstreamclose") \ V(ontrailers_string, "ontrailers") \ V(onunpipe_string, "onunpipe") \ @@ -293,7 +284,6 @@ struct PackageConfig { V(uid_string, "uid") \ V(unknown_string, "") \ V(url_string, "url") \ - V(user_string, "user") \ V(username_string, "username") \ V(valid_from_string, "valid_from") \ V(valid_to_string, "valid_to") \ @@ -356,7 +346,6 @@ struct PackageConfig { V(tls_wrap_constructor_function, v8::Function) \ V(tty_constructor_template, v8::FunctionTemplate) \ V(udp_constructor_function, v8::Function) \ - V(vm_parsing_context_symbol, v8::Symbol) \ V(url_constructor_function, v8::Function) \ V(write_wrap_template, v8::ObjectTemplate) @@ -587,7 +576,7 @@ class Environment { Environment(IsolateData* isolate_data, v8::Local context, - tracing::Agent* tracing_agent); + tracing::AgentWriterHandle* tracing_agent_writer); ~Environment(); void Start(int argc, @@ -625,7 +614,7 @@ class Environment { inline bool profiler_idle_notifier_started() const; inline v8::Isolate* isolate() const; - inline tracing::Agent* tracing_agent() const; + inline tracing::AgentWriterHandle* tracing_agent_writer() const; inline uv_loop_t* event_loop() const; inline uint32_t watched_providers() const; @@ -670,7 +659,8 @@ class Environment { std::unordered_multimap module_map; - std::unordered_map package_json_cache; + std::unordered_map + package_json_cache; inline double* heap_statistics_buffer() const; inline void set_heap_statistics_buffer(double* pointer); @@ -874,7 +864,7 @@ class Environment { v8::Isolate* const isolate_; IsolateData* const isolate_data_; - tracing::Agent* const tracing_agent_; + tracing::AgentWriterHandle* const tracing_agent_writer_; uv_check_t immediate_check_handle_; uv_idle_t immediate_idle_handle_; uv_prepare_t idle_prepare_handle_; diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index da43c95bea5f..d8ee737ce2fc 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -3,6 +3,7 @@ #include "node_mutex.h" #include "v8-inspector.h" +#include #include namespace node { @@ -13,56 +14,72 @@ using v8_inspector::StringView; using v8_inspector::StringBuffer; template -class DeleteRequest : public Request { +class DeletableWrapper : public Deletable { public: - explicit DeleteRequest(T* object) : object_(object) {} - void Call() override { - delete object_; + explicit DeletableWrapper(std::unique_ptr object) + : object_(std::move(object)) {} + ~DeletableWrapper() override = default; + + static T* get(MainThreadInterface* thread, int id) { + return + static_cast*>(thread->GetObject(id))->object_.get(); } private: - T* object_; + std::unique_ptr object_; }; -template -class SingleArgumentFunctionCall : public Request { - public: - using Fn = void (Target::*)(Arg); +template +std::unique_ptr WrapInDeletable(std::unique_ptr object) { + return std::unique_ptr>( + new DeletableWrapper(std::move(object))); +} - SingleArgumentFunctionCall(Target* target, Fn fn, Arg argument) - : target_(target), - fn_(fn), - arg_(std::move(argument)) {} +template +class CreateObjectRequest : public Request { + public: + CreateObjectRequest(int object_id, Factory factory) + : object_id_(object_id), factory_(std::move(factory)) {} - void Call() override { - Apply(target_, fn_, std::move(arg_)); + void Call(MainThreadInterface* thread) { + thread->AddObject(object_id_, WrapInDeletable(factory_(thread))); } private: - template - void Apply(Element* target, Fn fn, Arg arg) { - (target->*fn)(std::move(arg)); + int object_id_; + Factory factory_; +}; + +template +std::unique_ptr NewCreateRequest(int object_id, Factory factory) { + return std::unique_ptr( + new CreateObjectRequest(object_id, std::move(factory))); +} + +class DeleteRequest : public Request { + public: + explicit DeleteRequest(int object_id) : object_id_(object_id) {} + + void Call(MainThreadInterface* thread) override { + thread->RemoveObject(object_id_); } - Target* target_; - Fn fn_; - Arg arg_; + private: + int object_id_; }; -class PostMessageRequest : public Request { +template +class CallRequest : public Request { public: - PostMessageRequest(InspectorSessionDelegate* delegate, - StringView message) - : delegate_(delegate), - message_(StringBuffer::create(message)) {} + CallRequest(int id, Fn fn) : id_(id), fn_(std::move(fn)) {} - void Call() override { - delegate_->SendMessageToFrontend(message_->string()); + void Call(MainThreadInterface* thread) override { + fn_(DeletableWrapper::get(thread, id_)); } private: - InspectorSessionDelegate* delegate_; - std::unique_ptr message_; + int id_; + Fn fn_; }; class DispatchMessagesTask : public v8::Task { @@ -88,45 +105,63 @@ void DisposePairCallback(uv_handle_t* ref) { template class AnotherThreadObjectReference { public: - // We create it on whatever thread, just make sure it gets disposed on the - // proper thread. - AnotherThreadObjectReference(std::shared_ptr thread, - T* object) - : thread_(thread), object_(object) { + AnotherThreadObjectReference( + std::shared_ptr thread, int object_id) + : thread_(thread), object_id_(object_id) {} + + template + AnotherThreadObjectReference( + std::shared_ptr thread, Factory factory) + : AnotherThreadObjectReference(thread, thread->newObjectId()) { + thread_->Post(NewCreateRequest(object_id_, std::move(factory))); } AnotherThreadObjectReference(AnotherThreadObjectReference&) = delete; ~AnotherThreadObjectReference() { // Disappearing thread may cause a memory leak - CHECK(thread_->Post( - std::unique_ptr>(new DeleteRequest(object_)))); - object_ = nullptr; + thread_->Post( + std::unique_ptr(new DeleteRequest(object_id_))); } - template - void Post(Fn fn, Arg argument) const { - using R = SingleArgumentFunctionCall; - thread_->Post(std::unique_ptr(new R(object_, fn, std::move(argument)))); + template + void Call(Fn fn) const { + using Request = CallRequest; + thread_->Post(std::unique_ptr( + new Request(object_id_, std::move(fn)))); } - T* get() const { - return object_; + template + void Call(void (T::*fn)(Arg), Arg argument) const { + Call(std::bind(Apply, std::placeholders::_1, fn, std::move(argument))); } private: + // This has to use non-const reference to support std::bind with non-copyable + // types + template + static void Apply(T* target, void (T::*fn)(Argument), + /* NOLINT (runtime/references) */ Argument& argument) { + (target->*fn)(std::move(argument)); + } + std::shared_ptr thread_; - T* object_; + const int object_id_; }; class MainThreadSessionState { public: - MainThreadSessionState( - std::shared_ptr thread, - bool prevent_shutdown) : thread_(thread), - prevent_shutdown_(prevent_shutdown) {} + MainThreadSessionState(MainThreadInterface* thread, bool prevent_shutdown) + : thread_(thread), + prevent_shutdown_(prevent_shutdown) {} + + static std::unique_ptr Create( + MainThreadInterface* thread, bool prevent_shutdown) { + return std::unique_ptr( + new MainThreadSessionState(thread, prevent_shutdown)); + } void Connect(std::unique_ptr delegate) { - Agent* agent = thread_->GetInspectorAgent(); + Agent* agent = thread_->inspector_agent(); if (agent != nullptr) session_ = agent->Connect(std::move(delegate), prevent_shutdown_); } @@ -136,7 +171,7 @@ class MainThreadSessionState { } private: - std::shared_ptr thread_; + MainThreadInterface* thread_; bool prevent_shutdown_; std::unique_ptr session_; }; @@ -148,12 +183,14 @@ class CrossThreadInspectorSession : public InspectorSession { std::shared_ptr thread, std::unique_ptr delegate, bool prevent_shutdown) - : state_(thread, new MainThreadSessionState(thread, prevent_shutdown)) { - state_.Post(&MainThreadSessionState::Connect, std::move(delegate)); + : state_(thread, std::bind(MainThreadSessionState::Create, + std::placeholders::_1, + prevent_shutdown)) { + state_.Call(&MainThreadSessionState::Connect, std::move(delegate)); } void Dispatch(const StringView& message) override { - state_.Post(&MainThreadSessionState::Dispatch, + state_.Call(&MainThreadSessionState::Dispatch, StringBuffer::create(message)); } @@ -163,13 +200,15 @@ class CrossThreadInspectorSession : public InspectorSession { class ThreadSafeDelegate : public InspectorSessionDelegate { public: - ThreadSafeDelegate(std::shared_ptr thread, - std::unique_ptr delegate) - : thread_(thread), delegate_(thread, delegate.release()) {} + ThreadSafeDelegate(std::shared_ptr thread, int object_id) + : thread_(thread), delegate_(thread, object_id) {} void SendMessageToFrontend(const v8_inspector::StringView& message) override { - thread_->Post(std::unique_ptr( - new PostMessageRequest(delegate_.get(), message))); + delegate_.Call( + [m = StringBuffer::create(message)] + (InspectorSessionDelegate* delegate) { + delegate->SendMessageToFrontend(m->string()); + }); } private: @@ -252,7 +291,7 @@ void MainThreadInterface::DispatchMessages() { MessageQueue::value_type task; std::swap(dispatching_message_queue_.front(), task); dispatching_message_queue_.pop_front(); - task->Call(); + task->Call(this); } } while (had_messages); dispatching_messages_ = false; @@ -264,6 +303,26 @@ std::shared_ptr MainThreadInterface::GetHandle() { return handle_; } +void MainThreadInterface::AddObject(int id, + std::unique_ptr object) { + CHECK_NE(nullptr, object); + managed_objects_[id] = std::move(object); +} + +void MainThreadInterface::RemoveObject(int id) { + CHECK_EQ(1, managed_objects_.erase(id)); +} + +Deletable* MainThreadInterface::GetObject(int id) { + auto iterator = managed_objects_.find(id); + // This would mean the object is requested after it was disposed, which is + // a coding error. + CHECK_NE(managed_objects_.end(), iterator); + Deletable* pointer = iterator->second.get(); + CHECK_NE(nullptr, pointer); + return pointer; +} + std::unique_ptr Utf8ToStringView(const std::string& message) { icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( icu::StringPiece(message.data(), message.length())); @@ -303,10 +362,12 @@ Agent* MainThreadHandle::GetInspectorAgent() { } std::unique_ptr -MainThreadHandle::MakeThreadSafeDelegate( +MainThreadHandle::MakeDelegateThreadSafe( std::unique_ptr delegate) { + int id = newObjectId(); + main_thread_->AddObject(id, WrapInDeletable(std::move(delegate))); return std::unique_ptr( - new ThreadSafeDelegate(shared_from_this(), std::move(delegate))); + new ThreadSafeDelegate(shared_from_this(), id)); } bool MainThreadHandle::Expired() { diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index 75df5ffe8090..db79db43821a 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -9,10 +9,10 @@ #include "inspector_agent.h" #include "node_mutex.h" +#include #include #include #include -#include namespace v8_inspector { class StringBuffer; @@ -21,31 +21,41 @@ class StringView; namespace node { namespace inspector { +class MainThreadInterface; + class Request { public: - virtual void Call() = 0; + virtual void Call(MainThreadInterface*) = 0; virtual ~Request() {} }; +class Deletable { + public: + virtual ~Deletable() {} +}; + std::unique_ptr Utf8ToStringView( const std::string& message); using MessageQueue = std::deque>; -class MainThreadInterface; class MainThreadHandle : public std::enable_shared_from_this { public: explicit MainThreadHandle(MainThreadInterface* main_thread) - : main_thread_(main_thread) {} + : main_thread_(main_thread) { + } ~MainThreadHandle() { CHECK_NULL(main_thread_); // main_thread_ should have called Reset } std::unique_ptr Connect( std::unique_ptr delegate, bool prevent_shutdown); + int newObjectId() { + return ++next_object_id_; + } bool Post(std::unique_ptr request); Agent* GetInspectorAgent(); - std::unique_ptr MakeThreadSafeDelegate( + std::unique_ptr MakeDelegateThreadSafe( std::unique_ptr delegate); bool Expired(); @@ -55,6 +65,7 @@ class MainThreadHandle : public std::enable_shared_from_this { MainThreadInterface* main_thread_; Mutex block_lock_; int next_session_id_ = 0; + std::atomic_int next_object_id_ = {1}; friend class MainThreadInterface; }; @@ -72,6 +83,9 @@ class MainThreadInterface { Agent* inspector_agent() { return agent_; } + void AddObject(int handle, std::unique_ptr object); + Deletable* GetObject(int id); + void RemoveObject(int handle); private: using AsyncAndInterface = std::pair; @@ -92,6 +106,7 @@ class MainThreadInterface { v8::Platform* const platform_; DeleteFnPtr main_thread_request_; std::shared_ptr handle_; + std::unordered_map> managed_objects_; }; } // namespace inspector diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index c0425aab29d4..6e962b289ab3 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -46,9 +46,7 @@ class InspectorTraceWriter : public node::tracing::AsyncTraceWriter { } // namespace TracingAgent::TracingAgent(Environment* env) - : env_(env), - trace_writer_( - tracing::Agent::EmptyClientHandle()) { + : env_(env) { } TracingAgent::~TracingAgent() { @@ -62,7 +60,7 @@ void TracingAgent::Wire(UberDispatcher* dispatcher) { DispatchResponse TracingAgent::start( std::unique_ptr traceConfig) { - if (trace_writer_ != nullptr) { + if (!trace_writer_.empty()) { return DispatchResponse::Error( "Call NodeTracing::end to stop tracing before updating the config"); } @@ -76,10 +74,11 @@ DispatchResponse TracingAgent::start( if (categories_set.empty()) return DispatchResponse::Error("At least one category should be enabled"); - trace_writer_ = env_->tracing_agent()->AddClient( + trace_writer_ = env_->tracing_agent_writer()->agent()->AddClient( categories_set, std::unique_ptr( - new InspectorTraceWriter(frontend_.get()))); + new InspectorTraceWriter(frontend_.get())), + tracing::Agent::kIgnoreDefaultCategories); return DispatchResponse::OK(); } diff --git a/src/inspector/tracing_agent.h b/src/inspector/tracing_agent.h index 478107c5acdd..029fce7c191b 100644 --- a/src/inspector/tracing_agent.h +++ b/src/inspector/tracing_agent.h @@ -2,16 +2,13 @@ #define SRC_INSPECTOR_TRACING_AGENT_H_ #include "node/inspector/protocol/NodeTracing.h" +#include "tracing/agent.h" #include "v8.h" namespace node { class Environment; -namespace tracing { -class Agent; -} // namespace tracing - namespace inspector { namespace protocol { @@ -32,8 +29,7 @@ class TracingAgent : public NodeTracing::Backend { void DisconnectTraceClient(); Environment* env_; - std::unique_ptr, - void (*)(std::pair*)> trace_writer_; + tracing::AgentWriterHandle trace_writer_; std::unique_ptr frontend_; }; diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index ebb8d8a16160..0b99217d0a3f 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -187,8 +187,6 @@ static int StartDebugSignalHandler() { #endif // _WIN32 -// Used in NodeInspectorClient::currentTimeMS() below. -const int NANOS_PER_MSEC = 1000000; const int CONTEXT_GROUP_ID = 1; class ChannelImpl final : public v8_inspector::V8Inspector::Channel, @@ -593,7 +591,7 @@ class NodeInspectorClient : public V8InspectorClient { } double currentTimeMS() override { - return uv_hrtime() * 1.0 / NANOS_PER_MSEC; + return env_->isolate_data()->platform()->CurrentClockTimeMillis(); } node::Environment* env_; diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 3aba52dcde77..d584a5a3f9bc 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -488,8 +488,12 @@ Maybe CheckFile(const std::string& path, return Just(fd); } +using Exists = PackageConfig::Exists; +using IsValid = PackageConfig::IsValid; +using HasMain = PackageConfig::HasMain; + const PackageConfig& GetPackageConfig(Environment* env, - const std::string path) { + const std::string& path) { auto existing = env->package_json_cache.find(path); if (existing != env->package_json_cache.end()) { return existing->second; @@ -530,7 +534,7 @@ const PackageConfig& GetPackageConfig(Environment* env, } Local pkg_main; - HasMain::Bool has_main = HasMain::No; + HasMain has_main = HasMain::No; std::string main_std; if (pkg_json->Get(env->context(), env->main_string()).ToLocal(&pkg_main)) { has_main = HasMain::Yes; diff --git a/src/node.cc b/src/node.cc index 138595ba8683..ea91bc1ec953 100644 --- a/src/node.cc +++ b/src/node.cc @@ -61,6 +61,7 @@ #include "req_wrap-inl.h" #include "string_bytes.h" #include "tracing/agent.h" +#include "tracing/node_trace_writer.h" #include "util.h" #include "uv.h" #if NODE_USE_V8_PLATFORM @@ -387,7 +388,7 @@ class NodeTraceStateObserver : static struct { #if NODE_USE_V8_PLATFORM void Initialize(int thread_pool_size) { - tracing_agent_.reset(new tracing::Agent(trace_file_pattern)); + tracing_agent_.reset(new tracing::Agent()); auto controller = tracing_agent_->GetTracingController(); controller->AddTraceStateObserver(new NodeTraceStateObserver(controller)); tracing::TraceEventHelper::SetTracingController(controller); @@ -397,10 +398,10 @@ static struct { } void Dispose() { + tracing_agent_.reset(nullptr); platform_->Shutdown(); delete platform_; platform_ = nullptr; - tracing_agent_.reset(nullptr); } void DrainVMTasks(Isolate* isolate) { @@ -427,16 +428,23 @@ static struct { #endif // HAVE_INSPECTOR void StartTracingAgent() { - tracing_agent_->Enable(trace_enabled_categories); + if (trace_enabled_categories.empty()) { + tracing_file_writer_ = tracing_agent_->DefaultHandle(); + } else { + tracing_file_writer_ = tracing_agent_->AddClient( + ParseCommaSeparatedSet(trace_enabled_categories), + std::unique_ptr( + new tracing::NodeTraceWriter(trace_file_pattern)), + tracing::Agent::kUseDefaultCategories); + } } void StopTracingAgent() { - if (tracing_agent_) - tracing_agent_->Stop(); + tracing_file_writer_.reset(); } - tracing::Agent* GetTracingAgent() const { - return tracing_agent_.get(); + tracing::AgentWriterHandle* GetTracingAgentWriter() { + return &tracing_file_writer_; } NodePlatform* Platform() { @@ -444,6 +452,7 @@ static struct { } std::unique_ptr tracing_agent_; + tracing::AgentWriterHandle tracing_file_writer_; NodePlatform* platform_; #else // !NODE_USE_V8_PLATFORM void Initialize(int thread_pool_size) {} @@ -464,7 +473,9 @@ static struct { } void StopTracingAgent() {} - tracing::Agent* GetTracingAgent() const { return nullptr; } + tracing::AgentWriterHandle* GetTracingAgentWriter() { + return nullptr; + } NodePlatform* Platform() { return nullptr; @@ -3591,7 +3602,7 @@ Environment* CreateEnvironment(IsolateData* isolate_data, HandleScope handle_scope(isolate); Context::Scope context_scope(context); auto env = new Environment(isolate_data, context, - v8_platform.GetTracingAgent()); + v8_platform.GetTracingAgentWriter()); env->Start(argc, argv, exec_argc, exec_argv, v8_is_profiling); return env; } @@ -3650,7 +3661,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, HandleScope handle_scope(isolate); Local context = NewContext(isolate); Context::Scope context_scope(context); - Environment env(isolate_data, context, v8_platform.GetTracingAgent()); + Environment env(isolate_data, context, v8_platform.GetTracingAgentWriter()); env.Start(argc, argv, exec_argc, exec_argv, v8_is_profiling); const char* path = argc > 1 ? argv[1] : nullptr; diff --git a/src/node_config.cc b/src/node_config.cc index dd5ee6664868..62fd4ef81e09 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -29,6 +29,18 @@ using v8::Value; True(isolate), ReadOnly).FromJust(); \ } while (0) +#define READONLY_STRING_PROPERTY(obj, str, val) \ + do { \ + (obj)->DefineOwnProperty(context, \ + FIXED_ONE_BYTE_STRING(isolate, str), \ + String::NewFromUtf8( \ + isolate, \ + val.data(), \ + v8::NewStringType::kNormal).ToLocalChecked(), \ + ReadOnly).FromJust(); \ + } while (0) + + #define READONLY_PROPERTY(obj, name, value) \ do { \ obj->DefineOwnProperty(env->context(), \ @@ -60,13 +72,7 @@ static void Initialize(Local target, READONLY_BOOLEAN_PROPERTY("hasTracing"); #endif - target->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "icuDataDir"), - String::NewFromUtf8(isolate, - icu_data_dir.data(), - v8::NewStringType::kNormal).ToLocalChecked(), - ReadOnly).FromJust(); + READONLY_STRING_PROPERTY(target, "icuDataDir", icu_data_dir); #endif // NODE_HAVE_I18N_SUPPORT @@ -78,13 +84,7 @@ static void Initialize(Local target, if (config_experimental_modules) { READONLY_BOOLEAN_PROPERTY("experimentalModules"); if (!config_userland_loader.empty()) { - target->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "userLoader"), - String::NewFromUtf8(isolate, - config_userland_loader.data(), - v8::NewStringType::kNormal).ToLocalChecked(), - ReadOnly).FromJust(); + READONLY_STRING_PROPERTY(target, "userLoader", config_userland_loader); } } @@ -111,41 +111,21 @@ static void Initialize(Local target, Number::New(env->isolate(), 8 * sizeof(intptr_t))); if (!config_warning_file.empty()) { - target->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "warningFile"), - String::NewFromUtf8(isolate, - config_warning_file.data(), - v8::NewStringType::kNormal).ToLocalChecked(), - ReadOnly).FromJust(); + READONLY_STRING_PROPERTY(target, "warningFile", config_warning_file); } Local debugOptions = Object::New(isolate); + READONLY_PROPERTY(target, "debugOptions", debugOptions); + + READONLY_STRING_PROPERTY(debugOptions, "host", debug_options.host_name()); + + READONLY_PROPERTY(debugOptions, + "port", + Integer::New(isolate, debug_options.port())); - target->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "debugOptions"), - debugOptions, ReadOnly).FromJust(); - - debugOptions->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "host"), - String::NewFromUtf8(isolate, - debug_options.host_name().c_str(), - v8::NewStringType::kNormal).ToLocalChecked(), - ReadOnly).FromJust(); - - debugOptions->DefineOwnProperty( - context, - env->port_string(), - Integer::New(isolate, debug_options.port()), - ReadOnly).FromJust(); - - debugOptions->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "inspectorEnabled"), - Boolean::New(isolate, debug_options.inspector_enabled()), ReadOnly) - .FromJust(); + READONLY_PROPERTY(debugOptions, + "inspectorEnabled", + Boolean::New(isolate, debug_options.inspector_enabled())); } // InitConfig } // namespace node diff --git a/src/node_contextify.cc b/src/node_contextify.cc index a36b99e1a970..1473dcf513d9 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -608,16 +608,6 @@ class ContextifyScript : public BaseObject { target->Set(class_name, script_tmpl->GetFunction()); env->set_script_context_constructor_template(script_tmpl); - - Local parsing_context_symbol = - Symbol::New(env->isolate(), - FIXED_ONE_BYTE_STRING(env->isolate(), - "script parsing context")); - env->set_vm_parsing_context_symbol(parsing_context_symbol); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "kParsingContext"), - parsing_context_symbol) - .FromJust(); } diff --git a/src/node_crypto.cc b/src/node_crypto.cc index bda70ab54d52..8fac840244c6 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -483,7 +483,7 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { // Takes a string or buffer and loads it into a BIO. // Caller responsible for BIO_free_all-ing the returned object. -static BIO* LoadBIO(Environment* env, Local v) { +static BIOPointer LoadBIO(Environment* env, Local v) { HandleScope scope(env->isolate()); if (v->IsString()) { @@ -738,9 +738,12 @@ static X509_STORE* NewRootCertStore() { if (root_certs_vector.empty()) { for (size_t i = 0; i < arraysize(root_certs); i++) { - BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i])); - X509* x509 = PEM_read_bio_X509(bp, nullptr, NoPasswordCallback, nullptr); - BIO_free(bp); + X509* x509 = + PEM_read_bio_X509(NodeBIO::NewFixed(root_certs[i], + strlen(root_certs[i])).get(), + nullptr, // no re-use of X509 structure + NoPasswordCallback, + nullptr); // no callback data // Parse errors from the built-in roots are fatal. CHECK_NOT_NULL(x509); @@ -1375,13 +1378,11 @@ void SSLWrap::AddMethods(Environment* env, Local t) { env->SetProtoMethod(t, "setSession", SetSession); env->SetProtoMethod(t, "loadSession", LoadSession); env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused); - env->SetProtoMethodNoSideEffect(t, "isInitFinished", IsInitFinished); env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError); env->SetProtoMethodNoSideEffect(t, "getCurrentCipher", GetCurrentCipher); env->SetProtoMethod(t, "endParser", EndParser); env->SetProtoMethod(t, "certCbDone", CertCbDone); env->SetProtoMethod(t, "renegotiate", Renegotiate); - env->SetProtoMethod(t, "shutdownSSL", Shutdown); env->SetProtoMethodNoSideEffect(t, "getTLSTicket", GetTLSTicket); env->SetProtoMethod(t, "newSessionDone", NewSessionDone); env->SetProtoMethod(t, "setOCSPResponse", SetOCSPResponse); @@ -1987,16 +1988,6 @@ void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { } -template -void SSLWrap::Shutdown(const FunctionCallbackInfo& args) { - Base* w; - ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); - - int rv = SSL_shutdown(w->ssl_.get()); - args.GetReturnValue().Set(rv); -} - - template void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { Base* w; @@ -2130,15 +2121,6 @@ void SSLWrap::SetMaxSendFragment( #endif // SSL_set_max_send_fragment -template -void SSLWrap::IsInitFinished(const FunctionCallbackInfo& args) { - Base* w; - ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); - bool yes = SSL_is_init_finished(w->ssl_.get()); - args.GetReturnValue().Set(yes); -} - - template void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Base* w; @@ -2926,6 +2908,8 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo& args) { memset(cipher->auth_tag_, 0, sizeof(cipher->auth_tag_)); memcpy(cipher->auth_tag_, Buffer::Data(args[0]), cipher->auth_tag_len_); + + args.GetReturnValue().Set(true); } @@ -2980,9 +2964,9 @@ void CipherBase::SetAAD(const FunctionCallbackInfo& args) { CHECK(args[1]->IsInt32()); int plaintext_len = args[1].As()->Value(); - if (!cipher->SetAAD(Buffer::Data(args[0]), Buffer::Length(args[0]), - plaintext_len)) - args.GetReturnValue().Set(false); // Report invalid state failure + bool b = cipher->SetAAD(Buffer::Data(args[0]), Buffer::Length(args[0]), + plaintext_len); + args.GetReturnValue().Set(b); // Possibly report invalid state failure } @@ -3094,8 +3078,8 @@ void CipherBase::SetAutoPadding(const FunctionCallbackInfo& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); - if (!cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue())) - args.GetReturnValue().Set(false); // Report invalid state failure + bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); + args.GetReturnValue().Set(b); // Possibly report invalid state failure } @@ -3237,15 +3221,14 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo& args) { ASSIGN_OR_RETURN_UNWRAP(&hmac, args.Holder()); // Only copy the data if we have to, because it's a string - bool r = true; + bool r = false; if (args[0]->IsString()) { StringBytes::InlineDecoder decoder; - if (!decoder.Decode(env, args[0].As(), args[1], UTF8)) { - args.GetReturnValue().Set(false); - return; + if (decoder.Decode(env, args[0].As(), args[1], UTF8)) { + r = hmac->HmacUpdate(decoder.out(), decoder.size()); } - r = hmac->HmacUpdate(decoder.out(), decoder.size()); - } else if (args[0]->IsArrayBufferView()) { + } else { + CHECK(args[0]->IsArrayBufferView()); char* buf = Buffer::Data(args[0]); size_t buflen = Buffer::Length(args[0]); r = hmac->HmacUpdate(buf, buflen); @@ -4834,10 +4817,11 @@ void GetSSLCiphers(const FunctionCallbackInfo& args) { SSLPointer ssl(SSL_new(ctx.get())); CHECK(ssl); - Local arr = Array::New(env->isolate()); STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl.get()); + int n = sk_SSL_CIPHER_num(ciphers); + Local arr = Array::New(env->isolate(), n); - for (int i = 0; i < sk_SSL_CIPHER_num(ciphers); ++i) { + for (int i = 0; i < n; ++i) { const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i); arr->Set(env->context(), i, @@ -5142,6 +5126,8 @@ void InitCryptoOnce() { ERR_load_ENGINE_strings(); ENGINE_load_builtin_engines(); #endif // !OPENSSL_NO_ENGINE + + NodeBIO::GetMethod(); } diff --git a/src/node_crypto.h b/src/node_crypto.h index ee069c9cf799..269bccbc03a1 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -97,6 +97,8 @@ extern int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx); extern void UseExtraCaCerts(const std::string& file); +void InitCryptoOnce(); + class SecureContext : public BaseObject { public: ~SecureContext() override { diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index 094bb9cc1f88..baa90204f2f9 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -38,36 +38,32 @@ namespace crypto { #endif -BIO* NodeBIO::New() { +BIOPointer NodeBIO::New(Environment* env) { // The const_cast doesn't violate const correctness. OpenSSL's usage of // BIO_METHOD is effectively const but BIO_new() takes a non-const argument. - return BIO_new(const_cast(GetMethod())); + BIOPointer bio(BIO_new(const_cast(GetMethod()))); + if (bio && env != nullptr) + NodeBIO::FromBIO(bio.get())->env_ = env; + return bio; } -BIO* NodeBIO::NewFixed(const char* data, size_t len) { - BIO* bio = New(); +BIOPointer NodeBIO::NewFixed(const char* data, size_t len, Environment* env) { + BIOPointer bio = New(env); - if (bio == nullptr || + if (!bio || len > INT_MAX || - BIO_write(bio, data, len) != static_cast(len) || - BIO_set_mem_eof_return(bio, 0) != 1) { - BIO_free(bio); - return nullptr; + BIO_write(bio.get(), data, len) != static_cast(len) || + BIO_set_mem_eof_return(bio.get(), 0) != 1) { + return BIOPointer(); } return bio; } -void NodeBIO::AssignEnvironment(Environment* env) { - env_ = env; -} - - int NodeBIO::New(BIO* bio) { BIO_set_data(bio, new NodeBIO()); - BIO_set_init(bio, 1); return 1; @@ -251,6 +247,8 @@ const BIO_METHOD* NodeBIO::GetMethod() { return &method; #else + // This is called from InitCryptoOnce() to avoid race conditions during + // initialization. static BIO_METHOD* method = nullptr; if (method == nullptr) { diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index b4aa85f8fa36..0c61f19d0189 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -24,6 +24,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include "node_crypto.h" #include "openssl/bio.h" #include "env-inl.h" #include "util-inl.h" @@ -32,25 +33,21 @@ namespace node { namespace crypto { +// This class represents buffers for OpenSSL I/O, implemented as a singly-linked +// list of chunks. It can be used both for writing data from Node to OpenSSL +// and back, but only one direction per instance. +// The structure is only accessed, and owned by, the OpenSSL BIOPointer +// (a.k.a. std::unique_ptr). class NodeBIO : public MemoryRetainer { public: - NodeBIO() : env_(nullptr), - initial_(kInitialBufferLength), - length_(0), - eof_return_(-1), - read_head_(nullptr), - write_head_(nullptr) { - } - ~NodeBIO(); - static BIO* New(); + static BIOPointer New(Environment* env = nullptr); // NewFixed takes a copy of `len` bytes from `data` and returns a BIO that, // when read from, returns those bytes followed by EOF. - static BIO* NewFixed(const char* data, size_t len); - - void AssignEnvironment(Environment* env); + static BIOPointer NewFixed(const char* data, size_t len, + Environment* env = nullptr); // Move read head to next buffer if needed void TryMoveReadHead(); @@ -161,12 +158,14 @@ class NodeBIO : public MemoryRetainer { char* data_; }; - Environment* env_; - size_t initial_; - size_t length_; - int eof_return_; - Buffer* read_head_; - Buffer* write_head_; + Environment* env_ = nullptr; + size_t initial_ = kInitialBufferLength; + size_t length_ = 0; + int eof_return_ = -1; + Buffer* read_head_ = nullptr; + Buffer* write_head_ = nullptr; + + friend void node::crypto::InitCryptoOnce(); }; } // namespace crypto diff --git a/src/node_http2.cc b/src/node_http2.cc index d1319c9d82fd..e741120f5034 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -881,7 +881,12 @@ int Http2Session::OnHeaderCallback(nghttp2_session* handle, Http2Session* session = static_cast(user_data); int32_t id = GetFrameID(frame); Http2Stream* stream = session->FindStream(id); - CHECK_NOT_NULL(stream); + // If stream is null at this point, either something odd has happened + // or the stream was closed locally while header processing was occurring. + // either way, do not proceed and close the stream. + if (stream == nullptr) + return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; + // If the stream has already been destroyed, ignore. if (!stream->IsDestroyed() && !stream->AddHeader(name, value, flags)) { // This will only happen if the connected peer sends us more diff --git a/src/node_internals.h b/src/node_internals.h index 92b75b1f8607..a9eb3398d84f 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -195,9 +195,9 @@ extern bool config_experimental_modules; // that is used by lib/vm.js extern bool config_experimental_vm_modules; -// Set in node.cc by ParseArgs when --experimental-vm-modules is used. +// Set in node.cc by ParseArgs when --experimental-worker is used. // Used in node_config.cc to set a constant on process.binding('config') -// that is used by lib/vm.js +// that is used by the module loader. extern bool config_experimental_worker; // Set in node.cc by ParseArgs when --experimental-repl-await is used. diff --git a/src/node_perf.cc b/src/node_perf.cc index a1ca57e2d5c1..5d94bb4c8a4a 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -272,6 +272,9 @@ void MarkGarbageCollectionEnd(Isolate* isolate, v8::GCCallbackFlags flags, void* data) { Environment* env = static_cast(data); + // If no one is listening to gc performance entries, do not create them. + if (!env->performance_state()->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC]) + return; GCPerformanceEntry* entry = new GCPerformanceEntry(env, static_cast(type), diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 684ea41a66cc..d59b92555795 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -25,7 +25,7 @@ class NodeCategorySet : public BaseObject { static void Enable(const FunctionCallbackInfo& args); static void Disable(const FunctionCallbackInfo& args); - const std::set& GetCategories() { return categories_; } + const std::set& GetCategories() const { return categories_; } void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackThis(this); @@ -37,8 +37,8 @@ class NodeCategorySet : public BaseObject { private: NodeCategorySet(Environment* env, Local wrap, - std::set categories) : - BaseObject(env, wrap), categories_(categories) { + std::set&& categories) : + BaseObject(env, wrap), categories_(std::move(categories)) { MakeWeak(); } @@ -52,12 +52,14 @@ void NodeCategorySet::New(const FunctionCallbackInfo& args) { CHECK(args[0]->IsArray()); Local cats = args[0].As(); for (size_t n = 0; n < cats->Length(); n++) { - Local category = cats->Get(env->context(), n).ToLocalChecked(); + Local category; + if (!cats->Get(env->context(), n).ToLocal(&category)) return; Utf8Value val(env->isolate(), category); + if (!*val) return; categories.emplace(*val); } - CHECK_NOT_NULL(env->tracing_agent()); - new NodeCategorySet(env, args.This(), categories); + CHECK_NOT_NULL(env->tracing_agent_writer()); + new NodeCategorySet(env, args.This(), std::move(categories)); } void NodeCategorySet::Enable(const FunctionCallbackInfo& args) { @@ -67,7 +69,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo& args) { CHECK_NOT_NULL(category_set); const auto& categories = category_set->GetCategories(); if (!category_set->enabled_ && !categories.empty()) { - env->tracing_agent()->Enable(categories); + env->tracing_agent_writer()->Enable(categories); category_set->enabled_ = true; } } @@ -79,25 +81,28 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo& args) { CHECK_NOT_NULL(category_set); const auto& categories = category_set->GetCategories(); if (category_set->enabled_ && !categories.empty()) { - env->tracing_agent()->Disable(categories); + env->tracing_agent_writer()->Disable(categories); category_set->enabled_ = false; } } void GetEnabledCategories(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - std::string categories = env->tracing_agent()->GetEnabledCategories(); + std::string categories = + env->tracing_agent_writer()->agent()->GetEnabledCategories(); if (!categories.empty()) { args.GetReturnValue().Set( String::NewFromUtf8(env->isolate(), categories.c_str(), - v8::NewStringType::kNormal).ToLocalChecked()); + v8::NewStringType::kNormal, + categories.size()).ToLocalChecked()); } } // The tracing APIs require category groups to be pointers to long-lived // strings. Those strings are stored here. -static std::unordered_set categoryGroups; +static std::unordered_set category_groups; +static Mutex category_groups_mutex; // Gets a pointer to the category-enabled flags for a tracing category group, // if tracing is enabled for it. @@ -107,14 +112,15 @@ static const uint8_t* GetCategoryGroupEnabled(const char* category_group) { } static const char* GetCategoryGroup(Environment* env, - const Local categoryValue) { - CHECK(categoryValue->IsString()); + const Local category_value) { + CHECK(category_value->IsString()); - Utf8Value category(env->isolate(), categoryValue); + Utf8Value category(env->isolate(), category_value); + Mutex::ScopedLock lock(category_groups_mutex); // If the value already exists in the set, insertion.first will point // to the existing value. Thus, this will maintain a long lived pointer // to the category c-string. - auto insertion = categoryGroups.insert(category.out()); + auto insertion = category_groups.insert(category.out()); // The returned insertion is a pair whose first item is the object that was // inserted or that blocked the insertion and second item is a boolean @@ -133,7 +139,7 @@ static void Emit(const FunctionCallbackInfo& args) { // enabled. const char* category_group = GetCategoryGroup(env, args[1]); const uint8_t* category_group_enabled = - GetCategoryGroupEnabled(category_group); + GetCategoryGroupEnabled(category_group); if (*category_group_enabled == 0) return; // get trace_event phase @@ -142,8 +148,8 @@ static void Emit(const FunctionCallbackInfo& args) { // get trace_event name CHECK(args[2]->IsString()); - Utf8Value nameValue(env->isolate(), args[2]); - const char* name = nameValue.out(); + Utf8Value name_value(env->isolate(), args[2]); + const char* name = name_value.out(); // get trace_event id int64_t id = 0; @@ -212,7 +218,7 @@ static void CategoryGroupEnabled(const FunctionCallbackInfo& args) { const char* category_group = GetCategoryGroup(env, args[0]); const uint8_t* category_group_enabled = - GetCategoryGroupEnabled(category_group); + GetCategoryGroupEnabled(category_group); args.GetReturnValue().Set(*category_group_enabled > 0); } diff --git a/src/node_util.cc b/src/node_util.cc index 9f31786b3255..41b1307bb491 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -57,6 +57,9 @@ static void PreviewEntries(const FunctionCallbackInfo& args) { Local entries; if (!args[0].As()->PreviewEntries(&is_key_value).ToLocal(&entries)) return; + // Fast path for WeakMap, WeakSet and Set iterators. + if (args.Length() == 1) + return args.GetReturnValue().Set(entries); Local ret = Array::New(env->isolate(), 2); ret->Set(env->context(), 0, entries).FromJust(); ret->Set(env->context(), 1, v8::Boolean::New(env->isolate(), is_key_value)) diff --git a/src/node_version.h b/src/node_version.h index 761da762df1e..adf179479d7a 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 10 -#define NODE_MINOR_VERSION 8 -#define NODE_PATCH_VERSION 1 +#define NODE_MINOR_VERSION 9 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) diff --git a/src/node_worker.cc b/src/node_worker.cc index 3768d80a9c58..4f210203003e 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -287,22 +287,21 @@ void Worker::JoinThread() { } void Worker::OnThreadStopped() { - Mutex::ScopedLock lock(mutex_); - scheduled_on_thread_stopped_ = false; + { + Mutex::ScopedLock lock(mutex_); + scheduled_on_thread_stopped_ = false; - Debug(this, "Worker %llu thread stopped", thread_id_); + Debug(this, "Worker %llu thread stopped", thread_id_); - { - Mutex::ScopedLock stopped_lock(stopped_mutex_); - CHECK(stopped_); - } + { + Mutex::ScopedLock stopped_lock(stopped_mutex_); + CHECK(stopped_); + } - CHECK_EQ(child_port_, nullptr); - parent_port_ = nullptr; + CHECK_EQ(child_port_, nullptr); + parent_port_ = nullptr; + } - // It's okay to join the thread while holding the mutex because - // OnThreadStopped means it's no longer doing any work that might grab it - // and really just silently exiting. JoinThread(); { @@ -369,6 +368,7 @@ void Worker::StopThread(const FunctionCallbackInfo& args) { Worker* w; ASSIGN_OR_RETURN_UNWRAP(&w, args.This()); + Debug(w, "Worker %llu is getting stopped by parent", w->thread_id_); w->Exit(1); w->JoinThread(); } diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 83c74d2f1820..da54ca602372 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -265,7 +265,11 @@ size_t StringBytes::WriteUCS2(char* buf, size_t* chars_written) { uint16_t* const dst = reinterpret_cast(buf); - size_t max_chars = (buflen / sizeof(*dst)); + size_t max_chars = buflen / sizeof(*dst); + if (max_chars == 0) { + return 0; + } + size_t nchars; size_t alignment = reinterpret_cast(dst) % sizeof(*dst); if (alignment == 0) { diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 3efa6adb4edb..eb40d856fdab 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -60,8 +60,6 @@ TLSWrap::TLSWrap(Environment* env, SSLWrap(env, sc, kind), StreamBase(env), sc_(sc), - enc_in_(nullptr), - enc_out_(nullptr), write_size_(0), started_(false), established_(false), @@ -86,8 +84,6 @@ TLSWrap::TLSWrap(Environment* env, TLSWrap::~TLSWrap() { - enc_in_ = nullptr; - enc_out_ = nullptr; sc_ = nullptr; } @@ -112,11 +108,9 @@ void TLSWrap::NewSessionDoneCb() { void TLSWrap::InitSSL() { - // Initialize SSL - enc_in_ = crypto::NodeBIO::New(); - enc_out_ = crypto::NodeBIO::New(); - crypto::NodeBIO::FromBIO(enc_in_)->AssignEnvironment(env()); - crypto::NodeBIO::FromBIO(enc_out_)->AssignEnvironment(env()); + // Initialize SSL – OpenSSL takes ownership of these. + enc_in_ = crypto::NodeBIO::New(env()).release(); + enc_out_ = crypto::NodeBIO::New(env()).release(); SSL_set_bio(ssl_.get(), enc_in_, enc_out_); diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc index a3ddfb61a953..5a4d637bda03 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc @@ -1,23 +1,26 @@ #include "tracing/agent.h" -#include #include #include "tracing/node_trace_buffer.h" -#include "tracing/node_trace_writer.h" +#include "debug_utils.h" +#include "env-inl.h" namespace node { namespace tracing { -namespace { - -class ScopedSuspendTracing { +class Agent::ScopedSuspendTracing { public: - ScopedSuspendTracing(TracingController* controller, Agent* agent) - : controller_(controller), agent_(agent) { - controller->StopTracing(); + ScopedSuspendTracing(TracingController* controller, Agent* agent, + bool do_suspend = true) + : controller_(controller), agent_(do_suspend ? agent : nullptr) { + if (do_suspend) { + CHECK(agent_->started_); + controller->StopTracing(); + } } ~ScopedSuspendTracing() { + if (agent_ == nullptr) return; TraceConfig* config = agent_->CreateTraceConfig(); if (config != nullptr) { controller_->StartTracing(config); @@ -29,8 +32,10 @@ class ScopedSuspendTracing { Agent* agent_; }; +namespace { + std::set flatten( - const std::unordered_map>& map) { + const std::unordered_map>& map) { std::set result; for (const auto& id_value : map) result.insert(id_value.second.begin(), id_value.second.end()); @@ -43,18 +48,45 @@ using v8::platform::tracing::TraceConfig; using v8::platform::tracing::TraceWriter; using std::string; -Agent::Agent(const std::string& log_file_pattern) - : log_file_pattern_(log_file_pattern), file_writer_(EmptyClientHandle()) { +Agent::Agent() { tracing_controller_ = new TracingController(); tracing_controller_->Initialize(nullptr); + + CHECK_EQ(uv_loop_init(&tracing_loop_), 0); + CHECK_EQ(uv_async_init(&tracing_loop_, + &initialize_writer_async_, + [](uv_async_t* async) { + Agent* agent = ContainerOf(&Agent::initialize_writer_async_, async); + agent->InitializeWritersOnThread(); + }), 0); + uv_unref(reinterpret_cast(&initialize_writer_async_)); +} + +void Agent::InitializeWritersOnThread() { + Mutex::ScopedLock lock(initialize_writer_mutex_); + while (!to_be_initialized_.empty()) { + AsyncTraceWriter* head = *to_be_initialized_.begin(); + head->InitializeOnThread(&tracing_loop_); + to_be_initialized_.erase(head); + } + initialize_writer_condvar_.Broadcast(lock); +} + +Agent::~Agent() { + categories_.clear(); + writers_.clear(); + + StopTracing(); + + uv_close(reinterpret_cast(&initialize_writer_async_), nullptr); + uv_run(&tracing_loop_, UV_RUN_ONCE); + CheckedUvLoopClose(&tracing_loop_); } void Agent::Start() { if (started_) return; - CHECK_EQ(uv_loop_init(&tracing_loop_), 0); - NodeTraceBuffer* trace_buffer_ = new NodeTraceBuffer( NodeTraceBuffer::kBufferChunks, this, &tracing_loop_); tracing_controller_->Initialize(trace_buffer_); @@ -62,24 +94,48 @@ void Agent::Start() { // This thread should be created *after* async handles are created // (within NodeTraceWriter and NodeTraceBuffer constructors). // Otherwise the thread could shut down prematurely. - CHECK_EQ(0, uv_thread_create(&thread_, ThreadCb, this)); + CHECK_EQ(0, uv_thread_create(&thread_, [](void* arg) { + Agent* agent = static_cast(arg); + uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT); + }, this)); started_ = true; } -Agent::ClientHandle Agent::AddClient(const std::set& categories, - std::unique_ptr writer) { +AgentWriterHandle Agent::AddClient( + const std::set& categories, + std::unique_ptr writer, + enum UseDefaultCategoryMode mode) { Start(); + + const std::set* use_categories = &categories; + + std::set categories_with_default; + if (mode == kUseDefaultCategories) { + categories_with_default.insert(categories.begin(), categories.end()); + categories_with_default.insert(categories_[kDefaultHandleId].begin(), + categories_[kDefaultHandleId].end()); + use_categories = &categories_with_default; + } + ScopedSuspendTracing suspend(tracing_controller_, this); int id = next_writer_id_++; + AsyncTraceWriter* raw = writer.get(); writers_[id] = std::move(writer); - categories_[id] = categories; + categories_[id] = { use_categories->begin(), use_categories->end() }; + + { + Mutex::ScopedLock lock(initialize_writer_mutex_); + to_be_initialized_.insert(raw); + uv_async_send(&initialize_writer_async_); + while (to_be_initialized_.count(raw) > 0) + initialize_writer_condvar_.Wait(lock); + } - auto client_id = new std::pair(this, id); - return ClientHandle(client_id, &DisconnectClient); + return AgentWriterHandle(this, id); } -void Agent::Stop() { - file_writer_.reset(); +AgentWriterHandle Agent::DefaultHandle() { + return AgentWriterHandle(this, kDefaultHandleId); } void Agent::StopTracing() { @@ -96,66 +152,37 @@ void Agent::StopTracing() { } void Agent::Disconnect(int client) { + if (client == kDefaultHandleId) return; + { + Mutex::ScopedLock lock(initialize_writer_mutex_); + to_be_initialized_.erase(writers_[client].get()); + } ScopedSuspendTracing suspend(tracing_controller_, this); writers_.erase(client); categories_.erase(client); } -// static -void Agent::ThreadCb(void* arg) { - Agent* agent = static_cast(arg); - uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT); -} - -void Agent::Enable(const std::string& categories) { +void Agent::Enable(int id, const std::set& categories) { if (categories.empty()) return; - std::set categories_set; - std::stringstream category_list(categories); - while (category_list.good()) { - std::string category; - getline(category_list, category, ','); - categories_set.insert(category); - } - Enable(categories_set); -} -void Agent::Enable(const std::set& categories) { - std::string cats; - for (const std::string cat : categories) - cats += cat + ", "; - if (categories.empty()) - return; - - file_writer_categories_.insert(categories.begin(), categories.end()); - std::set full_list(file_writer_categories_.begin(), - file_writer_categories_.end()); - if (!file_writer_) { - // Ensure background thread is running - Start(); - std::unique_ptr writer( - new NodeTraceWriter(log_file_pattern_, &tracing_loop_)); - file_writer_ = AddClient(full_list, std::move(writer)); - } else { - ScopedSuspendTracing suspend(tracing_controller_, this); - categories_[file_writer_->second] = full_list; - } + ScopedSuspendTracing suspend(tracing_controller_, this, + id != kDefaultHandleId); + categories_[id].insert(categories.begin(), categories.end()); } -void Agent::Disable(const std::set& categories) { - for (auto category : categories) { - auto it = file_writer_categories_.find(category); - if (it != file_writer_categories_.end()) - file_writer_categories_.erase(it); +void Agent::Disable(int id, const std::set& categories) { + ScopedSuspendTracing suspend(tracing_controller_, this, + id != kDefaultHandleId); + std::multiset& writer_categories = categories_[id]; + for (const std::string& category : categories) { + auto it = writer_categories.find(category); + if (it != writer_categories.end()) + writer_categories.erase(it); } - if (!file_writer_) - return; - ScopedSuspendTracing suspend(tracing_controller_, this); - categories_[file_writer_->second] = { file_writer_categories_.begin(), - file_writer_categories_.end() }; } -TraceConfig* Agent::CreateTraceConfig() { +TraceConfig* Agent::CreateTraceConfig() const { if (categories_.empty()) return nullptr; TraceConfig* trace_config = new TraceConfig(); @@ -165,9 +192,9 @@ TraceConfig* Agent::CreateTraceConfig() { return trace_config; } -std::string Agent::GetEnabledCategories() { +std::string Agent::GetEnabledCategories() const { std::string categories; - for (const auto& category : flatten(categories_)) { + for (const std::string& category : flatten(categories_)) { if (!categories.empty()) categories += ','; categories += category; @@ -184,5 +211,6 @@ void Agent::Flush(bool blocking) { for (const auto& id_writer : writers_) id_writer.second->Flush(blocking); } + } // namespace tracing } // namespace node diff --git a/src/tracing/agent.h b/src/tracing/agent.h index fd7984275969..045aaef85e8e 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -4,6 +4,8 @@ #include "libplatform/v8-tracing.h" #include "uv.h" #include "v8.h" +#include "util.h" +#include "node_mutex.h" #include #include @@ -15,11 +17,14 @@ namespace tracing { using v8::platform::tracing::TraceConfig; using v8::platform::tracing::TraceObject; +class Agent; + class AsyncTraceWriter { public: virtual ~AsyncTraceWriter() {} virtual void AppendTraceEvent(TraceObject* trace_event) = 0; virtual void Flush(bool blocking) = 0; + virtual void InitializeOnThread(uv_loop_t* loop) {} }; class TracingController : public v8::platform::tracing::TracingController { @@ -31,60 +36,125 @@ class TracingController : public v8::platform::tracing::TracingController { } }; +class AgentWriterHandle { + public: + inline AgentWriterHandle() {} + inline ~AgentWriterHandle() { reset(); } + + inline AgentWriterHandle(AgentWriterHandle&& other); + inline AgentWriterHandle& operator=(AgentWriterHandle&& other); + inline bool empty() const { return agent_ == nullptr; } + inline void reset(); + + inline void Enable(const std::set& categories); + inline void Disable(const std::set& categories); + + inline Agent* agent() { return agent_; } + + private: + inline AgentWriterHandle(Agent* agent, int id) : agent_(agent), id_(id) {} + + AgentWriterHandle(const AgentWriterHandle& other) = delete; + AgentWriterHandle& operator=(const AgentWriterHandle& other) = delete; + + Agent* agent_ = nullptr; + int id_; + + friend class Agent; +}; class Agent { public: - // Resetting the pointer disconnects client - using ClientHandle = std::unique_ptr, - void (*)(std::pair*)>; - - static ClientHandle EmptyClientHandle() { - return ClientHandle(nullptr, DisconnectClient); - } - explicit Agent(const std::string& log_file_pattern); - void Stop(); + Agent(); + ~Agent(); TracingController* GetTracingController() { return tracing_controller_; } - // Destroying the handle disconnects the client - ClientHandle AddClient(const std::set& categories, - std::unique_ptr writer); - - // These 3 methods operate on a "default" client, e.g. the file writer - void Enable(const std::string& categories); - void Enable(const std::set& categories); - void Disable(const std::set& categories); - std::string GetEnabledCategories(); + enum UseDefaultCategoryMode { + kUseDefaultCategories, + kIgnoreDefaultCategories + }; + // Destroying the handle disconnects the client + AgentWriterHandle AddClient(const std::set& categories, + std::unique_ptr writer, + enum UseDefaultCategoryMode mode); + // A handle that is only used for managing the default categories + // (which can then implicitly be used through using `USE_DEFAULT_CATEGORIES` + // when adding a client later). + AgentWriterHandle DefaultHandle(); + + // Returns a comma-separated list of enabled categories. + std::string GetEnabledCategories() const; + + // Writes to all writers registered through AddClient(). void AppendTraceEvent(TraceObject* trace_event); + // Flushes all writers registered through AddClient(). void Flush(bool blocking); - TraceConfig* CreateTraceConfig(); + TraceConfig* CreateTraceConfig() const; private: + friend class AgentWriterHandle; + static void ThreadCb(void* arg); - static void DisconnectClient(std::pair* id_agent) { - id_agent->first->Disconnect(id_agent->second); - delete id_agent; - } + void InitializeWritersOnThread(); void Start(); void StopTracing(); void Disconnect(int client); - const std::string& log_file_pattern_; + void Enable(int id, const std::set& categories); + void Disable(int id, const std::set& categories); + uv_thread_t thread_; uv_loop_t tracing_loop_; + bool started_ = false; + class ScopedSuspendTracing; - std::unordered_map> categories_; - TracingController* tracing_controller_ = nullptr; - ClientHandle file_writer_; + // Each individual Writer has one id. int next_writer_id_ = 1; + enum { kDefaultHandleId = -1 }; + // These maps store the original arguments to AddClient(), by id. + std::unordered_map> categories_; std::unordered_map> writers_; - std::multiset file_writer_categories_; + TracingController* tracing_controller_ = nullptr; + + // Variables related to initializing per-event-loop properties of individual + // writers, such as libuv handles. + Mutex initialize_writer_mutex_; + ConditionVariable initialize_writer_condvar_; + uv_async_t initialize_writer_async_; + std::set to_be_initialized_; }; +void AgentWriterHandle::reset() { + if (agent_ != nullptr) + agent_->Disconnect(id_); + agent_ = nullptr; +} + +AgentWriterHandle& AgentWriterHandle::operator=(AgentWriterHandle&& other) { + reset(); + agent_ = other.agent_; + id_ = other.id_; + other.agent_ = nullptr; + return *this; +} + +AgentWriterHandle::AgentWriterHandle(AgentWriterHandle&& other) { + *this = std::move(other); +} + +void AgentWriterHandle::Enable(const std::set& categories) { + if (agent_ != nullptr) agent_->Enable(id_, categories); +} + +void AgentWriterHandle::Disable(const std::set& categories) { + if (agent_ != nullptr) agent_->Disable(id_, categories); +} + } // namespace tracing } // namespace node diff --git a/src/tracing/node_trace_writer.cc b/src/tracing/node_trace_writer.cc index a2f7bebfc72f..a0382e587b3a 100644 --- a/src/tracing/node_trace_writer.cc +++ b/src/tracing/node_trace_writer.cc @@ -3,16 +3,25 @@ #include #include -#include "util.h" +#include "util-inl.h" namespace node { namespace tracing { -NodeTraceWriter::NodeTraceWriter(const std::string& log_file_pattern, - uv_loop_t* tracing_loop) - : tracing_loop_(tracing_loop), log_file_pattern_(log_file_pattern) { +NodeTraceWriter::NodeTraceWriter(const std::string& log_file_pattern) + : log_file_pattern_(log_file_pattern) {} + +void NodeTraceWriter::InitializeOnThread(uv_loop_t* loop) { + CHECK_NULL(tracing_loop_); + tracing_loop_ = loop; + flush_signal_.data = this; - int err = uv_async_init(tracing_loop_, &flush_signal_, FlushSignalCb); + int err = uv_async_init(tracing_loop_, &flush_signal_, + [](uv_async_t* signal) { + NodeTraceWriter* trace_writer = + ContainerOf(&NodeTraceWriter::flush_signal_, signal); + trace_writer->FlushPrivate(); + }); CHECK_EQ(err, 0); exit_signal_.data = this; @@ -28,9 +37,7 @@ void NodeTraceWriter::WriteSuffix() { { Mutex::ScopedLock scoped_lock(stream_mutex_); if (total_traces_ > 0) { - total_traces_ = 0; // so we don't write it again in FlushPrivate - // Appends "]}" to stream_. - delete json_trace_writer_; + total_traces_ = kTracesPerFile; // Act as if we reached the file limit. should_flush = true; } } @@ -44,7 +51,7 @@ NodeTraceWriter::~NodeTraceWriter() { uv_fs_t req; int err; if (fd_ != -1) { - err = uv_fs_close(tracing_loop_, &req, fd_, nullptr); + err = uv_fs_close(nullptr, &req, fd_, nullptr); CHECK_EQ(err, 0); uv_fs_req_cleanup(&req); } @@ -75,10 +82,20 @@ void NodeTraceWriter::OpenNewFileForStreaming() { replace_substring(&filepath, "${pid}", std::to_string(uv_os_getpid())); replace_substring(&filepath, "${rotation}", std::to_string(file_num_)); - fd_ = uv_fs_open(tracing_loop_, &req, filepath.c_str(), + if (fd_ != -1) { + CHECK_EQ(uv_fs_close(nullptr, &req, fd_, nullptr), 0); + uv_fs_req_cleanup(&req); + } + + fd_ = uv_fs_open(nullptr, &req, filepath.c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0644, nullptr); - CHECK_NE(fd_, -1); uv_fs_req_cleanup(&req); + if (fd_ < 0) { + fprintf(stderr, "Could not open trace file %s: %s\n", + filepath.c_str(), + uv_strerror(fd_)); + fd_ = -1; + } } void NodeTraceWriter::AppendTraceEvent(TraceObject* trace_event) { @@ -92,7 +109,7 @@ void NodeTraceWriter::AppendTraceEvent(TraceObject* trace_event) { // to a state where we can start writing trace events to it. // Repeatedly constructing and destroying json_trace_writer_ allows // us to use V8's JSON writer instead of implementing our own. - json_trace_writer_ = TraceWriter::CreateJSONTraceWriter(stream_); + json_trace_writer_.reset(TraceWriter::CreateJSONTraceWriter(stream_)); } ++total_traces_; json_trace_writer_->AppendTraceEvent(trace_event); @@ -107,7 +124,7 @@ void NodeTraceWriter::FlushPrivate() { total_traces_ = 0; // Destroying the member JSONTraceWriter object appends "]}" to // stream_ - in other words, ending a JSON file. - delete json_trace_writer_; + json_trace_writer_.reset(); } // str() makes a copy of the contents of the stream. str = stream_.str(); @@ -121,11 +138,6 @@ void NodeTraceWriter::FlushPrivate() { WriteToFile(std::move(str), highest_request_id); } -void NodeTraceWriter::FlushSignalCb(uv_async_t* signal) { - NodeTraceWriter* trace_writer = static_cast(signal->data); - trace_writer->FlushPrivate(); -} - void NodeTraceWriter::Flush(bool blocking) { Mutex::ScopedLock scoped_lock(request_mutex_); if (!json_trace_writer_) { @@ -145,49 +157,71 @@ void NodeTraceWriter::Flush(bool blocking) { } void NodeTraceWriter::WriteToFile(std::string&& str, int highest_request_id) { - WriteRequest* write_req = new WriteRequest(); - write_req->str = std::move(str); - write_req->writer = this; - write_req->highest_request_id = highest_request_id; - uv_buf_t uv_buf = uv_buf_init(const_cast(write_req->str.c_str()), - write_req->str.length()); - request_mutex_.Lock(); - // Manage a queue of WriteRequest objects because the behavior of uv_write is - // undefined if the same WriteRequest object is used more than once - // between WriteCb calls. In addition, this allows us to keep track of the id - // of the latest write request that actually been completed. - write_req_queue_.push(write_req); - request_mutex_.Unlock(); - int err = uv_fs_write(tracing_loop_, reinterpret_cast(write_req), - fd_, &uv_buf, 1, -1, WriteCb); + if (fd_ == -1) return; + + uv_buf_t buf = uv_buf_init(nullptr, 0); + { + Mutex::ScopedLock lock(request_mutex_); + write_req_queue_.emplace(WriteRequest { + std::move(str), highest_request_id + }); + if (write_req_queue_.size() == 1) { + buf = uv_buf_init( + const_cast(write_req_queue_.front().str.c_str()), + write_req_queue_.front().str.length()); + } + } + // Only one write request for the same file descriptor should be active at + // a time. + if (buf.base != nullptr && fd_ != -1) { + StartWrite(buf); + } +} + +void NodeTraceWriter::StartWrite(uv_buf_t buf) { + int err = uv_fs_write( + tracing_loop_, &write_req_, fd_, &buf, 1, -1, + [](uv_fs_t* req) { + NodeTraceWriter* writer = + ContainerOf(&NodeTraceWriter::write_req_, req); + writer->AfterWrite(); + }); CHECK_EQ(err, 0); } -void NodeTraceWriter::WriteCb(uv_fs_t* req) { - WriteRequest* write_req = reinterpret_cast(req); - CHECK_GE(write_req->req.result, 0); +void NodeTraceWriter::AfterWrite() { + CHECK_GE(write_req_.result, 0); + uv_fs_req_cleanup(&write_req_); - NodeTraceWriter* writer = write_req->writer; - int highest_request_id = write_req->highest_request_id; + uv_buf_t buf = uv_buf_init(nullptr, 0); { - Mutex::ScopedLock scoped_lock(writer->request_mutex_); - CHECK_EQ(write_req, writer->write_req_queue_.front()); - writer->write_req_queue_.pop(); - writer->highest_request_id_completed_ = highest_request_id; - writer->request_cond_.Broadcast(scoped_lock); + Mutex::ScopedLock scoped_lock(request_mutex_); + int highest_request_id = write_req_queue_.front().highest_request_id; + write_req_queue_.pop(); + highest_request_id_completed_ = highest_request_id; + request_cond_.Broadcast(scoped_lock); + if (!write_req_queue_.empty()) { + buf = uv_buf_init( + const_cast(write_req_queue_.front().str.c_str()), + write_req_queue_.front().str.length()); + } + } + if (buf.base != nullptr && fd_ != -1) { + StartWrite(buf); } - delete write_req; } // static void NodeTraceWriter::ExitSignalCb(uv_async_t* signal) { - NodeTraceWriter* trace_writer = static_cast(signal->data); + NodeTraceWriter* trace_writer = + ContainerOf(&NodeTraceWriter::exit_signal_, signal); uv_close(reinterpret_cast(&trace_writer->flush_signal_), nullptr); uv_close(reinterpret_cast(&trace_writer->exit_signal_), [](uv_handle_t* signal) { NodeTraceWriter* trace_writer = - static_cast(signal->data); + ContainerOf(&NodeTraceWriter::exit_signal_, + reinterpret_cast(signal)); Mutex::ScopedLock scoped_lock(trace_writer->request_mutex_); trace_writer->exited_ = true; trace_writer->exit_cond_.Signal(scoped_lock); diff --git a/src/tracing/node_trace_writer.h b/src/tracing/node_trace_writer.h index b2d5e7912fa0..5e5781479c68 100644 --- a/src/tracing/node_trace_writer.h +++ b/src/tracing/node_trace_writer.h @@ -4,7 +4,6 @@ #include #include -#include "node_mutex.h" #include "libplatform/v8-tracing.h" #include "tracing/agent.h" #include "uv.h" @@ -17,10 +16,10 @@ using v8::platform::tracing::TraceWriter; class NodeTraceWriter : public AsyncTraceWriter { public: - explicit NodeTraceWriter(const std::string& log_file_pattern, - uv_loop_t* tracing_loop); + explicit NodeTraceWriter(const std::string& log_file_pattern); ~NodeTraceWriter(); + void InitializeOnThread(uv_loop_t* loop) override; void AppendTraceEvent(TraceObject* trace_event) override; void Flush(bool blocking) override; @@ -28,21 +27,19 @@ class NodeTraceWriter : public AsyncTraceWriter { private: struct WriteRequest { - uv_fs_t req; - NodeTraceWriter* writer; std::string str; int highest_request_id; }; - static void WriteCb(uv_fs_t* req); + void AfterWrite(); + void StartWrite(uv_buf_t buf); void OpenNewFileForStreaming(); void WriteToFile(std::string&& str, int highest_request_id); void WriteSuffix(); - static void FlushSignalCb(uv_async_t* signal); void FlushPrivate(); static void ExitSignalCb(uv_async_t* signal); - uv_loop_t* tracing_loop_; + uv_loop_t* tracing_loop_ = nullptr; // Triggers callback to initiate writing the contents of stream_ to disk. uv_async_t flush_signal_; // Triggers callback to close async objects, ending the tracing thread. @@ -58,14 +55,15 @@ class NodeTraceWriter : public AsyncTraceWriter { // Used to wait until async handles have been closed. ConditionVariable exit_cond_; int fd_ = -1; - std::queue write_req_queue_; + uv_fs_t write_req_; + std::queue write_req_queue_; int num_write_requests_ = 0; int highest_request_id_completed_ = 0; int total_traces_ = 0; int file_num_ = 0; const std::string& log_file_pattern_; std::ostringstream stream_; - TraceWriter* json_trace_writer_ = nullptr; + std::unique_ptr json_trace_writer_; bool exited_ = false; }; diff --git a/src/util.cc b/src/util.cc index 3e808e13fe87..66be18eae2d1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -24,6 +24,7 @@ #include "node_internals.h" #include "uv.h" #include +#include namespace node { @@ -118,4 +119,17 @@ void GetHumanReadableProcessName(char (*name)[1024]) { snprintf(*name, sizeof(*name), "%s[%d]", title, uv_os_getpid()); } +std::set ParseCommaSeparatedSet(const std::string& in) { + std::set out; + if (in.empty()) + return out; + std::istringstream in_stream(in); + while (in_stream.good()) { + std::string item; + getline(in_stream, item, ','); + out.emplace(std::move(item)); + } + return out; +} + } // namespace node diff --git a/src/util.h b/src/util.h index f7dcc5ea35ab..a9fce79ebeae 100644 --- a/src/util.h +++ b/src/util.h @@ -36,6 +36,7 @@ #include #include // std::function +#include namespace node { @@ -476,6 +477,8 @@ struct FunctionDeleter { template using DeleteFnPtr = typename FunctionDeleter::Pointer; +std::set ParseCommaSeparatedSet(const std::string& in); + } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/test/README.md b/test/README.md index 302db9d0bb8a..7ef705230983 100644 --- a/test/README.md +++ b/test/README.md @@ -13,26 +13,25 @@ GitHub with the `autocrlf` git config flag set to true. ## Test Directories -|Directory |Runs on CI |Purpose | -|-------------------|---------------|---------------| -|abort |Yes |Tests for when the ``` --abort-on-uncaught-exception ``` flag is used.| -|addons |Yes |Tests for [addon](https://nodejs.org/api/addons.html) functionality along with some tests that require an addon to function properly.| -|cctest |Yes |C++ test that is run as part of the build process.| -|common | |Common modules shared among many tests. [Documentation](./common/README.md)| -|es-module |Yes |Test ESM module loading.| -|fixtures | |Test fixtures used in various tests throughout the test suite.| -|gc |No |Tests for garbage collection related functionality.| -|internet |No |Tests that make real outbound connections (mainly networking related modules). Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections.| -|known_issues |Yes |Tests reproducing known issues within the system. All tests inside of this directory are expected to fail consistently. If a test doesn't fail on certain platforms, those should be skipped via `known_issues.status`.| -|message |Yes |Tests for messages that are output for various conditions (```console.log```, error messages etc.)| -|parallel |Yes |Various tests that are able to be run in parallel.| -|pseudo-tty |Yes |Tests that require stdin/stdout/stderr to be a TTY.| -|pummel |No |Various tests for various modules / system functionality operating under load.| -|sequential |Yes |Various tests that are run sequentially.| -|testpy | |Test configuration utility used by various test suites.| -|tick-processor |No |Tests for the V8 tick processor integration. The tests are for the logic in ```lib/internal/v8_prof_processor.js``` and ```lib/internal/v8_prof_polyfill.js```. The tests confirm that the profile processor packages the correct set of scripts from V8 and introduces the correct platform specific logic.| -|timers |No |Tests for [timing utilities](https://nodejs.org/api/timers.html) (```setTimeout``` and ```setInterval```).| - -_When a new test directory is added, make sure to update the `CI_JS_SUITES` -variable in the `Makefile` and the `js_test_suites` variable in -`vcbuild.bat`._ +| Directory | Runs on CI | Purpose | +| ------------------- | --------------- | --------------- | +| `abort` | Yes | Tests for when the ``` --abort-on-uncaught-exception ``` flag is used. | +| `addons` | Yes | Tests for [addon](https://nodejs.org/api/addons.html) functionality along with some tests that require an addon to function properly. | +| `addons-napi` | Yes | Tests for [n-api](https://nodejs.org/api/n-api.html) functionality. | +| `async-hooks` | Yes | Tests for [async_hooks](https://nodejs.org/api/async_hooks.html) functionality. | +| `cctest` | Yes | C++ tests that are run as part of the build process. | +| `code-cache` | No | Tests for a Node.js binary compiled with V8 code cache. | +| `common` | | Common modules shared among many tests. [Documentation](./common/README.md) | +| `doctool` | Yes | Tests for the documentation generator. | +| `es-module` | Yes | Test ESM module loading. | +| `fixtures` | | Test fixtures used in various tests throughout the test suite. | +| `internet` | No | Tests that make real outbound connections (mainly networking related modules). Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections. | +| `known_issues` | Yes | Tests reproducing known issues within the system. All tests inside of this directory are expected to fail consistently. If a test doesn't fail on certain platforms, those should be skipped via `known_issues.status`. | +| `message` | Yes | Tests for messages that are output for various conditions (```console.log```, error messages etc.) | +| `parallel` | Yes | Various tests that are able to be run in parallel. | +| `pseudo-tty` | Yes | Tests that require stdin/stdout/stderr to be a TTY. | +| `pummel` | No | Various tests for various modules / system functionality operating under load. | +| `sequential` | Yes | Various tests that are run sequentially. | +| `testpy` | | Test configuration utility used by various test suites. | +| `tick-processor` | No | Tests for the V8 tick processor integration. The tests are for the logic in ```lib/internal/v8_prof_processor.js``` and ```lib/internal/v8_prof_polyfill.js```. The tests confirm that the profile processor packages the correct set of scripts from V8 and introduces the correct platform specific logic. | +| `v8-updates` | No | Tests for V8 performance integration. | diff --git a/test/addons-napi/test_async/test-loop.js b/test/addons-napi/test_async/test-loop.js index efd15bcb2d0e..1b05cbad4a50 100644 --- a/test/addons-napi/test_async/test-loop.js +++ b/test/addons-napi/test_async/test-loop.js @@ -6,7 +6,7 @@ const iterations = 500; let x = 0; const workDone = common.mustCall((status) => { - assert.strictEqual(status, 0, 'Work completed successfully'); + assert.strictEqual(status, 0); if (++x < iterations) { setImmediate(() => test_async.DoRepeatedWork(workDone)); } diff --git a/test/addons-napi/test_general/test_general.c b/test/addons-napi/test_general/test_general.c index 8f429f939fb8..5a363d0b168f 100644 --- a/test/addons-napi/test_general/test_general.c +++ b/test/addons-napi/test_general/test_general.c @@ -216,7 +216,7 @@ static napi_value testAdjustExternalMemory(napi_env env, napi_callback_info info int64_t adjustedValue; NAPI_CALL(env, napi_adjust_external_memory(env, 1, &adjustedValue)); - NAPI_CALL(env, napi_create_double(env, adjustedValue, &result)); + NAPI_CALL(env, napi_create_double(env, (double)adjustedValue, &result)); return result; } diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js index f8aed7c0b2e0..e4edd32797c2 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js @@ -1,3 +1,4 @@ +// Flags: --expose-gc 'use strict'; const common = require('../../common'); @@ -35,10 +36,13 @@ common.expectsError(function() { type: Error }); +// FIXME: Free the memory early to avoid OOM. +// REF: https://github.com/nodejs/reliability/issues/12#issuecomment-412619655 +global.gc(); let maxString = buf.toString('latin1', 1); assert.strictEqual(maxString.length, kStringMaxLength); -// Free the memory early instead of at the end of the next assignment maxString = undefined; +global.gc(); maxString = buf.toString('latin1', 0, kStringMaxLength); assert.strictEqual(maxString.length, kStringMaxLength); diff --git a/test/async-hooks/coverage.md b/test/async-hooks/coverage.md index 461d5137e594..f633decd93a5 100644 --- a/test/async-hooks/coverage.md +++ b/test/async-hooks/coverage.md @@ -1,32 +1,32 @@ -## AsyncHooks Coverage Overview +# AsyncHooks Coverage Overview Showing which kind of async resource is covered by which test: -| Resource Type | Test | -|----------------------|----------------------------------------| -| CONNECTION | test-connection.ssl.js | -| FSEVENTWRAP | test-fseventwrap.js | -| FSREQWRAP | test-fsreqwrap-{access,readFile}.js | -| GETADDRINFOREQWRAP | test-getaddrinforeqwrap.js | -| GETNAMEINFOREQWRAP | test-getnameinforeqwrap.js | -| HTTPPARSER | test-httpparser.{request,response}.js | -| Immediate | test-immediate.js | -| JSSTREAM | TODO (crashes when accessing directly) | -| PBKDF2REQUEST | test-crypto-pbkdf2.js | -| PIPECONNECTWRAP | test-pipeconnectwrap.js | -| PIPEWRAP | test-pipewrap.js | -| PROCESSWRAP | test-pipewrap.js | -| QUERYWRAP | test-querywrap.js | -| RANDOMBYTESREQUEST | test-crypto-randomBytes.js | -| SHUTDOWNWRAP | test-shutdownwrap.js | -| SIGNALWRAP | test-signalwrap.js | -| STATWATCHER | test-statwatcher.js | -| TCPCONNECTWRAP | test-tcpwrap.js | -| TCPWRAP | test-tcpwrap.js | -| TIMERWRAP | test-timerwrap.set{Timeout,Interval}.js| -| TLSWRAP | test-tlswrap.js | -| TTYWRAP | test-ttywrap.{read,write}stream.js | -| UDPSENDWRAP | test-udpsendwrap.js | -| UDPWRAP | test-udpwrap.js | -| WRITEWRAP | test-writewrap.js | -| ZLIB | test-zlib.zlib-binding.deflate.js | +| Resource Type | Test | +|----------------------|-----------------------------------------| +| CONNECTION | test-connection.ssl.js | +| FSEVENTWRAP | test-fseventwrap.js | +| FSREQWRAP | test-fsreqwrap-{access,readFile}.js | +| GETADDRINFOREQWRAP | test-getaddrinforeqwrap.js | +| GETNAMEINFOREQWRAP | test-getnameinforeqwrap.js | +| HTTPPARSER | test-httpparser.{request,response}.js | +| Immediate | test-immediate.js | +| JSSTREAM | TODO (crashes when accessing directly) | +| PBKDF2REQUEST | test-crypto-pbkdf2.js | +| PIPECONNECTWRAP | test-pipeconnectwrap.js | +| PIPEWRAP | test-pipewrap.js | +| PROCESSWRAP | test-pipewrap.js | +| QUERYWRAP | test-querywrap.js | +| RANDOMBYTESREQUEST | test-crypto-randomBytes.js | +| SHUTDOWNWRAP | test-shutdownwrap.js | +| SIGNALWRAP | test-signalwrap.js | +| STATWATCHER | test-statwatcher.js | +| TCPCONNECTWRAP | test-tcpwrap.js | +| TCPWRAP | test-tcpwrap.js | +| TIMERWRAP | test-timerwrap.set{Timeout,Interval}.js | +| TLSWRAP | test-tlswrap.js | +| TTYWRAP | test-ttywrap.{read,write}stream.js | +| UDPSENDWRAP | test-udpsendwrap.js | +| UDPWRAP | test-udpwrap.js | +| WRITEWRAP | test-writewrap.js | +| ZLIB | test-zlib.zlib-binding.deflate.js | diff --git a/test/common/README.md b/test/common/README.md index 3dee2f197049..27634c97e11e 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -121,12 +121,6 @@ Tests whether `name`, `expected`, and `code` are part of a raised warning. If an expected warning does not have a code then `common.noWarnCode` can be used to indicate this. -### fileExists(pathname) -* pathname [<string>] -* return [<boolean>] - -Checks if `pathname` exists - ### getArrayBufferViews(buf) * `buf` [<Buffer>] * return [<ArrayBufferView[]>] @@ -578,7 +572,7 @@ one listed below. (`heap.validateSnapshotNodes(...)` is a shortcut for Create a heap dump and an embedder graph copy and validate occurrences. - + ```js validateSnapshotNodes('TLSWRAP', [ { @@ -596,7 +590,7 @@ validateSnapshotNodes('TLSWRAP', [ The http2.js module provides a handful of utilities for creating mock HTTP/2 frames for testing of HTTP/2 endpoints - + ```js const http2 = require('../common/http2'); ``` @@ -606,7 +600,7 @@ const http2 = require('../common/http2'); The `http2.Frame` is a base class that creates a `Buffer` containing a serialized HTTP/2 frame header. - + ```js // length is a 24-bit unsigned integer // type is an 8-bit unsigned integer identifying the frame type @@ -625,7 +619,7 @@ The serialized `Buffer` may be retrieved using the `frame.data` property. The `http2.DataFrame` is a subclass of `http2.Frame` that serializes a `DATA` frame. - + ```js // id is the 32-bit stream identifier // payload is a Buffer containing the DATA payload @@ -642,7 +636,7 @@ socket.write(frame.data); The `http2.HeadersFrame` is a subclass of `http2.Frame` that serializes a `HEADERS` frame. - + ```js // id is the 32-bit stream identifier // payload is a Buffer containing the HEADERS payload (see either @@ -660,7 +654,7 @@ socket.write(frame.data); The `http2.SettingsFrame` is a subclass of `http2.Frame` that serializes an empty `SETTINGS` frame. - + ```js // ack is a boolean indicating whether or not to set the ACK flag. const frame = new http2.SettingsFrame(ack); @@ -673,7 +667,7 @@ socket.write(frame.data); Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2 request headers to be used as the payload of a `http2.HeadersFrame`. - + ```js const frame = new http2.HeadersFrame(1, http2.kFakeRequestHeaders, 0, true); @@ -685,7 +679,7 @@ socket.write(frame.data); Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2 response headers to be used as the payload a `http2.HeadersFrame`. - + ```js const frame = new http2.HeadersFrame(1, http2.kFakeResponseHeaders, 0, true); @@ -697,7 +691,7 @@ socket.write(frame.data); Set to a `Buffer` containing the preamble bytes an HTTP/2 client must send upon initial establishment of a connection. - + ```js socket.write(http2.kClientMagic); ``` diff --git a/test/common/benchmark.js b/test/common/benchmark.js index f8952a8b9ad6..0894146c4d14 100644 --- a/test/common/benchmark.js +++ b/test/common/benchmark.js @@ -20,7 +20,10 @@ function runBenchmark(name, args, env) { const mergedEnv = Object.assign({}, process.env, env); - const child = fork(runjs, argv, { env: mergedEnv, stdio: 'pipe' }); + const child = fork(runjs, argv, { + env: mergedEnv, + stdio: ['inherit', 'pipe', 'inherit', 'ipc'] + }); child.stdout.setEncoding('utf8'); let stdout = ''; diff --git a/test/common/index.js b/test/common/index.js index 21fead16eebe..0884e819683c 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -477,17 +477,8 @@ exports.hasMultiLocalhost = function hasMultiLocalhost() { return ret === 0; }; -exports.fileExists = function(pathname) { - try { - fs.accessSync(pathname); - return true; - } catch (err) { - return false; - } -}; - exports.skipIfEslintMissing = function() { - if (!exports.fileExists( + if (!fs.existsSync( path.join(__dirname, '..', '..', 'tools', 'node_modules', 'eslint') )) { exports.skip('missing ESLint'); @@ -703,8 +694,8 @@ exports.expectsError = function expectsError(fn, settings, exact) { assert.fail(`Expected one argument, got ${util.inspect(arguments)}`); } const descriptor = Object.getOwnPropertyDescriptor(error, 'message'); - assert.strictEqual(descriptor.enumerable, - false, 'The error message should be non-enumerable'); + // The error message should be non-enumerable + assert.strictEqual(descriptor.enumerable, false); let innerSettings = settings; if ('type' in settings) { diff --git a/test/common/index.mjs b/test/common/index.mjs index 8bf512f6b92f..74194975f1fc 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -3,7 +3,6 @@ import common from './index.js'; const { - PORT, isMainThread, isWindows, isWOW64, @@ -34,7 +33,6 @@ const { mustCallAtLeast, mustCallAsync, hasMultiLocalhost, - fileExists, skipIfEslintMissing, canCreateSymLink, getCallSite, @@ -63,7 +61,6 @@ const { } = common; export { - PORT, isMainThread, isWindows, isWOW64, @@ -94,7 +91,6 @@ export { mustCallAtLeast, mustCallAsync, hasMultiLocalhost, - fileExists, skipIfEslintMissing, canCreateSymLink, getCallSite, diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index c895df087c4b..8c05ea6a0b32 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -11,7 +11,34 @@ try { const assert = require('assert'); const { readFile } = require('fs'); const fixtures = require('../common/fixtures'); -const toHTML = require('../../tools/doc/html.js'); +const html = require('../../tools/doc/html.js'); +const path = require('path'); + +module.paths.unshift( + path.join(__dirname, '..', '..', 'tools', 'doc', 'node_modules')); +const unified = require('unified'); +const markdown = require('remark-parse'); +const remark2rehype = require('remark-rehype'); +const raw = require('rehype-raw'); +const htmlStringify = require('rehype-stringify'); + +function toHTML({ input, filename, nodeVersion, analytics }, cb) { + const content = unified() + .use(markdown) + .use(html.firstHeader) + .use(html.preprocessText) + .use(html.preprocessElements, { filename }) + .use(html.buildToc, { filename }) + .use(remark2rehype, { allowDangerousHTML: true }) + .use(raw) + .use(htmlStringify) + .processSync(input); + + html.toHTML( + { input, content, filename, nodeVersion, analytics }, + cb + ); +} // Test data is a list of objects with two properties. // The file property is the file path. @@ -80,7 +107,6 @@ testData.forEach(({ file, html, analyticsId }) => { readFile(file, 'utf8', common.mustCall((err, input) => { assert.ifError(err); - toHTML( { input: input, diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index e295014071a3..cdd3664cf1c3 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -10,9 +10,27 @@ try { const assert = require('assert'); const fs = require('fs'); +const path = require('path'); const fixtures = require('../common/fixtures'); const json = require('../../tools/doc/json.js'); +module.paths.unshift( + path.join(__dirname, '..', '..', 'tools', 'doc', 'node_modules')); +const unified = require('unified'); +const markdown = require('remark-parse'); + +function toJSON(input, filename, cb) { + function nullCompiler() { + this.Compiler = (tree) => tree; + } + + unified() + .use(markdown) + .use(json.jsonAPI, { filename }) + .use(nullCompiler) + .process(input, cb); +} + // Outputs valid json with the expected fields when given simple markdown // Test data is a list of objects with two properties. // The file property is the file path. @@ -21,6 +39,7 @@ const testData = [ { file: fixtures.path('sample_document.md'), json: { + type: 'module', source: 'foo', modules: [{ textRaw: 'Sample Markdown', @@ -28,8 +47,8 @@ const testData = [ modules: [{ textRaw: 'Seussian Rhymes', name: 'seussian_rhymes', - desc: '
    \n
  1. fish
  2. \n
  3. fish

    \n
  4. \n
  5. ' + - '

    Red fish

    \n
  6. \n
  7. Blue fish
  8. \n
\n', + desc: '
    \n
  1. fish
  2. \n
  3. fish
  4. \n
\n' + + '
    \n
  • Red fish
  • \n
  • Blue fish
  • \n
', type: 'module', displayName: 'Seussian Rhymes' }], @@ -41,6 +60,7 @@ const testData = [ { file: fixtures.path('order_of_end_tags_5873.md'), json: { + type: 'module', source: 'foo', modules: [{ textRaw: 'Title', @@ -55,15 +75,10 @@ const testData = [ signatures: [ { params: [{ - textRaw: '`array` {Array} ', + textRaw: '`array` {Array}', name: 'array', type: 'Array' }] - }, - { - params: [{ - name: 'array' - }] } ] }], @@ -78,6 +93,7 @@ const testData = [ { file: fixtures.path('doc_with_yaml.md'), json: { + type: 'module', source: 'foo', modules: [ { @@ -92,7 +108,7 @@ const testData = [ changes: [] }, desc: '

Describe Foobar in more detail ' + - 'here.

\n', + 'here.

', type: 'module', displayName: 'Foobar' }, @@ -110,7 +126,7 @@ const testData = [ ] }, desc: '

Describe Foobar II in more detail ' + - 'here. fg(1)

\n', + 'here. fg(1)

', type: 'module', displayName: 'Foobar II' }, @@ -123,7 +139,7 @@ const testData = [ changes: [] }, desc: '

Describe Deprecated thingy in more ' + - 'detail here. fg(1p)

\n', + 'detail here. fg(1p)

', type: 'module', displayName: 'Deprecated thingy' }, @@ -131,7 +147,7 @@ const testData = [ textRaw: 'Something', name: 'something', desc: '\n

' + - 'Describe Something in more detail here.

\n', + 'Describe Something in more detail here.

', type: 'module', displayName: 'Something' } @@ -147,9 +163,9 @@ const testData = [ testData.forEach((item) => { fs.readFile(item.file, 'utf8', common.mustCall((err, input) => { assert.ifError(err); - json(input, 'foo', common.mustCall((err, output) => { + toJSON(input, 'foo', common.mustCall((err, output) => { assert.ifError(err); - assert.deepStrictEqual(output, item.json); + assert.deepStrictEqual(output.json, item.json); })); })); }); diff --git a/test/es-module/testcfg.py b/test/es-module/testcfg.py index 0d8dfeed463e..83ce46ee6672 100644 --- a/test/es-module/testcfg.py +++ b/test/es-module/testcfg.py @@ -3,4 +3,4 @@ import testpy def GetConfiguration(context, root): - return testpy.SimpleTestConfiguration(context, root, 'es-module') + return testpy.ParallelTestConfiguration(context, root, 'es-module') diff --git a/test/fixtures/0-dns/README.md b/test/fixtures/0-dns/README.md index 650970a2c5a5..9a4a4a2b3d8a 100644 --- a/test/fixtures/0-dns/README.md +++ b/test/fixtures/0-dns/README.md @@ -1,3 +1,5 @@ +# 0-dns + ## Purpose The test cert file for use `test/parallel/test-tls-0-dns-altname.js` can be created by using `asn1.js` and `asn1.js-rfc5280`, diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 8df48eef9b1d..32e34705bb97 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -1,19 +1,18 @@ -all: agent1-cert.pem agent1-pfx.pem agent2-cert.pem agent3-cert.pem agent4-cert.pem agent5-cert.pem agent6-cert.pem agent7-cert.pem agent8-cert.pem agent9-cert.pem ca1-cert.pem ca2-crl.pem ca3-cert.pem ec-cert.pem dh512.pem dh1024.pem dh2048.pem dsa1025.pem dsa_private_1025.pem dsa_public_1025.pem rsa_private_1024.pem rsa_private_2048.pem rsa_private_4096.pem rsa_public_1024.pem rsa_public_2048.pem rsa_public_4096.pem - +all: agent1-cert.pem agent1-pfx.pem agent2-cert.pem agent3-cert.pem agent4-cert.pem agent5-cert.pem agent6-cert.pem agent7-cert.pem agent8-cert.pem agent9-cert.pem ca1-cert.pem ca2-crl.pem ca3-cert.pem ec-cert.pem dh512.pem dh1024.pem dh2048.pem dsa1025.pem dsa_private_1025.pem dsa_public_1025.pem rsa_private_1024.pem rsa_private_2048.pem rsa_private_4096.pem rsa_public_1024.pem rsa_public_2048.pem rsa_public_4096.pem ec-pfx.pem # # Create Certificate Authority: ca1 # ('password' is used for the CA password.) # ca1-cert.pem: ca1.cnf - openssl req -new -x509 -days 9999 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem + openssl req -new -x509 -days 99999 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem # # Create Certificate Authority: ca2 # ('password' is used for the CA password.) # ca2-cert.pem: ca2.cnf - openssl req -new -x509 -days 9999 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem + openssl req -new -x509 -days 99999 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem echo '01' > ca2-serial touch ca2-database.txt @@ -35,7 +34,7 @@ ca3-cert.pem: ca3-csr.pem ca3-key.pem ca3.cnf ca1-cert.pem ca1-key.pem openssl x509 -req \ -extfile ca3.cnf \ -extensions v3_ca \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in ca3-csr.pem \ -CA ca1-cert.pem \ @@ -53,7 +52,7 @@ fake-cnnic-root-key.pem: fake-cnnic-root-cert.pem: fake-cnnic-root.cnf fake-cnnic-root-key.pem openssl req -x509 -new \ -key fake-cnnic-root-key.pem \ - -days 1024 \ + -days 99999 \ -out fake-cnnic-root-cert.pem \ -config fake-cnnic-root.cnf @@ -65,7 +64,7 @@ fake-startcom-root-key.pem: fake-startcom-root-cert.pem: fake-startcom-root.cnf \ fake-startcom-root-key.pem - openssl req -new -x509 -days 9999 -config \ + openssl req -new -x509 -days 99999 -config \ fake-startcom-root.cnf -key fake-startcom-root-key.pem -out \ fake-startcom-root-cert.pem echo '01' > fake-startcom-root-serial @@ -85,7 +84,7 @@ agent1-cert.pem: agent1-csr.pem ca1-cert.pem ca1-key.pem openssl x509 -req \ -extfile agent1.cnf \ -extensions v3_ca \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent1-csr.pem \ -CA ca1-cert.pem \ @@ -120,7 +119,7 @@ agent2-csr.pem: agent2-key.pem agent2.cnf # Create a Certificate for the agent. agent2-cert.pem: agent2-csr.pem agent2-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -in agent2-csr.pem \ -signkey agent2-key.pem \ -out agent2-cert.pem @@ -140,7 +139,7 @@ agent3-csr.pem: agent3.cnf agent3-key.pem agent3-cert.pem: agent3-csr.pem ca2-cert.pem ca2-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent3-csr.pem \ -CA ca2-cert.pem \ @@ -164,7 +163,7 @@ agent4-csr.pem: agent4.cnf agent4-key.pem agent4-cert.pem: agent4-csr.pem ca2-cert.pem ca2-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent4-csr.pem \ -CA ca2-cert.pem \ @@ -206,7 +205,7 @@ agent5-csr.pem: agent5.cnf agent5-key.pem agent5-cert.pem: agent5-csr.pem ca2-cert.pem ca2-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent5-csr.pem \ -CA ca2-cert.pem \ @@ -231,7 +230,7 @@ agent6-csr.pem: agent6.cnf agent6-key.pem agent6-cert.pem: agent6-csr.pem ca3-cert.pem ca3-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent6-csr.pem \ -CA ca3-cert.pem \ @@ -257,7 +256,7 @@ agent7-csr.pem: agent1.cnf agent7-key.pem agent7-cert.pem: agent7-csr.pem fake-cnnic-root-cert.pem fake-cnnic-root-key.pem openssl x509 -req \ -extfile agent7.cnf \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent7-csr.pem \ -CA fake-cnnic-root-cert.pem \ @@ -286,7 +285,7 @@ agent8-cert.pem: agent8-csr.pem fake-startcom-root-cert.pem fake-startcom-root-k -keyfile fake-startcom-root-key.pem \ -cert fake-startcom-root-cert.pem \ -batch \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent8-csr.pem \ -startdate 161020235959Z \ @@ -316,7 +315,7 @@ agent9-cert.pem: agent9-csr.pem -keyfile fake-startcom-root-key.pem \ -cert fake-startcom-root-cert.pem \ -batch \ - -days 9999 \ + -days 99999 \ -passin "pass:password" \ -in agent9-csr.pem \ -startdate 161021000001Z \ @@ -330,7 +329,7 @@ ec-csr.pem: ec-key.pem ec-cert.pem: ec-csr.pem ec-key.pem openssl x509 -req \ - -days 9999 \ + -days 99999 \ -in ec-csr.pem \ -signkey ec-key.pem \ -out ec-cert.pem @@ -371,13 +370,13 @@ rsa_private_4096.pem: openssl genrsa -out rsa_private_4096.pem 4096 rsa_public_1024.pem: rsa_private_1024.pem - openssl rsa -in rsa_private_1024.pem -out rsa_public_1024.pem + openssl rsa -in rsa_private_1024.pem -pubout -out rsa_public_1024.pem rsa_public_2048.pem: rsa_private_2048.pem - openssl rsa -in rsa_private_2048.pem -out rsa_public_2048.pem + openssl rsa -in rsa_private_2048.pem -pubout -out rsa_public_2048.pem rsa_public_4096.pem: rsa_private_4096.pem - openssl rsa -in rsa_private_4096.pem -out rsa_public_4096.pem + openssl rsa -in rsa_private_4096.pem -pubout -out rsa_public_4096.pem clean: rm -f *.pem *.srl ca2-database.txt ca2-serial fake-startcom-root-serial diff --git a/test/fixtures/keys/agent1-cert.pem b/test/fixtures/keys/agent1-cert.pem index 9c5c2ca4c62e..ee4d9c434e27 100644 --- a/test/fixtures/keys/agent1-cert.pem +++ b/test/fixtures/keys/agent1-cert.pem @@ -1,18 +1,18 @@ -----BEGIN CERTIFICATE----- -MIIC1jCCAj+gAwIBAgIJAJqEq8+4pyrAMA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV +MIIC2DCCAkGgAwIBAgIJAPrVDMagf1FsMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2ExMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTA0MTgxMzI5MDhaFw00MjA5MDIxMzI5 -MDhaMH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzAN -BgNVBAoTBkpveWVudDEQMA4GA1UECxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQx -MSAwHgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAuOs3hW8rF+7xx5iB9wjmIgd+HTqRFUeKxG+mWV35Hl6A -3uzYGXwWznqsOomr4a/UkZrxbPGp5Awqa9g72NF97g3Sysq2DW4a3ycXWAeYYcHS -lRxqJGXTjx+vG/0nDCXLBhoDKO00zEccdjGS8xEjjieQQr+KeASmIm0kQmuN5YcC -AwEAAaNhMF8wXQYIKwYBBQUHAQEEUTBPMCMGCCsGAQUFBzABhhdodHRwOi8vb2Nz -cC5ub2RlanMub3JnLzAoBggrBgEFBQcwAoYcaHR0cDovL2NhLm5vZGVqcy5vcmcv -Y2EuY2VydDANBgkqhkiG9w0BAQsFAAOBgQA45MmH28Gns+1yu9w9MR/oR8hKDMnG -E4yDZ+9SofWdqRsGe5MNeMbp9c+FxIxODcNmdhV5Ao6+ZCRX4N9GjLqUL1jQoFAs -pT/U80ZU+4bz2EwGMBQt7CJZb/u+j8/vXheyGFZkCWEQj6AgZQFTniRRQJLwbiy5 -uDktGqnhvamyrg== +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTVaGA8yMjkyMDUyMjAx +MTY1NVowfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEP +MA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQDDAZhZ2Vu +dDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQDnXT3od/PORzybLaYoAhqwa87601hrKbOrcJH9XGVX +TqFoSqkVZCbFFHDDlambsucH0jejao7cKFm7UKyMhlOxSYaynD2o28nS1ZBRwybV +zOGsIhF2sPc3TY6+P2EQWhe1F9tZsUcoOSXihwx78V0HLVde3UoXmtDVwD8ASlRu +vQIDAQABo2EwXzBdBggrBgEFBQcBAQRRME8wIwYIKwYBBQUHMAGGF2h0dHA6Ly9v +Y3NwLm5vZGVqcy5vcmcvMCgGCCsGAQUFBzAChhxodHRwOi8vY2Eubm9kZWpzLm9y +Zy9jYS5jZXJ0MA0GCSqGSIb3DQEBBQUAA4GBAIi44Hk6phewUYEEmSSuuS4pViPZ +Eu/uCDtDAdn/Qz/q2lFHRsaia9ov7xfncYpgV7/vq5MAHigas4ZGUoutwCzwnaAI +l9wxkLG3G8wPN3x4wDGoLxpqaH5nqJIo6iWady9WM9PDaVHn+6ibrP9p55T65o+O +BaF2ovk9NzkxpMPM -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent1-csr.pem b/test/fixtures/keys/agent1-csr.pem index 51617129d0df..b6eb759b897b 100644 --- a/test/fixtures/keys/agent1-csr.pem +++ b/test/fixtures/keys/agent1-csr.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD -EwZhZ2VudDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC46zeFbysX7vHHmIH3COYiB34dOpEVR4rE -b6ZZXfkeXoDe7NgZfBbOeqw6iavhr9SRmvFs8ankDCpr2DvY0X3uDdLKyrYNbhrf -JxdYB5hhwdKVHGokZdOPH68b/ScMJcsGGgMo7TTMRxx2MZLzESOOJ5BCv4p4BKYi -bSRCa43lhwIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hhbGxlbmdlIHBhc3N3 -b3JkMA0GCSqGSIb3DQEBBQUAA4GBAC1pwZvvfYfK8IXYyXLD3N47MEbn/Y8C85Qi -rYVl7y/7ThurCLtWVlS3e7es3Kr8nxjHTjVZW20RZHOmOGfSOkXoL3uuwew1jvCq -ibM2jwPCq1N/I4D94Fzh9LG86Cu8U6PtBlZzgprdK84Fo8U/pFRikPrggApUiPhm -MZeWhDyn +MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQD +DAZhZ2VudDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDnXT3od/PORzybLaYoAhqwa87601hrKbOr +cJH9XGVXTqFoSqkVZCbFFHDDlambsucH0jejao7cKFm7UKyMhlOxSYaynD2o28nS +1ZBRwybVzOGsIhF2sPc3TY6+P2EQWhe1F9tZsUcoOSXihwx78V0HLVde3UoXmtDV +wD8ASlRuvQIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3 +b3JkMA0GCSqGSIb3DQEBCwUAA4GBAMFbLKd2LbXJ3DPnwzYPcToOYZbwirgZicQX +AGyU93YrwnTwITgz8bfYlMDDm+tL8w8tLjUTZQNpYqAC7WrUeBw6HuxluQ3MNJz3 +1X9e0SXgeiuNXZjjBRP7zgXvjeZ+ArOC7KZJbswsFGAC/c3ZUpkGG0trcRULcYTA ++wjl1ERh -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent1-key.pem b/test/fixtures/keys/agent1-key.pem index 08546736d546..031aad87f106 100644 --- a/test/fixtures/keys/agent1-key.pem +++ b/test/fixtures/keys/agent1-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQC46zeFbysX7vHHmIH3COYiB34dOpEVR4rEb6ZZXfkeXoDe7NgZ -fBbOeqw6iavhr9SRmvFs8ankDCpr2DvY0X3uDdLKyrYNbhrfJxdYB5hhwdKVHGok -ZdOPH68b/ScMJcsGGgMo7TTMRxx2MZLzESOOJ5BCv4p4BKYibSRCa43lhwIDAQAB -AoGBAIXZzPCLDXhffydo3vo/uMT9A26IzCfJB0s1PgYGHaK76TBz4+Bej+uZpD0j -FgVgzs8uhn7DVqQ5oiM5++fvi+Sd+KlyVNgLKe7UTBGYE5Nc9DuDDD0GmJtFvso6 -amsVhECF8sWZVOAwUdrwHhWevp5gJ1cfs3YMTlT9YqdRaWOhAkEA8TJAPfnbEfWf -saDhWCjanW+w2QEYPa6wYFt+I5L2XPTeKR/wEQ3EzM++vCWxSF5LNSaXIdic847p -BcIGi/0r6QJBAMREt5r1c6Wf5mS6i/Jg6AdCEUjy0feRCeKemJDMKxyl5m/cU+rk -p5YBUgwoI8kzc82GEhyg4/NgHQfNcrZdT+8CQFVzChNq21PHgyX46xzCjIDOOwcG -PkJMCyx3/X446JMSJUrIh9Ji4F/3EYmyiNYsodRYsZ5KEYCwFpn1nUAnF1ECQQC/ -uzl54YomJDyX7jzEfLJuVLY6AyvmowN7JN95pFoBVHf2ktBPySuFuKiEQ7oh1Wet -QOn0mZ/VovD5LFSBnkp1AkEAgOMkBCJuOfBDvQwrmAAowWQi//7D2x0fhyKcrF6D -EZYVV125Wodw3zFxmE9p4vb6Hg3X5jSyGMzdE5ZqMgBD7w== +MIICXwIBAAKBgQDnXT3od/PORzybLaYoAhqwa87601hrKbOrcJH9XGVXTqFoSqkV +ZCbFFHDDlambsucH0jejao7cKFm7UKyMhlOxSYaynD2o28nS1ZBRwybVzOGsIhF2 +sPc3TY6+P2EQWhe1F9tZsUcoOSXihwx78V0HLVde3UoXmtDVwD8ASlRuvQIDAQAB +AoGBAMaeCBh6aWWrR/8beCmebNUJJ/2x05TjjuddUybC3AjQasYCWhcQDCxh+NAe +uiT8t1LCh5sVTiD3zth8UDSu2EaWrL6gpOHqTHx1SgrVL1D99ha0QnDyBQ+GWBkh +0NoNHOF47mbmn7+gJpVNgiFtfTeOUyK3HUDlaa+/qJwdwEQNAkEA/9dzyExaFUzz +E6p1UGN0rvjTdC48Bak2D33Ut6FiABdBn1smAVIlroVv8nb+Tfvq7vgsgPXYTJcy +W2VN9f/tGwJBAOeB6QJLG7wUYRuKHndnXAPIJT6GW7TKuVQzNtRvB2wcqOZ3cF50 +gYi6dYmiV0SWEMr2IcYisgEnyE7uKh3tCQcCQQCB9OVBV1di/oVy9eFFhl+dCZQP +rfSbQ4rMb7R/2qA3P5j744b4oMu3TNzCoyMmZdK+tJ2WnErVDPBtcJYbYXcFAkEA +mTejbP8kle+u7TkWPNRNU7ts2tq1awwYaB+VFDd/ZA/7wLwfxIO7DzDIhZTJyPzA +lHMdmzJvONCJg6OggDnWlQJBAPpS05NSnr/gzoccnVfDkf0bqBe7ATAEJ8F7PS/z +kauA/tWM/Pec0unSdrAJKV9CLfKUvKBXwOIS3GPLTsYHTvc= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent1-pfx.pem b/test/fixtures/keys/agent1-pfx.pem index b0395eede9c2..11893f48eed1 100644 Binary files a/test/fixtures/keys/agent1-pfx.pem and b/test/fixtures/keys/agent1-pfx.pem differ diff --git a/test/fixtures/keys/agent1.cnf b/test/fixtures/keys/agent1.cnf index 6904b2e930d8..c4739da96200 100644 --- a/test/fixtures/keys/agent1.cnf +++ b/test/fixtures/keys/agent1.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent2-cert.pem b/test/fixtures/keys/agent2-cert.pem index 7538cfb9b048..dba141a39e22 100644 --- a/test/fixtures/keys/agent2-cert.pem +++ b/test/fixtures/keys/agent2-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICcTCCAdoCCQDTgzSLdDTF0TANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO -BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR -cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTMwODAxMTExOTAwWhcNNDAxMjE2MTExOTAw -WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD -VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg -MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBAKGYRnu2BdY2R8flqKPLICWO/7NoRVGH4KZBY1uBF/VYXyA2 -VT5O7461mt6oA372BItGyNxdbMEvQBRcLiXTueKF5D+KYu30bWem6A/AxxYvnqU4 -tP+uhsXNuGNQTp8i0vBDM/nUx7QGeP1Kda6C936PCNt7wbGPKPNyACNMbnptAgMB -AAEwDQYJKoZIhvcNAQEFBQADgYEATzjDAPocPA2Jm8wrLBW+fOC478wMo9gT3Y3N -ZU6fnF2dEPFLNETCMtDxnKhi4hnBpaiZ0fu0oaR1cSDRIVtlyW4azNjny4495C0F -JLuP5P5pz+rJe+ImKw+mO1ARA9fUAL3VN6/kVXY/EspwWJcLbJ5jdsDmkRbV52hX -Th4jkAI= +MIICczCCAdwCCQDoSvlN91onszANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV +UzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZKb3llbnQxEDAO +BgNVBAsMB05vZGUuanMxDzANBgNVBAMMBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR +cnlAdGlueWNsb3Vkcy5vcmcwIBcNMTgwODA4MDExNjU1WhgPMjI5MjA1MjIwMTE2 +NTVaMH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzAN +BgNVBAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEPMA0GA1UEAwwGYWdlbnQy +MSAwHgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEA+ANNQJCYkK2xeMpXY7P0FqQRnWm757yDXwLfeoz4IRfk +/20bdRPMIA3EIzDfIUyibq9Zdgm+sLixfv0WPRANEhLeMOdDAT4AuNDeZGu/4lTz +Hl4wsMq/FGDokIlmFeC+IBjTcNFNllr0wXT3650lEnXANaTe2qb5eqgq1RHA9MUC +AwEAATANBgkqhkiG9w0BAQUFAAOBgQDVUwS6OhVpM8nDknHMa1g05Ly9krwMP73V +01JpCsHxlXRomptTdAob/UVDSXlZxm6OrtXHiXI3Lz9bwStg++F3hxEfhVV7YJ1c +pc7HT1GqGkesFwYH6/KE871t54oIhpVzbeuJhtAdreRXRnjRrxxD11cYPwhn/f5O +jJdQL5duew== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent2-csr.pem b/test/fixtures/keys/agent2-csr.pem index 30d06a37ebb0..05faae060682 100644 --- a/test/fixtures/keys/agent2-csr.pem +++ b/test/fixtures/keys/agent2-csr.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD -EwZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQChmEZ7tgXWNkfH5aijyyAljv+zaEVRh+Cm -QWNbgRf1WF8gNlU+Tu+OtZreqAN+9gSLRsjcXWzBL0AUXC4l07niheQ/imLt9G1n -pugPwMcWL56lOLT/robFzbhjUE6fItLwQzP51Me0Bnj9SnWugvd+jwjbe8Gxjyjz -cgAjTG56bQIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hhbGxlbmdlIHBhc3N3 -b3JkMA0GCSqGSIb3DQEBBQUAA4GBAEBfLsByEqL79HRr4QwPTARMW51ohh29kCUU -OunEyxM8Ti3lBPGOePXLBGjq6e/eLmoOfKsOXKjE+Z3Rpj2L0IKJgpBBcvD2BCyM -920PdvIHHgWXGSGiDGL/nMbX3SZrYNP/ERawg/Tzqh4QorPj91RKYez9NNLoOncm -Ug1MI/t9 +MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQD +DAZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQD4A01AkJiQrbF4yldjs/QWpBGdabvnvINf +At96jPghF+T/bRt1E8wgDcQjMN8hTKJur1l2Cb6wuLF+/RY9EA0SEt4w50MBPgC4 +0N5ka7/iVPMeXjCwyr8UYOiQiWYV4L4gGNNw0U2WWvTBdPfrnSUSdcA1pN7apvl6 +qCrVEcD0xQIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3 +b3JkMA0GCSqGSIb3DQEBCwUAA4GBAHVG4Ng4xzGOWDBCj7/6LyxOdRt7E7eknkPx +BrU41OdwS4HEA4nNx3dcsvP5VmFDtLOBrUD499qPvhqW/QKBfTYwozollD/azi99 +kBpJK/mYKw9TBV34PGwgEZ/Eirg6vA/g5dE/8szIbzyWfYaRhnaFEzM9/0bAEOyI +3gr2WmL7 -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent2-key.pem b/test/fixtures/keys/agent2-key.pem index 155eacedd33d..81a8bf343651 100644 --- a/test/fixtures/keys/agent2-key.pem +++ b/test/fixtures/keys/agent2-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQChmEZ7tgXWNkfH5aijyyAljv+zaEVRh+CmQWNbgRf1WF8gNlU+ -Tu+OtZreqAN+9gSLRsjcXWzBL0AUXC4l07niheQ/imLt9G1npugPwMcWL56lOLT/ -robFzbhjUE6fItLwQzP51Me0Bnj9SnWugvd+jwjbe8GxjyjzcgAjTG56bQIDAQAB -AoGAd19C6g5731N30T5hRqY+GCC72a90TZc/p/Fz0Vva8/4VP3mDnSS4qMaVIlgh -RP++OZjPtqI5PbiG8MNrv7vZe0UXlV7oZE0IA+jomUXsplbwMFf6pkrqdyHi+cbm -rBudhmKeLUgNA6peMGVA83C5g2SMqU5kB+tWzZT7Rs9rsyECQQDWpXxZgULqbFZv -wjpIDGWjOpQZrv123bJ9TQ+VoskCu4vlyDJqDJPwnscl8NnzpFJriDARn0WrB2sd -8GCX1yEpAkEAwLo/MYG5elkNRsE5/vINSIo04Gu6tP/Sd7EBtHYAPHUPjs/MhhVX -tMIGtACheHMwjGRPyr8pboEp2LEap4GjpQJBALNsy+CJ0+TfwPVU96EIc+GZcvlx -NMErGyvwwclEtSDKo2vmCHZrozLtlu1ZQueOgbMPuZbRe8w2vEzfhe8HTtkCQAYy -NrPlwsvPLyEWN0IeEBVD9D0+2WrWSrL0auSdYpaPAOgLgDzTVNWH42VIG+jeczIg -S3xuNuvJlUnVL9Ew1s0CQQCly+gduXtvOYip1/Stm/65kT7d8ICQgjh0XSPw/kUC -llVMQY3z1iFCaj/z0Csr0t0kJ534bH7GP3LOoNruV0p9 +MIICXgIBAAKBgQD4A01AkJiQrbF4yldjs/QWpBGdabvnvINfAt96jPghF+T/bRt1 +E8wgDcQjMN8hTKJur1l2Cb6wuLF+/RY9EA0SEt4w50MBPgC40N5ka7/iVPMeXjCw +yr8UYOiQiWYV4L4gGNNw0U2WWvTBdPfrnSUSdcA1pN7apvl6qCrVEcD0xQIDAQAB +AoGBANrNPuhJKO/q7Pldub9SUXNwB8JSN954J4Y46KQbngTEKdlWjrS5ZIqa2oEZ +aqDcFSmFNW23py4NozofWfFBKeUdeRyQvSOg7wfhf2OdmpA4ilAhHx3Qih5wSPX1 +zz5cIpkO1f/d/SacT6Arl9eD1VEbhFUrMu59gTsUwfjJbhFBAkEA/TDhVL1PxH6l +zBgNiBPv9hc3ztjJYm+a6KhiP8EBObdPBqDRm1YOo3n8VeIhfruxn2yoVpvBDjCi +fD36XcQ2mQJBAPrDtvoqtiZjfjpzTnanAZjOYmVfS0VimQdLUd164A3lMAMV9nsG +hQbtzttges16i2/NJF8hky3dsjw25WcsBw0CQArUM17/ddDupcKz6KhASgwZdB6Z +sQtPwK1gvksBwz6ns26SJETjil69kehOcqZL+s3ZxN1nbftgYyKzN+kYwkkCQQDG +tSfdfNLyAI0aDBz08MnXKFPYOHcQ+FyC5zBr7N52pFIzX8f9HOF06CSuufkVsjGj +2k8kAxr5kV+XT3jhFIZRAkEAuDOSGDCVu+0vX120jTJu4PjfeHuaeNfWjC226x9h +EQAxkDfFfKTN7dsBXqt0r0HmLZfWBVQ1svEXCkwvPuRaeg== -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent2.cnf b/test/fixtures/keys/agent2.cnf index 0a9f2c7374e1..90a1cf954650 100644 --- a/test/fixtures/keys/agent2.cnf +++ b/test/fixtures/keys/agent2.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent3-cert.pem b/test/fixtures/keys/agent3-cert.pem index fededd80769c..6aaa99cc8122 100644 --- a/test/fixtures/keys/agent3-cert.pem +++ b/test/fixtures/keys/agent3-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICbjCCAdcCCQDuvizlIRoS+TANBgkqhkiG9w0BAQsFADB6MQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO -BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA -dGlueWNsb3Vkcy5vcmcwHhcNMTUxMTEyMjEzMTQ3WhcNNDMwMzI5MjEzMTQ3WjB9 -MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK -EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MzEgMB4G -CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQAD -gY0AMIGJAoGBAM8KaJS9K/7LKuV1c8Jsliy9o3ubBGHGguBLmtHLgsAhsvbB/lE7 -cuxbBXPHLgegopcOrbsp4EuHURcN2WAkGcXpBIE5msYOxmImy2FifuUi0Vj4b2Ey -cpmkADXZrAOygwPw3WH16wNlR/vsL1GFubQ6EIdK4gv9fhBBdMFKm7LRAgMBAAEw -DQYJKoZIhvcNAQELBQADgYEAlTYjnZKIOEbKg7nxBikobIOOHiPB/ExouO4MscAU -tOvMq7iE56ASff5tr5RAzYzojJaOq0ReWx9imunVh7P0nBBN96dDvxkyKH08KHKO -MuZp75GDhaDnMPqu1QClU0u31ATI7gUOF+pN+IaGWT1K3g2/Rxy+tXAxyO2smEZe -sko= +MIICcDCCAdkCCQD4FZz1QNuPSzANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZKb3llbnQxEDAO +BgNVBAsMB05vZGUuanMxDDAKBgNVBAMMA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwIBcNMTgwODA4MDExNjU2WhgPMjI5MjA1MjIwMTE2NTZa +MH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNV +BAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEPMA0GA1UEAwwGYWdlbnQzMSAw +HgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0BAQEF +AAOBjQAwgYkCgYEApAJcDHyQjhzkfzqJy5+U0umvbr5KUDm1EjOlsRha37w+6Hlp +VM6zBgU0KtPfSgktRbKGYefB/W5JPzHE0gm0Cwye1WceUsM+IuEMSjRNz7A8BJuc +cj/wnGJR9YUTEFJBheDPVcpo4LraTR/hWgA8zde4+LBUZhNNYRQpA80Bz9MCAwEA +ATANBgkqhkiG9w0BAQUFAAOBgQAY3g3zQlroG4AgGPSc+OJvdmE6uxS22GLP2Z2S +OZaFBsrom2GbKV9angrVLRYYyLwRrvCtSWJJ/7YWv1Yu5mB5ZS/t7U7+c/WAnZdb +XhsAlDnAwaeioA9ktNfmsB72l1I4rdiBXjanhxNCV/yvGDN83ANibIxHql+FqgBW +/K16Rg== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent3-csr.pem b/test/fixtures/keys/agent3-csr.pem index c5773f2ce3ea..276ae2c2f2e4 100644 --- a/test/fixtures/keys/agent3-csr.pem +++ b/test/fixtures/keys/agent3-csr.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD -EwZhZ2VudDMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPCmiUvSv+yyrldXPCbJYsvaN7mwRhxoLg -S5rRy4LAIbL2wf5RO3LsWwVzxy4HoKKXDq27KeBLh1EXDdlgJBnF6QSBOZrGDsZi -JsthYn7lItFY+G9hMnKZpAA12awDsoMD8N1h9esDZUf77C9Rhbm0OhCHSuIL/X4Q -QXTBSpuy0QIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hhbGxlbmdlIHBhc3N3 -b3JkMA0GCSqGSIb3DQEBBQUAA4GBAKcTs/vSdImZFlC0sBzFjqofQJI8uDZrOhkh -Stv3k0TmlRB51zSFlOmb0ReZa3JyUzOkpvx1nIl6HeZ1lZFZhAr2WCib31H7iJF/ -rbUpCjqQ9gBXSaXxQ6QkJSIEjM+QRiDiRQ7Uphq5qsa9uzGTJI9Jv/Ej8h2pYfRD -eDO3k0+c +MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQD +DAZhZ2VudDMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkAlwMfJCOHOR/OonLn5TS6a9uvkpQObUS +M6WxGFrfvD7oeWlUzrMGBTQq099KCS1FsoZh58H9bkk/McTSCbQLDJ7VZx5Swz4i +4QxKNE3PsDwEm5xyP/CcYlH1hRMQUkGF4M9VymjgutpNH+FaADzN17j4sFRmE01h +FCkDzQHP0wIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3 +b3JkMA0GCSqGSIb3DQEBCwUAA4GBAE8nEwmxEzcYwoGWz7Myjwbf+dBMPZz6xVAj +IuW+h8ITimJ6lESWgAtXtWPCj2SSp95Kwmo3Ex0kp3opEAMe+8ShglyZaVvPwVyB +d8usbQ1zD6NdrNdSmS4Zn/J9l+OfI17VZLUvacpyVLouJe0MvA30Sf0pxJKLwXKq +UlecNvEf -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent3-key.pem b/test/fixtures/keys/agent3-key.pem index c4636fffc89f..8f6057ed82e0 100644 --- a/test/fixtures/keys/agent3-key.pem +++ b/test/fixtures/keys/agent3-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDPCmiUvSv+yyrldXPCbJYsvaN7mwRhxoLgS5rRy4LAIbL2wf5R -O3LsWwVzxy4HoKKXDq27KeBLh1EXDdlgJBnF6QSBOZrGDsZiJsthYn7lItFY+G9h -MnKZpAA12awDsoMD8N1h9esDZUf77C9Rhbm0OhCHSuIL/X4QQXTBSpuy0QIDAQAB -AoGBALlX+wl0VCdTX8Jso8WgicvhtLGZs5GIMW9zn1RCmHlBccG/Jtk3nAkE7tuX -qpg/cG5EQLi1o0paB/jYeAm+J6bMypiXNeakjW8McD55XJuqmotgbZ+IhZQzr0TF -h7zDBhhzLqIuIAjsQ0H8JFR+p3vrruchCZeQ6jxE05CeSZ/VAkEA8tyL+UvEozCh -QmokAshXLhZkFn24Ss9//xQ3iu6EE+ZIQyKy87msZhD4/rJ4GO+U1dzG7yQNeym2 -S+yHSzDUjwJBANo9xPCWBGYFbwZ/GWuwwV6nBjx35//3oEKg4PW11KSHm4cFRWV4 -JCO0q1sJEQCgzFGvNAwP63/onMJT3y1gcp8CQEgKA7s/LmT519vLgEMTCkkxex7w -y+nlAyK27ILZnXQJqwW/FTYWrXzZLALhDZ7X8l49zwTAvP77sId08ezr3yECQQCV -Cvw1Ze5pEirpn+Fnd1YH4z9SCn1phN5wwlf/1gb7uhTQGBx1mJ/ttpQT3tQ6vpXq -7yE3X6PwPZbY69iNr8F3AkBbymGXgt66Lv7gdea0UlRFjEWhuP2OC0WOtg4entvZ -1KHxsgMNIrYoPjvPq/3ReCZapnKpQfMuR564BCOY4bnX +MIICXQIBAAKBgQCkAlwMfJCOHOR/OonLn5TS6a9uvkpQObUSM6WxGFrfvD7oeWlU +zrMGBTQq099KCS1FsoZh58H9bkk/McTSCbQLDJ7VZx5Swz4i4QxKNE3PsDwEm5xy +P/CcYlH1hRMQUkGF4M9VymjgutpNH+FaADzN17j4sFRmE01hFCkDzQHP0wIDAQAB +AoGBAJASSo3ldo6ALvDcmWM4AeHsyeD8ZAdpSfh9ShXxkRJtKM3KqY6ILJcjRxpA +GCvPN+e71XR3w98+XDWZII5pW6/ZE/bINkO2IMDuFmIWCbadvUbleQNd7eCVk5OI +bYtZwmRI8zxC5gfEf54ukwL2agR1Hq/uENqw35OAwMnINQgRAkEAz7/ckH3xIzyM +9w3oqe3kTTB2XyBzrSPSZaelfasV5qzin78EI3X9BRQzRSe53Dx2bAxcprGhUwHj +qMd047QZ3QJBAMoZ1r+tMn8bY9Am89ZKaXtOoLIlYrXVu83ieGNA78cdJy7+hspT +b0GFPM4ZkidXR9oVDOSgWuSNddvGryDN7W8CQBriaEemlKsLre5WtXIwH+hBSkA7 +Md0JErQnAsqFdlsYqmcj0ARKw4iBubTMVEgE5wpKez7zI75bMzvnO+AvsV0CQQC9 +2vQwcIYlfheQLWeXgaQB4GV5tUE7zKN20C+EHjaieLKcpSL+4s57YK00eDUinA21 +w1yvUizQ1EtJwSY3zPwlAkAg28bieVGyYxCMcK6jaSW28DscFcUXy9EuNGWc9nu6 +VPoBbU5tgHCz3k5lcgJtODkOAREGXdU8KKUEMiC3+Mpi -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent3.cnf b/test/fixtures/keys/agent3.cnf index 26db5ba7557e..36337178b247 100644 --- a/test/fixtures/keys/agent3.cnf +++ b/test/fixtures/keys/agent3.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent4-cert.pem b/test/fixtures/keys/agent4-cert.pem index adbedbf30d17..d4b231010faf 100644 --- a/test/fixtures/keys/agent4-cert.pem +++ b/test/fixtures/keys/agent4-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICjDCCAfWgAwIBAgIJAO6+LOUhGhL6MA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoTBkpveWVu -dDEQMA4GA1UECxMHTm9kZS5qczEMMAoGA1UEAxMDY2EyMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTExMTIyMTMxNDdaFw00MzAzMjkyMTMx -NDdaMH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzAN -BgNVBAoTBkpveWVudDEQMA4GA1UECxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQ0 -MSAwHgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAmRNV3/oxV+YEXxo0wXHbA45gm4SyPhxlxi0ZXd4Xasmu -D2u4G57LV3uuEQ7fT34OhiOm1zr/Mv5IE8d3d0upRjpFUru45zxKg4nbqO1e07jM -2Yq5awwfk8BZpo7BEYVZ6SOiJO+tq/RFCPoTtjagwsDgUqHw9W7oVxXWeU0NmmMC -AwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADgYEA -c7q2wkyEDotnZeBDWZG+6kqXBMSF38SH3PJdM9Kb/0q8W47aMa4E1hAUfn02Ucnl -QpnaSJToDISnvgEfTL9VAKMIzOJIhqWaR/WwiiAZpWC7M4PRhi6j45eDYESHRdOa -uyk3Mlfs16mbPSG/IZvVW1YnRLJFAD5k2obbW1Sc2cI= +MIICjjCCAfegAwIBAgIJAPgVnPVA249MMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV +BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu +dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EyMSAwHgYJKoZIhvcNAQkB +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTZaGA8yMjkyMDUyMjAx +MTY1NlowfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEP +MA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQDDAZhZ2Vu +dDQxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQC9ODycAmQFQY9TjC+2PI65Oi2qfJhvAwSBxwrTOMII +Piw/p2WxG/Nj2FVNIzMKnD8PxhSQLp9Jy+B8kInxmluAu/RYLlnTnp+RXVILn8eV +/AYbDJ/es1lYOK1O23vfwfKn8lZx7n6atBTULFdXygAmRSzm5oZ2gy/KMJ69PUnl +WwIDAQABoxcwFTATBgNVHSUEDDAKBggrBgEFBQcDAjANBgkqhkiG9w0BAQUFAAOB +gQAnI7sDFf6+B9xDRZJIDM9ZRF+xZ/ZcfReyYVJRUNDZ/HltbuVHLvRdbEpf1CXw +zFl4u6Zg0pYT+pOl/C8Cg9uJJZZ88U4IziWpgoK67Y830eAKr5st64YdNFDUjBKd +t8iNbMQoppeNCdzH1LDzuVSddogho/ro6ax+4CoVAW7+9g== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent4-csr.pem b/test/fixtures/keys/agent4-csr.pem index 58b44e308b77..eeb06113f829 100644 --- a/test/fixtures/keys/agent4-csr.pem +++ b/test/fixtures/keys/agent4-csr.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD -EwZhZ2VudDQxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZE1Xf+jFX5gRfGjTBcdsDjmCbhLI+HGXG -LRld3hdqya4Pa7gbnstXe64RDt9Pfg6GI6bXOv8y/kgTx3d3S6lGOkVSu7jnPEqD -iduo7V7TuMzZirlrDB+TwFmmjsERhVnpI6Ik762r9EUI+hO2NqDCwOBSofD1buhX -FdZ5TQ2aYwIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hhbGxlbmdlIHBhc3N3 -b3JkMA0GCSqGSIb3DQEBBQUAA4GBAG9Jbj7/DGM14TC4kT9BbCF624Tgyo7LdZVa -b31rd5q3n5DkxorUq3ALlX3AMQ4sgbYYV8SysQSloldpW4TgjXZl2ohMU/xmXhfH -WPbUk/T3eNVAohzC5YMbSWp5Kgd7T4Q8meyYYYC97akjAbPIY3pkPdxTxFi0lO69 -dOQSg6cj +MIIB4jCCAUsCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQD +DAZhZ2VudDQxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9ODycAmQFQY9TjC+2PI65Oi2qfJhvAwSB +xwrTOMIIPiw/p2WxG/Nj2FVNIzMKnD8PxhSQLp9Jy+B8kInxmluAu/RYLlnTnp+R +XVILn8eV/AYbDJ/es1lYOK1O23vfwfKn8lZx7n6atBTULFdXygAmRSzm5oZ2gy/K +MJ69PUnlWwIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3 +b3JkMA0GCSqGSIb3DQEBCwUAA4GBAI4ksOnyG7so/N9HdcDCopz+7DIS7FvggS6W +eqMADvdWjmJu24wkQsO7322E8TD8ws9yyNKjalJHGic86Ugmvd7mJgv5po89Mqcz +mHTHw/6QZ/3Y9rfQgg4nk8Mx0rVgLrg+dvgbzRpQ0ybK+/btCwI5iCNYR/tx1pns +W0afkoLM -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent4-key.pem b/test/fixtures/keys/agent4-key.pem index 51d2f289a6f2..a0c6bc9242c9 100644 --- a/test/fixtures/keys/agent4-key.pem +++ b/test/fixtures/keys/agent4-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCZE1Xf+jFX5gRfGjTBcdsDjmCbhLI+HGXGLRld3hdqya4Pa7gb -nstXe64RDt9Pfg6GI6bXOv8y/kgTx3d3S6lGOkVSu7jnPEqDiduo7V7TuMzZirlr -DB+TwFmmjsERhVnpI6Ik762r9EUI+hO2NqDCwOBSofD1buhXFdZ5TQ2aYwIDAQAB -AoGAHkS7g1l2rlnWXXPSILpBw3dA1R+tGykEWuaKEIyc9snAeF4lfpisvrS/G7Jk -J9TWTGH6WK7azZuIZxjXH6i/ZMxOjd2r0P5RFo0Gjn3VtlCFw1c21TndIEhT/VbB -IfnFmPS2j/tNAq03Bn+VyB665XcbO/GCJFIxEDt+Nsx6yVkCQQDJOd8TXZ1bbsEJ -KsN/XZSKgP+qqqxh1Bx7+7/a8nbhCfSV41qt/zyUMBFlB6xKaU9dRU3FErtIH7pU -8pa0WMPNAkEAwr4rGDGX3e7ihc4pjj2I8J7xEU1q30UK8YzTMJt8BipUAHhFqpQa -RJvvsCUS3If3d+ZDaTQBSogqFjOW1/gG7wJAbLhw15S/3VPExkAtqlYUWJUEDeDz -DFQ/I5nMee6A3muzk3xoVRRPVb122IBBzV6Cu+Ei+LR7Lae+1ADR/hTrjQJAaAzD -acHVqragQW3NtjoamLXTh7Mdjv2Mw1LC5A2vTnv/NeENF/7Zqh7HCg5E7Z+YEW/u -RJ+MsQ3frs0Ro4LZ8QJAehOewhlYbd3REtJ/6QxbsfsURnGzdEjYS94qgNGyPUs5 -KwcroVGbGSu+K7xtKqOuz+ILihRDkX33VNGtDnKVlw== +MIICWwIBAAKBgQC9ODycAmQFQY9TjC+2PI65Oi2qfJhvAwSBxwrTOMIIPiw/p2Wx +G/Nj2FVNIzMKnD8PxhSQLp9Jy+B8kInxmluAu/RYLlnTnp+RXVILn8eV/AYbDJ/e +s1lYOK1O23vfwfKn8lZx7n6atBTULFdXygAmRSzm5oZ2gy/KMJ69PUnlWwIDAQAB +AoGAUDom4JLW66+XYHogxKi6buiu8gkv7GmgIJJPEa2P/0S1KCwGnuhV8vCHglQ5 +UPdceYinsVZDLVvnC4mRI0IqJxlbZ383EmDGJU6K6gn0pLVM+VBcqQKG32y9GtXu +eBBchRi/tFDiCWRkBETz4O3UDKJsr9ZvsxmlrmwypURnBmkCQQDhDeSBTfbErLRY +rICMZZqXWK+Kg/oRX78sQCnOvehQCwRU/jCjbtSiKhs/FVJWNC5CRpCMQ5rpbWYc +jguSpwtlAkEA1zzvYbKaLcEFRbmOwLyC70CQOll/IcviOKcd0TlBE4pfTrIZW+GW +MhNTsf1bu/ZAfo/mKluuhxiPFeOEx9kBvwJBALPXmTmnJsJFzJxrxRHsg5vb9/M1 +wdiubaOb5ozaf1GvbBfLROzlPTAVe85uaGyQqEK4Bvy/bYSJsqaw8BiSOm0CQEOr +3+OKoNjzz/GNFqnYWx5X4UDHNKZukNCZElHeu2wmXDLE4h42Pd++ndjfPIFLOhnQ +ql/09Vl6Sjpqjyu6OccCP3TqpfqihkMkysTbC529Mh7h2okjWdkcHp9LNDn0EQj3 +BAkB5XEgSLxiqAsao37HDp/Dflhgv6ZL5em0E5bAaQ== -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent4.cnf b/test/fixtures/keys/agent4.cnf index 5e583eb5951b..8839ba64f533 100644 --- a/test/fixtures/keys/agent4.cnf +++ b/test/fixtures/keys/agent4.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent5-cert.pem b/test/fixtures/keys/agent5-cert.pem index 9264e61912b3..2ae70a9788cd 100644 --- a/test/fixtures/keys/agent5-cert.pem +++ b/test/fixtures/keys/agent5-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICgzCCAeygAwIBAgIJAO6+LOUhGhL7MA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoTBkpveWVu -dDEQMA4GA1UECxMHTm9kZS5qczEMMAoGA1UEAxMDY2EyMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTExMTIyMTMxNDdaFw00MzAzMjkyMTMx -NDdaMHQxCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDERMA8GA1UECgwI -VHJlc29yaXQxFjAUBgNVBAMMDcOBZMOhbSBMaXBwYWkxJzAlBgkqhkiG9w0BCQEW -GGFkYW0ubGlwcGFpQHRyZXNvcml0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEAtrYJnvw24liDRWrfRDp/aBRwAK3xoaJ99YBCj7U8955GJvsoN21q6ZiD -gT+/7K+HA5gxLXTngrSCTzbk8qfGTD+Gco5WoOK7ubm5R4ePlGrT+yCMaUQBKzX7 -3s3f0rxuAI5F2qCtIJAS/K6Nk3v6C60DyK/rudnY/+d8dFQf2gECAwEAAaMXMBUw -EwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADgYEAIKKOEGadVtoi -OYOX1jXbmJzOQjRM04igJaBSuV/2n0IMXpSrxRKCU8SrwgK4BRC+w/cmLezUeUXL -zCuHBypIXQBC6PgveZvLZX/mwetup9Jml7nM8t7cxIaqUzwTsMpXrBPQiZplVS0b -Kqhsp/QNOSr1oqVd3bQ5iZ8N7R+6VEg= +MIIChTCCAe6gAwIBAgIJAPgVnPVA249NMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV +BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu +dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EyMSAwHgYJKoZIhvcNAQkB +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTZaGA8yMjkyMDUyMjAx +MTY1NlowdDELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MREwDwYDVQQK +DAhUcmVzb3JpdDEWMBQGA1UEAwwNw4Fkw6FtIExpcHBhaTEnMCUGCSqGSIb3DQEJ +ARYYYWRhbS5saXBwYWlAdHJlc29yaXQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQClldd/5IKiKBpRdTuJbkYpfM8ksSRn6kaDrmDXgnywjEZweBieQf4N +T6KrnIVowtW+aDAigYKxFupdhKdzzSTLoQkxKxXzdeiIYjaL39SMtCBCQeziJ+0d +yEVUnA23qySJkkQwAZgH6O09XOfxoaDwoXD5/exPAv341wN52GITxwIDAQABoxcw +FTATBgNVHSUEDDAKBggrBgEFBQcDAjANBgkqhkiG9w0BAQUFAAOBgQAYTgQziema +Qm593zYGZ5xjQdRl5+cgA6hVAQ6SMDLFqxsPaLd+YumJhlZ2IqBrRT+mjXjS94Rh +S8wCD2xZ8f4XRiE61Sc+K4xkY0ezaNMkc+iVw40aYX6nqoiNimGzk/k/2r9q5SGa +MXzu74XMo0fyCKW2yAdiecQZMWvkadgwzQ== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent5-csr.pem b/test/fixtures/keys/agent5-csr.pem index a40b2206f793..32424ab7239d 100644 --- a/test/fixtures/keys/agent5-csr.pem +++ b/test/fixtures/keys/agent5-csr.pem @@ -2,11 +2,11 @@ MIIB2TCCAUICAQAwdDELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MREw DwYDVQQKDAhUcmVzb3JpdDEWMBQGA1UEAwwNw4Fkw6FtIExpcHBhaTEnMCUGCSqG SIb3DQEJARYYYWRhbS5saXBwYWlAdHJlc29yaXQuY29tMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQC2tgme/DbiWINFat9EOn9oFHAArfGhon31gEKPtTz3nkYm -+yg3bWrpmIOBP7/sr4cDmDEtdOeCtIJPNuTyp8ZMP4Zyjlag4ru5ublHh4+UatP7 -IIxpRAErNfvezd/SvG4AjkXaoK0gkBL8ro2Te/oLrQPIr+u52dj/53x0VB/aAQID +AQUAA4GNADCBiQKBgQClldd/5IKiKBpRdTuJbkYpfM8ksSRn6kaDrmDXgnywjEZw +eBieQf4NT6KrnIVowtW+aDAigYKxFupdhKdzzSTLoQkxKxXzdeiIYjaL39SMtCBC +QeziJ+0dyEVUnA23qySJkkQwAZgH6O09XOfxoaDwoXD5/exPAv341wN52GITxwID AQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqG -SIb3DQEBBQUAA4GBAAoVh5wdSi58RJrwy4xaXeZwrRUeCEfNf66AhAr16fa7AxMZ -7XCMGVYTCcPxsFaagYptWYigYOP3vC89i1dm29PjUwRvyTvkSQ+o/8Cjs+BESeG2 -HrmK7b7xQjXCUwUXfHW7bnqVsTXcX1QfSztWKZANgETITD0MsGjh6Cdv+6ze +SIb3DQEBCwUAA4GBAJegSKpkqj2SlIyWOF1Km2YcAmW8sPlBsAVbP6Ymui6e63PM +u4wnufVABUEAYomBXQYx1WVdnPOFw1as/buRrGGvbqQZm15LpjKE0JfuXo9fliqh +f+TXRrTBkvIqhK+2nBQRGmxuZQ+6xFUwT3JRFxBzLhJuSLy7Xfhl+QFlq7HB -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent5-key.pem b/test/fixtures/keys/agent5-key.pem index d9ee12e4d629..07e358546ffa 100644 --- a/test/fixtures/keys/agent5-key.pem +++ b/test/fixtures/keys/agent5-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC2tgme/DbiWINFat9EOn9oFHAArfGhon31gEKPtTz3nkYm+yg3 -bWrpmIOBP7/sr4cDmDEtdOeCtIJPNuTyp8ZMP4Zyjlag4ru5ublHh4+UatP7IIxp -RAErNfvezd/SvG4AjkXaoK0gkBL8ro2Te/oLrQPIr+u52dj/53x0VB/aAQIDAQAB -AoGAbB+X2/THifT1YhwXmenAQdhuW4iUSKG/RowrV53aQXLxctoId5yRu0Ec+Vy/ -eBJ7pJ3o5EydQFUQFE6Y+BxfFPogncoTu7U8I5S38aBDaL5teX8DzaDqLvcqU7GF -s+nOACcCErQ2BcpasTkKBFzzrpJtAes2jVzpsfa48JZtc70CQQDe0uUtlKR7tatL -sugU7OfRoeV1c/tHWp/5HODY0ZeMYvbNw6SqebKeBts26rJNGn4b4LgJs/TTT3qz -ux6a0ex3AkEA0eo22zaBVjZcygfIfEW9tyfGT1eHgfE/DHcaPHekwgwltoo2gEkU -hzWy7n09MTkM2Zw6RBz6yvbdJ80/T8UjRwJBALfPJPqauazLSgjiBozseLb3ZD+l -c02DNp/a8KgrDWbjZFCM6VMvnOa7JS6CIJ92ET2R/H8UkguWbtPAshhovzUCQQC8 -uU8SbQGBKiToOnEkUWtMhMUFRlN9HxEpOtdqr8J/933cjIyNb6a2HTA+vHhMjdcg -uhWkcU2FNscEZsJaDIo3AkAOnbQTW1w4WjkV92B+EH6dQfS3wdCFVDUYM+POcwfQ -7HNtjmk1XeMTkGLlyinyFe2nARfXXzMmyRYP8o2m9uCf +MIICXAIBAAKBgQClldd/5IKiKBpRdTuJbkYpfM8ksSRn6kaDrmDXgnywjEZweBie +Qf4NT6KrnIVowtW+aDAigYKxFupdhKdzzSTLoQkxKxXzdeiIYjaL39SMtCBCQezi +J+0dyEVUnA23qySJkkQwAZgH6O09XOfxoaDwoXD5/exPAv341wN52GITxwIDAQAB +AoGBAJj3rwggEqo4v+9mjKSuMbTb7wSnfMlevNujOSV+DzCNtfjqiVuR/V9QpSdC +RmB8NTdcSrNlz1VHpSTVilhJOGZEJO0FMVPzEj3SHpYltfn6nULIhHCWnw1w1/1L +HG6KpBqphGWD88VZrIrFYJqsqZ4dYJmo4wSuEWlNEY89IT4ZAkEA2QJS3nIetck1 +WDse+AcUxA5xu/cm2RKYMHCVtXFnLKM2LQBlHw1XKiDq4vnuOJcBdTplCHfurxzr +H3QYiQxIGwJBAMNWM23i6w24nN6bAQvT+0cfdCRjfOAdA18a8NePBIBFGXFWLoNU +ZX/B44pTbVJ3ZD193TQD34JT5CDx8EcTNcUCQEUvZngg7gWK1oUApEjzCP3QlRYW +H76JHRgkbLZiJ0Cl8Dm8rICP4kA+KmSexgIosoBLU7a1ddVCZPusKb5Xug0CQAc8 +nlMn4QV1HXqxy2wgwmJ0K91dQjcbXBCd8uZJiiUmajbktnxvGAOPr1pklNxFSBVv +IE7ZBeLSMNV3oStA7vECQD9fJpLUpakpuZn8k6/YI9KMeN6EvS3QEPPSzCZQV4A/ +BEgBKV4hPdIC7CkTzYmjIjSZMOYydx6dZZHu7+2SIhg= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent5.cnf b/test/fixtures/keys/agent5.cnf index 1958e21cf9bf..710a677037cd 100644 --- a/test/fixtures/keys/agent5.cnf +++ b/test/fixtures/keys/agent5.cnf @@ -2,7 +2,7 @@ string_mask = utf8only utf8 = yes default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent6-cert.pem b/test/fixtures/keys/agent6-cert.pem index b6c03990f4c7..f47b6bf28bad 100644 --- a/test/fixtures/keys/agent6-cert.pem +++ b/test/fixtures/keys/agent6-cert.pem @@ -1,31 +1,31 @@ -----BEGIN CERTIFICATE----- -MIICajCCAdOgAwIBAgIJAMTNiT75p13MMA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV +MIICbDCCAdWgAwIBAgIJAOmH20toP0GBMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EzMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTA0MTgxMzI4NDFaFw00MjA5MDIxMzI4 -NDFaMHQxCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDERMA8GA1UECgwI -VHJlc29yaXQxFjAUBgNVBAMMDcOBZMOhbSBMaXBwYWkxJzAlBgkqhkiG9w0BCQEW -GGFkYW0ubGlwcGFpQHRyZXNvcml0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA3Iwmwd6gdWH1AlSFeuVsEY/2MQm3XluOyHR9HNtXkWqwcQqVL8FX3NHt -//1jaSTMJjkR4FhC9R0hX6wyUuBp11J4GzoDqd02JUkCeUISq/3/2G+ynaZCx5Eo -GNHhcN0gALTCET/1QMD9h4aBjRbij3iHUghcbgverfkasp59WWcCAwEAATANBgkq -hkiG9w0BAQsFAAOBgQAmfrCJY+FPeOraPTUQTYf9rXqfVRQEVc/yyVygPbtg3gtA -yST0wI/g6sBjQ6Mm39yMf4rkWmwOKGtrKcqs9o9NdM5g5QQSWeg925Ex6aB+REgz -qjaAsLM88BJ0QU76VPi6K0hDSpeuQ6Zrcp93VkdGdVZzna3FSCMTNRnSq/GuMQ== +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTdaGA8yMjkyMDUyMjAx +MTY1N1owdDELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MREwDwYDVQQK +DAhUcmVzb3JpdDEWMBQGA1UEAwwNw4Fkw6FtIExpcHBhaTEnMCUGCSqGSIb3DQEJ +ARYYYWRhbS5saXBwYWlAdHJlc29yaXQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQClbVjopeoE3BHAf9O/zO5DyQvpNfRBB4QMnaUVhsfu0arp7YKMYS1v +i+HjIP60m/6uaXpgWQPGJIAcO8V1fGq49U4/XgLmsgmSeaSjd5XzutDYVJRHFQVu +Mr9oKKf/1cCfCqJzeUDirC5snz+rauzLlD6dqS1293v/1naCC+akMQIDAQABMA0G +CSqGSIb3DQEBBQUAA4GBAKFx8usWox9ncOq+h3KPjXH1y6m7ceKHs3zUj1UiSmVp ++E2cFQX9Azceqouf+m8At2e6Ki8JezY66JmZvh0vEUDg7RxIcQf9IRaPADub+MKp +UtAeaIgAQMbRl2dEiSrfjPoOBoqNy3R1eIfrDEyDsiPpqJALbUxfA/S0Ly7JMQIC -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIJAJqEq8+4pyq/MA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV +MIIChDCCAe2gAwIBAgIJAPrVDMagf1FtMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2ExMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTA0MTgxMzI4NDFaFw00MjA5MDIxMzI4 -NDFaMHoxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzAN -BgNVBAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EzMSAw -HgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0BAQEF -AAOBjQAwgYkCgYEAqs4MKn9saUIu/9EfHQPouC3kL9Mo5sd1WR6RBeSd8cqeFxXW -EWEq/P0hUeAH1sY0u8RFOccJmSJg8KTyRGc+VZzWimopz17mTuQY4hPW4bFzqmQm -7STfJz5eHzynBTU8jk5omi8hjbnRA38jOm4D7rN/vqtB+RG+vEhxONnq4DMCAwEA -AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBo8rX1uZWHvKHG -gWw+LXrY24Pkg8NdDRmfqEVyuaR4GoGGOXCqlVaFa6x+4/eqOUzHoC9uGfPtjrvW -BYQ1o/l0JZWW4KZYuXoVuMUSj+sel82mf9zLDeq5WYTPECgJDMfgVpXOmhHfyezn -SkUTX7XJUohjET+X5BqTFlqRT/RfIw== +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTdaGA8yMjkyMDUyMjAx +MTY1N1owejELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEP +MA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQwwCgYDVQQDDANjYTMx +IDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDIVigurX3u6qjhxxWERDRINbd8jc9VD1GD1T5SCt1oBjeK +qyUSEV4f6KFvHuh3oKjmiJy4OvuiNMkzNxI3v32yoJHkQUchB4tlBVLec4gz+ZfO +9RpM10gPBes9nSh6LUx4myZ8Rpungw0UcZaGvrwPNZYbFWvCqUSuea4GVF20fwID +AQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACbwa28NeiUG +mqw14fpmT/ZDpc/BAR8gKO8OutMZO5oKjlFjplhujFlie3Zza/hxIlztF8IdYCE/ +/BZruPB+ed9ls5I7ODH1dFw8YAhxsa4y/lNP7Cq721SH49oFZJslqj1PYmhy1q4m +XrNdd447SPkWlB1D1s9NYINmqzNEsJyU -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent6-csr.pem b/test/fixtures/keys/agent6-csr.pem index 9d1925682b39..d19b5e31c9d5 100644 --- a/test/fixtures/keys/agent6-csr.pem +++ b/test/fixtures/keys/agent6-csr.pem @@ -2,11 +2,11 @@ MIIB2TCCAUICAQAwdDELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MREw DwYDVQQKDAhUcmVzb3JpdDEWMBQGA1UEAwwNw4Fkw6FtIExpcHBhaTEnMCUGCSqG SIb3DQEJARYYYWRhbS5saXBwYWlAdHJlc29yaXQuY29tMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDcjCbB3qB1YfUCVIV65WwRj/YxCbdeW47IdH0c21eRarBx -CpUvwVfc0e3//WNpJMwmORHgWEL1HSFfrDJS4GnXUngbOgOp3TYlSQJ5QhKr/f/Y -b7KdpkLHkSgY0eFw3SAAtMIRP/VAwP2HhoGNFuKPeIdSCFxuC96t+Rqynn1ZZwID +AQUAA4GNADCBiQKBgQClbVjopeoE3BHAf9O/zO5DyQvpNfRBB4QMnaUVhsfu0arp +7YKMYS1vi+HjIP60m/6uaXpgWQPGJIAcO8V1fGq49U4/XgLmsgmSeaSjd5XzutDY +VJRHFQVuMr9oKKf/1cCfCqJzeUDirC5snz+rauzLlD6dqS1293v/1naCC+akMQID AQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqG -SIb3DQEBCwUAA4GBAEU4gmRyeeh5TMYG3bI0biXr+9CvkYBaHwZD5o4TUo8AenIR -NTrJdy9Pg9B23eOnEnCDB+KMfl08UuaPxbKRXRtYm1rTC8v5wmJEpZdWxum4c3hL -3o7J8/LmjRGQImr5vnS5zmsVrBLtjW+jVpSg5xnXFKQmpXPfgRwhvbu0lXf7 +SIb3DQEBCwUAA4GBAAQVVx4gJtdNpKrVpQ90Vu/nj/43Q4p/c2KdKlwzhkvcBp5X +5oJQdU/z9OJTRJIz3U3utDsmsNwPIaeSomPISr1OgmKfroytr36AkUmpeqGjK7Cx +ywkk2iENiiddS8eECmaYXO9iCwDelDMksFUrE8sEWYUwCjfuHMISiirmz5Dq -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent6-key.pem b/test/fixtures/keys/agent6-key.pem index e42fa2d1d1bd..898457f0ce6c 100644 --- a/test/fixtures/keys/agent6-key.pem +++ b/test/fixtures/keys/agent6-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDcjCbB3qB1YfUCVIV65WwRj/YxCbdeW47IdH0c21eRarBxCpUv -wVfc0e3//WNpJMwmORHgWEL1HSFfrDJS4GnXUngbOgOp3TYlSQJ5QhKr/f/Yb7Kd -pkLHkSgY0eFw3SAAtMIRP/VAwP2HhoGNFuKPeIdSCFxuC96t+Rqynn1ZZwIDAQAB -AoGBAIL3AsjbL8OksL56fG0XMY5YQ6SpFWeFzQsCCY2KPrzOcwodc6vRDyDE1KTP -zimQvV3xQ8lKADDX5IqQka2fL5mgF+LighVvGHDm6M4ILJb46SDbuINwnqqvVuye -+OwjHBGEmKu18K+eL/YoCh3+sFTKP/18F7c7DGskCyzyub5RAkEA+Fs1ROx5w8AH -cbIH4fMU/QBGQVnuKgNXGSPcT6NHqFLbrhvNn5HwoF1SiJKkML1h3gVpj3T8kquw -Y1FcTVB9eQJBAONV1qXFo7i5gl2FyPuXvpgdzIXxzzr6q3seDkCR7q/vfBo+kKAx -zyG2xjJrCc9+ox4Vh257qK9b57W6R6sWNd8CQQCeAHjNVpzI2nxh6t908k8h/nCz -1uDcPa/FwLjCuaA3CC/Wfr28jP5HJ9gAJzrp/zIqK8tShxzAuxXGudY9Ib4RAkEA -v+3elIIx4WktOQwUTOUmEoNGAufOD3tGf2E2oykRnRPRcM7Vh4nF2C7ZUgOweq/t -wx5mAs7/8VzkWTb1/ul3fQJACLBXTChgyA77i5C/035tLwQbeLOjexLblEI0dgkW -HIa8q4ZL0M7L+/oziQ8zIT0bTAqEG1Q00PgFLl3m8gDuNg== +MIICWwIBAAKBgQClbVjopeoE3BHAf9O/zO5DyQvpNfRBB4QMnaUVhsfu0arp7YKM +YS1vi+HjIP60m/6uaXpgWQPGJIAcO8V1fGq49U4/XgLmsgmSeaSjd5XzutDYVJRH +FQVuMr9oKKf/1cCfCqJzeUDirC5snz+rauzLlD6dqS1293v/1naCC+akMQIDAQAB +AoGAGfA/VJtPSlvHXMuuRBC5+172wyZ2mgu3pNLDI9DyYHv3tJ5NLf2+xhLE5Hwz +89XR5T8ctSa/9L2caNDmcTmE8iLLAquhc/ZrxVGrL3RvL4CSur2X+7BF5i4QESrr +V50B23PlocoPyfhaZ+f/2HXm1i8JWZeHz/l7ky8e7+GQ58ECQQDXNDvF2cfGfG/c +AiIuawr9uH55IPeii7hw6qmDpJ2haas7jGJ56rAU15Xb9dKDm6prNKaFyeHK9YLl +olQmT2x1AkEAxMl17Sih9mt1yZFWWKWt2gmetQR3zITox1r98ocoMxtzN5d4JHd6 +1WleBvTvLnv6DQyKZgUHCo5YANHQA6pRTQJAXUlmM8DQ6cidULiYCpkaPZvRLz7M +OejpPgFrFAay0fqVYI3dTk4eoBpH+v6Xj7dV63z6RnqZ5zn/0P1KDwVU1QJAWhVj +X5KXOggNXp2iqmgFwudeeL033i8FpKUZ1Vlb5LFvOAal4AO1/lYCzip4B46HdEvG +W1d31rQ8wvtJPzRLjQJAfhQXhlqngx7oUAdaz1Dy4AXyv6+khAXqq7aoQPq+Df+l +buwTlQkUTyHdPXha6eUnpnKhD14omo8f3OY/1RdOsw== -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent6.cnf b/test/fixtures/keys/agent6.cnf index 1b66c9b0d7ba..8fa963f2d58e 100644 --- a/test/fixtures/keys/agent6.cnf +++ b/test/fixtures/keys/agent6.cnf @@ -2,7 +2,7 @@ string_mask = utf8only utf8 = yes default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent7-cert.pem b/test/fixtures/keys/agent7-cert.pem index 0107ebbe172d..6a26fd45f2e5 100644 --- a/test/fixtures/keys/agent7-cert.pem +++ b/test/fixtures/keys/agent7-cert.pem @@ -1,19 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIDEDCCAfigAwIBAgIJAKpGbw//YhvMMA0GCSqGSIb3DQEBCwUAMDIxCzAJBgNV -BAYTAkNOMQ4wDAYDVQQKEwVDTk5JQzETMBEGA1UEAxMKQ05OSUMgUk9PVDAeFw0x -NTA2MTAwNDI4MTNaFw00MjEwMjUwNDI4MTNaMF0xCzAJBgNVBAYTAlVTMQswCQYD -VQQIEwJDQTELMAkGA1UEBxMCU0YxDTALBgNVBAoTBElPSlMxETAPBgNVBAsTCGlv -anMub3JnMRIwEAYDVQQDEwlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCur6nhJBpxAmWKVbTKvEDn8YJ7ebkpNSwNVMzSycmvo3XOIogw -ZngRJ/dL8YM/+p5CvAheJ6IqThgRw6+Se42O5ywlYpaHaY7n1oaFJC+2RUoPwdS7 -Rz0dl30kXwUnKlllqkGDdFwMUD5NlXBLsGgiW1gkPHCvlOYxfuv50z3yIMgxfVGP -a7FeAYIHkRWQ5VrvugT70YaZMhLoMnj8c6RcIe81PV3eCS5Pp4ce8SGUkzAV9AFu -f4yVlEnPqqy/VrinT+xNrRKt+2YijIb54i75p+2AVveOhpLcCcB2K65Zgc5LnZB8 -EY7W8/Qfh0DOAZibOd2vrUl2pkkOlR+qkYX/AgMBAAEwDQYJKoZIhvcNAQELBQAD -ggEBAIiPC5SMDJAbUwkEWZxSleKfliLnycwaRfzF/B+8CUMd+hrVdrKe/u1aPDEV -FgWq4Vd3K3jtGZxwfW8VMjtF3aj7vd/Lx6XUbZv+VUKURlDRktBuZTDdYu5mECV1 -+iDd64robqeYbZ04w1pnwArT50+oZdmQ9BgbQom1B4FoMhoeSX7A0gITH5BHW1xs -SRiqI7tDoDqhhn6X8pWoiq9QpXCSjXqUDNlxmiL5+e9j6DUv+e4z/bWY0s/COmY6 -2gGSZDJGDcpwx8RgEy+1gDNMMApqLZxH0b/RwtE/9R9OiPm272pCuz2zkdQM48a0 -9/GbQ68v2fmDZRF2WnYrkTSzF0Y= +MIIDEjCCAfqgAwIBAgIJAL1FQTepkhMPMA0GCSqGSIb3DQEBBQUAMDIxCzAJBgNV +BAYTAkNOMQ4wDAYDVQQKDAVDTk5JQzETMBEGA1UEAwwKQ05OSUMgUk9PVDAgFw0x +ODA4MDgwMTE2NThaGA8yMjkyMDUyMjAxMTY1OFowXTELMAkGA1UEBhMCVVMxCzAJ +BgNVBAgMAkNBMQswCQYDVQQHDAJTRjENMAsGA1UECgwESU9KUzERMA8GA1UECwwI +aW9qcy5vcmcxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALCm7Zzcl94OLdlf5kL64gZNJby8pnR/rODqM90iHBqQ3wNe +645i/icRk2D89kOSFIJfPuyYBNxsslE10p1Z/+1SeptK6bf2G4BfDbAiEhkoGNfz +gqj+CsvmCePlN0wKt5Dvr3ePc2ZzD+RPMe2nyPYaJzen3eG3gtxNcJjUNu5q8UmR +acPXexRctxkGMknZwIQffZbw8imbXCx7UAqxsdbvqM5y3xYFhAEkoaavVYNbXdu+ +LxKiIpRSqqPRwMiKieI0gvMtGJ17VFyrQxReB1rRtG/FQyFc1KdnTLbMbpJ14I23 +uhe211TTfgXIdHJo5GWlvb8GH+jplPfvFIA+tzkCAwEAATANBgkqhkiG9w0BAQUF +AAOCAQEAD+viY75WLCyN6U9VMYUT9K6AH3rEAMtxS5XgMUnXGDqz17BF88gDc+Rw +qhDQBOdWSNgo7xYfAtYk8KYy2THo0tDoIT1lE1hUvK63kwY/HivKZD+/A8vQgWyM +m/b6mX7fEHNf9UrqdU8IiUJy6Gayd2ZUeYW1xOm4hebdEy8/SE5rvlodePbfwrQe +V/kAUN/SBjWsk1oYnAk/MYV03p5JbfqpYiVM3/wO63SS9Kos2JfoSLYT5/iUBLG7 +TaEToJFSoA1+UCL/1v2hbWcCRHZrku55a6MSyAUxuCoTWCFHWWnKyC9iBBk7zApI +3zGymgVX6g21j3iVo97G07oAMIHjsw== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent7-csr.pem b/test/fixtures/keys/agent7-csr.pem index 6c0e37d9375e..556767b05c09 100644 --- a/test/fixtures/keys/agent7-csr.pem +++ b/test/fixtures/keys/agent7-csr.pem @@ -1,17 +1,17 @@ -----BEGIN CERTIFICATE REQUEST----- -MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjENMAsGA1UEChMESU9KUzERMA8GA1UECxMIaW9qcy5vcmcxEjAQBgNVBAMT -CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK6vqeEk -GnECZYpVtMq8QOfxgnt5uSk1LA1UzNLJya+jdc4iiDBmeBEn90vxgz/6nkK8CF4n -oipOGBHDr5J7jY7nLCVilodpjufWhoUkL7ZFSg/B1LtHPR2XfSRfBScqWWWqQYN0 -XAxQPk2VcEuwaCJbWCQ8cK+U5jF+6/nTPfIgyDF9UY9rsV4BggeRFZDlWu+6BPvR -hpkyEugyePxzpFwh7zU9Xd4JLk+nhx7xIZSTMBX0AW5/jJWUSc+qrL9WuKdP7E2t -Eq37ZiKMhvniLvmn7YBW946GktwJwHYrrlmBzkudkHwRjtbz9B+HQM4BmJs53a+t -SXamSQ6VH6qRhf8CAwEAAaAlMCMGCSqGSIb3DQEJBzEWExRBIGNoYWxsZW5nZSBw -YXNzd29yZDANBgkqhkiG9w0BAQsFAAOCAQEAgT89dg/uj55YDT0wqNH2spt6JBK+ -gF7Y8R7MBgGEJSbJnjAkJSUpKKPE3ph6mJ9naYl1U3zqt+xoQKdp8kn8649u5Hjq -TmmlsCExf0cznpMHINB9FG1aOoKdrsHf4o4eSXBAOacrpgnCpPAnaywE8F6Rc1a0 -3RDogwETUOFzTKvyl8XJQ2jUQt4qs9+fmkR12IVNe8IFPe2I8j5wMmQ81nUmFDpC -NHy35vXjs+7N15FEkkvbr7jxZzMzXAhdZLUEOwIcNZsfpgCCqRmM/j5w8qXLFShd -NUZn6Psex2Jkq2rcNwJ25739ORS69nWqhZrUvaaMP6IqjFcJBVWIyRwltQ== +MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjENMAsGA1UECgwESU9KUzERMA8GA1UECwwIaW9qcy5vcmcxEjAQBgNVBAMM +CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALCm7Zzc +l94OLdlf5kL64gZNJby8pnR/rODqM90iHBqQ3wNe645i/icRk2D89kOSFIJfPuyY +BNxsslE10p1Z/+1SeptK6bf2G4BfDbAiEhkoGNfzgqj+CsvmCePlN0wKt5Dvr3eP +c2ZzD+RPMe2nyPYaJzen3eG3gtxNcJjUNu5q8UmRacPXexRctxkGMknZwIQffZbw +8imbXCx7UAqxsdbvqM5y3xYFhAEkoaavVYNbXdu+LxKiIpRSqqPRwMiKieI0gvMt +GJ17VFyrQxReB1rRtG/FQyFc1KdnTLbMbpJ14I23uhe211TTfgXIdHJo5GWlvb8G +H+jplPfvFIA+tzkCAwEAAaAlMCMGCSqGSIb3DQEJBzEWDBRBIGNoYWxsZW5nZSBw +YXNzd29yZDANBgkqhkiG9w0BAQsFAAOCAQEAWo29DGuO+fzXS9/b6JYMbH/13+RN +nuxZx/rWLjRG3v128hC5dn7+M54fPIbsSUUC22Xr+qq7JoleeG8IAaFJGeCtAAw/ +x00uBqTDPbwbDs8ph+NvzSAXLyW9chiz4mfCPy/G+sM+a8harUeDyHDeYHPM0Dhs +yBiWKhVSkH0qbbbb2oLA1AAh4f4mN1J2/u88h6rtTTyKao/t9JkQkPmslxnW0e/W +HYvvQiUxm41YiaugHqSWSSgDZPEEJils3SyS9d41z0SlsEnSoh/TtPsTgqTHACXd +pW3CQ4lGPycXtKhkMW+wHm3iuiJtMCDVEhGw3eG5jOc/7wwSInqXrR0Iew== -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent7-key.pem b/test/fixtures/keys/agent7-key.pem index ff7268cf9d8f..db2c889980e3 100644 --- a/test/fixtures/keys/agent7-key.pem +++ b/test/fixtures/keys/agent7-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEArq+p4SQacQJlilW0yrxA5/GCe3m5KTUsDVTM0snJr6N1ziKI -MGZ4ESf3S/GDP/qeQrwIXieiKk4YEcOvknuNjucsJWKWh2mO59aGhSQvtkVKD8HU -u0c9HZd9JF8FJypZZapBg3RcDFA+TZVwS7BoIltYJDxwr5TmMX7r+dM98iDIMX1R -j2uxXgGCB5EVkOVa77oE+9GGmTIS6DJ4/HOkXCHvNT1d3gkuT6eHHvEhlJMwFfQB -bn+MlZRJz6qsv1a4p0/sTa0SrftmIoyG+eIu+aftgFb3joaS3AnAdiuuWYHOS52Q -fBGO1vP0H4dAzgGYmzndr61JdqZJDpUfqpGF/wIDAQABAoIBAQCNIXcKYnTKYLlQ -rjXGpZl6yvA0ef9Sf5b7nkts8YJ02IdQ5y1IjUDr+3IcdR8pDX3XRLst9q9ZpoZj -s8mhexi/H53XBnO/K1U9kWBVKQszI3/Wgy8vrzp9Mer0+5/aKKjZLliHr/a+LAZq -ABYd0IQRXeM0Q3B3KsFfs79Ks5QUjXjrOPCkFCKmLwZin0Oujbb88WDeqSHAYB0A -35lUDuQtg1rCNkTirBCdFAYFkfaRRwDGwdQ7L9cijidxMONYx1EapDbyqGL2BXJl -99ZVebokUKeKQrvsghQZhmcph1mHABsOMfRw4x8TGxMJJSRM264OYCn66EK1tBh4 -tA0oU5GBAoGBAOTZEF1cQWjHHLvMUSP4B/6ZxvcP9ZdQaPISrq2j9oaArnCxxYvm -XHTZRK0YAXzPnmhBXL46FoslDwUKu+T2gajl1NOBKk9C8uao9Xqm+IDKuA+ebf8V -1B31Sf5bxnBI9jMaORGZg5/KFGvl3IzBrJODPTFToLHoqlS+lGhHoMYPAoGBAMNp -g0+w8m/CsKapOhKZ6+91pT3sHsVUQ7JhTKpajpk+JOB7JaF1eZzuShTykkpDWmGw -VesgbpBx+/JnjxW3Lnq24FUp4t+9OZ5r3gr2uFPHkmr4laT8S1WSqspmck0jZMgM -zAIrLV7miAxVefrDjoqf5VkMaqwGoZavXU5UzLERAoGAK+vFCkYEf7mHODvUbtTR -o/mbiBtWBT53hc40HDtVuybDU/mqclk58WsplRcAYhXuzw+MXy4C2Z25LjyLJzxw -UhwaJqWpmyC8Qay3wFx/YSiG/uhnMAfeeAl1tA2lHjPCnLgxr8EI1AgSt0qcc59Q -IdeUTP1B4CNJXY5eKU1l+90CgYEAuU0aybzfiH80CDY87VqsUnxa32dCnpiTQVnm -2zvYMRSu33enbX36foewFEEZ2/YWhMA0GSy965dK9Mii9FKqbo9wFxILI2NKeiGL -gxYGINwEyg9DyBm+Tj0wW5HeHavMa69G3V+YPH+azydW7iX2yxlo4JJXrRz0qfFN -J3ReTiECgYEA4CIpRG5XzW6BEscqDBBQZ46RVy8wsnwxt62V2g2CImDwzKslcHK8 -oQurwl5WLKmvb0amMTedmVeIey3GOy23G8HrpHjEZjLi3wr3s3xJlPVajDBWw5Og -dgU9acdKHcbzv9dnsyC6eO1hr0TlEJqMkPuoNr3RihEuhv88rQbmGas= +MIIEowIBAAKCAQEAsKbtnNyX3g4t2V/mQvriBk0lvLymdH+s4Ooz3SIcGpDfA17r +jmL+JxGTYPz2Q5IUgl8+7JgE3GyyUTXSnVn/7VJ6m0rpt/YbgF8NsCISGSgY1/OC +qP4Ky+YJ4+U3TAq3kO+vd49zZnMP5E8x7afI9honN6fd4beC3E1wmNQ27mrxSZFp +w9d7FFy3GQYySdnAhB99lvDyKZtcLHtQCrGx1u+oznLfFgWEASShpq9Vg1td274v +EqIilFKqo9HAyIqJ4jSC8y0YnXtUXKtDFF4HWtG0b8VDIVzUp2dMtsxuknXgjbe6 +F7bXVNN+Bch0cmjkZaW9vwYf6OmU9+8UgD63OQIDAQABAoIBAFB/QLfCLdIaU/pC +IQNUn7qPXSrsLE3aAEVdc9TIvlW8vmMi1eREZ9wVvjrsCqwv3PirvljBzTVEst0e +0aKyaFUUyJoLQQV7OHz+05X3cJfWFbwSUu//E5xmbwtSYChemdeJ4UNyMvv0YsF+ +9Rl+46yBrm1GKW252f/Zqf16dq2de+FU/qi/Mhf0ruKtn/wHiDLyapyymr2qxO2s +O71qyZx7x/322UfzU75C0jhvYMsZlhJ/bJ4BdP689c5PDCzUF1aSwNxlkQkPkaAR +mbDVeHt4CSidVJwTAo4glbz6Lqg8FcKzSRyiWKtc4gYgAYdQ+TL7eUB3/a6wgWjr +6SmjOAECgYEA3sBlaiqufnYKGPCgmN4aDYMidcgEleVWpILk37l47ns4fvmymGvA +d4sG0XqIEtchnUidRs+ZGWTuCtFIunucorcM2Sj1LNbprXAmjxmDZrwr7sZsd65K +Z5XLuM2Jhk0ms5tQ2mfWSTo9RWaaWhcvgTou6XZb5LLQ7atV350k8RkCgYEAywUD +8v/WznkYeVZOH3nPtctWnRv1sRhDUtmDbj7slPAAo+JW4PmTDuqkW7MrOjdq6YyR +CgYnqhD/FzAaHQj3d9gofbOrfwX/fYGUDKE697SE888CRg3a0keNJLMEZumqib4j +BJUaLvAW9rFngV2aWgPa2PteDrc+TT6hsT0+GyECgYBjuCfuhlsFnBxbG+YZaVyq +belQZxG+dSP7k+mYSnTb9mfNWEVevOY13hRYVQ1zucF/oxFdsPQuDSQPza9MZKgz +o9Tpps9TmoaUMV/hsh9EL7tPMp8+WNVQWBwSiFknuYQ45bAlhlTFBYCGgC9bY4PN +y1lTBLyQvoiPzaMs7zGpiQKBgEI9ba9waB7QBfs4/J5qeSoAoU77m2tf1j+G9soW +v8xMjnjqVZxr8d5xEpVU3SrOgBSZp40UuwZTK1feeva0QUIaBgQVhkQYqebCS5Lf +XEUL4kFGbqB6zsXDULsDqdEGNn1gyz4og/WCoot1EKd16fGqxlH7mhHFGg/L+qfA +qq3hAoGBAKkpHzmQxyvKVy6hvLoIJmF2mKKh3xIihmkoc9F1dCUl/bEWnByYea/S +eYFfy0rSEa7unGtGAW8y8RsX5Qqypv83c0hY33dVO0atpKPXw0HfAythuuFUr9HZ +LQlwHN2QhrK3vvKiorHOrP3lskRKtkIg/sr1GoJ1TT2vy9fXt24e -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent7.cnf b/test/fixtures/keys/agent7.cnf index b2177948d02c..ed3bb91df701 100644 --- a/test/fixtures/keys/agent7.cnf +++ b/test/fixtures/keys/agent7.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 2048 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent8-cert.pem b/test/fixtures/keys/agent8-cert.pem index 86de1d44a64a..eec8e13a85cc 100644 --- a/test/fixtures/keys/agent8-cert.pem +++ b/test/fixtures/keys/agent8-cert.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDUDCCAjgCAQEwDQYJKoZIhvcNAQELBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNV -BAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRp -ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5MCAYDzIwMTYxMDIwMjM1OTU5WhcNNDQwMzIxMTAwNjM5WjBdMQsw -CQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZO -T0RFSlMxDzANBgNVBAsTBmFnZW50ODESMBAGA1UEAxMJbG9jYWxob3N0MIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzkVSP6XxWpBlSjqqavwOhpp36aFJ -qLK7fRpxR+f0PdQ9WJajDEicxwKWGFqQBE+d5BjqrAD59L2QGZQ2VOF9VLZyFz3F -9TIlkd4yt9Od0qE98yIouDBNWu7UZqvNynAe5caD5i1MgyIUQqIUOnZwM21hwqYN -N/OESf38A8Tfuvh3ALUn7zBEVyUPWIWTYPhFHSCWIsS2URZ/qDLk8GavphkqXdFB -ii3V8Th5niPtpIsRF6Qhwh8SK+s0zh53o0qkmCNpXLd/PJQQAwC70WRq7ncL4D+U -C1gnDL0j9SzojXQu31kXs8UZTa7RFnx5r+gDiA/gGrLs4IiwDJhVHMx0nQIDAQAB -MA0GCSqGSIb3DQEBCwUAA4IBAQA7iMlm+rgZnlps+LFsoXG4dGNPaOhKI9t/XBrO -6O64LLyx/FPIQSaYi130QNB7Zy0uw8xqrH6cGRTJ9RCfBFFP4rzgIX3wEAHnmwMr -i4dGEixBUIIjhw6fAVxAhrkzmgUpUt0qIP9otGgESEYXIg7bFkXIHit0Im1VOdvf -+LnUKZw9o7UEesKIDVkuAsjoKKkrsO0kdf0dgAj6Ix5xmAtBsDvkH0aOSdPfTZG6 -LQrnZf/quBotog3NmDzrvQaH8GNpTJcYNjKlxD2z0PvQUyp0FD8oCC+oD+EGv2zZ -65scEXU/n8kTmdJkCjx4nb39HttYzOlNlTgMxAfxgL7A/PcT +BAoMDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsMIlNlY3VyZSBEaWdpdGFsIENlcnRp +ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMMIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5MCAXDTE2MTAyMDIzNTk1OVoYDzIyOTIwNTIyMDExNzAxWjBdMQsw +CQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZO +T0RFSlMxDzANBgNVBAsMBmFnZW50ODESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwD0j4pL8gbhtpmcKdPo/Iq1HpuZi +VOTjk16e/AfBXjvZoUg9lujr/Mw4X1+X56zfr05Y3+Pyr8euVf/2t81RwvqyjB84 +xFKrk3wBnciv3JodbzmL3aKqVeAwE2O3DSvcR/yaTJtW7EthnDfvaoUwSTN4zpZA +c/PMVpPK0LWZ98vjIdQ7dTOFTLDmawtVxWouX7VPdo0vtYe3/DnzyTojhWQyCL68 +KS9AeWc1opYWmjLeHhOBC+8ovfPRBd9/kjZX0SsWRCC3bKqmJJ48/QTJe2jQnc1V +ERgiWy8SCS9irPDJpqGeEXJiAhCEfZGqZzjW+G34803rBGZCW3t8BibtPwIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQB1ixGtVRFWh3BGT096vdIhOjg/v1c8RZeIEgex +/GKGxcTq7BnQTh4QCTIvcgj/x2Y3RVpKzjF6OCMgAxTeY8cq0uSxrJXAMtpEyOaQ +izF0AwE0baehEY14VlYyuReZOcjVRoQOkNuDUa9lgmfLXQPMvC6rNnpRkD1mt/ot +GBCdHEAGcQNzcRcGVsAFDf9X3Jq6misskbsq/m+If/XXaIiGvT71XsV3CQYp+RF+ +QjcI9bjOOKwb1V7iGl4BBIIDdqMAaLPdKLymYKGglmWAtwwm5n6F1ViOoDXi1VnH +vai/7152egBZ0uoB/KumTa2LpuJUAGQ4b0QA6wb0v+JuOaOG -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent8-csr.pem b/test/fixtures/keys/agent8-csr.pem index af749bcd1c82..251cb7fcb5ab 100644 --- a/test/fixtures/keys/agent8-csr.pem +++ b/test/fixtures/keys/agent8-csr.pem @@ -1,17 +1,17 @@ -----BEGIN CERTIFICATE REQUEST----- -MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGTk9ERUpTMQ8wDQYDVQQLEwZhZ2VudDgxEjAQBgNVBAMT -CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM5FUj+l -8VqQZUo6qmr8Doaad+mhSaiyu30acUfn9D3UPViWowxInMcClhhakARPneQY6qwA -+fS9kBmUNlThfVS2chc9xfUyJZHeMrfTndKhPfMiKLgwTVru1GarzcpwHuXGg+Yt -TIMiFEKiFDp2cDNtYcKmDTfzhEn9/APE37r4dwC1J+8wRFclD1iFk2D4RR0gliLE -tlEWf6gy5PBmr6YZKl3RQYot1fE4eZ4j7aSLERekIcIfEivrNM4ed6NKpJgjaVy3 -fzyUEAMAu9Fkau53C+A/lAtYJwy9I/Us6I10Lt9ZF7PFGU2u0RZ8ea/oA4gP4Bqy -7OCIsAyYVRzMdJ0CAwEAAaAlMCMGCSqGSIb3DQEJBzEWExRBIGNoYWxsZW5nZSBw -YXNzd29yZDANBgkqhkiG9w0BAQUFAAOCAQEAykAWr5pOZh1BMc7NZgc66J16VkjN -KM2deMQNl7r3BFB336At+zmpudnjdT/tPaH34FT/Idh/DPfiSdpuDQWDA+E7xady -S7KoKfNesPFjV4rR1WgNtoix0B5EaaNxdR8ljwL30N/LbsMDWxIK7rWyhvuw3DXr -C90PbsOTCLbW1HGItgYCQFJnpXK1O1Vx0Bo55F//oxDGVTzkUqb0lsVGHLLCg0s2 -DxX3++FqFy/NjzZ5R/k1o+WIom1PzhLXJ+cqQsqYT9kBIVHTtvTAnDM70dZ8EeSW -/O4w+gb+OSJjClz7p4DuX4idDG+0cISxBOYFPyTFlGrXQ0ZXULP4pihsUA== +MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGTk9ERUpTMQ8wDQYDVQQLDAZhZ2VudDgxEjAQBgNVBAMM +CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMA9I+KS +/IG4baZnCnT6PyKtR6bmYlTk45NenvwHwV472aFIPZbo6/zMOF9fl+es369OWN/j +8q/HrlX/9rfNUcL6sowfOMRSq5N8AZ3Ir9yaHW85i92iqlXgMBNjtw0r3Ef8mkyb +VuxLYZw372qFMEkzeM6WQHPzzFaTytC1mffL4yHUO3UzhUyw5msLVcVqLl+1T3aN +L7WHt/w588k6I4VkMgi+vCkvQHlnNaKWFpoy3h4TgQvvKL3z0QXff5I2V9ErFkQg +t2yqpiSePP0EyXto0J3NVREYIlsvEgkvYqzwyaahnhFyYgIQhH2Rqmc41vht+PNN +6wRmQlt7fAYm7T8CAwEAAaAlMCMGCSqGSIb3DQEJBzEWDBRBIGNoYWxsZW5nZSBw +YXNzd29yZDANBgkqhkiG9w0BAQsFAAOCAQEAL406WiM09XflXU0d0pWbeKG3buIA +L5iO1csseS4tbHTdcy7H0cr54JZEOGaBbsBTJrn/8ILJJsBzurPDdaA39KGv87qF +DM9HrAiKGYWOUuUk9lEPoghZhvLsZ/FV/SI+HOzrMu6Yi7/En56vXk1YwqxOf3JL +Gd0OCIxYbHnGlxvwhRATadBJk07NmG3w5WI46ClRdHSEVYLiCsTB1raRixCbKmxe +9sJ7fG3vnRoxOVZ8b0mMzSPsPyCHYRoTCGHivIytm/tps5jRkF2v1+BFDcy/unUm +NKRhIB8HNVYmZlTPlWdw/k8z8w/JIE72sJXp4jfgha8Zx8tL4qAiUbK9WA== -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent8-key.pem b/test/fixtures/keys/agent8-key.pem index c1773f7cff4d..e38210c6389e 100644 --- a/test/fixtures/keys/agent8-key.pem +++ b/test/fixtures/keys/agent8-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAzkVSP6XxWpBlSjqqavwOhpp36aFJqLK7fRpxR+f0PdQ9WJaj -DEicxwKWGFqQBE+d5BjqrAD59L2QGZQ2VOF9VLZyFz3F9TIlkd4yt9Od0qE98yIo -uDBNWu7UZqvNynAe5caD5i1MgyIUQqIUOnZwM21hwqYNN/OESf38A8Tfuvh3ALUn -7zBEVyUPWIWTYPhFHSCWIsS2URZ/qDLk8GavphkqXdFBii3V8Th5niPtpIsRF6Qh -wh8SK+s0zh53o0qkmCNpXLd/PJQQAwC70WRq7ncL4D+UC1gnDL0j9SzojXQu31kX -s8UZTa7RFnx5r+gDiA/gGrLs4IiwDJhVHMx0nQIDAQABAoIBAHHp5KdT3Ht4XQfm -aDEXLGp3qhtzQDuTIWnQjZj5Z3Ax4wMmhbsF6tcY/Y1LjldjJL5QaGE/VMstWQRX -Tr4HnXCIJW/iZI2p+Qean4XXr0QgWhcI2VYHDuFWHiTpYogW7WlV/YfDooqU6n12 -BxfWStaL5L5bd9dbe8ZlJqVqN2iISfqGNIz9YKM04rHycTcicNmf0J0smkHlnHJE -ROQR73IXjDDOmkwdG75qyGRBQ0j0KEDu//n1axcOKf48F+8BQk2PFMq+RhkGGqJD -zTQK3kB33HRWeNWbykLPzYGcPtSlvaecCTc/q9wbbxh5AFlvSrPz3VzdRHECocM3 -v/o2vqECgYEA/uZib1ZYczuihcvLKxo8e/IBNYUKUcyosHDqAmJ5q8Y+Vg35ACfM -mJAhT1SXXAmm2tHuTnztfLDMQAOGVItuf5U8nuJYuWrvhMCtBT40XPeUVPD8b2D1 -9y5EipiB7huH8kMb1aAPUNgQhmqT93+4qcGf6PcNTkk6uHCCXFZEc7UCgYEAzyk1 -/T+Ah3p9+c1s+AjqkWj3Qa9lOKclJOT2O88AG+4fGQhSdUvkLDAMX3L6ri3gVZzr -wH3DJIwJx1uCW4eNJFVmh8AyP4SkfzQp1FqsIzBMQuPz6Hqtclh/UPx1yOe3NseO -xVM6Z5RbOOWyDaWxxbQHZnHkqSKcTB8K1lJ/XkkCgYAaStlMcrOc70HMW0ERqRsk -DcpiIt71oQ6lZIA+zrmOJly3s6lDgtdvxS4qaKdULwqu94iFQA2fFv16fOKWReuX -7WTbXq2YMpeSMe2m5Mux6ze5q0HemznDzVn0kdaVIPHc418zodbyl9bchpHMrbf2 -iqpb9V/B+3u7Gp/Xtm5JIQKBgBFrjr2wBFfgJg3Gh35ICamWoQwl+qYL8CStGEOp -QYIXwQey2nRAoHxSwgeYvJm/A9lPK8fxC2LcX8oi2NBnkqfWgpuxvsf2mHqV4VqZ -EVaYLiGF17HZ9xHhfTtLL4Boc9CocUoImKWzJQSg1BsvrsZIQEMOGsNaRLhl99xT -7Z/5AoGBAIxgzOGLVVrIv8vRc4YouPf0OGBmUawnEZxYVD1Mo4Tt97XjxH93B1iz -hof62zDCL7WEdKuwnOs1towBmLjC7qrAbkUgNVYmI5sG9c8+1NKClTOJGsHHiMLF -n8GxnsNU5FVTmJ/PZfOU+eru7uDYZHTkii0tkaHWUzg13pkhka5E +MIIEogIBAAKCAQEAwD0j4pL8gbhtpmcKdPo/Iq1HpuZiVOTjk16e/AfBXjvZoUg9 +lujr/Mw4X1+X56zfr05Y3+Pyr8euVf/2t81RwvqyjB84xFKrk3wBnciv3JodbzmL +3aKqVeAwE2O3DSvcR/yaTJtW7EthnDfvaoUwSTN4zpZAc/PMVpPK0LWZ98vjIdQ7 +dTOFTLDmawtVxWouX7VPdo0vtYe3/DnzyTojhWQyCL68KS9AeWc1opYWmjLeHhOB +C+8ovfPRBd9/kjZX0SsWRCC3bKqmJJ48/QTJe2jQnc1VERgiWy8SCS9irPDJpqGe +EXJiAhCEfZGqZzjW+G34803rBGZCW3t8BibtPwIDAQABAoIBABBw6jHFimz5vf7+ +TwmkIWQw17DxgTVrgf8nl4dMjoAltD4z9HiEoTI0sRmPDmnVAih3FejIEQhxlnpq +cspTeAup7z1Gqk84Fs59S5IYCNpgH+ZUUJ76+4ButQ3jeFNbDfLmKrgkjPGWnNmE +eyhsDa4lBc79ULPaBP7ekvj4nxtvIZM1NWt80ZE/nRPjl2fZKQKVIQHu6RQD4aks +LQYsqHV2c0GzOW5+PIcZJDkYBKcb+LexVxkLj2zbXKoFPkZBIUZB3VmXEkctCfmo +I/OZhtSg8yPfL/MM3md8FXq+tFRzDelmWZEHr4hlkvGcLWGyF8xDTZ7OOnO7j9ok +NBYnBdECgYEA6rO++sBhL/Fx+LgbnKp8Jo/oZsprUQtvoaBtrAmuWR/fVX8vmTUB +Q50OnZJ6EY//Xu4qjSIdChcIEjPaGd9WyNQDKjWdh4RXkAe92qKif1dSzo56lc2F +liThMn+zpzyrl8ssjrTSE2Ol8511/vlmKPXSgW01BNnPzYmamYiFcVcCgYEA0a7z +A77+9DSwaYrlV3sXpUKSVBf4oEcfFxY+o0MN+hL9ufSkO0+KtDl9TQK3UjjlikFm +eSAYtaEs/TFkP2bO9HUt+AxNBj3yqabxNb3uKvwKU4D9WIiMOVggPzsZZMn0nDXJ +mmuYeKJ58Tz08Fsqn9XMBe3IdM52r8CQzwR/6lkCgYAA3AenA21Xr5qrPoFbYYRy +37QKLFOYSGJwRRYhuydYTDWVKpISDY+jn7+d9BteVRiqUFT3j1hr4Qm2h1oVHixD +MAOS8/9Pr7xiWqTnWBEgRkGXYA4y3j3O/vOUK8OMqTw3ohbXrvHWAFdrPPhhpqgp +Hj1XG/9FtUZ9ijN2vHlAoQKBgARLLtK+0H2zroEaxQN7k8pgiJqMOx0dF7fjTrkN +IHYkeWmbZtmIEXELVFOFYLegTqL8H9sPGzJs8HzmzAS4WDiNRbm0lscv8Y4jywCs +uPnMW3HGTGnJsgVilpZ04Vo9AHNKbqxo06B0w0Z7VxCs7TyEpj7g1Z/+slN6//wd +PXlRAoGAK+sauzJ9rAPQyetIp1ZTj2ppkN0VYcI5prPnMijwiBumRZD/IkTL7pTe +H47iu/WzTI6wNI+JoQLkKad8vqm3eRkCg0zRtfcIYUvrcpru+jg2ClE8NxQXX7+R +IivQAD1Y0AyF7fV4vJh9YO+inw9Bcp4itG0hqTNZ244lWFK2E4E= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent8.cnf b/test/fixtures/keys/agent8.cnf index bb50a0e71992..c89841bcd4b6 100644 --- a/test/fixtures/keys/agent8.cnf +++ b/test/fixtures/keys/agent8.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 2048 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/agent9-cert.pem b/test/fixtures/keys/agent9-cert.pem index 196922986cdb..520ae4fde95e 100644 --- a/test/fixtures/keys/agent9-cert.pem +++ b/test/fixtures/keys/agent9-cert.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDUDCCAjgCAQIwDQYJKoZIhvcNAQELBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNV -BAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRp -ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5MCAYDzIwMTYxMDIxMDAwMDAxWhcNNDQwMzIxMTAwNzAyWjBdMQsw -CQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZO -T0RFSlMxDzANBgNVBAsTBmFnZW50OTESMBAGA1UEAxMJbG9jYWxob3N0MIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApT6nASSx9e2i/t0aHSd9BxMRD92o -33/iaiXWzBOKMJp7jxCWAg6SnpjrFsyjTxaAqg+e1zlm10YBT6DholstffzQqK2x -TKGVOQK4jxX23wJlrn5mDk0fagBtY49L1KFy8DxJqKgt7uxz61GGUWwKWXG7Vnga -bkqDd9o3ZF7bOq7mMQvfDzPrwYI8uTjTxR8R19uxNNOGtHMTnwvDeczTmtTox8U+ -4N2hN2scDZvRBx5aQAtnXRyZhAokAJMYojinx9iqlVFQi3ct52LIhsca6ympfDc2 -0yA4aSVfoW7NlqsnvrTOV4nt3UbrxGGpiE7Em8Hdcw2EMF+jqCTLGtsqYQIDAQAB -MA0GCSqGSIb3DQEBCwUAA4IBAQCMjKFycVQh7Puz/FpQh3NhJ99Ic3rzr+3nAKFD -4Kcl3L8szH3zjLCw46/y2jqPiAbg2zg9miYkI/2W/G+m2VQEQvp2SwjVr/Rj2Soe -iTonruUpDFF7LG01q3kpZ7nYWRGvVgn5D9BGk4/SWuzxiWRdwlzJf2e8cXLExVS0 -0CgRsb5nRoZ+RZmVIrGMfIi8CI7uTlcHtQzD7B7gpHtOSMlQoSSeqOy6F498duvl -QhhQhJBxmjSegw/lawWQSDFArJimK/rwyb6ZFbRfBgg6o/k5W9G5l0oG5abQMp+/ -u8Fd+QUNwR6OovE0AqL6wNHCnqzNnihTL6/hRVer6i5Hfxmb +BAoMDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsMIlNlY3VyZSBEaWdpdGFsIENlcnRp +ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMMIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5MCAXDTE2MTAyMTAwMDAwMVoYDzIyOTIwNTIyMDExNzAyWjBdMQsw +CQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZO +T0RFSlMxDzANBgNVBAsMBmFnZW50OTESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1RfsIHFH/58sMeDPPkKCj4sK4ujw +jiSMLi/vuwBjK9h/LtnBZ0wd5kMq9J9mFtQe21dqb4f+z2G2ZthziJ7GHDpJ7WEf +HQa6cEHrk7Tct3XpyGYMvLmSHD+y54U8cO/K66w0k9iZvTiQ1eJxdaPkoQsdqinC +Z+fh2Icy9tWbGatwtddizcGFM71a2vJjcg8Fnb/X/D/fCbF9L8hl3EVqWSs8Y+BD +gIiJqdnc/R9RW8T8W1QeCmkuX/Nm1dJqLF5fNXP8lMgdSMHASTgPE1v5OJqGpIvd +wBYOuYCaGvjplsS+isBh2sDA98SgmL35GGHWiNhZIQkVMKzjgiDkKKU8hwIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQBv4AYF2CfowizdqeL9vrDOSxMQAowxAZWLsixC +RHfzkjPaaN0t0dApEIdttzmmif104LuK8lqQe9zvG/F7kh4Mhj1cfaJZraNbNprL +QHnnV+sSL+flSJfkSmSkuu5Cn78g72qnERqzwYZKHIBnMQhUf6yUmHxmxQlJDtcP +kNCX4vCkkC9MW91n3GDXpSQX8KkSIP+aP1kHqHkWr7mh7du9p/E7rnI2UfVcXg0C +db3eSDVq94e41HK9uWQgYRLLMz9OSnMmOgfK21o+eBWaHb+07Wo87cSPzuGVBtj7 +0DueLUdvSpliM8wZBIf6xzTdF401VinLZfFGyg6pYM0ADfda -----END CERTIFICATE----- diff --git a/test/fixtures/keys/agent9-csr.pem b/test/fixtures/keys/agent9-csr.pem index bba87d631f15..b75a32311d6f 100644 --- a/test/fixtures/keys/agent9-csr.pem +++ b/test/fixtures/keys/agent9-csr.pem @@ -1,17 +1,17 @@ -----BEGIN CERTIFICATE REQUEST----- -MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH -EwJTRjEPMA0GA1UEChMGTk9ERUpTMQ8wDQYDVQQLEwZhZ2VudDkxEjAQBgNVBAMT -CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKU+pwEk -sfXtov7dGh0nfQcTEQ/dqN9/4mol1swTijCae48QlgIOkp6Y6xbMo08WgKoPntc5 -ZtdGAU+g4aJbLX380KitsUyhlTkCuI8V9t8CZa5+Zg5NH2oAbWOPS9ShcvA8Saio -Le7sc+tRhlFsCllxu1Z4Gm5Kg3faN2Re2zqu5jEL3w8z68GCPLk408UfEdfbsTTT -hrRzE58Lw3nM05rU6MfFPuDdoTdrHA2b0QceWkALZ10cmYQKJACTGKI4p8fYqpVR -UIt3LediyIbHGuspqXw3NtMgOGklX6FuzZarJ760zleJ7d1G68RhqYhOxJvB3XMN -hDBfo6gkyxrbKmECAwEAAaAlMCMGCSqGSIb3DQEJBzEWExRBIGNoYWxsZW5nZSBw -YXNzd29yZDANBgkqhkiG9w0BAQUFAAOCAQEAKlz52i1TpqNFQQu2YCl2YlTKbu2s -+92Qq+9b8wKoTweEFxDYtfq8d6rgYtetDbJDh+CDSjG3REINHtbPB0BjFdmZq/Q6 -7JHLjmWKacmhaZJIp6xtrAX93qXYfbqH2S/DNSAO1e1sUa/gKL+wuVcrM8My7mzo -cMEgc7mHJCbSjYIcYPELas+rADoCE4mgiX8wwYQjFqxj/cdlcMzVS3ZuARAiPzA7 -60Zk3/NnbXd/OBOcf/FvbrYIQ45eV4JlMowtcdLtxP91N5/X3BBMFsXt4mPoXETC -V78wipSWtfiKTox1Ze7PSJsYm9E9TOYYPh9kSGizIFzrgnk9H15+Iy5Ixg== +MIICxzCCAa8CAQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH +DAJTRjEPMA0GA1UECgwGTk9ERUpTMQ8wDQYDVQQLDAZhZ2VudDkxEjAQBgNVBAMM +CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUX7CBx +R/+fLDHgzz5Cgo+LCuLo8I4kjC4v77sAYyvYfy7ZwWdMHeZDKvSfZhbUHttXam+H +/s9htmbYc4iexhw6Se1hHx0GunBB65O03Ld16chmDLy5khw/sueFPHDvyuusNJPY +mb04kNXicXWj5KELHaopwmfn4diHMvbVmxmrcLXXYs3BhTO9WtryY3IPBZ2/1/w/ +3wmxfS/IZdxFalkrPGPgQ4CIianZ3P0fUVvE/FtUHgppLl/zZtXSaixeXzVz/JTI +HUjBwEk4DxNb+TiahqSL3cAWDrmAmhr46ZbEvorAYdrAwPfEoJi9+Rhh1ojYWSEJ +FTCs44Ig5CilPIcCAwEAAaAlMCMGCSqGSIb3DQEJBzEWDBRBIGNoYWxsZW5nZSBw +YXNzd29yZDANBgkqhkiG9w0BAQsFAAOCAQEAlbvFevH6Xx79VvWyXdZOehokMpqr +xbodQqntaxtk1pRtiostga5j2pBIos5BBE5KvgPCp2rJMYjdhjyxk6v4P04nhXDo +rtD2PVIVZEaHWw743HVtFpDl9V/JK35jm/FgAbstFFP/OG3uNuHGTxvdPq4NW4dc +TVWpJ09IdbAJ9YfWbro+r/FCP3anXO40TMTNZAJKztyhMlqcmrBC/GHahtav2Y37 +gPpc70WyhqfQE1paEXT/uO1GMiOaVqPt98RTlt7smnLxHodZ3aF3qONl7VFFEaC+ +8rdKdZWTpTJQiAbBo8Xn7UxY6PFvPjteCK9duRULV8+SfimEq0wmC6Fygg== -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/agent9-key.pem b/test/fixtures/keys/agent9-key.pem index 1156fddfa68d..ad01bf54ba74 100644 --- a/test/fixtures/keys/agent9-key.pem +++ b/test/fixtures/keys/agent9-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEApT6nASSx9e2i/t0aHSd9BxMRD92o33/iaiXWzBOKMJp7jxCW -Ag6SnpjrFsyjTxaAqg+e1zlm10YBT6DholstffzQqK2xTKGVOQK4jxX23wJlrn5m -Dk0fagBtY49L1KFy8DxJqKgt7uxz61GGUWwKWXG7VngabkqDd9o3ZF7bOq7mMQvf -DzPrwYI8uTjTxR8R19uxNNOGtHMTnwvDeczTmtTox8U+4N2hN2scDZvRBx5aQAtn -XRyZhAokAJMYojinx9iqlVFQi3ct52LIhsca6ympfDc20yA4aSVfoW7NlqsnvrTO -V4nt3UbrxGGpiE7Em8Hdcw2EMF+jqCTLGtsqYQIDAQABAoIBAE7FXAUOggry2hVW -PuGQ9mfN7f87MgpAwyTInukvk1tx+N6NEIUwfzI9QSvgJyVHW9Q1mAmO4nhSdcOI -tKaZgkkhoDIYgoE+MY04v9Ptq35JfUE+HdZJa2UziPHB2Gsm/0yH4LEWYrcXXnbZ -qQbdUt2qepxQqoDS4nLawjcFhMom24ns24eMCsFW7yrxhyvQwFKqGOKXauCpClp2 -oPXhd2wljutuIGJjMmeqMw7CuyfZMee6BsuXNWWr/kso0NaQwxKoFnGlyaOl6oUV -ypr5ADXv0NNaSqDgyfEfJedsGQul+WWnkjz6PFbWZtbG5SIKb5PCJ2aWD7mvcHdI -85BL4jUCgYEA0yPogvmlK/hSpckk/AkRtHWwjUdkgdoZzxiJV/D01y8EtB+yL46t -Gzl23Y1VtLXxn+CZdj2putS5z1Rg1LA0oMZ+TwhxGskURBPP7mym83Qn1huRcnWw -df9flCg4IwRLqI6QfsQ2Q6j549j5u8P+tqVi/yZQY0V2SGcXTXaqIksCgYEAyFpy -24+AW33ypNxr9sOIx2YQyn0UDK2K6LQYRmjwhpCZEtBdoUqKGP/9UUycM4TN9D32 -p0le+3TJVk9tVqyvwFeGBkguO/3dXD6KTsqrCfMFNj/R6QRYFEaLWjkG8EI5TXOK -a/CbhtyGaRY5QzwLRjLdEYIph3r1d2uedVzwGoMCgYEAvPV59R2u8LcAYFavvs/v -BG3/X7DxBjVGu8zdvdJrjNkLgJiNQ3qQ+bhn5MfEWEIsyESdkvCEoiwXTrHZJv+7 -WdfK2rhXYP1sIbEJefvLPj5KGJf7h1BEaJXv2AxWkSAbBfLw5kJ7vfnQClX4yk4R -+yvweSC0+OMFhK6ecDku8hkCgYAJPRJ6yV0z2tTrgTaBRHb0KuKvU6EvDHmRTWyp -IoGk0tocIfuPSm6fxH4b15qETaVpk8nh4OI+Wh5GmpcCHihkiCSn+YAYSBaDAGdE -RtgoN0qQO9UkF40wMiiO2n5VadhWl/NUEt45E8Ym5l1xmj0y2XmUKxpbIvJatV2z -L7vqnQKBgCuV47rGYLaPz+gVgwIz0PvNFgp2fdSBYYQUf70XsaEU1bQtim6q5jxd -+ePUiT65k42Iw7oLWyGtxdyxmmKgQ18i5aDNjT2SLr3RAC2BSR5Fs1W1PLi24nV6 -QW7fepI9tOBTbwbLG8ARRzx2YXrBf9PqvmDbrMiTi0WGFGlVJatX +MIIEpAIBAAKCAQEA1RfsIHFH/58sMeDPPkKCj4sK4ujwjiSMLi/vuwBjK9h/LtnB +Z0wd5kMq9J9mFtQe21dqb4f+z2G2ZthziJ7GHDpJ7WEfHQa6cEHrk7Tct3XpyGYM +vLmSHD+y54U8cO/K66w0k9iZvTiQ1eJxdaPkoQsdqinCZ+fh2Icy9tWbGatwtddi +zcGFM71a2vJjcg8Fnb/X/D/fCbF9L8hl3EVqWSs8Y+BDgIiJqdnc/R9RW8T8W1Qe +CmkuX/Nm1dJqLF5fNXP8lMgdSMHASTgPE1v5OJqGpIvdwBYOuYCaGvjplsS+isBh +2sDA98SgmL35GGHWiNhZIQkVMKzjgiDkKKU8hwIDAQABAoIBADeUw8w6f/MWy2o/ +Hw84PeG+/Jnu9D+/HKk3a6o1EajwEUxhE+cjnXDf+CZSJUizD1Fa3bI1oKrq666r +qobqEvZt5bZ67KifhqWdLBscw60+njndFFltdcTUgI+O2xMCGMWb5yLhDkiipnSD +WeC7XPj8c0JdHg4IF4poyUxEru3kpdVNrOzTbrs4hf6LUsts25c5IPourgpk1Awk +Rs0zuKMj7K5sp3oTAY+KrsFkavsWLVRrNVNaT9vY+bR1S8kfo7TUeBl2c65yUiBO +UcLWcrd8mALN797JGYe+PK0iQbGsH3106W8k5tve4tSowe2sRvIMiArSsfkBKl+j +/lGePyECgYEA8pbt2CoaW+Iusie9cEAqip2k4nGwh0Vdh+IHb8dgXwMDRC9x+DwL +DTP84+Bdc1siVNofNshzaLjyyG1ah6YXOqSzUpr6SO6dnGzotAFleUlA/z69vejk +FEp6VkElTb7YSuUUjzsPRgLZlfSHtyRIhg3V5rA8LSGQ2MXBVH+zyCkCgYEA4N+S +MrFORTld/6or6hQJGLoBvI2Hwvql3tM+vuNJS890FJBsaJRlHFYM6/4CSdZTZR9B +Za1A7vvYEggJqGGgDtfbKFgss00zrTYRzaY46PpK488HBevY/G2HxXZ2NLg8tK3m +556M0agBULxrWpFQYwu+37cd4oW7hA83EQ77NS8CgYEApnSrxRy2s3+SvQoJscFF +r5GWNw79qwQMtpWAttFerjMaBapskIFar/eROieU1/ebqg91RZjrn9rwNFjcuqFb +5RBoP3E59dtNaK1OS1197Gg4YiwB9BKeldG4+gB/gUZHkbR4lANZapfAB2Yfzanm +3Z0WvdEFqY4Tnrqq+rkZemkCgYAGwnGwmGfT6N+Med8MEEIdvimjM1XrZIFr60mt +j0N6xeelXpoDosJPUb7dsSr8cTbciU378nNLO8LI9/jiWNzo1VA/LDdbxGxTPpbW +abK4Ph3WLzj00pwZKmm0Y9U1zHv2qmuQdtGg074GYUOQ22FhOM8qBmUdlAuI8rQj +DSI7/QKBgQDYPHpPPWjqTr5J3a0hEZefRjGqccOkon0oW62DpKSLjH6pG1LpQYVS +akWh2gx18TFNk5x5JOlAS2ujZv2TyqXsIB/sDcI1+l1Ja9ARcdM/42qaTUSMUNGL +50DTvsKLtFK7aKgfs4LcBjniuzBN/az/GwxS0s/Bi+F/njlklzStGw== -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/agent9.cnf b/test/fixtures/keys/agent9.cnf index a9f5a5f16a3a..bf5da95e3dd4 100644 --- a/test/fixtures/keys/agent9.cnf +++ b/test/fixtures/keys/agent9.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 2048 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/ca1-cert.pem b/test/fixtures/keys/ca1-cert.pem index 8e45f8891c14..205e2f7226bd 100644 --- a/test/fixtures/keys/ca1-cert.pem +++ b/test/fixtures/keys/ca1-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIJAI3yHAFGivOTMA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV +MIIChDCCAe2gAwIBAgIJAO5Yan0JUdezMA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2ExMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTA0MTgxMzI4NDFaFw00MjA5MDIxMzI4 -NDFaMHoxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzAN -BgNVBAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2ExMSAw -HgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0BAQEF -AAOBjQAwgYkCgYEAwbF7gKfk7nGLcH0lbok1UJEBpMiQ49YxUqT/oIfXBaRjMODX -RknQxpARWw4R8qj+Zeu9zZZ8Hzv3dAxtcpnMTgeoPUL3HCStk0bK8QrFdkFrBxQD -mF92r9Mgr/fz+x7rSZuCIKhATwB5iJOz63fRctTL5tBmzG15JUG1GN5HPZECAwEA -AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQAnAHtchz5FGqod -8twiFF3yQdGN3WE3VC3A6VrcmjKUp+M7f0uRDYw4uKUhadyZdYhMn39fe9DVN6rC -6wUUoe4hSs+0SWi6Ora7DFpCbm6fNpooSr0K0OUMZ2opwDmAEPdVOSPRhzQJ/cNp -s3mxIrkAQ5kgJSSGlPETMEumQmXDfA== +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTVaGA8yMjkyMDUyMjAx +MTY1NVowejELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEP +MA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQwwCgYDVQQDDANjYTEx +IDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQC1XJLKHcMcvx9RG2L0jL3Oc7M4ogGOobVDSE8Fom9Xe4nz +HRbOxNCell+HeJIvyieLNQ+UxF5qDa0hOdXgzFI3wzRmX8mzUoLsqIxeh1Tg4MOx +yPeBrFCK4gsiCRaYWjGhfcIEAE3pIkUz9/CpQeG6psqzPNV7ZnJLbl/XopLQjQID +AQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBACfO4emOcWWf +sk98DJwfQQIc0i2D2ALRCgVUpszQOrhDci1ARGkSPc3oyx5xT/b9NCGYUxpHdz52 +t8bTqYJsU6u7kiOe6o0KcQT7FvKrzWgzcL+yCNiQ/2vrx6FJZBL/W3uvzVSoOYCU +D6TJXtGA5d2TnarRMflWXSk3rFqGvtUf -----END CERTIFICATE----- diff --git a/test/fixtures/keys/ca1-cert.srl b/test/fixtures/keys/ca1-cert.srl index c9650b0529c1..8ed0077c7457 100644 --- a/test/fixtures/keys/ca1-cert.srl +++ b/test/fixtures/keys/ca1-cert.srl @@ -1 +1 @@ -9A84ABCFB8A72AC0 +FAD50CC6A07F516D diff --git a/test/fixtures/keys/ca1-key.pem b/test/fixtures/keys/ca1-key.pem index 3a619fbf2484..e46eb322c478 100644 --- a/test/fixtures/keys/ca1-key.pem +++ b/test/fixtures/keys/ca1-key.pem @@ -1,17 +1,18 @@ -----BEGIN ENCRYPTED PRIVATE KEY----- -MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI4tZeEUDNwLoCAggA -MBQGCCqGSIb3DQMHBAglCttpxF+UrASCAoCOiXoMG1+CJFtRnovzp0wSCeEtieI3 -jntJkCBF+NNUZrbWaQqWO+Id8KjXNFQdUo7lYT0d0w5lf52OHTyswjN0ILCOp/WN -eVMDfgmaJXtaah2l++hDFhcbGsOdRcwM0+yComF02Qxr13ftYnIPzUH4+Ix1i1Tr -6eBGDBJv0eXDZj/dLrploA7/pepKlytRw2stIL99TSICR54UQ7fyZ/oS6NvoQU7U -iBCVsrkjyE6jHJZ6vNe/ZjM8ZdLM9K2inoldpFaavDTh6GwHC6e3e9FJuJk6X30e -s2lhrVLOmxLuFS168iApyA8XvVTg/RG08DvkzUUFv8+HNETH0Qkb5kpJM+pPzwyu -c5et2fX8YuQRc8SdIdd+Z0lZJga1IciEXlsfzGeUtcZKUjBZ5yPTx+1InfcNFDKR -wCU2p0Haj9OCcvSBzU53I57RYXkENMEHQ46/FytGULXHimIoIR/SEbrqbKX0xDmT -rc/4c4vI5+tQPYMjo0rqydLAb5YjWCivrXDVXVHrG0YFsAoJkvTBLXlPiqTcnkea -KACuq7B+ymdVmpjV891OLuN3Yah+HgrvTkMlNexsFWvGpis03UYwpI6bppe4dHtt -rLBlgtyxFLJ9hu/YnkR6HcrjKaW5kGFDX06elAZBdPD/6foghzTb4jw3OK6a4ue0 -PE/zF6d7QWW+w5xKtNO62WWKABi9OtLhdUNVAFyBlaA43zYbnXkyfmv0l7LXPZ9t -Ps+BmG4r/gxO6GmZZ40sRXFjpkj230bTjbN6sUrU3WgOszMy0uFAph+zBUIMZWSP -wqZWmQi8MHQ4+Qm8N5GdXUTXw32eZ60bj82QGPso/NNxzDQsk5wd+bR3 +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIq7DAvJ4TiXMCAggA +MB0GCWCGSAFlAwQBKgQQL6ValIJtDzAAQv3neNekGASCAoA54EMlceey59Q6XR4g +YAb97wr31CN/b+vyi8pg30k1QVgIvqoubNpkm8zSLBOU7trfIKQyyq2MYXiHeVHk +wEoNXDuGFesgE3xLc5aAVhh3wFNARGEwUkMhtKtrXn7rGIaQu59uHVOiSnM+9MaT +O7mhfEG+z1tO1xrd7IAGap/mZVu+jQpWAHvmQdL2F0Nf1xvBnVfS7z6PBVFBmKQG +hqtBWsDJtH2AwvdTsBAa8kNOr2/r3VuX33oJ6XHpzlbLFXqiGftqCzndCRYudpce +fB9lxHT7dN3t/D/VQ4TsjS1nfFECDxN/B1rM5Seri/n+g7b87gXZk90vA7lvtEGj ++d0kGJT/Fqnq7kusdDuhccMO7B7ZlKzc9i0umEeSoEbBgjk7RQT/AtxuRB7Nd5u+ +GWQjqePmaT3V0CR48LFCaZH0334RkF9vxKee+VVZUVOz5qbssclYDaZDR6gmZjFE +em1d+IVlmus1UI1GloVM+m9toYvyCHPpoZAwwA9iTX1Ez41Ig7I0k63UcAD+ziQY +juAP+L4HHtRBvT33TSDoLIq5unqRZD8uAd/ApHe9E3/NrCcbQNGK7vmT6A864uTS +el6xo1wCdLI6jx0PR7NHw9VnWNyFaJNhld8gu0FYMehtjw+rEMpVgnibuFYTtKCN +NRbMz+fFSOhfBgyUE+68GvqHHPoe05/Qep9uCeFJ9F6Y5uArArHMiIGNIv1ao7At +O+vK8NjPoEsK881rnjeWste/eT75qIU3iEyuDGvBnJNzGuQykI8adG6X60CruMuH +7LwS3kZK1W1QcBcG/xF3IZcs1o4le1zqzlsCH4qlWh4YfPID4HEKQGLS0DMzDY8x +tmzr -----END ENCRYPTED PRIVATE KEY----- diff --git a/test/fixtures/keys/ca1.cnf b/test/fixtures/keys/ca1.cnf index afd3066eb9da..0b6426dc953b 100644 --- a/test/fixtures/keys/ca1.cnf +++ b/test/fixtures/keys/ca1.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/ca2-cert.pem b/test/fixtures/keys/ca2-cert.pem index 34bfa410b683..8d2d4273df7f 100644 --- a/test/fixtures/keys/ca2-cert.pem +++ b/test/fixtures/keys/ca2-cert.pem @@ -1,15 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICazCCAdQCCQC6w+RgcQYePDANBgkqhkiG9w0BAQsFADB6MQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO -BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA -dGlueWNsb3Vkcy5vcmcwHhcNMTUxMTEyMjEzMTQ3WhcNNDMwMzI5MjEzMTQ3WjB6 -MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK -EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqG -SIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A -MIGJAoGBAMreMdPZsvC/FZUQWKrJ009zmeW7qgepfIpgX3IlJkptXZYiIQMJF0UF -V8COK9+0vDxd/K4ehK2bZKAP0dvyRY3UHiAYfGSAWa92s2JhGGu9SESSfahVYniI -M6bbFQb06eq0RU4KTYbsSlePY6tiGWCGzOwy6xGlUxZfySgWAdiTAgMBAAEwDQYJ -KoZIhvcNAQELBQADgYEAtiq4TqAXCGqmAkicZ4kFSuF3jq9AE9xhhIfW9FWPSRNp -V+TP7GVbSGwiW6UDy1bdemvBVKBP7LEhBpauYhDFY3Nw/FSGy6bqhSCH/OPTtM/f -fXkBkKN3mSbNohXGhevAUlWWurOddrWWWYtDydcGemqvivlamKAvkCQj+lMmi3o= +MIICbTCCAdYCCQDakSqa9pRwoTANBgkqhkiG9w0BAQsFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZKb3llbnQxEDAO +BgNVBAsMB05vZGUuanMxDDAKBgNVBAMMA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwIBcNMTgwODA4MDExNjU2WhgPMjI5MjA1MjIwMTE2NTZa +MHoxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNV +BAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EyMSAwHgYJ +KoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEAvQ+FcEz9z9g97WelMFbnT1lPXyimgyfWr5hYDG51rVo0L8hBbxW3 +uaS+lxOodW1Sb+ycTAvyVIdfiIUi1XFROGyTUY2Vi2r8yglS7+YSQyk5+6jTJbHe ++UBLY8wO/B6vSZXBb1Ym1+LtfUeEJc1+5qtB7joyllwt3ID/qCeJxNECAwEAATAN +BgkqhkiG9w0BAQsFAAOBgQCzAc/3u++UkXTShUZgT9L5lA/wg2yfMA737EEg/FG1 +JEW7OmkvYekZdL7V3o2CpymYXpUuFaWgW6cxMRJ1wylZkqk8Ad527uAfe21fGIFl +9wiLSjXjoVYod0xHtsDE+5y3a46QspH/Rxq5gHkdhV3J4RkwYrx6deEnAEKHA5S4 +qg== -----END CERTIFICATE----- diff --git a/test/fixtures/keys/ca2-cert.srl b/test/fixtures/keys/ca2-cert.srl index 18b47ea80f4c..d91d153202de 100644 --- a/test/fixtures/keys/ca2-cert.srl +++ b/test/fixtures/keys/ca2-cert.srl @@ -1 +1 @@ -EEBE2CE5211A12FB +F8159CF540DB8F4D diff --git a/test/fixtures/keys/ca2-crl.pem b/test/fixtures/keys/ca2-crl.pem index 22467ee507a4..6cd77ea257cf 100644 --- a/test/fixtures/keys/ca2-crl.pem +++ b/test/fixtures/keys/ca2-crl.pem @@ -1,10 +1,10 @@ -----BEGIN X509 CRL----- -MIIBeTCB4zANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQGEwJVUzELMAkGA1UECBMC -Q0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUu -anMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5v -cmcXDTE1MTExMjIxMzE0N1oXDTE4MDgwNzIxMzE0N1owODAaAgkA7r4s5SEaEvcX -DTE1MTAwOTIzNDIwNlowGgIJAO6+LOUhGhL6Fw0xNTExMTIyMTMxNDdaMA0GCSqG -SIb3DQEBDQUAA4GBALigobvv8r1RjPDc7DGiGdOYIKlSZR0FBWBj4U3/gmFQs3/c -q+iBlLEYjzdnW4qZ+YJ34C0LfwUjVIyFYYKA+5dRGZ5NhidMPUF9yUZyLlLN8Cqt -RD+L/PhoFFAXCETiYQzf+1XhCvqYr8pTIp+ie1Ho1GQWN0OUNih2uC3pWYPV +MIIBXTCBxzANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQGEwJVUzELMAkGA1UECAwC +Q0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZKb3llbnQxEDAOBgNVBAsMB05vZGUu +anMxDDAKBgNVBAMMA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5v +cmcXDTE4MDgwODAxMTcwMloXDTQ1MTIyMzAxMTcwMlowHDAaAgkA+BWc9UDbj0wX +DTE4MDgwODAxMTcwMlowDQYJKoZIhvcNAQENBQADgYEAQLa20feEGeSrXOrh5WZ/ +YAvsB6dPEy4lumjNOH8k+mbOmdlWEOAKlf75p3hsi02HYyVwoR02vsdbGGIxPAXi +WVa0h6/ZRmw3emLx08s7QxHLISrj3mzDgqU3mMrY27S07mtYaJqNd9gWJNusBXVF +3N7qhYNDijxwYG+e+Ty1WS8= -----END X509 CRL----- diff --git a/test/fixtures/keys/ca2-database.txt b/test/fixtures/keys/ca2-database.txt index 9e6cb45e40c2..c943e0c0173e 100644 --- a/test/fixtures/keys/ca2-database.txt +++ b/test/fixtures/keys/ca2-database.txt @@ -1,2 +1 @@ -R 401216111901Z 151009234206Z EEBE2CE5211A12F7 unknown /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent4/emailAddress=ry@tinyclouds.org -R 430329213147Z 151112213147Z EEBE2CE5211A12FA unknown /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent4/emailAddress=ry@tinyclouds.org +R 22920522011656Z 180808011702Z F8159CF540DB8F4C unknown /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent4/emailAddress=ry@tinyclouds.org diff --git a/test/fixtures/keys/ca2-database.txt.attr b/test/fixtures/keys/ca2-database.txt.attr new file mode 100644 index 000000000000..8f7e63a3475c --- /dev/null +++ b/test/fixtures/keys/ca2-database.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/test/fixtures/keys/ca2-database.txt.old b/test/fixtures/keys/ca2-database.txt.old new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/fixtures/keys/ca2-key.pem b/test/fixtures/keys/ca2-key.pem index 87c617a6c44d..2e48b87636f1 100644 --- a/test/fixtures/keys/ca2-key.pem +++ b/test/fixtures/keys/ca2-key.pem @@ -1,17 +1,18 @@ -----BEGIN ENCRYPTED PRIVATE KEY----- -MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI+D0kZN/uPY0CAggA -MBQGCCqGSIb3DQMHBAj+U7U2/bM95wSCAoCTn+utBgersCUv06fNriyEJgzlwZec -tP5xqiXdZmUzaawdkzBeEJOWZYsawxFk/d0vxTXJMosUfoJOwEu+uv07DQVefVku -RFWaF7QHk5GQRreoAHBdP+IWhf19U7r5F5YFkt9OGfCtVhlSQPHIm3GYQOXBIAAz -Hzfv5dEBrl5G6mkUCtOYhZiy7eETP8EYmFT3cyPkW+4qMVOMkTUZUTg6z+b06Zsy -LW5wTGtc4I+9liHzQZ6tReaQZMOsiXL1/6ef3ZL3TxtUm678x6LOmEsRaH24vzoO -5hZMqj5u53hJElM/sUUXiKCjnITsgq7bjSj7gcoB5DAEPuzgw47RAzoz7iUR1IFD -p3tL7XuXD0mMgu1acrafQprNv9G3pBO2Ifcss1+etnD+bBrhoya1D46BgFIF/7Lz -xwj2D1GnrgnctAcal8f9mIP77TXM9qzG3okUVebmOqL/CuuQuVgT9a8cjwDiEmHW -oA/66ovQ1g6LFZdwcnAyl3+k2Z5ggJT9HCBbJUAHpb5+qpJwO8nKRsf5Y6wnBYPe -pRp2yl8TW7vVlUi5LeiZ4q/c4JfzcizBguzIInwBZMdRvA9ID97r4bdptKh+zazg -0cZo4VolYu8gDuxs0pUnaBi8MJxUynRFQNvAiLQtD0cG9PrCFg6WS0/vEmUtIdgF -Ah9tMb9HgEuJeRaggcaO3eVNL8EWO/pkJMtxy9xoqUxwWEbxwiYrozBRHP4cKur/ -bW+cBy0gICOc5QoISvBSack0t+U2HB3ojz0DzvAWAVpmcqRKmHitRvma4o+x/uro -bVhvAhLa7NPxOUJBI92yFBqn8zz8KIqLPVGcYGhucZcNqECPDaf6t85e +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQI4wcMSIZ9VYYCAggA +MB0GCWCGSAFlAwQBKgQQrdlE/1g1dUWjPXe+cDF3hgSCAoBXqokDLdhUcEMNy6mp +S+yixHeWaS35QF8ESaqMa+Qc+l/ZJxLLUQRf52TimO+sz51TXfQFJtWTsZVaGyii +94uoniHVtaSirpzuQVUEPx9/o4XVRc9MtEf78z8DUwOJ6dHlVganU9BZesS0+TZc +E5apDKhWhjbrjWWhwNMUb2jYHQvaZoDjlvyhy5qUG9MQn65KbrK2WLT8Jsq9RE4y +38fxdV1S2OetDc29hSp54DWkXegjrX7iDOWLSGhG0GmjS6rggDQ71/CN7fbOAwf/ +ztniGUqriPNO2gaaivHiT9yuzYyA58FyGLCnVg6+jkQ8znhOfO9DwSWEaRWCsv2n +v1Ep4HzSopt2CogBUsJxg5Xzls7qq0e232+gndMlT4tEOfK194aOuXCReESA+yll +YRcdsjQzFUyCUrGv+RGmQmiK8QcLI9jIPa6Mi0R6VnUMyHGB3i7oY1UaKKS5+6zB +4ftXEOfx141siDymRTTALrmQd6jHqpXbbou2idbKGMNn/G6GSl/5fXmPSUOs0H2l +HdhvPJEfyYsWhS12jXRKtlWIAb+A7BKZac+y+kyhcJG2OLz2cCqmTXIZDdEMr3aE +aoz8rP2vloyKFx9LMDdK8/ec9b02cU/XctZ3XepL+0+WYfk2JKulhJsvsAyQX93l +Wdb16NzGE0X909+9N26VZzCVVeY2Ti2Xo40dLkQthMmGytz8h0sro8gTcHlasQv/ +4rQJ7nb4FL29Vv8TBLwAO0ivDSy/lDayi+eY3dOMBjHlXP4ZqBd5bybkpZNisG5f +C/p6R7czFrFZ/MMhU39O5GBZhD0Y3BfI+ih6ly0/jfqFnETNyG18jNrUOgJ8ZeEz +sVpU -----END ENCRYPTED PRIVATE KEY----- diff --git a/test/fixtures/keys/ca2.cnf b/test/fixtures/keys/ca2.cnf index 8d216c57237d..51a72fafa70d 100644 --- a/test/fixtures/keys/ca2.cnf +++ b/test/fixtures/keys/ca2.cnf @@ -7,13 +7,13 @@ crl = ca2-crl.pem database = ca2-database.txt name_opt = CA_default cert_opt = CA_default -default_crl_days = 999 +default_crl_days = 9999 default_md = sha512 [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/ca3-cert.pem b/test/fixtures/keys/ca3-cert.pem index 2c1cec871944..99dbbc3096b3 100644 --- a/test/fixtures/keys/ca3-cert.pem +++ b/test/fixtures/keys/ca3-cert.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIJAJqEq8+4pyq/MA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNV +MIIChDCCAe2gAwIBAgIJAPrVDMagf1FtMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVu dDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2ExMSAwHgYJKoZIhvcNAQkB -FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xNTA0MTgxMzI4NDFaFw00MjA5MDIxMzI4 -NDFaMHoxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzAN -BgNVBAoMBkpveWVudDEQMA4GA1UECwwHTm9kZS5qczEMMAoGA1UEAwwDY2EzMSAw -HgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzCBnzANBgkqhkiG9w0BAQEF -AAOBjQAwgYkCgYEAqs4MKn9saUIu/9EfHQPouC3kL9Mo5sd1WR6RBeSd8cqeFxXW -EWEq/P0hUeAH1sY0u8RFOccJmSJg8KTyRGc+VZzWimopz17mTuQY4hPW4bFzqmQm -7STfJz5eHzynBTU8jk5omi8hjbnRA38jOm4D7rN/vqtB+RG+vEhxONnq4DMCAwEA -AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBo8rX1uZWHvKHG -gWw+LXrY24Pkg8NdDRmfqEVyuaR4GoGGOXCqlVaFa6x+4/eqOUzHoC9uGfPtjrvW -BYQ1o/l0JZWW4KZYuXoVuMUSj+sel82mf9zLDeq5WYTPECgJDMfgVpXOmhHfyezn -SkUTX7XJUohjET+X5BqTFlqRT/RfIw== +FhFyeUB0aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE2NTdaGA8yMjkyMDUyMjAx +MTY1N1owejELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEP +MA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQwwCgYDVQQDDANjYTMx +IDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDIVigurX3u6qjhxxWERDRINbd8jc9VD1GD1T5SCt1oBjeK +qyUSEV4f6KFvHuh3oKjmiJy4OvuiNMkzNxI3v32yoJHkQUchB4tlBVLec4gz+ZfO +9RpM10gPBes9nSh6LUx4myZ8Rpungw0UcZaGvrwPNZYbFWvCqUSuea4GVF20fwID +AQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACbwa28NeiUG +mqw14fpmT/ZDpc/BAR8gKO8OutMZO5oKjlFjplhujFlie3Zza/hxIlztF8IdYCE/ +/BZruPB+ed9ls5I7ODH1dFw8YAhxsa4y/lNP7Cq721SH49oFZJslqj1PYmhy1q4m +XrNdd447SPkWlB1D1s9NYINmqzNEsJyU -----END CERTIFICATE----- diff --git a/test/fixtures/keys/ca3-cert.srl b/test/fixtures/keys/ca3-cert.srl index ecab7285d692..b3b7875005c3 100644 --- a/test/fixtures/keys/ca3-cert.srl +++ b/test/fixtures/keys/ca3-cert.srl @@ -1 +1 @@ -C4CD893EF9A75DCC +E987DB4B683F4181 diff --git a/test/fixtures/keys/ca3-csr.pem b/test/fixtures/keys/ca3-csr.pem index 4daa2302ab24..ceeab96806a5 100644 --- a/test/fixtures/keys/ca3-csr.pem +++ b/test/fixtures/keys/ca3-csr.pem @@ -2,12 +2,12 @@ MIIB3zCCAUgCAQAwejELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQH DAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQwwCgYDVQQD DANjYTMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMIGfMA0GCSqG -SIb3DQEBAQUAA4GNADCBiQKBgQCqzgwqf2xpQi7/0R8dA+i4LeQv0yjmx3VZHpEF -5J3xyp4XFdYRYSr8/SFR4AfWxjS7xEU5xwmZImDwpPJEZz5VnNaKainPXuZO5Bji -E9bhsXOqZCbtJN8nPl4fPKcFNTyOTmiaLyGNudEDfyM6bgPus3++q0H5Eb68SHE4 -2ergMwIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3b3Jk -MA0GCSqGSIb3DQEBCwUAA4GBABMaKC7NVVdfoQeKwIy5lYo17mOr4WcWHPNRcoIy -rAHLcAzFOp0RCSZ7ROVRR6O/QIBYapUmPmdYRhKfz1g35xCX3+T28cWXngALV5v0 -XzMYJiew+97/LlNnBwoTRafAorviugdbFgJeMpYHRkG7/zXQsBz+hwgymKZnHW9D -Dl4h +SIb3DQEBAQUAA4GNADCBiQKBgQDIVigurX3u6qjhxxWERDRINbd8jc9VD1GD1T5S +Ct1oBjeKqyUSEV4f6KFvHuh3oKjmiJy4OvuiNMkzNxI3v32yoJHkQUchB4tlBVLe +c4gz+ZfO9RpM10gPBes9nSh6LUx4myZ8Rpungw0UcZaGvrwPNZYbFWvCqUSuea4G +VF20fwIDAQABoCUwIwYJKoZIhvcNAQkHMRYMFEEgY2hhbGxlbmdlIHBhc3N3b3Jk +MA0GCSqGSIb3DQEBCwUAA4GBAIDV1hoEgicY9C07qhcJi1QiI0dw6IGOGANgUbXX +HCVYqQDNGfm+wuclaqp7kcMcTvZ0WY/soNeX+wsEyTGPxcjs5qQMWZoqclZqaseR +mQZ6IdITdYSngdqwL6/CyfIkHjTSyXzBikkHuM+cFpY9f6CekoZzDavyieUVcTEm +OMIp -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/ca3-key.pem b/test/fixtures/keys/ca3-key.pem index 6c2b067abed0..f8be36b68e9a 100644 --- a/test/fixtures/keys/ca3-key.pem +++ b/test/fixtures/keys/ca3-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQCqzgwqf2xpQi7/0R8dA+i4LeQv0yjmx3VZHpEF5J3xyp4XFdYR -YSr8/SFR4AfWxjS7xEU5xwmZImDwpPJEZz5VnNaKainPXuZO5BjiE9bhsXOqZCbt -JN8nPl4fPKcFNTyOTmiaLyGNudEDfyM6bgPus3++q0H5Eb68SHE42ergMwIDAQAB -AoGBAJkcc5N0/j2s8mynjXh5FJhlqvOkGjol+m+VEvNxaJRiySxwiqCxtdNrJf87 -EEvbCVJ4MoYEgfof8z5E3lerJRgqrhY2RSfiQrSUA89Lw9uYzcx28zhWpwwmuLHY -5gjz+LCDDS5okLsXnl2awHXADEmcx29sZnRS6dGRFcf8F0FhAkEA1c7HrW8Vghu2 -FlRaY6LOuoFNAHM++ugoWrC85/moYevLG8wAJCuSIp/RuWrx1FdJoa7rfhyS649v -cMGN0m1yHwJBAMyC1S1QoqXSdoqN8OrXyHJmaSbWG8IMLcT2FXA8Mk3Tk0zWSjiz -sk/O85NsmUQQnkRgbtSS+w0Kc0OMWXbfl20CQH+igFsNjEZuaoXr90WxhD2cQK57 -HebEvopdJXhJ9nX2P/qpDpCJHiTjSVyp9hFvxjnp5RUU07QhnUIvmY073rsCQFMN -ovNHNvZutVNpd3h372B+NJ/f/d/dQE0nvucYmzk9/ikLMZM7buO4YPTy+n9I3G1a -WEgd9LSEFPFOsxpyjTUCQGn9XTyeSo1EoVuV21DE0Cnx30YsnPKMT1YRS7QgjDPK -RA3fSsvnhtTzT53kfJ/ZurBV+RKbePL1JVqDtGvJVeE= +MIICXwIBAAKBgQDIVigurX3u6qjhxxWERDRINbd8jc9VD1GD1T5SCt1oBjeKqyUS +EV4f6KFvHuh3oKjmiJy4OvuiNMkzNxI3v32yoJHkQUchB4tlBVLec4gz+ZfO9RpM +10gPBes9nSh6LUx4myZ8Rpungw0UcZaGvrwPNZYbFWvCqUSuea4GVF20fwIDAQAB +AoGBAIm1/+UmSV0EXZbl/Tpwj+fbVQf/izgTUZtn6HEJGu046NEfmFn1KliQ1vfF +rVMeUzw1SFWz5em4k13rS1CbB1GczDcfRh03kFJrkGn8bI+3P1PXBJLjOWVC8dAE +r/guBreMN1K6O3FydQr8I9sZrYKiPB8ChoXj8pd4nRmwAbURAkEA8qSdoCTHbgZV +3O1x5CshLhD4wQAwOuEvEsTnTSW8MfULQMzlXJ7XofyqqL8GZGSRynp2GaS0Kwf3 +grSgM/XBFQJBANNdWRywZnSbvn/+eD//Y8LtwNuZZuf0rM4AmXGScxL51msetnGH +ALFrKsfh4c/MD3wYN2t3LhL+LPNsz3DufEMCQQCtMKZ5ugbHF6qNyMW0MLy8Hs0P +JU1HmZd59CWMwVR07A0eMaG83HvZWXmOfNrZKZeOSJ6naxJWbJdUKgz3SYCJAkEA +rEku1f/Dw9Efmt0lz6SxALcjuNx10STTpqc+bCDfw9v6Nx61wBw3KGceXAd3NRY0 +mQZ0RhjDaZ/drB5JiNgcWQJBAO39OvJf9L5AxnBNJ4Fvq+0OQTe51T90TG6+LG/Z +ipKhigb+V8dN6Xhwb7lGWFip1sfPmCJ0ehw9/uqGUJHLuGA= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/ca3.cnf b/test/fixtures/keys/ca3.cnf index 53855e141961..83a6e7f97e4e 100644 --- a/test/fixtures/keys/ca3.cnf +++ b/test/fixtures/keys/ca3.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/dh1024.pem b/test/fixtures/keys/dh1024.pem index e5556e02020c..2ceb5d977658 100644 --- a/test/fixtures/keys/dh1024.pem +++ b/test/fixtures/keys/dh1024.pem @@ -1,5 +1,5 @@ -----BEGIN DH PARAMETERS----- -MIGHAoGBAO2Ij3VgqTKsxLZiK0uW0xWVszBzNbdjgLkriicMcZuUj1fQOSM6CPwv -5kdrRV8kHCK9q8dU1Dpf2dgh3l4fFFLpjIuUmUx3b7Q+GfHZ1UepNxr1NHSJaCl+ -wA0gwSDYhy8xRAsZ3bFVsLfDCuxuzPNC0yjtS5CVqci//vq0NTM7AgEC +MIGHAoGBANbhtynvkH1sZ2K9dLEyZ3keteaBUab1GvFeCgJV9akoxmtjSuD9o6bS +pD+y+GstQb1WqiPICSraJs+uX1NNzxYQTFz3Ur0vR20RN6i3aJaldnWl+HitRlfa +iEA2DUoPISmOFsrzPQdfdRh6tTYZYGbjElA5KukUsMtMRaTIDSIjAgEC -----END DH PARAMETERS----- diff --git a/test/fixtures/keys/dh2048.pem b/test/fixtures/keys/dh2048.pem index 451de9b92af9..baeb28f3a168 100644 --- a/test/fixtures/keys/dh2048.pem +++ b/test/fixtures/keys/dh2048.pem @@ -1,8 +1,8 @@ -----BEGIN DH PARAMETERS----- -MIIBCAKCAQEAg3ytm4B8bqS4KmLTw7eeqrzp8Y4Ew65weXKL9eY2FmudR0VUkoti -fs7/fKDsxMVgLyL+9UpbTs18CNslwWgMCSkrXe/NtXWlQQBLgXhEHOaeK/6j9zyt -S6rlSvGK68NF0/e7o6jZXOSktIeflJQXoUyeds65+la/l5O2iuX0tgnGfNjB2Pdt -RnoAPNJW+SBvyfcmiWjfd5Lh67SBgckqFMiH+CPiw54U2CeDPB343DUEPpTcnLJB -aJs4uuxDnskz/0ZVidNBpUBs1wPQ8ruVNZx3hG2+PIqNPvOfYUPXIgn1ABj3mGAR -sgtN63KUBX322zkTVPJnt30mrWp/F62GSwIBAg== +MIIBCAKCAQEAoKS3RTOlvieMbectTsczMWgZwvO6frAZkIXR+GLI8SKfsr21Xyr6 +5p8YqT5wWpEUhpEAasOxEaOhqQ6qUGWOrxtacqE+HiuM5wTuZs31UGslgLdBDwqx +XF3rRV9DBiNNRhzUlytuVnBNoh2F4YgXxl0OZ4EhldN3VAhQy+3bbI9hCt36uuwE +iGV1i1PEMk0UTZrYKKuZwpaahqznmLQN6Dbg3E5RtmvSjlgQQ8WAse37/CAUiGTx +QLFl2CKUJfEYMQKjlasZ2fPSTTM4VDJByixynzzHQ/YxPRAYCQ/HejbjegaI0b3F +pcMjtKtKYghGRnIo2cb/yj8p9RQyB0TluwIBAg== -----END DH PARAMETERS----- diff --git a/test/fixtures/keys/dh512.pem b/test/fixtures/keys/dh512.pem index dcab8db9fbc8..de17bcc3c796 100644 --- a/test/fixtures/keys/dh512.pem +++ b/test/fixtures/keys/dh512.pem @@ -1,4 +1,4 @@ -----BEGIN DH PARAMETERS----- -MEYCQQDpl3okBAjG92NSOaQEsIyqzvJRN06yHuGXunxYVIqxg7TnU8DBZW0ZYyiJ -rJLRA/9b9dCk5DXpq1pFGoAkYLoDAgEC +MEYCQQCyJYaQNCz0LyNQXKPNKZMq4pcvSNlxZvNLLtdixaA2SYj4nbIxOSths0Nu +ao2AsGzSfAAtMUn1WEKE4VIxzW0rAgEC -----END DH PARAMETERS----- diff --git a/test/fixtures/keys/dsa1025.pem b/test/fixtures/keys/dsa1025.pem index 1b59f5e351db..ba5cab4548a2 100644 --- a/test/fixtures/keys/dsa1025.pem +++ b/test/fixtures/keys/dsa1025.pem @@ -1,9 +1,9 @@ -----BEGIN DSA PARAMETERS----- -MIIBLgKBiQCtjGXOH3Rq+lM09nwe6nbShOduCyfjgZhgMZ2WfY6PYLW3gNnhNYT7 -88rZbECcyKlyzRApFgs9KMfiqWfWIhQn+FmolmeUNdRXpmkGyJAqY63GobI8S1Jn -xYbwdH7PsV1IwM56ylrnpdUDhSH7+Y95rgEIUXX9OHS503gzFFEHCmQl1/RS7Qxp -AhUApmbNUvRisdjnyjhDK6RO3pafN90CgYhQLHJ+qq+nxLX/lqQL/tCFY3P6DlYc -3ezT3Ic+3GhEMMXMBMJ+WRmRkCW5vh1grQyLVa/MLWvYgNkoUAO8eGElcloUero8 -m5Tp3bFArEqb8rJXWYM1sAlnl/Y0uFpw1AyHLuZC26z+SSeDbV9REtz14EknkFXk -su4QN55ZQKoiBv2cFDMsIf9b +MIIBLgKBiQC2r/KfMa0uMf8PoW7ClzmYn41i33sJvaZnzJ376hkreEmYSov5Nn1H +s0Sgbkl/RRSXO6USVcWixIDjAkrfBFMBEQAmduy/RVLKFTm0VfOjwmgI5KswpGi6 +pMlf2gpCIjGfLNjX2D3t2fKFgNV1dHr4I2nHROnLpgXcr+2LVUijm8WdGc/uwY2b +AhUA/tubPhgw2Vo2C6uFx+4wkXc/vX8CgYh9NIz7YeCvZEFqPiHcC8HhYk0ERo4u +ynprB27vSYszw7124Mo0zQt7Je3hIq2IfltmbWXwZNBp0MHFK93VzBX4Ytbov3KA +KGdigUSZi4OsJLuZpLUFLt4Nx3kSHb7LSCflXlfk7esdd0R/3SdhUGcuvz17sCjV +p57mAYTFNoolrLZaKb+dQprw -----END DSA PARAMETERS----- diff --git a/test/fixtures/keys/dsa_private_1025.pem b/test/fixtures/keys/dsa_private_1025.pem index 11f5e807ca8e..e2927f0097ff 100644 --- a/test/fixtures/keys/dsa_private_1025.pem +++ b/test/fixtures/keys/dsa_private_1025.pem @@ -1,12 +1,12 @@ -----BEGIN DSA PRIVATE KEY----- -MIIB0QIBAAKBiQCtjGXOH3Rq+lM09nwe6nbShOduCyfjgZhgMZ2WfY6PYLW3gNnh -NYT788rZbECcyKlyzRApFgs9KMfiqWfWIhQn+FmolmeUNdRXpmkGyJAqY63GobI8 -S1JnxYbwdH7PsV1IwM56ylrnpdUDhSH7+Y95rgEIUXX9OHS503gzFFEHCmQl1/RS -7QxpAhUApmbNUvRisdjnyjhDK6RO3pafN90CgYhQLHJ+qq+nxLX/lqQL/tCFY3P6 -DlYc3ezT3Ic+3GhEMMXMBMJ+WRmRkCW5vh1grQyLVa/MLWvYgNkoUAO8eGElcloU -ero8m5Tp3bFArEqb8rJXWYM1sAlnl/Y0uFpw1AyHLuZC26z+SSeDbV9REtz14Ekn -kFXksu4QN55ZQKoiBv2cFDMsIf9bAoGHFPpl8uRj7sNjsnIPPI9CuqlIoZXFNXeM -X9Yu7T3s5mn5Q2ATcgnryDXwqpqle630wy1LZjjmtyE84oVJd4W6YTlzHNwIv2ql -ymMzWBE5+BrRXtqIndvkaWJRSUwtZ7XPPeeCzqR5uXRAsy54azoFDoisuOO5dVOm -VZERfp4Up+Duvws5+Gq2AhQlmsEI+CInYqsDR2ha+UcwXmGJSg== +MIIB0wIBAAKBiQC2r/KfMa0uMf8PoW7ClzmYn41i33sJvaZnzJ376hkreEmYSov5 +Nn1Hs0Sgbkl/RRSXO6USVcWixIDjAkrfBFMBEQAmduy/RVLKFTm0VfOjwmgI5Ksw +pGi6pMlf2gpCIjGfLNjX2D3t2fKFgNV1dHr4I2nHROnLpgXcr+2LVUijm8WdGc/u +wY2bAhUA/tubPhgw2Vo2C6uFx+4wkXc/vX8CgYh9NIz7YeCvZEFqPiHcC8HhYk0E +Ro4uynprB27vSYszw7124Mo0zQt7Je3hIq2IfltmbWXwZNBp0MHFK93VzBX4Ytbo +v3KAKGdigUSZi4OsJLuZpLUFLt4Nx3kSHb7LSCflXlfk7esdd0R/3SdhUGcuvz17 +sCjVp57mAYTFNoolrLZaKb+dQprwAoGIXuEQl13kgZSS01f5GZ5h+vIBlmIpx4xw +lcsDZgrhIjaDHONd1ENQ6iHlDAotO+TCaPhmC6u8/FkecCkhccbbMzTTMq2qCxKS +k3Xw1TvlBvBwc+Wy03GqGkiJjHProtWx1T5Ix/Ry+G8RxEucLSlh8xJcCrL/yueZ +KgdXLKMLKLP3t9DJcHd7WAIVAMBoRtLSze63Y7aC49Q2iFZhy9+u -----END DSA PRIVATE KEY----- diff --git a/test/fixtures/keys/dsa_public_1025.pem b/test/fixtures/keys/dsa_public_1025.pem index e55e3d8871b2..c439e5713e04 100644 --- a/test/fixtures/keys/dsa_public_1025.pem +++ b/test/fixtures/keys/dsa_public_1025.pem @@ -1,12 +1,12 @@ -----BEGIN PUBLIC KEY----- -MIIBzTCCATsGByqGSM44BAEwggEuAoGJAK2MZc4fdGr6UzT2fB7qdtKE524LJ+OB -mGAxnZZ9jo9gtbeA2eE1hPvzytlsQJzIqXLNECkWCz0ox+KpZ9YiFCf4WaiWZ5Q1 -1FemaQbIkCpjrcahsjxLUmfFhvB0fs+xXUjAznrKWuel1QOFIfv5j3muAQhRdf04 -dLnTeDMUUQcKZCXX9FLtDGkCFQCmZs1S9GKx2OfKOEMrpE7elp833QKBiFAscn6q -r6fEtf+WpAv+0IVjc/oOVhzd7NPchz7caEQwxcwEwn5ZGZGQJbm+HWCtDItVr8wt -a9iA2ShQA7x4YSVyWhR6ujyblOndsUCsSpvysldZgzWwCWeX9jS4WnDUDIcu5kLb -rP5JJ4NtX1ES3PXgSSeQVeSy7hA3nllAqiIG/ZwUMywh/1sDgYsAAoGHFPpl8uRj -7sNjsnIPPI9CuqlIoZXFNXeMX9Yu7T3s5mn5Q2ATcgnryDXwqpqle630wy1LZjjm -tyE84oVJd4W6YTlzHNwIv2qlymMzWBE5+BrRXtqIndvkaWJRSUwtZ7XPPeeCzqR5 -uXRAsy54azoFDoisuOO5dVOmVZERfp4Up+Duvws5+Gq2 +MIIBzjCCATsGByqGSM44BAEwggEuAoGJALav8p8xrS4x/w+hbsKXOZifjWLfewm9 +pmfMnfvqGSt4SZhKi/k2fUezRKBuSX9FFJc7pRJVxaLEgOMCSt8EUwERACZ27L9F +UsoVObRV86PCaAjkqzCkaLqkyV/aCkIiMZ8s2NfYPe3Z8oWA1XV0evgjacdE6cum +Bdyv7YtVSKObxZ0Zz+7BjZsCFQD+25s+GDDZWjYLq4XH7jCRdz+9fwKBiH00jPth +4K9kQWo+IdwLweFiTQRGji7KemsHbu9JizPDvXbgyjTNC3sl7eEirYh+W2ZtZfBk +0GnQwcUr3dXMFfhi1ui/coAoZ2KBRJmLg6wku5mktQUu3g3HeRIdvstIJ+VeV+Tt +6x13RH/dJ2FQZy6/PXuwKNWnnuYBhMU2iiWstlopv51CmvADgYwAAoGIXuEQl13k +gZSS01f5GZ5h+vIBlmIpx4xwlcsDZgrhIjaDHONd1ENQ6iHlDAotO+TCaPhmC6u8 +/FkecCkhccbbMzTTMq2qCxKSk3Xw1TvlBvBwc+Wy03GqGkiJjHProtWx1T5Ix/Ry ++G8RxEucLSlh8xJcCrL/yueZKgdXLKMLKLP3t9DJcHd7WA== -----END PUBLIC KEY----- diff --git a/test/fixtures/keys/ec-cert.pem b/test/fixtures/keys/ec-cert.pem index f2084198aa46..ad92a1da65fc 100644 --- a/test/fixtures/keys/ec-cert.pem +++ b/test/fixtures/keys/ec-cert.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE----- -MIIB6DCCAY8CCQDxe0NTwQvhajAJBgcqhkjOPQQBMH0xCzAJBgNVBAYTAlVTMQsw -CQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoTBkpveWVudDEQMA4GA1UE -CxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQyMSAwHgYJKoZIhvcNAQkBFhFyeUB0 -aW55Y2xvdWRzLm9yZzAeFw0xNDAxMjUyMzQ1NTRaFw00MTA2MTEyMzQ1NTRaMH0x -CzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoT -BkpveWVudDEQMA4GA1UECxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQyMSAwHgYJ -KoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzBZMBMGByqGSM49AgEGCCqGSM49 -AwEHA0IABMF+Qkla0cb0tH6NcJDnd2drh0xr74hkJY8SWtsZ/7WyL8VHN8SfoDOo -2BZDByoBmHkFy1BEC0b7JFYOCAs/ShwwCQYHKoZIzj0EAQNIADBFAiEAwcJ6lRH6 -EhV5Iywr9VlmDsPDypEGIXMWLvw4Sbe+2+cCIC/TOweK9vmYiY2Y1ewAqhO7TGeX -9nTgmSQD2OBZrrOf +MIIB6zCCAZECCQCBokj/YZyrgDAJBgcqhkjOPQQBMH0xCzAJBgNVBAYTAlVTMQsw +CQYDVQQIDAJDQTELMAkGA1UEBwwCU0YxDzANBgNVBAoMBkpveWVudDEQMA4GA1UE +CwwHTm9kZS5qczEPMA0GA1UEAwwGYWdlbnQyMSAwHgYJKoZIhvcNAQkBFhFyeUB0 +aW55Y2xvdWRzLm9yZzAgFw0xODA4MDgwMTE3MDJaGA8yMjkyMDUyMjAxMTcwMlow +fTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0GA1UE +CgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQ8wDQYDVQQDDAZhZ2VudDIxIDAe +BgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFkwEwYHKoZIzj0CAQYIKoZI +zj0DAQcDQgAE66yptjRZ8bbNf8udG9JEI8pyCit8csm+uKqBfZPUpzo2nygLSMkr +nGYnDbMXnGGolWnxORWqVMDwh0kP2riJojAJBgcqhkjOPQQBA0kAMEYCIQCNYxzf +kN+8CF7ueZEZrQnTmefGvQBFU6x0xP6jTlzTYgIhAOfXl9lbCACFKu8jrIlH1euw +NL+pX0A4665uHg17kZqW -----END CERTIFICATE----- diff --git a/test/fixtures/keys/ec-csr.pem b/test/fixtures/keys/ec-csr.pem index c77a6562de07..629c42aa37a8 100644 --- a/test/fixtures/keys/ec-csr.pem +++ b/test/fixtures/keys/ec-csr.pem @@ -1,9 +1,9 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIBNjCB3wIBADB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcT -AlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMT +MIIBODCB3wIBADB9MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcM +AlNGMQ8wDQYDVQQKDAZKb3llbnQxEDAOBgNVBAsMB05vZGUuanMxDzANBgNVBAMM BmFnZW50MjEgMB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwWTATBgcq -hkjOPQIBBggqhkjOPQMBBwNCAATBfkJJWtHG9LR+jXCQ53dna4dMa++IZCWPElrb -Gf+1si/FRzfEn6AzqNgWQwcqAZh5BctQRAtG+yRWDggLP0ocoAAwCQYHKoZIzj0E -AQNHADBEAiBqnVIhsMk35UAXt3/dgIAKUpnE652YTQ4rgidrxgbvqQIgDXs1gfj0 -3HACt3JASAlNgFGGUYmmDvKTj/7H1gQRB7Q= +hkjOPQIBBggqhkjOPQMBBwNCAATrrKm2NFnxts1/y50b0kQjynIKK3xyyb64qoF9 +k9SnOjafKAtIySucZicNsxecYaiVafE5FapUwPCHSQ/auImioAAwCgYIKoZIzj0E +AwIDSAAwRQIgIggV/82bb/c0MQEOkfZKdOcsexsit3LpEs+qzF7BSsoCIQCti/XZ +EQUMIPdE1qfPnrxSRqQKbNANDVtlkLkfAP/IRw== -----END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/ec-key.pem b/test/fixtures/keys/ec-key.pem index 85c8d08a8bba..bbabda235f5e 100644 --- a/test/fixtures/keys/ec-key.pem +++ b/test/fixtures/keys/ec-key.pem @@ -2,7 +2,7 @@ BggqhkjOPQMBBw== -----END EC PARAMETERS----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEINozA3blScV9x7C5R9RCaSqV4KOkrm0Gh0Qx7vr6VcnOoAoGCCqGSM49 -AwEHoUQDQgAEwX5CSVrRxvS0fo1wkOd3Z2uHTGvviGQljxJa2xn/tbIvxUc3xJ+g -M6jYFkMHKgGYeQXLUEQLRvskVg4ICz9KHA== +MHcCAQEEIPwpJlqX3faXUjfVXbNJ+YeZszQOgNW2pLpI9jrWdsJ5oAoGCCqGSM49 +AwEHoUQDQgAE66yptjRZ8bbNf8udG9JEI8pyCit8csm+uKqBfZPUpzo2nygLSMkr +nGYnDbMXnGGolWnxORWqVMDwh0kP2riJog== -----END EC PRIVATE KEY----- diff --git a/test/fixtures/keys/ec-pfx.pem b/test/fixtures/keys/ec-pfx.pem index 3a4aa7dd6960..f5e76a76118e 100644 Binary files a/test/fixtures/keys/ec-pfx.pem and b/test/fixtures/keys/ec-pfx.pem differ diff --git a/test/fixtures/keys/ec.cnf b/test/fixtures/keys/ec.cnf index 83ac65c00aa8..03bd5663c574 100644 --- a/test/fixtures/keys/ec.cnf +++ b/test/fixtures/keys/ec.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 1024 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/fake-cnnic-root-cert.pem b/test/fixtures/keys/fake-cnnic-root-cert.pem index ba0ddee61ea4..a0867a4f2a81 100644 --- a/test/fixtures/keys/fake-cnnic-root-cert.pem +++ b/test/fixtures/keys/fake-cnnic-root-cert.pem @@ -1,18 +1,18 @@ -----BEGIN CERTIFICATE----- -MIIC9zCCAd+gAwIBAgIJAMJ5SivqSZNtMA0GCSqGSIb3DQEBCwUAMDIxCzAJBgNV -BAYTAkNOMQ4wDAYDVQQKEwVDTk5JQzETMBEGA1UEAxMKQ05OSUMgUk9PVDAeFw0x -NTA2MDkxNzE1MTZaFw0xODAzMjkxNzE1MTZaMDIxCzAJBgNVBAYTAkNOMQ4wDAYD -VQQKEwVDTk5JQzETMBEGA1UEAxMKQ05OSUMgUk9PVDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAMwlKdTOPb+B0bENBw5+ZgnN2KxNhLBcEd0HB174fI1o -iE7qmbRObzSXT4HCmg1j8lijq3isnI4oMH9nCJNxZcdXtY7c3YXYoGtsVWAX++ZF -wYzakXXvDnHiaGXOos9+LuIRC0PZqyoYwZb0lvfyjPzIKBLVoCAAVTw65ankLN/J -5vJ44PzyiLmBZhhr9WzyyKVYNo2X7FLMGJtg8lz0vslb4ImNxumKmGyBijv730E5 -qEc6HSriNeH/GSO7HBkxpbt+1MDkg3RaY/uGABuWhtuGgT8PkYCRdsSypawG561j -NKs/Ny4gTBaQAsmnuj2wwUj0i4MQkQDute/Db/IY56UCAwEAAaMQMA4wDAYDVR0T -BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEARJG19V4/zOko/8eIVYeX9L6hQRNt -a6llIYPihQG29GdQsU+d0FqXba9N3oUD5kSF21F4oty7hWzLbBWnrKl66mXKNwWI -DjcYwjc2etThNEhud3jY2SreDx6OIFu97DW2oZfvBSTYrh1xastxuDVcBmhdNk4N -76Qj8s2X9KOS7nE+FY90ANwvckmHEAiq//aD5liwzCc8AYZi/JxV00YR7JS7Niee -y0M5UZ0AAO+P9DB+fkIRZcSodtmPa4Q3m32p3RgGS7TnNHsqDvRXsnrt+7YV1kBW -xrYO/iKGhq2K4bv6Z8JWUHyGyx7JEOFCJ25oWLYgByW5cJUE3xM4UTDzuw== +MIIC+TCCAeGgAwIBAgIJAPPMd48PUuAYMA0GCSqGSIb3DQEBCwUAMDIxCzAJBgNV +BAYTAkNOMQ4wDAYDVQQKDAVDTk5JQzETMBEGA1UEAwwKQ05OSUMgUk9PVDAgFw0x +ODA4MDgwMTE2NThaGA8yMjkyMDUyMjAxMTY1OFowMjELMAkGA1UEBhMCQ04xDjAM +BgNVBAoMBUNOTklDMRMwEQYDVQQDDApDTk5JQyBST09UMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAsau37tmHO9PkSzC8VAv9XZux2nauZtczAH6lUPhT +g/8Nu34qJscnCz3o1wMsloKrNFRPaXQTLBN9N+Cmc/F2dxMU4hO4Ww8iY8sDA6p0 +6CBj+F4gbj2HadKSpyd3LsEPAe1AwglqbL6MgVSHzghBoYKzlRPar1+P99ajJWJ2 +NY5quur5SbzrSJtywi3k0PlKYmdzxcCi6c+jUAvxnzWfXxGXPwRPsNttPu26yBGF +YvDvVMIVjQyAVv5JOsAwnU+1eI2P2nvZYdM6T1Hkup+DowMP/cpSnZsiKztVh0aI +85ED1iFt2oqntzcRsVMCBG6I2hBEeRCL8Z1XYC0MXr/OzwIDAQABoxAwDjAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBPLbqRREhVnRPklxdTHqZWuLVg +1HMkvk71tbccrVODDctpxMrXsVoqYGfk1Pz2Bcp8Vex2Ca6aUyjK8Pxvt3baEiln +8pj0VD3cyLofvJf6cbMWkNQYkuy0pHUOoY1vGtF/N1VfTfC5d2VLhjo7uf+rulCD +qJt7oDp6mTsIlg0ShSb+icQtfSXVhNnEVmWsAeIuITC7Zn8FNgp0MD/ye5G9CSPl +HiAoMM3w53bON9DjYnAc84xwcjLaN0hJHxZkZBAQT2ui+vUbjBXrNU2vUy2qhxm4 +O/zneEqCkc2uwqtXZzv/+hsevyHdNs7cO6AkRrZH5Rehf5ECEvMtdXUrV2Hh -----END CERTIFICATE----- diff --git a/test/fixtures/keys/fake-cnnic-root-cert.srl b/test/fixtures/keys/fake-cnnic-root-cert.srl index ac98e2eaadcc..3bfb1fd297cf 100644 --- a/test/fixtures/keys/fake-cnnic-root-cert.srl +++ b/test/fixtures/keys/fake-cnnic-root-cert.srl @@ -1 +1 @@ -AA466F0FFF621BCC +BD454137A992130F diff --git a/test/fixtures/keys/fake-cnnic-root-key.pem b/test/fixtures/keys/fake-cnnic-root-key.pem index 9455d4cea77d..5ec98d472e1c 100644 --- a/test/fixtures/keys/fake-cnnic-root-key.pem +++ b/test/fixtures/keys/fake-cnnic-root-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAzCUp1M49v4HRsQ0HDn5mCc3YrE2EsFwR3QcHXvh8jWiITuqZ -tE5vNJdPgcKaDWPyWKOreKycjigwf2cIk3Flx1e1jtzdhdiga2xVYBf75kXBjNqR -de8OceJoZc6iz34u4hELQ9mrKhjBlvSW9/KM/MgoEtWgIABVPDrlqeQs38nm8njg -/PKIuYFmGGv1bPLIpVg2jZfsUswYm2DyXPS+yVvgiY3G6YqYbIGKO/vfQTmoRzod -KuI14f8ZI7scGTGlu37UwOSDdFpj+4YAG5aG24aBPw+RgJF2xLKlrAbnrWM0qz83 -LiBMFpACyae6PbDBSPSLgxCRAO6178Nv8hjnpQIDAQABAoIBAGKGtS+98lNRRnEb -BoLaQkkNDjvqldXAOebhE4+kggiFoPPlihVZnZZWSMsprswzpq1dIM73EAAUKYPz -qFHw8txI2pl+w3Nr39C40mO0b6DtncJrYrT2kZQpX5VzK2TVU69L5pHypgeFNzmy -BoLYj28Y8y5T6BpJztlo25spQvcmUAR0PZmde1NJwjWTdxAlCeER+fvgJu2UsKpn -EEEIc5UGEdedhRLkQgt0Cu1FqeDihvr+z6upH467trmNhlTyrPeN3+FqRUkuqPvA -RdR1g7+fSRTku+QzrCq/tN2zyjVDwED2GGQs1fCOYOb/vSsIydIddqGIqdSdE05r -ZtIhGEECgYEA7EtwzIJAHV1rcB2OcNgodLx7/ratPIJZg5umGDfd159MkwzxcFjz -lxiu4SjW8s+83KgZ6E6N4ZsekJLz1eI33gGGK4XqGBSHiQe+A8WnQeRJXCmT1nzx -23LjE07sJd42l2byPejF+dBRQZF71pqsjTHLvn+jJD2CakdaeozEpEkCgYEA3Stg -L7DqSjPBOaGpFR6bZqdJhYG4/FVIVN9sKTfo0CqlNHrqjIeL8RgTSu+PYJTvIF2B -NfUjTfsxGfLKKBIHR+1LRMt2rr/tYnvr1/kwAAw9zYaugNiZ/J4BPLCXtN4Ahj4t -2d2Zbyg/bD3ppmT80LGnzJ3oQhmQVC0nuv8PMH0CgYEA4zzVmEa2Q8cgWCyEXC70 -EPdmQxkIVkWAshkQTQAE3qR6bnwnAAT7FNaO70doFxACLy2V5JsOxOR5K023Inwv -f9d1YQuiiU/M29HPQS9mXu6cQf5WBxIXQRQmHd5rKSue0lEVKsZdBZX5XpX7QvFy -eUJnDqcOi/5/GZfPAkW3ockCgYAa+/vUVcWAIChnG65BgWZ8c9SokVc8kjss/8V2 -kfe5zjox2P1c//y3AbT445mesw0p6b6mEq6oCQnInLLFiM2SnQUd86UbVRdleLEh -vKl6mAPCW7hWyBahl7WW7gTUcHGn71YwyrS5tzNlxXgIcTHXVJWghXOc/Pl7C7dZ -PV1hEQKBgQCnJQuQ1fb+w9O+P2MKdZPD/ztrghIeIyS9X90GuFWPMCWlIO6gaF8U -JY3BNuiahAhxVLcnaG8mNCXARPGCRGYDwN11vv/jrUOH/dXbd1bwwUkHfNu00w75 -LTHh1YKab/RifALc5k8mGWNIuZWE8xqjKOrpyNiX2VKwhglrJ1NK0A== +MIIEowIBAAKCAQEAsau37tmHO9PkSzC8VAv9XZux2nauZtczAH6lUPhTg/8Nu34q +JscnCz3o1wMsloKrNFRPaXQTLBN9N+Cmc/F2dxMU4hO4Ww8iY8sDA6p06CBj+F4g +bj2HadKSpyd3LsEPAe1AwglqbL6MgVSHzghBoYKzlRPar1+P99ajJWJ2NY5quur5 +SbzrSJtywi3k0PlKYmdzxcCi6c+jUAvxnzWfXxGXPwRPsNttPu26yBGFYvDvVMIV +jQyAVv5JOsAwnU+1eI2P2nvZYdM6T1Hkup+DowMP/cpSnZsiKztVh0aI85ED1iFt +2oqntzcRsVMCBG6I2hBEeRCL8Z1XYC0MXr/OzwIDAQABAoIBAB9q8zKcasqMlLEr +JBJksGAOOSwdkoeDBHTQ8GDaGMKdposCK2gCDYhyYSssV4UiBC5TvlsyeHVx2NG5 +uxWDnGRADpBP1mjby0QEUTsjuFqX57Wyx19XKAvxfZdrZirxXrsDflERoy0poOT5 +0q3/TcPGvgTdpu0eI/I6lUz2FVsw0SuXf9rH6oTKylPo0sXGOFkRPQQpGNS2aTi7 +CWvwGyfgmmAt4MNQLsjiGqBBCr5nHqxzreUDg1TnxlCDNUvr/5p6wFOzaPfnAW+5 +1vGOZCf4M9Z4CuC+xNjbIzhr8tm0F369sNBkq/fcB+X+7nZgmLejrofsFgaCmWyG +wBSajWECgYEA6yHiG/6NU/2Vu1zA9IcLVHe59yImWaNy01brtf/lKq/cU/pwhftf +l7aL0D4YWMSykTmGaJw84YNaSdM08i50Z9vleSjDP3nbcKjF3Lna9xMqlxac520h +kT5wXQSnfu1VAcRihNXoD7uvOmnZgFmaCvHSu05BsIljgAYMAMMOaBECgYEAwXBU +iNwfdW+Htn9EdHCFUWgirAkD1P9tLrayIic4y6FzjPyaTkQp5oS30AXtWzIpIzO5 +GCwAw0m1d0ezaFWwkdZNrc0j9ymvnMq5Y5+K7D9Xj085OqmaBnOboWARorevF5at +wZX0NTqY6/oTSU8iLhGsF5FKpmwfPxVhpRpoqN8CgYA+J5rJo6RgS2xFNuOawAfy +sCNsfI5+q4Iy84sjdR1zB0HKwSz1fdlrFUooJgHxlS1OzlIFXSeKxVococQhML58 +pdgnCutx4Bht029aRZboMRzVC5k2Y9a3ujWhoRVVrA8IhI02aAUMA6TyYACquQTL +V9lIwgsDS44NzYtmuCkawQKBgAjDZwEAP+iZEePhph9ETbXfatqyWdsXa0HXgwBr +GHaZLNvxQahUDDXmQ1GIQzWDczumBzeiHrK6Lx9lPyp131bsB37dMUjsOYl34agy +vR9wyy2x4BzZPCIYsK9B4+qkOalu6RZBDdwveGgQXzlN/XVq1YoHygL6GPxJoq/R +H3avAoGBAImi0V0rvnSmfSwHcmc+VKwhYTuHUPwcEKCitT06fRJdBohh/HWu4zNr +KDHZrqbZdoRKnnP/CNK82Bb0s9jB506b9dp5z3L0aBM5xfQyRVdgm3T7nUDeefsG +wg/7hRHk8gZrwyE6LbOscYIQfh1yxl9xpisJqKF+CnKYXqI1/gzc -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/fake-cnnic-root.cnf b/test/fixtures/keys/fake-cnnic-root.cnf index 1d9573dfbe46..4b88c233aed9 100644 --- a/test/fixtures/keys/fake-cnnic-root.cnf +++ b/test/fixtures/keys/fake-cnnic-root.cnf @@ -1,6 +1,6 @@ [ req ] default_bits = 2048 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/fake-startcom-root-cert.pem b/test/fixtures/keys/fake-startcom-root-cert.pem index b3ebbacf753d..ef5efc63525b 100644 --- a/test/fixtures/keys/fake-startcom-root-cert.pem +++ b/test/fixtures/keys/fake-startcom-root-cert.pem @@ -1,22 +1,22 @@ -----BEGIN CERTIFICATE----- -MIIDjTCCAnWgAwIBAgIJAKDrU4iaFPb+MA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV -BAYTAklMMRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUg -RGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWduaW5nMSkwJwYDVQQDEyBTdGFydENvbSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNjExMDQwOTUwMTNaFw00NDAzMjEw -OTUwMTNaMH0xCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMSsw -KQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWduaW5nMSkwJwYD -VQQDEyBTdGFydENvbSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBALvhAZtGU3u3uyB4lHn5X85XJdyPAnOY0hGc -SVMzfQ/BBEvBPkcdhJvZPLqcWTnJplsJXH+GHz9q73DbyLekdF/f6dNVcRmDjvZq -pZ6KgT8D4GmudNPMEuHs9+bqI+l5p7Mh1mEmot5JYtXvGD3UiN2ZUQ/trhf5xiJq -MEaiQHBxhJESkY+RYV2GK0njCJ2ypmtAAzyGUlNgHqxBy1PrBBqh0xbSOa2pwRyz -9u7EkYN4BCQKNCBJbOaX9rH+j836YlEHEymutjYDuYiHaOve0yJCHsQqsx7+p9aB -UxCS9mTj9q9bz9GJR9tfT04+HmQRjtSZYt7fHIixgS0vT4/6QlsCAwEAAaMQMA4w -DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAiIgJ9EGWepY/Qk6n6Kcj -YQFZXeV6ugnWz96sxYc0xmo/XNkYQFLxVneyWanlUxAbvScEdC8rJ5rUrwVMhfaS -goneP2Otjcg0XcMrsf5RaJk0H8uGUdvdgWUHO85pseMOFgqXxJgEux7wcFS41qhw -thc/obZ5keOPJf3tsOffV5OJc6owwgaviz3RNFRJUleZU5r3swjWIEDK89sz9q+S -qcwostbKRrEcjyltblhFKR9s4Qyn9FYWntPApFHq7M0/jA/4iiHRcltFfc19mslb -lhRBZZ/vds3VEtfs7uPhcodXBTv5d5xUk6pybSSFhKTTtHc8OpdvbM+5LchzTc23 -pA== +MIIDjzCCAnegAwIBAgIJAIrO+pnSbEnMMA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNV +BAYTAklMMRYwFAYDVQQKDA1TdGFydENvbSBMdGQuMSswKQYDVQQLDCJTZWN1cmUg +RGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWduaW5nMSkwJwYDVQQDDCBTdGFydENvbSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAgFw0xODA4MDgwMTE3MDFaGA8yMjkyMDUy +MjAxMTcwMVowfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoMDVN0YXJ0Q29tIEx0ZC4x +KzApBgNVBAsMIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxKTAn +BgNVBAMMIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxAFEAtP3FDgZFZbQdykco3OhEc7u7JjY +oOQ8ivKAM26ldDV/WCC1ddFeVDQw6qhiPysCmFAJuz/m5xTwJTF22Gs6GcuBnhwQ +Kqu8bBKHP8GRu7i/NxdiN5mPCvj6FfDKyOdgu6pQMxWSVBrgJPPJVpZTwrSK7xmk +tjZty5MU8YY/Jw3KIZWEYuxu2UuyAm48bECCbR0hssIFL/Y0riFAgdDwslJugA1h +mLa/ogpLAU3oixLlqIhDJ6o6RnAE9B52Os/kjjuxiW/eLZT7/1y3uuDGpqncCZ8F +hZur8uAqr39m0tvdL9VZ2+0yU8EmbdQ2/GVxAfKUHFb1d67QlRAwbQIDAQABoxAw +DjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA76XAf5U198X9aGOox +CiT9UtE+qMUFikWg+sXevCh2WWdMfEQs9o8sariQpd9pIXDGxrqD2bSHEdMNQ4/Z +LQ2ZudnJ0u0EOhEqagpU5F9MV97ScV4/IAfd3O/quphRhhJWSssIvO12I8IPzkL5 +O5K+K/RV4LiXiyOPK22TNpVZbQfrs6qFS1HX+x5Y2CEpIxk74354j1WHxe0EbkPf +q3pEYtOrJwS3MHVBhx3rsoq/s7mIXi9cAGu1QyibTORMyuWXQE2W2rZkhs53vzqv +OZcsg5NYHEFxYfluLYN0thQ5tA/dRizqXxrx72LZqBeVvnG9NK+DQVQIBelXQmQD +rGui -----END CERTIFICATE----- diff --git a/test/fixtures/keys/fake-startcom-root-csr.pem b/test/fixtures/keys/fake-startcom-root-csr.pem deleted file mode 100644 index 56da4e65b4a4..000000000000 --- a/test/fixtures/keys/fake-startcom-root-csr.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIC5zCCAc8CAQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0 -ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcx -KTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAww1iG1Oq6uIEN5u4W0jWnDFvaKGp -R6XSYPK3D1VJTqr7XUfzbVG2Acc5B7WTmerFsxOADXe8kpC3U6QxcyLvMv90Bpju -dasttLnoBU2XqJxWTpmJyM8RfbSZEKfNIdKzG2uQQVHIJOV/bm6yhQIT2cDKNZDx -M0OPiCeeQMezD4/Y98zFDyWjTI2zW6kyBzdjPSLJ3DMJs+4EC6LJhKrp9kBbJHhU -QdIrQ1C3ycJ0lKv8uV8xWsgz/CsPkp92H/iUDxBnFgMcdFmgt/XgPDf1Q9ipfq7B -5Ef8RlQuDsqer+/UPOXLHWHtE+5QbkL4hzCjJEszkl5QbSPdiK1rcIkEvQIDAQAB -oCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3 -DQEBCwUAA4IBAQCwvK3cFAA9ShrFNhSuZ//xFgrXxqQXS4o571jDCLYh+QAgcRUU -ATPM0GQ4CKUR3gWD14Ji922PiVZCpKgvkEVrvMYq6jgydT2urki0hL/po7msdnLQ -2FWMwgpINaTmhmUNBxHBQbopW4HWDzcCfSQwGN/iCElNmawXGIN1LRcDAl08h/cW -hTP9agZXpmoZ2wHg+ZRHcJwJm4QL4Rm7JfyNN3fZWUFgn3Pfkwgiu9PMhU92KRU/ -5PJ3tcyw9qSQJsw6CPuijRI9kaKdFIj6BsOGmsSyYq9OoqtlfqXqgXXv3XfKQmmh -Hntg6KSQhReXDHCSTgtBZFa6+kwg3mgr8I7N ------END CERTIFICATE REQUEST----- diff --git a/test/fixtures/keys/fake-startcom-root-database.txt b/test/fixtures/keys/fake-startcom-root-database.txt index b1f582201ae3..e1adbae3b0af 100644 --- a/test/fixtures/keys/fake-startcom-root-database.txt +++ b/test/fixtures/keys/fake-startcom-root-database.txt @@ -1,2 +1,2 @@ -V 440321100639Z 01 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent8/CN=localhost -V 440321100702Z 02 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent9/CN=localhost +V 22920522011701Z 01 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent8/CN=localhost +V 22920522011702Z 02 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent9/CN=localhost diff --git a/test/fixtures/keys/fake-startcom-root-database.txt.old b/test/fixtures/keys/fake-startcom-root-database.txt.old index 66c1d034dd47..8afe3bcdf5ff 100644 --- a/test/fixtures/keys/fake-startcom-root-database.txt.old +++ b/test/fixtures/keys/fake-startcom-root-database.txt.old @@ -1 +1 @@ -V 440321100639Z 01 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent8/CN=localhost +V 22920522011701Z 01 unknown /C=US/ST=CA/L=SF/O=NODEJS/OU=agent8/CN=localhost diff --git a/test/fixtures/keys/fake-startcom-root-issued-certs/01.pem b/test/fixtures/keys/fake-startcom-root-issued-certs/01.pem index 86de1d44a64a..eec8e13a85cc 100644 --- a/test/fixtures/keys/fake-startcom-root-issued-certs/01.pem +++ b/test/fixtures/keys/fake-startcom-root-issued-certs/01.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDUDCCAjgCAQEwDQYJKoZIhvcNAQELBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNV -BAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRp -ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5MCAYDzIwMTYxMDIwMjM1OTU5WhcNNDQwMzIxMTAwNjM5WjBdMQsw -CQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZO -T0RFSlMxDzANBgNVBAsTBmFnZW50ODESMBAGA1UEAxMJbG9jYWxob3N0MIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzkVSP6XxWpBlSjqqavwOhpp36aFJ -qLK7fRpxR+f0PdQ9WJajDEicxwKWGFqQBE+d5BjqrAD59L2QGZQ2VOF9VLZyFz3F -9TIlkd4yt9Od0qE98yIouDBNWu7UZqvNynAe5caD5i1MgyIUQqIUOnZwM21hwqYN -N/OESf38A8Tfuvh3ALUn7zBEVyUPWIWTYPhFHSCWIsS2URZ/qDLk8GavphkqXdFB -ii3V8Th5niPtpIsRF6Qhwh8SK+s0zh53o0qkmCNpXLd/PJQQAwC70WRq7ncL4D+U -C1gnDL0j9SzojXQu31kXs8UZTa7RFnx5r+gDiA/gGrLs4IiwDJhVHMx0nQIDAQAB -MA0GCSqGSIb3DQEBCwUAA4IBAQA7iMlm+rgZnlps+LFsoXG4dGNPaOhKI9t/XBrO -6O64LLyx/FPIQSaYi130QNB7Zy0uw8xqrH6cGRTJ9RCfBFFP4rzgIX3wEAHnmwMr -i4dGEixBUIIjhw6fAVxAhrkzmgUpUt0qIP9otGgESEYXIg7bFkXIHit0Im1VOdvf -+LnUKZw9o7UEesKIDVkuAsjoKKkrsO0kdf0dgAj6Ix5xmAtBsDvkH0aOSdPfTZG6 -LQrnZf/quBotog3NmDzrvQaH8GNpTJcYNjKlxD2z0PvQUyp0FD8oCC+oD+EGv2zZ -65scEXU/n8kTmdJkCjx4nb39HttYzOlNlTgMxAfxgL7A/PcT +BAoMDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsMIlNlY3VyZSBEaWdpdGFsIENlcnRp +ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMMIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5MCAXDTE2MTAyMDIzNTk1OVoYDzIyOTIwNTIyMDExNzAxWjBdMQsw +CQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZO +T0RFSlMxDzANBgNVBAsMBmFnZW50ODESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwD0j4pL8gbhtpmcKdPo/Iq1HpuZi +VOTjk16e/AfBXjvZoUg9lujr/Mw4X1+X56zfr05Y3+Pyr8euVf/2t81RwvqyjB84 +xFKrk3wBnciv3JodbzmL3aKqVeAwE2O3DSvcR/yaTJtW7EthnDfvaoUwSTN4zpZA +c/PMVpPK0LWZ98vjIdQ7dTOFTLDmawtVxWouX7VPdo0vtYe3/DnzyTojhWQyCL68 +KS9AeWc1opYWmjLeHhOBC+8ovfPRBd9/kjZX0SsWRCC3bKqmJJ48/QTJe2jQnc1V +ERgiWy8SCS9irPDJpqGeEXJiAhCEfZGqZzjW+G34803rBGZCW3t8BibtPwIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQB1ixGtVRFWh3BGT096vdIhOjg/v1c8RZeIEgex +/GKGxcTq7BnQTh4QCTIvcgj/x2Y3RVpKzjF6OCMgAxTeY8cq0uSxrJXAMtpEyOaQ +izF0AwE0baehEY14VlYyuReZOcjVRoQOkNuDUa9lgmfLXQPMvC6rNnpRkD1mt/ot +GBCdHEAGcQNzcRcGVsAFDf9X3Jq6misskbsq/m+If/XXaIiGvT71XsV3CQYp+RF+ +QjcI9bjOOKwb1V7iGl4BBIIDdqMAaLPdKLymYKGglmWAtwwm5n6F1ViOoDXi1VnH +vai/7152egBZ0uoB/KumTa2LpuJUAGQ4b0QA6wb0v+JuOaOG -----END CERTIFICATE----- diff --git a/test/fixtures/keys/fake-startcom-root-issued-certs/02.pem b/test/fixtures/keys/fake-startcom-root-issued-certs/02.pem index 196922986cdb..520ae4fde95e 100644 --- a/test/fixtures/keys/fake-startcom-root-issued-certs/02.pem +++ b/test/fixtures/keys/fake-startcom-root-issued-certs/02.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDUDCCAjgCAQIwDQYJKoZIhvcNAQELBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNV -BAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRp -ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5MCAYDzIwMTYxMDIxMDAwMDAxWhcNNDQwMzIxMTAwNzAyWjBdMQsw -CQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZO -T0RFSlMxDzANBgNVBAsTBmFnZW50OTESMBAGA1UEAxMJbG9jYWxob3N0MIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApT6nASSx9e2i/t0aHSd9BxMRD92o -33/iaiXWzBOKMJp7jxCWAg6SnpjrFsyjTxaAqg+e1zlm10YBT6DholstffzQqK2x -TKGVOQK4jxX23wJlrn5mDk0fagBtY49L1KFy8DxJqKgt7uxz61GGUWwKWXG7Vnga -bkqDd9o3ZF7bOq7mMQvfDzPrwYI8uTjTxR8R19uxNNOGtHMTnwvDeczTmtTox8U+ -4N2hN2scDZvRBx5aQAtnXRyZhAokAJMYojinx9iqlVFQi3ct52LIhsca6ympfDc2 -0yA4aSVfoW7NlqsnvrTOV4nt3UbrxGGpiE7Em8Hdcw2EMF+jqCTLGtsqYQIDAQAB -MA0GCSqGSIb3DQEBCwUAA4IBAQCMjKFycVQh7Puz/FpQh3NhJ99Ic3rzr+3nAKFD -4Kcl3L8szH3zjLCw46/y2jqPiAbg2zg9miYkI/2W/G+m2VQEQvp2SwjVr/Rj2Soe -iTonruUpDFF7LG01q3kpZ7nYWRGvVgn5D9BGk4/SWuzxiWRdwlzJf2e8cXLExVS0 -0CgRsb5nRoZ+RZmVIrGMfIi8CI7uTlcHtQzD7B7gpHtOSMlQoSSeqOy6F498duvl -QhhQhJBxmjSegw/lawWQSDFArJimK/rwyb6ZFbRfBgg6o/k5W9G5l0oG5abQMp+/ -u8Fd+QUNwR6OovE0AqL6wNHCnqzNnihTL6/hRVer6i5Hfxmb +BAoMDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsMIlNlY3VyZSBEaWdpdGFsIENlcnRp +ZmljYXRlIFNpZ25pbmcxKTAnBgNVBAMMIFN0YXJ0Q29tIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5MCAXDTE2MTAyMTAwMDAwMVoYDzIyOTIwNTIyMDExNzAyWjBdMQsw +CQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNGMQ8wDQYDVQQKDAZO +T0RFSlMxDzANBgNVBAsMBmFnZW50OTESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1RfsIHFH/58sMeDPPkKCj4sK4ujw +jiSMLi/vuwBjK9h/LtnBZ0wd5kMq9J9mFtQe21dqb4f+z2G2ZthziJ7GHDpJ7WEf +HQa6cEHrk7Tct3XpyGYMvLmSHD+y54U8cO/K66w0k9iZvTiQ1eJxdaPkoQsdqinC +Z+fh2Icy9tWbGatwtddizcGFM71a2vJjcg8Fnb/X/D/fCbF9L8hl3EVqWSs8Y+BD +gIiJqdnc/R9RW8T8W1QeCmkuX/Nm1dJqLF5fNXP8lMgdSMHASTgPE1v5OJqGpIvd +wBYOuYCaGvjplsS+isBh2sDA98SgmL35GGHWiNhZIQkVMKzjgiDkKKU8hwIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQBv4AYF2CfowizdqeL9vrDOSxMQAowxAZWLsixC +RHfzkjPaaN0t0dApEIdttzmmif104LuK8lqQe9zvG/F7kh4Mhj1cfaJZraNbNprL +QHnnV+sSL+flSJfkSmSkuu5Cn78g72qnERqzwYZKHIBnMQhUf6yUmHxmxQlJDtcP +kNCX4vCkkC9MW91n3GDXpSQX8KkSIP+aP1kHqHkWr7mh7du9p/E7rnI2UfVcXg0C +db3eSDVq94e41HK9uWQgYRLLMz9OSnMmOgfK21o+eBWaHb+07Wo87cSPzuGVBtj7 +0DueLUdvSpliM8wZBIf6xzTdF401VinLZfFGyg6pYM0ADfda -----END CERTIFICATE----- diff --git a/test/fixtures/keys/fake-startcom-root-key.pem b/test/fixtures/keys/fake-startcom-root-key.pem index d8f727d2be67..24e45004fb5d 100644 --- a/test/fixtures/keys/fake-startcom-root-key.pem +++ b/test/fixtures/keys/fake-startcom-root-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAu+EBm0ZTe7e7IHiUeflfzlcl3I8Cc5jSEZxJUzN9D8EES8E+ -Rx2Em9k8upxZOcmmWwlcf4YfP2rvcNvIt6R0X9/p01VxGYOO9mqlnoqBPwPgaa50 -08wS4ez35uoj6XmnsyHWYSai3kli1e8YPdSI3ZlRD+2uF/nGImowRqJAcHGEkRKR -j5FhXYYrSeMInbKma0ADPIZSU2AerEHLU+sEGqHTFtI5ranBHLP27sSRg3gEJAo0 -IEls5pf2sf6PzfpiUQcTKa62NgO5iIdo697TIkIexCqzHv6n1oFTEJL2ZOP2r1vP -0YlH219PTj4eZBGO1Jli3t8ciLGBLS9Pj/pCWwIDAQABAoIBAFOQL2O9stH7FTrL -Btb9iJRBBLEF1oRNu1lj1uUvqHdCVUPQbn+47EtZIv6pHbJrMxeYoVCC+hD94gOj -bbHobm5aLCj3/rbnYcXOB13torDBa6X1lzbAtMFR4a0OBO0KVAGDklNhmN0fbNtU -XcbaagmN8JUSFPXK/Uo/SruP3PNldfPVtf/EnBlK4LOI5/WDyiwLQxlVf389poKp -wXwhVgL9Kh0uzxD31HH0NOL+D1KOI6j7gNrOAOZFFGTwVAtQFI28wIwftKf3qicQ -TZvV/O+Aw+oIZsOfX9Pg6dNehhEC25F6UcGrX7b7fI/Rbx6L/VxfjMHfbvsUtTxz -iwW1H5ECgYEA85U2LiBicAB4QkclUHjLPrPl7W0bDvKFKJkxXJ44y/ziFjOhksuF -J1xYXhVhP7mdXwGVlt2X9PSjkW06I+DFqi2IbGDBqJ/0hJrAr/+5J5OySCFlx2kC -TwIAYJIud0Vgk8FdToijOKq8I3KFmUsc6k0UMmCdCy4HXz0Qy3RqsekCgYEAxXTZ -3orr/ItfjVFz9bkcNUMutRVvsyewYJOemgaejdSHLYl8lTcLQDLSnA/Sd7JtXOyS -3M7GVpiBZqW15UJry5fpkRNhqOXqXz6/Hp9E3hG9RnS2EkZDR2vIrRwa3o6zKq8P -XYOOOzjdYq881khhRhafXCon0XvLdZAsOKfDQ6MCgYEAqsDw6Ej/eLB7nUqul8j2 -AZCvIE+Z5lKQkjNB7UFlY2p1O0cafwN45mzP7bRjJf8CmPVNXiMdQTS17V56oWgS -aQfeWMtDNuhayxKI/Vfw/hOFqRbweGfenHA0v336YNYbq7ijpkgW08SsetTvXtTP -AljiTaZ4sLulo1f1jAqiOPECgYA1CgJL6P0ixT1RdIO1iZeuJvGw6qUqdorGJmD/ -9q84YdI9xSSV4EdBY2V3Tji2tlLyFwoMDe7w6942eGS3xHO4KIIw2gftmnSuSOiF -jTqufA1fk5IkroL7+FPbTCVbivFNkeCKuf/GoKu3CmNJHAAlF4aO9zPi7WHlnmiC -f23QCQKBgET2u4cPsUAZJ8utCyQ+ZhKJUTcYDN/Nlpd/yVC+dS9BZAc2tH1EfRN2 -pxSzm9Qgd6Cjc7cVJ/T745b85nbPjd1MsOgvPCKr0TFARmlGpu4RtKEHrROSaahX -7vR7HiYqhbeYlVRz9lZ5N+J1BT7sq7+Rond89UtL/O7g0wEs/N3V +MIIEogIBAAKCAQEAxAFEAtP3FDgZFZbQdykco3OhEc7u7JjYoOQ8ivKAM26ldDV/ +WCC1ddFeVDQw6qhiPysCmFAJuz/m5xTwJTF22Gs6GcuBnhwQKqu8bBKHP8GRu7i/ +NxdiN5mPCvj6FfDKyOdgu6pQMxWSVBrgJPPJVpZTwrSK7xmktjZty5MU8YY/Jw3K +IZWEYuxu2UuyAm48bECCbR0hssIFL/Y0riFAgdDwslJugA1hmLa/ogpLAU3oixLl +qIhDJ6o6RnAE9B52Os/kjjuxiW/eLZT7/1y3uuDGpqncCZ8FhZur8uAqr39m0tvd +L9VZ2+0yU8EmbdQ2/GVxAfKUHFb1d67QlRAwbQIDAQABAoIBADkk8VItwDRp4o5T +yPVkzA+vb39EqI3cRhQqVqhf6RaVpLFLw5PK/XybDPhZuwU/EF3ASWJku2GXUNeA +WD9Pu4l/QZIxrdmN7vyx0x5jDIF/CuEDDOSf8aeqInUdf7QT3ttR8fbkwbsTB/Vz +XHQJi2KuMz9p6bOp80aYecxHVmzPp0oWUJs8/3pnvgM/5r4/25CC+rbHD1ji2FN0 +YHaocebPwBWl26bsu2WoLFGKKo+tbkLD3C0qlirn5oFGNOokhexkHH3xXusJvSuO +o1E0KoMIbFod06533fSiRjHplgrDsRbAKGe8ZvB90aWjWIOpMlqzYBfOcXsbLN/O +d/5hwdUCgYEA44haw5ZbljqtKpuJJprSl06TusAZoe8GeDHeqzsN6QlZDhiID+01 +FMADk9570Pby9qMUV3cQQkMc05AiKRSTTea0/lZT/bmaxGNrxdbP9TU0R+zx6zBC +QVJQsixa5f0xlYoNjal1QMFaMr0So45XTgOuhJaBxkLr30IETsHWHq8CgYEA3Icc +PvhEMngqJTYHwolSwtd1/dkfqRXf5bYsmZt48kUyq9mpH9iT25KXu1D+xBTHeLCX +TzigaHfI22iLb0MxmlXR0EIJNpYk7LNfh5hPuKiM3rreTXsBMnzmUSts83+fPZON +I7o+FZTc9Gv33U+bsvAW9v0LoVU/1mhR9f1hiaMCgYB5Gby9NsyeQ7Kg59Fyg5qs +P30vO0kpP+/gjyJlXnQD4R7N+s6IM4c5+Qyuag7aZGViUd/kwZEcw12XWLJlzPat +0qnoaIghleTCu+vDi5Z5ewzNb1Y/CBtrauVaP3NNz5nRbn3SNSwcAA0CzlEaTgs3 +kYwUM4r0u++QjzF9vXs6LwKBgChDyxZ8QgdtBVTx/oy4ghHtQS/uOuemhNDuaEpL +ptOlatER1t1nr+eBZo7fBQVMPfd9VsMyNaedZ2EYP407GY1yafK6e/Apjehh/+lE +GBpBPCdWu0wuT1Omlm7vnN8AyFR34mdJlBhgq888/267IFSVnbvPDBaS+CrvtTdS +4kI9AoGAYsfsGR5Otgsjrxp0Vch7NiLOIyiWikWPt0DMp7TxhTaPNum2Z156nPI8 +eNHuyKXEvmcq/rGWa/hIptZaXmApUMsfORMu1PJPihBybegZK4mM0RfeLgTNLLhq +KiuTtVMwwnmCtd67Cw/jHs//tQBeXLPCBhstvisJLd1ZFTAB1nw= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/fake-startcom-root.cnf b/test/fixtures/keys/fake-startcom-root.cnf index d6a9557bc877..ba92892108db 100644 --- a/test/fixtures/keys/fake-startcom-root.cnf +++ b/test/fixtures/keys/fake-startcom-root.cnf @@ -5,7 +5,7 @@ default_ca = CA_default dir = . name_opt = CA_default cert_opt = CA_default -default_crl_days = 999 +default_crl_days = 9999 default_md = sha256 database = fake-startcom-root-database.txt serial = fake-startcom-root-serial @@ -26,7 +26,7 @@ emailAddress = optional [ req ] default_bits = 2048 -days = 999 +days = 9999 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no diff --git a/test/fixtures/keys/rsa_private_1024.pem b/test/fixtures/keys/rsa_private_1024.pem index 1ef8d3a70127..e4858346aa6c 100644 --- a/test/fixtures/keys/rsa_private_1024.pem +++ b/test/fixtures/keys/rsa_private_1024.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDOF+YjZgVg8yGFS+++0WVcTKms1Wl2Lbnzj7jWOPyZnXxww7cE -afiL3QI2RZCiVwBcueUejCbzT5iLrsWceryOCHZE4nQ5IOEYCpPzWw6oTfSM7HV0 -axQEpSzJFp20NJV9pVvBmSrrrdlGaDwHY1nlGVB3s2CKTAVxcKWoD6FhVQIDAQAB -AoGBAIoz5JRgWcMFx7jHj2H6sWoPzsij5DDnwQbfniep11p8DXLhC93d4lqIPm9+ -ftseVJPZ5RdzDLuk6Lri3IlulPnEeJZrfYQVlfge6N9swQ54j3wRGEBjcP+7pu7Q -nQ5FpOyJqQWWMUinf+o1bEkClIBPTY4x8pIoCM09wSvD9weRAkEA/hWym3rDwrcu -pKvb1VgWZtrrCv5m+2Dk5V7qA+9sUyI9Lq9dlklNMcbuJXCy8Evd2Q3EMySYQGVc -cXEKkeKefwJBAM+ll95tMX/YDEYAtOf3stz59rC4EyuD2kOZJt0dPj3vApYYq9+0 -Wnd0c8VOzJGjpVI21SY+fA+doMiZVVjSPisCQCD0R3oK7iDvCUmqUJTXG/CzLBD8 -9fZcltN4//kKsI4Hvs+zRvwa/bwbBQAuIccwz9E7C9tmP6j6fIbqFmjdb5kCQCJI -MJ6kYHu+66fTDgsONhWNn1Dl0yRoDG0EqAnxfgkzoLWvNREl8ZmvPD3jGJsi7XR5 -YQ+DWXAqkhUMW67iZykCQQCgZdOUkAWu7NsCfGSTTvrMapa5PAt/GPDzzY9JGGif -p+09SVdrnphr+MX6MCnOsixPXrMtg/LLhpQkwjVetm15 +MIICWwIBAAKBgQCarMIyITT3auLmJ6TnSmES908I25oHPzFK1W5YbMfs0XYbMk7Q +HUkkKo/r9E+FQgodhkyPugZznZLEliO48DRc92UGh/7+WQwoAVXZwsxbvSEkPxrC +wC/DGvHJRTG1WCF9MuAYm2bdkcV0Sm99D5e2JBAANUXy6uZAmbo96aGBJQIDAQAB +AoGAFz4OkGndA7DUF7GtXfQXUjpHbhVRt/UO+yfHRRJTmIqBLOUKYsuDyiN7LQGx +UVzzGCyuJIrXnVf4TgIhrBCsTXAuUe3ZtkUcTZkw82ISltHDGF7UWxRtk97hF1lv +5mZ5AcIjNYKZefNwZhTKH02aaK8gxzg1/GtWxIn3aI0n/aECQQDLRBhc3qCqYKxJ +Upkvzmf+828qOBUOM0Fnl5erMICpGyS4WJYtNpeGaNn4Ewxyw7ePs/Ekti31TJdH +FXTAepEvAkEAws17rnaQChsWgcXI6wMgwd9AKE+ZteunbwMaqP9Wn6atc/QTBTHR +qplJtLirDonMAUsMix+O2uX8fPcSqQi16wJAIVKwi8kTndrrY7ne0y+LbQiLmOhI +y2MrvcfkXXQ+I3sHshETzaW9gZN+6GR3Dfl4Bl8BkXssXaKIymaCFWwCkQJAC5nv +Nrmq5F8unPXpfE2IYuNnz77F2ba6FvtpWA003Hcxt0ke5N1NrkpIwHGLBmegdadB +jPuJJ3Iw8kRIoTZ6lwJAeTkgkLsoBVXtGOf4lgfzHfd7e59d05clWLB3x9p3eNYe +4JPSat6ULOSvqBdnoGQPRhGpzlhXcsGc+od9Oc8YxQ== -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_2048.pem b/test/fixtures/keys/rsa_private_2048.pem index 7ff76a493328..19974540bba4 100644 --- a/test/fixtures/keys/rsa_private_2048.pem +++ b/test/fixtures/keys/rsa_private_2048.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA20oG4U+MsV45A4zG0ySoavFmWmdkVtmKh1Tk9sC3V6Fu5w1v -44lZDa57n+ghEA9Y4txUVQzm3TppwBFqUB2bBZrAhAjmjiPxjECGTV7ABaAQyihJ -R0F2LL1KmdlduFXACvNCfIseBoOY6K49vrW3/rVC1gBQ6/S3K6jECjGAvOyUcIAv -ch0YpW68v12AOUMI+CpzRQdMv6akbOVt5Qtg1vIvv0lIuirYcq9MWS++oFvHrxzX -qAiAfgc0truwbW5Lz2w7Wcy0pBYeVW6HvBFPwUEV/2rn+RHrbgE9yQ+p4gDkdfHV -yuMx21Mf449UwQUuI3HZ4BPqmyWkwSEYsfVYMQIDAQABAoIBAA9GT8Zf+SfdrVD+ -/FZ2xjh0yjFf5FBcZNbaZfx+Hgc/mm8Ds5iA17ApSDkyPSNWPlXHDSTDek1MpVMY -o3QjK8ovJlvMFustu8SONgyrneqGZMUAG2KYP7gME2c2Cd4uMutQWIA+XIANqJgE -kw52r/NRAu/PI9PbvuqOneEr45DFNNfu7RUsyewfrd07+xeDzqyMZFizjgZS8pyF -eu9jVo/4T64tT24+oTVn1O3sSn4DL0oh3IvTyv7jVDHP5QqjvY7scSSva5VPqXQI -9kkdzm0ECUqEAxwwn8EmyogrMJJYIKBmuFYxl3rYAY19hNVsMafmnlHxjSgv3n8h -LjnnPLECgYEA/bZy7NtfPrHWBQvSpUPyge7ykfOwOoNYHY0OJcw/MGjNbk6d6ZOv -3/gpGNO90iJkBI5cMXOgtOe0Nj1dkkSy9C81jd3JzR9mrK9Id8sJcUw2XpN1IKcE -w89tcf1tmvP/st6dY3RDHARIPjNvQfcWkzT0uDJmf8cihS3MeWcPi2UCgYEA3UQh -gPFfTAVW/mvwOkO37SK6/5hXbE4V1bHoP3fWAXmXO3C53K4FAuhErq8nw6ZOf9DG -jjhskmeXoUNb06gLBO2okfFL9ccDS4hKm5LQJvolrFfd6PTc/HOIxCvEj7aA4w0T -d0c1KUZjS7SNL0e3I4jNbJF6GXjwTHBMo5se2t0CgYEA2F7Hpi30DVC2l/kcPOs0 -nxD79/LeIRiwhgssvJlybkOCpwcO7wuPmy9VRSIXKWVA7Q3HnDjjHkTYUMWGzl4e -S9cTEhjKqE+WTcDyyY7zT5dSatfQtPcbPi7hRKx/0/0w3QezLAUT0onoXnuY76Xc -r9AiwA/jkCdwzilfz01QWW0CgYAUHmjJd6kJmYaydZAPTC8CIeFM8kYos+TqXFXY -x4Wu9qZYokRUG4KbJBFyrLx53rpOhuY28kx093RjFmPYF/SAizeDpaQZgfH7wTW/ -dZb1pFMem5Ky5ujdD4hFBhHGW3rWqk61zsS3rw3CSXV48hVl5r9++q9Wd5ep66Ac -VDN3BQKBgGMkPiQ5YuhVG3zEYM/4zgW7zCEuDyocqXkv5nJGW3JxPDBuJhLbwQ8F -RqawaRhuIQZtKnbN7JIGLFYYx+LkUlj7bbkzz6iaHHBtiDqz4/bHEL3q02DpAyJR -koWbtKIbZfS0Zno3OoGdYyvwXYaaE3Q3DJOc+NUmMKhlAhcAkjQv +MIIEogIBAAKCAQEA9uN385/HznblztBMUT80szQdmldjwnGgH2A9blEAc4qlKD0p +lUWWHpgBnwrEh3qz/VF6uSmd7vKHUOxYhwNN1W/fp/AwOdXsUx5XiToVyMajJDdr +ZQoV5nJAnkdIVWMZllX2DTBqXcVefoNshE8Ce6hKcO7tWDcWLNvW1NHVTuM3SYSS +JARRriKNUvsmh2EKPqMgrfDgDvx4C1OzetUQTrhi3+aROdJaL4cOPP5n5FKBTWo1 +yzSN/RGG7VJEaXyChbUYSn6TrPH3qC0DygMcHRSjVPZ4YCkbXTTe18/H7CRCE+aF +O7/J+bjEC0sXXsWmMCp1UW84EkYjnmiFIll4KwIDAQABAoIBABgLuZAZ3M0IGYPW +F8jF/i0CA2wX3NiAVpcXuYP4EbIvK7zKkDVArMlYBrhlxRRo6AThHbHREtfF+VXx +XwHvWXJTThY+N4Q6iKTjzKTJ6ns+lX8egrA5lj52nEKOMMZYO5K/1pIcSA/P/E8Y +H8aXJ2fB0VZEfwtbeiZuVvMtaLghCjWKdU3ixfObP+TlHzVtHsGrXVoWvRszZgiC +bPix4+y+Eq6N5/AnNBnOINIL7B1IkDzG9nU8/S/9UKJSY07JPPnQOEHML2Fg6Wxd +C8X7Ed2PfyHle5gS8TPylf9mPWsijrkExOvhjUyg0+MJ0bo1cWiucW5t1FdlZNB0 +qiZaQmkCgYEA/LP/Y+VqkhXhoG3r6cS9scVvXJXgN+Vtd0gDtU3vEoDIElVA9VeW +DF5uUvDbiKP76WuvWQHZ2ZcG0rON5xLT5jMYgNWbsZHF/HIkGQAQOeAXItfO3C8w +ae3e8liqinnfnHDrLX3QoqYzynGU4iIMjb7/0nxywzJWmOLlT4twD7UCgYEA+hwN +BxY1zziXakMRjzKFqNC1tdaHAOFi/ymQ02q/i2UuONqD+tqHiJzUH9ZkzP6d13og +cV+JDP6qyMZW7cFR8zD+m/KkgquLKXukFXYNXDePs9l+0nkkRx3th1k8OnakBqvd +oE8FSQItpHWq8on2HOOOaqXZu8YoZ5Co2FdTlF8CgYANee/pvOdVCROyQYpuOg6/ +tz68GkYN1Q9kaBPCjHhubS2+RIulSdl3qWWKyMt8WvppNVPxlDaw8uvrOqYbp5Zj +VWA+JqYZ7yM21kN0jdtPqtKxCf8/IMkdLRFRrUbTAbLaHe98ypPgyKpEZpBBCv3O +ZVwxNm/MVxflKVx/RHlibQKBgGUujfKtAI3Zlh/uDB+DT+FQtgJfTHSFufgCR83P +5Leu8jkb5cLJP4V79LEAmfz4kMCIbrGO9bHlIRBidO5whAe/bXGHgxg97+mTVHk+ +Lf99lswqlAzv50ZCDELyTdRVBNySEPH2peu4TuC2nbbLK17ajFYGzIQTkWr8ceI7 +yds/AoGAdIUTnv3tKkF4J+EKtfMiV1fgNJuqgbiCjbuNYmnsjxGj8KSwncYrzhjv +wAGWp0pgFvTEK0jFHonPs9hdKvekO3ePD/oPeE0bH5nVIRAei6AEBb6cBgrviO+l +3azUr8/i4BV+jvVT5CVW8/KORDwNWisJpzQoQZR7KdkBzcFvRkw= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_4096.pem b/test/fixtures/keys/rsa_private_4096.pem index 30ca58045bdf..811d74482237 100644 --- a/test/fixtures/keys/rsa_private_4096.pem +++ b/test/fixtures/keys/rsa_private_4096.pem @@ -1,51 +1,51 @@ -----BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEArAvNBLD//h69aKy5t49I5CFdtwVuAym9qXa3IMZ7vCauW5/8 -V7xkTZeX/Yywykyxm59R3e1xQT9Wcsur0OhQby449szXEJq/ZRVIos7p/CpgzlGO -eWOhbwm6J973uJvMudvq1UPJA90vX1LGcgZfL/SOFkqRs+bVyrkjScDrDP7wCMQA -CkJTh8ScwVqURnRb61mx+sck8kuuauNAaKgXIzQZWYHGIihKVc+iWCYhAXE0Lq8B -yX125IbHIVVPKUdr5EfnNxLD9c1fO7rWNZfNlkZnEr2PZxa+T8YjD8FCJTYxLFLQ -7bH94Gh0UtydgqO2yYwr5TV7FSFa+HwqkvdBNo9c7g9608lNWXa+CZOU/HsTTcyj -WIzqnXwZf5eUc8G7oHmNMTx8xOQ9gbnS1TjgDtztvh+RGeEsMQT5UEU7Do1eeCyl -8lQ56BdZJ4eoUefAW7YqGkuYi0Qn5deX9ei1ozlefewPC/6q/sPNZHbPcdJ5yeya -N+TV4qzKlDGH3lw8g1mT3BOJhCcdxLuYuc3vKplBGx6fAW0klT39eeK4FtCEWH1r -xUzQEltngS9INYos6238KS8u3GFZFf3ggJemtxg/1oTv4L2ZGS7/j4rGef1IP2ij -Ith28ZnsYCJyajxQRB2ViUSirdFEQ0s7vAnxtMzAtDKcMsQDfbWWeEKGbZMCAwEA -AQKCAgEAgCB9u7uxuefcuWLBIKH17+elalMB3hss41LFCQSoS7Qm75eTDyf/LwXx -rGMlmlNJhhM9neBiEux/jhh+SaNpm5M52xssI3KLjVUvdghQm3pYA+8bAu4e4JnG -6ECWDgcBjXzpQ5Aq2NTVndEAdxSluQoQ8yrvnaIQn9wHGrswkcoeqviE6x8AJEFZ -WGoDuQCZIAn5kUDUFBomt/WsFwTvzkjThCQwkWmeCpAKYEltFSzgZs/wrcThUUnK -bNmijaRiBm1CFXLFO36KKOp48wqtkfe2dW90p5p5euGdZPNRNnNIZbD7ZbnDz2cb -Eka4iv0veKQKYLXWhyMDI8Ec17yJ9EYDe12jogMyb7839VxklDyVV0aPY8C0YDst -l92qU7v+0S1dpFA22rmEKThTTYmAWoCfY8tsQSgQGb6y2WVFo46iZOsoC6lZQOqJ -yhxwDfLjsRyAJHCkHFuigcj7jukt5/zzhC7+JkKg+iWrv63a3TvFiu8jWYgddy38 -e2rM7mXS18oe0PAKWiYU+JcEHdousGFkfcHyVzsiCku1MiWKZNVsQDKU2sYQdgo+ -B6XR0yiVCucFBLT2jEht+MsrbNpdXQ2/cNYbabQFLGKSST1qfJNepvGiCqUsCakA -nickA91dTBF4yH3M6hREQolkpw+6SD0bd9Kf2P0QmWOSrefPKMkCggEBAN1Bnzrk -6eJUHiJNlQ5QHXty7HYlFueO7dPHjRLiwd4EnRabjwx2rxtWjYwLP4MOsV3J9a5f -dX7GVarQxbQys64pFKP3fqktjhxEBsPw/+kJH1E5SRfmZKtKOqsJan/AHSGpeBWg -Hp4kjpHW2qxsoXZr2IJuICmf5aVui2kUB6C9CgE1IFIf4dAphIOPg+OJJck2z6Do -lJhlG2L6JOdcuNTOy4Ecf1C8EYAGbOe+4gXSIVYx/yG+Tat+CKqZbQqr9B8jDPy7 -4BLhI97uHYP5K0tl/DNVcMD73WeWEEvbw7V7bJ94sH78SUK6w2FMijne3UbEcB60 -tSI59wwHIJ1mW9UCggEBAMcP9JecWe8ss+QzKvSdBeP15dtpiqx0Q+ijFZYHQGy8 -fP6MJD8/4w/uvS+mP1LaWaLm2mcMrog1dKMxps+fcUBkFAZpwc7uRj/n2ovoJo4R -TOT/6xUn33a4fnuZcyW2RDQrfolNOHkXmVRYdUYMS3G1JkGMDJfpOrWW41THhixn -XTSFgrBlVl3cgKZ+v/YM5phM+cZLYZU8/tOdYfxoiSWDOGMwEBiwbyNE1FTUlXDv -oORXJ8Kt4ei3b7KElgu+QFpBWR15OU09fLUHTArydB6oE5H9mHUic9Yi71AiKTPM -wxBhM6V+vXdjc89QcUhHtpJBXwLX8N+lOiqLBJHdX8cCggEBAKSJ5YEltSzkA1jd -OyjeuV4Rs/mUUXk4WHLy5l2SFjwmUC/81R+er0/0SOVJhBzRc2NdCoB3augxVIno -Ie6E+gxdboUVS7NCNnmcuS9D7Pv/FbQQluPYKSsc045YPUPtuXxMDAqA/eP7Ka8Z -CZvKWTS4tNUiUnbB+0TQdYpaI+YMTwFg4b1RClwEVBCGTL2MQ3ZkdXmjHMZMAlbT -0VfhI27Wro5AhAmlIpqDrL+Wu306rCHuol4UqKwM2SMNYALcp3n0VfcpPFSt60Ag -8gAv71tt52TBeE17wEYFWe8f6mXu+HOLjC2TLmQagau9ANpSe1niQcMD/eQLGUZv -knibI1UCggEAaVWJERzb/hLCkjN9PHlGn60D14nOppjTQmvhxUTLE37eCXgwygNN -bKXhGDC5e2ctXWUZFsSAKnVW5fAlG+J79B3A9u/JbW1qYPCYFcZfeHexH9BIHia+ -Ob1AuLinVMJQ7uZBC/h/tJwHN7mjPNDOrzmzJ6YrF8uDlIlme/skhaSgjmVDlYHa -JMrEjNWvUEzdTKQW25YR6f2fvmyeaAkM4XvBP8M0EUxzUs9eKBFhjqROl+WClaKb -UyCWC3nbSBWBSgEgXddCuhuaPNTCqVxIk9xOlscBgKIdd6d+yQF6mf11DtrQkHcz -XNSUeJRRjXTdKCFNXFzWChINaGutnF3vCwKCAQBvmjBndvF1cQW6GdYMNBpZE+gr -jsWMRQqs3TQnUI2bzhOGj/2JzWcghCuYB3pIlEGYrhaGLYa0bBwMcoE95lg/Gleg -YxQakN4Qv7Xy6zN8pT/8GNAaqBuO+4AOAITrM4xGAYYkfvQbG83PZpoUl1h82+tS -4imnGk+gzqzz52PkAYV/LkcWlBFSoqSeI2lQvaLLrijhacHKokJui3YAmqIMR6X2 -AeVV3juiLWJsCk9Jd5eLTPy4XlcNzB5MTenmUWXUFjqhSeNPMNHDE82xuZ362OKD -FvtYiLTGh2vWw/0zRHbV4S5dO5RkNLVxiu7akOoV6uBgYdNCJxYHNBVWusyA +MIIJKAIBAAKCAgEA4uXPuhYg/4tlw7dIph6hz0H4eHMIX5VbS37kIl35YrlcwNJg +TX4Rc9E/ywnmKI03k1Nb0wWh1rl+6CCeUiwgU9taZf/N+zp9ad1aKJ/BLZS/ctT6 +KvLbxt/BFGAr3QF5tAGS1xgLQ27hguRA4pBRW+1UHtFf0PGvGiIRF14/D+cL8LHC +PHatAeqqrRErRocd/TJCxuPceKZtr7Ejb6q5BOw/AKvWnaxdc/xitiz9RHZ4IbAj +1SF168SvFKZSl0YDhPNPzt/aO4//p22s8JEPRi5zN6cbP9gBb653hWB9D8FdqXjc +/07jGtW2OIobnNbAe0xkwnbh07F9RMXsm5SV0EuLjR+1CgTkW9+OV7HFgVqqGayj +VwLt0SpEUTJgtTHiz6lVvvbGILjoIZEUHXYAci8xmXwqjku8bzND5Xm5MA7ByK6X +qppvTwmj8Z89GO3xevVwsSTA+bLDurzfqPKtp6bcAB8cA/eYXwsHWm1w2RgbmwmX +MgGIxmgRnNy/GA0mgiudRCGMRFDmTngVDcyEJG4jO6phhcEqVEyt8FX8WLapX0li +wycK2BjAMZdKwB2Dcd3/L8jvJQbUrKU1e0mWaokccURH+IBaARK88qY7X8nPvVkv +fJrf3CfwP2tAsjHvaEdNPS4yBNF696VcZUyuaVPI/2AfkG1UrcPF6BMv33ECAwEA +AQKCAgEArA+d4P2a9G6fMzWwL9kW13atl5mUBffbDXsiQTWGQmlSfx6JzPoG/g72 +E2BkWugL9vrFrVaeDZkJNbpWlPXFZhH3kVXUu+j05ezny9qpwYkFTW1YcG1OYJeZ +cXwkhynxQqHW2qnvEKnq9TlmQukx6UYl/mDECkzcfjLLRy8/Hy4Ujege5X8RX1y3 +JRrZ+FfKVBFjNjPhItUCZLMtriaGu8bzV+z3iQYGsEf6CzA+t0Ynf1R1N9Bx/eJe +6ofeJb0AOjfQk46JjZV7R1oSRTObo5rh4JgmP9nr7Oce19P9wo7eGf//htQpwFXE +I0gH/H2V5WpfFmDUi5YS6q406R5aI/buOxoJYosM9v0LsChQD20ksOKCM9gAryWY +qfQXJI+bs0GuYdlR2STGOUnPXaTjd79thmcHMtgNw1YU77fMVjxaSWWwjrxdHPKL +VraXf9UVXjB8WsJOhCLtwQfM4maIaRlGx9V1w6zUgeKorbe454sTI+1AIqGkwpLa +BvyPGXlaRhLhgBuW/icqfPdo5brm5qvv718zfyKxnHPbtg7DxkW+vid26O2Xl1Kt +n477Kk9YNJRsdI1CmSdAnzNQ6RJwCFyR3Fo1OwMVZkCMI+968VkIw8viEBrS8hsf +xPKK69TLYYyp+SMoY/AHKuhofVhjt7W7iwsnYWxZ/m6uBP6hDeECggEBAPsqHSHz +aDBtVLvnAO83R1TcEgYfH2fEe+3q2yPq+8ltjpjdp1jlsllEqjGJOfoMCAs/Hugy +dyke6lsYNLqMEjf/+soSIdxz/pjAx1IsWB2FTmw7FHa5Lk8L+22B9Ozc02VAOFtb +dKCpftPuN5MRYy0UcB7E7JjlrqlWkwYEGUjXUGFosEJeS2Ycb98aRTNy2i2nW9i4 +rNspAeXgCebb0IdsR2yPgaHfMyubjIQww6KHn4aGGAkACH/xBMM5qW0zEnBmoVDI +EzlhREmgBEgvYUv66VBD2ecdHFva4NEtpJy7+qlYS+4bDm9uQbF+NqbM3yQ3bcg2 +0hSiAw16YwPMNL0CggEBAOdEGLg+qC8lzhCclmWWULO0rQvnxq6uc8+xX1NteAQV +BEDkNMtM/l1Vh5a3xzlQcOzK9doBdKxH49TsjzWRsm9EvI3cCiyuDROUIWEx5KxW +hb5i/0oPtvFFWgKygpXY01dLmkoVwOPlw9Y+etJYIRRQ2BCUJjmcTW6TgnbrV+Y8 +YrWNNn9Cm+hnyqnNybOH3E1ebH1x14mfCwUrVNnT/cwVtVS/eUCtucl2L4sw2b0Z +x+mgF4uP2DlTMhZhVf2DqxvXR4yiTx7k06A7VJvN3g9r/RC1rCz4p+00rXldk9KA +0RWzuFMhccfpkKaC97OhBth3l8LGR5V0ATIgG50OEsUCggEAX/DEVBWwdN8ugOBK +wRXyj33I/MGis3agiE8wClZWe6j30XjJ1fFX4TWTdXyfwt4ZrIIeAkBUuEZw6v8i +FSgwRWfomou2l4lPdXYeLUt3FT+4pysiM/+kqtk+36PGtTvdHE4duPgEYuKb6cST +QgBgS/YEphw+7GDACTtiyeeC6QomUC83NQLj9ktiiGx2hqKWqN3G/c/9Z3IQoYik +/6Rz0WcRGWzv7a9e0oeGc3BVKp5312EdiUKT/JtKYHCEQYxCvODXOg5TGZYICb+w +IwrGNcnQmbJxaBD8pjHDsuOmf6BmrY1m47s+Fl6dhXla0vhrPGBX9STLtsn0NI/N +hsPYWQKCAQBRO44jSX7x8KmNFDOPw1jdhp0yDVuwh/6N+ZOuTklVxbwUvxP8RTMj +vaM+wZbs/uBrjG8HAHPm/+l7JQy4mFDA3LgObDf2sbxOID4JUeksz8dytHtPnG16 +Gg4f3GwaDmtNwnSTiUiTxGUhoBisQeB8rlj2mdNDcS+Ro6az9r6NVLCnbM6zrMXu +wGZjdrFeql4rnvskpRQ8duz8B9hqGxiO0yE6f3crzNnxdd4FWkdhMOkTmvQqRYCB +wkNZsR7vSYyU3u127Jw2EdJz+eMiRxG1AQ2HDQlJUp5Jp7M3ajM+QZkvsk0QhjLd +MaFpm58+LVWmO3vHIraKPJEe9kA8znCxAoIBAGwAm6H1oRetnD8bRiiBTf3xNMfl +UZQpDRZBOzJeXRIt54E+DjOqWvi9ommBvz1V9A7H6kxkAaz9aLXJOPIdsvLZwvt+ +cjocJ2WOkurauHX1K/QYdZZN4aIg9XrHKVcTk5jnhw59QK2PQeV8awJ48So754tu +YPUn0Q3Yj48FtOdr4LiG1miakSlceLlXf5Gf4i5N3cZ0pDBTBSD3Rv7WLa3AprKk +s9FzVH5SEXnAjl/JFna2mndnRFF3s07UhRFv2XtR+e+zOpRefN33XE1EmfaAVeSP +k5YORPc/fTKNoFodnXC2EFLFd1KvDGgvDDWJDaLGe+Hr9o3FgJHn18HyQAs= -----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_public_1024.pem b/test/fixtures/keys/rsa_public_1024.pem index 0ec72a9b23c1..e24933731cfc 100644 --- a/test/fixtures/keys/rsa_public_1024.pem +++ b/test/fixtures/keys/rsa_public_1024.pem @@ -1,6 +1,6 @@ -----BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOF+YjZgVg8yGFS+++0WVcTKms -1Wl2Lbnzj7jWOPyZnXxww7cEafiL3QI2RZCiVwBcueUejCbzT5iLrsWceryOCHZE -4nQ5IOEYCpPzWw6oTfSM7HV0axQEpSzJFp20NJV9pVvBmSrrrdlGaDwHY1nlGVB3 -s2CKTAVxcKWoD6FhVQIDAQAB +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCarMIyITT3auLmJ6TnSmES908I +25oHPzFK1W5YbMfs0XYbMk7QHUkkKo/r9E+FQgodhkyPugZznZLEliO48DRc92UG +h/7+WQwoAVXZwsxbvSEkPxrCwC/DGvHJRTG1WCF9MuAYm2bdkcV0Sm99D5e2JBAA +NUXy6uZAmbo96aGBJQIDAQAB -----END PUBLIC KEY----- diff --git a/test/fixtures/keys/rsa_public_2048.pem b/test/fixtures/keys/rsa_public_2048.pem index e43ef4c73bff..15fd34820cfd 100644 --- a/test/fixtures/keys/rsa_public_2048.pem +++ b/test/fixtures/keys/rsa_public_2048.pem @@ -1,9 +1,9 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA20oG4U+MsV45A4zG0ySo -avFmWmdkVtmKh1Tk9sC3V6Fu5w1v44lZDa57n+ghEA9Y4txUVQzm3TppwBFqUB2b -BZrAhAjmjiPxjECGTV7ABaAQyihJR0F2LL1KmdlduFXACvNCfIseBoOY6K49vrW3 -/rVC1gBQ6/S3K6jECjGAvOyUcIAvch0YpW68v12AOUMI+CpzRQdMv6akbOVt5Qtg -1vIvv0lIuirYcq9MWS++oFvHrxzXqAiAfgc0truwbW5Lz2w7Wcy0pBYeVW6HvBFP -wUEV/2rn+RHrbgE9yQ+p4gDkdfHVyuMx21Mf449UwQUuI3HZ4BPqmyWkwSEYsfVY -MQIDAQAB +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9uN385/HznblztBMUT80 +szQdmldjwnGgH2A9blEAc4qlKD0plUWWHpgBnwrEh3qz/VF6uSmd7vKHUOxYhwNN +1W/fp/AwOdXsUx5XiToVyMajJDdrZQoV5nJAnkdIVWMZllX2DTBqXcVefoNshE8C +e6hKcO7tWDcWLNvW1NHVTuM3SYSSJARRriKNUvsmh2EKPqMgrfDgDvx4C1OzetUQ +Trhi3+aROdJaL4cOPP5n5FKBTWo1yzSN/RGG7VJEaXyChbUYSn6TrPH3qC0DygMc +HRSjVPZ4YCkbXTTe18/H7CRCE+aFO7/J+bjEC0sXXsWmMCp1UW84EkYjnmiFIll4 +KwIDAQAB -----END PUBLIC KEY----- diff --git a/test/fixtures/keys/rsa_public_4096.pem b/test/fixtures/keys/rsa_public_4096.pem index 30ca58045bdf..30a2245c7266 100644 --- a/test/fixtures/keys/rsa_public_4096.pem +++ b/test/fixtures/keys/rsa_public_4096.pem @@ -1,51 +1,14 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEArAvNBLD//h69aKy5t49I5CFdtwVuAym9qXa3IMZ7vCauW5/8 -V7xkTZeX/Yywykyxm59R3e1xQT9Wcsur0OhQby449szXEJq/ZRVIos7p/CpgzlGO -eWOhbwm6J973uJvMudvq1UPJA90vX1LGcgZfL/SOFkqRs+bVyrkjScDrDP7wCMQA -CkJTh8ScwVqURnRb61mx+sck8kuuauNAaKgXIzQZWYHGIihKVc+iWCYhAXE0Lq8B -yX125IbHIVVPKUdr5EfnNxLD9c1fO7rWNZfNlkZnEr2PZxa+T8YjD8FCJTYxLFLQ -7bH94Gh0UtydgqO2yYwr5TV7FSFa+HwqkvdBNo9c7g9608lNWXa+CZOU/HsTTcyj -WIzqnXwZf5eUc8G7oHmNMTx8xOQ9gbnS1TjgDtztvh+RGeEsMQT5UEU7Do1eeCyl -8lQ56BdZJ4eoUefAW7YqGkuYi0Qn5deX9ei1ozlefewPC/6q/sPNZHbPcdJ5yeya -N+TV4qzKlDGH3lw8g1mT3BOJhCcdxLuYuc3vKplBGx6fAW0klT39eeK4FtCEWH1r -xUzQEltngS9INYos6238KS8u3GFZFf3ggJemtxg/1oTv4L2ZGS7/j4rGef1IP2ij -Ith28ZnsYCJyajxQRB2ViUSirdFEQ0s7vAnxtMzAtDKcMsQDfbWWeEKGbZMCAwEA -AQKCAgEAgCB9u7uxuefcuWLBIKH17+elalMB3hss41LFCQSoS7Qm75eTDyf/LwXx -rGMlmlNJhhM9neBiEux/jhh+SaNpm5M52xssI3KLjVUvdghQm3pYA+8bAu4e4JnG -6ECWDgcBjXzpQ5Aq2NTVndEAdxSluQoQ8yrvnaIQn9wHGrswkcoeqviE6x8AJEFZ -WGoDuQCZIAn5kUDUFBomt/WsFwTvzkjThCQwkWmeCpAKYEltFSzgZs/wrcThUUnK -bNmijaRiBm1CFXLFO36KKOp48wqtkfe2dW90p5p5euGdZPNRNnNIZbD7ZbnDz2cb -Eka4iv0veKQKYLXWhyMDI8Ec17yJ9EYDe12jogMyb7839VxklDyVV0aPY8C0YDst -l92qU7v+0S1dpFA22rmEKThTTYmAWoCfY8tsQSgQGb6y2WVFo46iZOsoC6lZQOqJ -yhxwDfLjsRyAJHCkHFuigcj7jukt5/zzhC7+JkKg+iWrv63a3TvFiu8jWYgddy38 -e2rM7mXS18oe0PAKWiYU+JcEHdousGFkfcHyVzsiCku1MiWKZNVsQDKU2sYQdgo+ -B6XR0yiVCucFBLT2jEht+MsrbNpdXQ2/cNYbabQFLGKSST1qfJNepvGiCqUsCakA -nickA91dTBF4yH3M6hREQolkpw+6SD0bd9Kf2P0QmWOSrefPKMkCggEBAN1Bnzrk -6eJUHiJNlQ5QHXty7HYlFueO7dPHjRLiwd4EnRabjwx2rxtWjYwLP4MOsV3J9a5f -dX7GVarQxbQys64pFKP3fqktjhxEBsPw/+kJH1E5SRfmZKtKOqsJan/AHSGpeBWg -Hp4kjpHW2qxsoXZr2IJuICmf5aVui2kUB6C9CgE1IFIf4dAphIOPg+OJJck2z6Do -lJhlG2L6JOdcuNTOy4Ecf1C8EYAGbOe+4gXSIVYx/yG+Tat+CKqZbQqr9B8jDPy7 -4BLhI97uHYP5K0tl/DNVcMD73WeWEEvbw7V7bJ94sH78SUK6w2FMijne3UbEcB60 -tSI59wwHIJ1mW9UCggEBAMcP9JecWe8ss+QzKvSdBeP15dtpiqx0Q+ijFZYHQGy8 -fP6MJD8/4w/uvS+mP1LaWaLm2mcMrog1dKMxps+fcUBkFAZpwc7uRj/n2ovoJo4R -TOT/6xUn33a4fnuZcyW2RDQrfolNOHkXmVRYdUYMS3G1JkGMDJfpOrWW41THhixn -XTSFgrBlVl3cgKZ+v/YM5phM+cZLYZU8/tOdYfxoiSWDOGMwEBiwbyNE1FTUlXDv -oORXJ8Kt4ei3b7KElgu+QFpBWR15OU09fLUHTArydB6oE5H9mHUic9Yi71AiKTPM -wxBhM6V+vXdjc89QcUhHtpJBXwLX8N+lOiqLBJHdX8cCggEBAKSJ5YEltSzkA1jd -OyjeuV4Rs/mUUXk4WHLy5l2SFjwmUC/81R+er0/0SOVJhBzRc2NdCoB3augxVIno -Ie6E+gxdboUVS7NCNnmcuS9D7Pv/FbQQluPYKSsc045YPUPtuXxMDAqA/eP7Ka8Z -CZvKWTS4tNUiUnbB+0TQdYpaI+YMTwFg4b1RClwEVBCGTL2MQ3ZkdXmjHMZMAlbT -0VfhI27Wro5AhAmlIpqDrL+Wu306rCHuol4UqKwM2SMNYALcp3n0VfcpPFSt60Ag -8gAv71tt52TBeE17wEYFWe8f6mXu+HOLjC2TLmQagau9ANpSe1niQcMD/eQLGUZv -knibI1UCggEAaVWJERzb/hLCkjN9PHlGn60D14nOppjTQmvhxUTLE37eCXgwygNN -bKXhGDC5e2ctXWUZFsSAKnVW5fAlG+J79B3A9u/JbW1qYPCYFcZfeHexH9BIHia+ -Ob1AuLinVMJQ7uZBC/h/tJwHN7mjPNDOrzmzJ6YrF8uDlIlme/skhaSgjmVDlYHa -JMrEjNWvUEzdTKQW25YR6f2fvmyeaAkM4XvBP8M0EUxzUs9eKBFhjqROl+WClaKb -UyCWC3nbSBWBSgEgXddCuhuaPNTCqVxIk9xOlscBgKIdd6d+yQF6mf11DtrQkHcz -XNSUeJRRjXTdKCFNXFzWChINaGutnF3vCwKCAQBvmjBndvF1cQW6GdYMNBpZE+gr -jsWMRQqs3TQnUI2bzhOGj/2JzWcghCuYB3pIlEGYrhaGLYa0bBwMcoE95lg/Gleg -YxQakN4Qv7Xy6zN8pT/8GNAaqBuO+4AOAITrM4xGAYYkfvQbG83PZpoUl1h82+tS -4imnGk+gzqzz52PkAYV/LkcWlBFSoqSeI2lQvaLLrijhacHKokJui3YAmqIMR6X2 -AeVV3juiLWJsCk9Jd5eLTPy4XlcNzB5MTenmUWXUFjqhSeNPMNHDE82xuZ362OKD -FvtYiLTGh2vWw/0zRHbV4S5dO5RkNLVxiu7akOoV6uBgYdNCJxYHNBVWusyA ------END RSA PRIVATE KEY----- +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4uXPuhYg/4tlw7dIph6h +z0H4eHMIX5VbS37kIl35YrlcwNJgTX4Rc9E/ywnmKI03k1Nb0wWh1rl+6CCeUiwg +U9taZf/N+zp9ad1aKJ/BLZS/ctT6KvLbxt/BFGAr3QF5tAGS1xgLQ27hguRA4pBR +W+1UHtFf0PGvGiIRF14/D+cL8LHCPHatAeqqrRErRocd/TJCxuPceKZtr7Ejb6q5 +BOw/AKvWnaxdc/xitiz9RHZ4IbAj1SF168SvFKZSl0YDhPNPzt/aO4//p22s8JEP +Ri5zN6cbP9gBb653hWB9D8FdqXjc/07jGtW2OIobnNbAe0xkwnbh07F9RMXsm5SV +0EuLjR+1CgTkW9+OV7HFgVqqGayjVwLt0SpEUTJgtTHiz6lVvvbGILjoIZEUHXYA +ci8xmXwqjku8bzND5Xm5MA7ByK6XqppvTwmj8Z89GO3xevVwsSTA+bLDurzfqPKt +p6bcAB8cA/eYXwsHWm1w2RgbmwmXMgGIxmgRnNy/GA0mgiudRCGMRFDmTngVDcyE +JG4jO6phhcEqVEyt8FX8WLapX0liwycK2BjAMZdKwB2Dcd3/L8jvJQbUrKU1e0mW +aokccURH+IBaARK88qY7X8nPvVkvfJrf3CfwP2tAsjHvaEdNPS4yBNF696VcZUyu +aVPI/2AfkG1UrcPF6BMv33ECAwEAAQ== +-----END PUBLIC KEY----- diff --git a/test/gc/.gitignore b/test/gc/.gitignore deleted file mode 100644 index 567609b1234a..000000000000 --- a/test/gc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ diff --git a/test/gc/binding.cc b/test/gc/binding.cc deleted file mode 100644 index 8bde3b8505cf..000000000000 --- a/test/gc/binding.cc +++ /dev/null @@ -1,80 +0,0 @@ -#include "node.h" -#include "uv.h" - -#include -#include - -#include - -#ifdef NDEBUG -#define CHECK(x) do { if (!(x)) abort(); } while (false) -#else -#define CHECK assert -#endif - -#define CHECK_EQ(a, b) CHECK((a) == (b)) - -namespace { - -struct Callback { - inline Callback(v8::Isolate* isolate, - v8::Local object, - v8::Local function) - : object(isolate, object), function(isolate, function) {} - - v8::Persistent object; - v8::Persistent function; -}; - -static uv_async_t async_handle; -static std::vector callbacks; - -inline void Prime() { - uv_ref(reinterpret_cast(&async_handle)); - CHECK_EQ(0, uv_async_send(&async_handle)); -} - -inline void AsyncCallback(uv_async_t*) { - auto isolate = v8::Isolate::GetCurrent(); - v8::HandleScope handle_scope(isolate); - auto context = isolate->GetCurrentContext(); - auto global = context->Global(); - while (!callbacks.empty()) { - v8::HandleScope handle_scope(isolate); - auto callback = callbacks.back(); - callbacks.pop_back(); - auto function = v8::Local::New(isolate, callback->function); - delete callback; - if (node::MakeCallback(isolate, global, function, 0, nullptr).IsEmpty()) - return Prime(); // Have exception, flush remainder on next loop tick. - } - uv_unref(reinterpret_cast(&async_handle)); -} - -inline void OnGC(const v8::FunctionCallbackInfo& info) { - CHECK(info[0]->IsObject()); - CHECK(info[1]->IsFunction()); - auto object = info[0].As(); - auto function = info[1].As(); - auto callback = new Callback(info.GetIsolate(), object, function); - auto on_callback = [] (const v8::WeakCallbackInfo& data) { - auto callback = data.GetParameter(); - callbacks.push_back(callback); - callback->object.Reset(); - Prime(); - }; - callback->object.SetWeak(callback, on_callback, - v8::WeakCallbackType::kParameter); -} - -inline void Initialize(v8::Local exports, - v8::Local module, - v8::Local context) { - NODE_SET_METHOD(module->ToObject(context).ToLocalChecked(), "exports", OnGC); - CHECK_EQ(0, uv_async_init(uv_default_loop(), &async_handle, AsyncCallback)); - uv_unref(reinterpret_cast(&async_handle)); -} - -} // anonymous namespace - -NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/gc/binding.gyp b/test/gc/binding.gyp deleted file mode 100644 index dc8963360172..000000000000 --- a/test/gc/binding.gyp +++ /dev/null @@ -1,9 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'binding', - 'defines': [ 'V8_DEPRECATION_WARNINGS=1' ], - 'sources': [ 'binding.cc' ], - }, - ], -} diff --git a/test/gc/testcfg.py b/test/gc/testcfg.py deleted file mode 100644 index d6bbcd60fff1..000000000000 --- a/test/gc/testcfg.py +++ /dev/null @@ -1,6 +0,0 @@ -import sys, os -sys.path.append(os.path.join(os.path.dirname(__file__), '..')) -import testpy - -def GetConfiguration(context, root): - return testpy.SimpleTestConfiguration(context, root, 'gc', ['--expose-gc']) diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index 58e13c65e1ba..606ab818c9d7 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -70,7 +70,7 @@ if (process.argv[2] !== 'child') { TIMEOUT); console.error('[PARENT] Fail'); - killChildren(workers); + killSubprocesses(workers); process.exit(1); }, TIMEOUT); @@ -102,7 +102,7 @@ if (process.argv[2] !== 'child') { console.error('[PARENT] All workers have died.'); console.error('[PARENT] Fail'); - killChildren(workers); + killSubprocesses(workers); process.exit(1); } @@ -155,7 +155,7 @@ if (process.argv[2] !== 'child') { clearTimeout(timer); console.error('[PARENT] Success'); - killChildren(workers); + killSubprocesses(workers); } } }); @@ -203,10 +203,10 @@ if (process.argv[2] !== 'child') { ); }; - function killChildren(children) { - Object.keys(children).forEach(function(key) { - const child = children[key]; - child.kill(); + function killSubprocesses(subprocesses) { + Object.keys(subprocesses).forEach(function(key) { + const subprocess = subprocesses[key]; + subprocess.kill(); }); } } diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index f8797bc8f3b0..e6e7a44fcd4d 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -116,16 +116,16 @@ function launchChildProcess() { clearTimeout(timer); console.error('[PARENT] Success'); - killChildren(workers); + killSubprocesses(workers); } } }); } -function killChildren(children) { - Object.keys(children).forEach(function(key) { - const child = children[key]; - child.kill(); +function killSubprocesses(subprocesses) { + Object.keys(subprocesses).forEach(function(key) { + const subprocess = subprocesses[key]; + subprocess.kill(); }); } @@ -141,7 +141,7 @@ if (process.argv[2] !== 'child') { TIMEOUT); console.error('[PARENT] Fail'); - killChildren(workers); + killSubprocesses(workers); process.exit(1); }, TIMEOUT); diff --git a/test/internet/test-dgram-multicast-set-interface-lo.js b/test/internet/test-dgram-multicast-set-interface-lo.js index c869b87d8a75..73ab31884d5e 100644 --- a/test/internet/test-dgram-multicast-set-interface-lo.js +++ b/test/internet/test-dgram-multicast-set-interface-lo.js @@ -89,7 +89,7 @@ if (process.argv[2] !== 'child') { TIMEOUT); console.error('[PARENT] Skip'); - killChildren(workers); + killSubprocesses(workers); common.skip('Check filter policy'); process.exit(1); @@ -132,7 +132,7 @@ if (process.argv[2] !== 'child') { console.error('[PARENT] All workers have died.'); console.error('[PARENT] Fail'); - killChildren(workers); + killSubprocesses(workers); process.exit(1); } @@ -187,7 +187,7 @@ if (process.argv[2] !== 'child') { clearTimeout(timer); console.error('[PARENT] Success'); - killChildren(workers); + killSubprocesses(workers); } } }); @@ -239,9 +239,9 @@ if (process.argv[2] !== 'child') { ); }; - function killChildren(children) { - for (const i in children) - children[i].kill(); + function killSubprocesses(subprocesses) { + for (const i in subprocesses) + subprocesses[i].kill(); } } diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index 538f4bef49d8..84fe7f50c320 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -350,8 +350,8 @@ assertDeepAndStrictEqual( new Map([[1, undefined]]) ); assertOnlyDeepEqual( - new Map([[1, null]]), - new Map([['1', undefined]]) + new Map([[1, null], ['', '0']]), + new Map([['1', undefined], [false, 0]]) ); assertNotDeepOrStrict( new Map([[1, undefined]]), @@ -367,9 +367,18 @@ assertOnlyDeepEqual( new Map([[null, undefined]]), new Map([[undefined, null]]) ); + +assertOnlyDeepEqual( + new Set([null, '']), + new Set([undefined, 0]) +); +assertNotDeepOrStrict( + new Set(['']), + new Set(['0']) +); assertOnlyDeepEqual( - new Set([null]), - new Set([undefined]) + new Map([[1, {}]]), + new Map([[true, {}]]) ); // GH-6416. Make sure circular refs don't throw. @@ -547,13 +556,12 @@ assertOnlyDeepEqual([1, , , 3], [1, , , 3, , , ]); // Handle different error messages { const err1 = new Error('foo1'); - const err2 = new Error('foo2'); - const err3 = new TypeError('foo1'); - assertNotDeepOrStrict(err1, err2, assert.AssertionError); - assertNotDeepOrStrict(err1, err3, assert.AssertionError); + assertNotDeepOrStrict(err1, new Error('foo2'), assert.AssertionError); + assertNotDeepOrStrict(err1, new TypeError('foo1'), assert.AssertionError); + assertDeepAndStrictEqual(err1, new Error('foo1')); // TODO: evaluate if this should throw or not. The same applies for RegExp // Date and any object that has the same keys but not the same prototype. - assertOnlyDeepEqual(err1, {}, assert.AssertionError); + assertOnlyDeepEqual(err1, {}); } // Handle NaN @@ -927,3 +935,10 @@ assert.throws(() => assert.deepStrictEqual(new Boolean(true), {}), ); util.inspect.defaultOptions = tmp; } + +// Basic valueOf check. +{ + const a = new String(1); + a.valueOf = undefined; + assertNotDeepOrStrict(a, new String(1)); +} diff --git a/test/parallel/test-benchmark-assert.js b/test/parallel/test-benchmark-assert.js index 3ca72df718cd..8a8ba0244489 100644 --- a/test/parallel/test-benchmark-assert.js +++ b/test/parallel/test-benchmark-assert.js @@ -10,6 +10,7 @@ const runBenchmark = require('../common/benchmark'); runBenchmark( 'assert', [ + 'strict=1', 'len=1', 'method=', 'n=1', diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index daab9c9edc12..f89e25fdbb2f 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -1039,3 +1039,10 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_VALUE', type: TypeError }); + +common.expectsError(() => { + Buffer.alloc(40, 'x', 20); +}, { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError +}); diff --git a/test/parallel/test-buffer-write.js b/test/parallel/test-buffer-write.js index 06117f614e83..c0c5e9c88fbc 100644 --- a/test/parallel/test-buffer-write.js +++ b/test/parallel/test-buffer-write.js @@ -70,3 +70,24 @@ for (let i = 1; i < 10; i++) { assert.ok(!Buffer.isEncoding(encoding)); assert.throws(() => Buffer.alloc(9).write('foo', encoding), error); } + +// UCS-2 overflow CVE-2018-12115 +for (let i = 1; i < 4; i++) { + // Allocate two Buffers sequentially off the pool. Run more than once in case + // we hit the end of the pool and don't get sequential allocations + const x = Buffer.allocUnsafe(4).fill(0); + const y = Buffer.allocUnsafe(4).fill(1); + // Should not write anything, pos 3 doesn't have enough room for a 16-bit char + assert.strictEqual(x.write('ыыыыыы', 3, 'ucs2'), 0); + // CVE-2018-12115 experienced via buffer overrun to next block in the pool + assert.strictEqual(Buffer.compare(y, Buffer.alloc(4, 1)), 0); +} + +// Should not write any data when there is no space for 16-bit chars +const z = Buffer.alloc(4, 0); +assert.strictEqual(z.write('\u0001', 3, 'ucs2'), 0); +assert.strictEqual(Buffer.compare(z, Buffer.alloc(4, 0)), 0); + +// Large overrun could corrupt the process +assert.strictEqual(Buffer.alloc(4) + .write('ыыыыыы'.repeat(100), 3, 'utf16le'), 0); diff --git a/test/parallel/test-child-process-fork-net.js b/test/parallel/test-child-process-fork-net.js index babde351d3f0..48521a7fdafe 100644 --- a/test/parallel/test-child-process-fork-net.js +++ b/test/parallel/test-child-process-fork-net.js @@ -122,7 +122,7 @@ if (process.argv[2] === 'child') { while (j--) { const client = net.connect(this.address().port, '127.0.0.1'); client.on('error', function() { - // This can happen if we kill the child too early. + // This can happen if we kill the subprocess too early. // The client should still get a close event afterwards. console.error('[m] CLIENT: error event'); }); diff --git a/test/parallel/test-child-process-spawn-error.js b/test/parallel/test-child-process-spawn-error.js index 109effa5c833..28591f88fa0e 100644 --- a/test/parallel/test-child-process-spawn-error.js +++ b/test/parallel/test-child-process-spawn-error.js @@ -23,10 +23,11 @@ const common = require('../common'); const spawn = require('child_process').spawn; const assert = require('assert'); +const fs = require('fs'); const enoentPath = 'foo123'; const spawnargs = ['bar']; -assert.strictEqual(common.fileExists(enoentPath), false); +assert.strictEqual(fs.existsSync(enoentPath), false); const enoentChild = spawn(enoentPath, spawnargs); enoentChild.on('error', common.mustCall(function(err) { diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index f4f7b0dfe55e..ec35cad7e896 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -100,9 +100,9 @@ fileStream.on('data', function(data) { sha1Hash.update(data); }); fileStream.on('close', common.mustCall(function() { + // Test SHA1 of sample.png assert.strictEqual(sha1Hash.digest('hex'), - '22723e553129a336ad96e10f6aecdf0f45e4149e', - 'Test SHA1 of sample.png'); + '22723e553129a336ad96e10f6aecdf0f45e4149e'); })); // Issue https://github.com/nodejs/node-v0.x-archive/issues/2227: unknown digest diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js index 9d0e495881f1..982b0ac6d5b6 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js @@ -56,18 +56,54 @@ const good = [ '7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2' + 'd5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887', }, + { + pass: '', + salt: '', + keylen: 64, + cost: 16, + parallelization: 1, + blockSize: 1, + expected: + '77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442' + + 'fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906', + }, + { + pass: 'password', + salt: 'NaCl', + keylen: 64, + cost: 1024, + parallelization: 16, + blockSize: 8, + expected: + 'fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b373162' + + '2eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640', + }, + { + pass: 'pleaseletmein', + salt: 'SodiumChloride', + keylen: 64, + cost: 16384, + parallelization: 1, + blockSize: 8, + expected: + '7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2' + + 'd5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887', + }, ]; // Test vectors that should fail. const bad = [ - { N: 1, p: 1, r: 1 }, // N < 2 - { N: 3, p: 1, r: 1 }, // Not power of 2. - { N: 2 ** 16, p: 1, r: 1 }, // N >= 2**(r*16) - { N: 2, p: 2 ** 30, r: 1 }, // p > (2**30-1)/r + { N: 1, p: 1, r: 1 }, // N < 2 + { N: 3, p: 1, r: 1 }, // Not power of 2. + { N: 1, cost: 1 }, // both N and cost + { p: 1, parallelization: 1 }, // both p and parallelization + { r: 1, blockSize: 1 } // both r and blocksize ]; // Test vectors where 128*N*r exceeds maxmem. const toobig = [ + { N: 2 ** 16, p: 1, r: 1 }, // N >= 2**(r*16) + { N: 2, p: 2 ** 30, r: 1 }, // p > (2**30-1)/r { N: 2 ** 20, p: 1, r: 8 }, { N: 2 ** 10, p: 1, r: 8, maxmem: 2 ** 20 }, ]; diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js index 3a44be928047..dcef59e43f90 100644 --- a/test/parallel/test-dns.js +++ b/test/parallel/test-dns.js @@ -135,14 +135,31 @@ assert.deepStrictEqual(dns.getServers(), portsExpected); dns.setServers([]); assert.deepStrictEqual(dns.getServers(), []); -common.expectsError(() => { - dns.resolve('example.com', [], common.mustNotCall()); -}, { - code: 'ERR_INVALID_ARG_TYPE', - type: TypeError, - message: 'The "rrtype" argument must be of type string. ' + - 'Received type object' -}); +{ + const errObj = { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: 'The "rrtype" argument must be of type string. ' + + 'Received type object' + }; + common.expectsError(() => { + dns.resolve('example.com', [], common.mustNotCall()); + }, errObj); + common.expectsError(() => { + dnsPromises.resolve('example.com', []); + }, errObj); +} +{ + const errObj = { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: 'The "name" argument must be of type string. ' + + 'Received type undefined' + }; + common.expectsError(() => { + dnsPromises.resolve(); + }, errObj); +} // dns.lookup should accept only falsey and string values { diff --git a/test/parallel/test-fs-existssync-false.js b/test/parallel/test-fs-existssync-false.js index de5ecfa66ad9..096be6de38df 100644 --- a/test/parallel/test-fs-existssync-false.js +++ b/test/parallel/test-fs-existssync-false.js @@ -1,5 +1,5 @@ 'use strict'; -const common = require('../common'); +require('../common'); const tmpdir = require('../common/tmpdir'); // This test ensures that fs.existsSync doesn't incorrectly return false. @@ -28,7 +28,7 @@ for (let i = 0; i < 50; i++) { } // Test if file exists synchronously -assert(common.fileExists(dir), 'Directory is not accessible'); +assert(fs.existsSync(dir), 'Directory is not accessible'); // Test if file exists asynchronously fs.access(dir, function(err) { diff --git a/test/parallel/test-fs-mkdir-rmdir.js b/test/parallel/test-fs-mkdir-rmdir.js index ff0da82bdf77..5e4982ba8576 100644 --- a/test/parallel/test-fs-mkdir-rmdir.js +++ b/test/parallel/test-fs-mkdir-rmdir.js @@ -10,11 +10,11 @@ const d = path.join(tmpdir.path, 'dir'); tmpdir.refresh(); // Make sure the directory does not exist -assert(!common.fileExists(d)); +assert(!fs.existsSync(d)); // Create the directory now fs.mkdirSync(d); // Make sure the directory exists -assert(common.fileExists(d)); +assert(fs.existsSync(d)); // Try creating again, it should fail with EEXIST assert.throws(function() { fs.mkdirSync(d); @@ -22,7 +22,7 @@ assert.throws(function() { // Remove the directory now fs.rmdirSync(d); // Make sure the directory does not exist -assert(!common.fileExists(d)); +assert(!fs.existsSync(d)); // Similarly test the Async version fs.mkdir(d, 0o666, common.mustCall(function(err) { diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 937c73aca4a4..18e9e973f14c 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -32,7 +32,7 @@ tmpdir.refresh(); fs.mkdir(pathname, common.mustCall(function(err) { assert.strictEqual(err, null); - assert.strictEqual(common.fileExists(pathname), true); + assert.strictEqual(fs.existsSync(pathname), true); })); } @@ -41,7 +41,7 @@ tmpdir.refresh(); fs.mkdir(pathname, 0o777, common.mustCall(function(err) { assert.strictEqual(err, null); - assert.strictEqual(common.fileExists(pathname), true); + assert.strictEqual(fs.existsSync(pathname), true); })); } @@ -50,7 +50,7 @@ tmpdir.refresh(); fs.mkdirSync(pathname); - const exists = common.fileExists(pathname); + const exists = fs.existsSync(pathname); assert.strictEqual(exists, true); } diff --git a/test/parallel/test-fs-mkdtemp.js b/test/parallel/test-fs-mkdtemp.js index 443dafa27563..98b62aa315e0 100644 --- a/test/parallel/test-fs-mkdtemp.js +++ b/test/parallel/test-fs-mkdtemp.js @@ -11,16 +11,16 @@ tmpdir.refresh(); const tmpFolder = fs.mkdtempSync(path.join(tmpdir.path, 'foo.')); assert.strictEqual(path.basename(tmpFolder).length, 'foo.XXXXXX'.length); -assert(common.fileExists(tmpFolder)); +assert(fs.existsSync(tmpFolder)); const utf8 = fs.mkdtempSync(path.join(tmpdir.path, '\u0222abc.')); assert.strictEqual(Buffer.byteLength(path.basename(utf8)), Buffer.byteLength('\u0222abc.XXXXXX')); -assert(common.fileExists(utf8)); +assert(fs.existsSync(utf8)); function handler(err, folder) { assert.ifError(err); - assert(common.fileExists(folder)); + assert(fs.existsSync(folder)); assert.strictEqual(this, undefined); } diff --git a/test/parallel/test-fs-readfile.js b/test/parallel/test-fs-readfile.js index 287834ab201e..118f2e43aab5 100644 --- a/test/parallel/test-fs-readfile.js +++ b/test/parallel/test-fs-readfile.js @@ -53,7 +53,7 @@ for (const e of fileInfo) { for (const e of fileInfo) { fs.readFile(e.name, common.mustCall((err, buf) => { console.log(`Validating readFile on file ${e.name} of length ${e.len}`); - assert.ifError(err, 'An error occurred'); + assert.ifError(err); assert.deepStrictEqual(buf, e.contents, 'Incorrect file contents'); })); } diff --git a/test/parallel/test-fs-symlink-dir-junction.js b/test/parallel/test-fs-symlink-dir-junction.js index cd9459bf44af..5bd7a8dcc4ec 100644 --- a/test/parallel/test-fs-symlink-dir-junction.js +++ b/test/parallel/test-fs-symlink-dir-junction.js @@ -47,8 +47,8 @@ fs.symlink(linkData, linkPath, 'junction', common.mustCall(function(err) { fs.unlink(linkPath, common.mustCall(function(err) { assert.ifError(err); - assert(!common.fileExists(linkPath)); - assert(common.fileExists(linkData)); + assert(!fs.existsSync(linkPath)); + assert(fs.existsSync(linkData)); })); })); })); diff --git a/test/gc/test-http-client-connaborted.js b/test/parallel/test-gc-http-client-connaborted.js similarity index 86% rename from test/gc/test-http-client-connaborted.js rename to test/parallel/test-gc-http-client-connaborted.js index 008d75bca5d0..3218c054ed4a 100644 --- a/test/gc/test-http-client-connaborted.js +++ b/test/parallel/test-gc-http-client-connaborted.js @@ -1,5 +1,6 @@ 'use strict'; -// just like test/gc/http-client.js, +// Flags: --expose-gc +// just like test-gc-http-client.js, // but aborting every connection that comes in. const common = require('../common'); @@ -9,7 +10,6 @@ function serverHandler(req, res) { } const http = require('http'); -const weak = require(`./build/${common.buildType}/binding`); const todo = 500; let done = 0; let count = 0; @@ -36,7 +36,7 @@ function getall() { }, cb).on('error', cb); count++; - weak(req, afterGC); + common.onGC(req, { ongc }); })(); setImmediate(getall); @@ -45,7 +45,7 @@ function getall() { for (let i = 0; i < 10; i++) getall(); -function afterGC() { +function ongc() { countGC++; } diff --git a/test/gc/test-http-client-onerror.js b/test/parallel/test-gc-http-client-onerror.js similarity index 88% rename from test/gc/test-http-client-onerror.js rename to test/parallel/test-gc-http-client-onerror.js index 8b05e941749c..8842da93c30d 100644 --- a/test/gc/test-http-client-onerror.js +++ b/test/parallel/test-gc-http-client-onerror.js @@ -1,5 +1,6 @@ 'use strict'; -// just like test/gc/http-client.js, +// Flags: --expose-gc +// just like test-gc-http-client.js, // but with an on('error') handler that does nothing. const common = require('../common'); @@ -11,7 +12,6 @@ function serverHandler(req, res) { } const http = require('http'); -const weak = require(`./build/${common.buildType}/binding`); const todo = 500; let done = 0; let count = 0; @@ -42,7 +42,7 @@ function getall() { }, cb).on('error', onerror); count++; - weak(req, afterGC); + common.onGC(req, { ongc }); })(); setImmediate(getall); @@ -53,7 +53,7 @@ function runTest() { getall(); } -function afterGC() { +function ongc() { countGC++; } diff --git a/test/gc/test-http-client-timeout.js b/test/parallel/test-gc-http-client-timeout.js similarity index 86% rename from test/gc/test-http-client-timeout.js rename to test/parallel/test-gc-http-client-timeout.js index c396a89032bf..e5cb91c06f89 100644 --- a/test/gc/test-http-client-timeout.js +++ b/test/parallel/test-gc-http-client-timeout.js @@ -1,5 +1,6 @@ 'use strict'; -// just like test/gc/http-client.js, +// Flags: --expose-gc +// just like test-gc-http-client.js, // but with a timeout set const common = require('../common'); @@ -13,7 +14,6 @@ function serverHandler(req, res) { } const http = require('http'); -const weak = require(`./build/${common.buildType}/binding`); const todo = 550; let done = 0; let count = 0; @@ -39,13 +39,13 @@ function getall() { pathname: '/', port: server.address().port }, cb); - req.on('error', cb); + req.setTimeout(10, function() { console.log('timeout (expected)'); }); count++; - weak(req, afterGC); + common.onGC(req, { ongc }); })(); setImmediate(getall); @@ -54,7 +54,7 @@ function getall() { for (let i = 0; i < 10; i++) getall(); -function afterGC() { +function ongc() { countGC++; } diff --git a/test/gc/test-http-client.js b/test/parallel/test-gc-http-client.js similarity index 90% rename from test/gc/test-http-client.js rename to test/parallel/test-gc-http-client.js index 8b50ad5ea4ff..d31874fa1666 100644 --- a/test/gc/test-http-client.js +++ b/test/parallel/test-gc-http-client.js @@ -1,4 +1,5 @@ 'use strict'; +// Flags: --expose-gc // just a simple http server and client. const common = require('../common'); @@ -9,7 +10,6 @@ function serverHandler(req, res) { } const http = require('http'); -const weak = require(`./build/${common.buildType}/binding`); const todo = 500; let done = 0; let count = 0; @@ -40,7 +40,7 @@ function getall() { }, cb); count++; - weak(req, afterGC); + common.onGC(req, { ongc }); })(); setImmediate(getall); @@ -49,7 +49,7 @@ function getall() { for (let i = 0; i < 10; i++) getall(); -function afterGC() { +function ongc() { countGC++; } diff --git a/test/gc/test-net-timeout.js b/test/parallel/test-gc-net-timeout.js similarity index 88% rename from test/gc/test-net-timeout.js rename to test/parallel/test-gc-net-timeout.js index 05d854d18ee7..236980efa3d6 100644 --- a/test/gc/test-net-timeout.js +++ b/test/parallel/test-gc-net-timeout.js @@ -1,5 +1,6 @@ 'use strict'; -// just like test/gc/http-client-timeout.js, +// Flags: --expose-gc +// just like test-gc-http-client-timeout.js, // but using a net server/client instead const common = require('../common'); @@ -19,7 +20,6 @@ function serverHandler(sock) { } const net = require('net'); -const weak = require(`./build/${common.buildType}/binding`); const assert = require('assert'); const todo = 500; let done = 0; @@ -44,7 +44,7 @@ function getall() { }); count++; - weak(req, afterGC); + common.onGC(req, { ongc }); setImmediate(getall); } @@ -52,7 +52,7 @@ function getall() { for (let i = 0; i < 10; i++) getall(); -function afterGC() { +function ongc() { countGC++; } diff --git a/test/parallel/test-heapdump-http2.js b/test/parallel/test-heapdump-http2.js index cbc1209ab055..b503951e6585 100644 --- a/test/parallel/test-heapdump-http2.js +++ b/test/parallel/test-heapdump-http2.js @@ -2,9 +2,9 @@ 'use strict'; const common = require('../common'); const { recordState } = require('../common/heap'); -const http2 = require('http2'); if (!common.hasCrypto) common.skip('missing crypto'); +const http2 = require('http2'); { const state = recordState(); diff --git a/test/parallel/test-http-request-arguments.js b/test/parallel/test-http-request-arguments.js new file mode 100644 index 000000000000..5cdd514fd506 --- /dev/null +++ b/test/parallel/test-http-request-arguments.js @@ -0,0 +1,28 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +// Test providing both a url and options, with the options partially +// replacing address and port portions of the URL provided. +{ + const server = http.createServer( + common.mustCall((req, res) => { + assert.strictEqual(req.url, '/testpath'); + res.end(); + server.close(); + }) + ); + server.listen( + 0, + common.mustCall(() => { + http.get( + 'http://example.com/testpath', + { hostname: 'localhost', port: server.address().port }, + common.mustCall((res) => { + res.resume(); + }) + ); + }) + ); +} diff --git a/test/parallel/test-http2-compat-serverresponse-destroy.js b/test/parallel/test-http2-compat-serverresponse-destroy.js index 8ee52a74ab4e..9082ec2ab8e9 100644 --- a/test/parallel/test-http2-compat-serverresponse-destroy.js +++ b/test/parallel/test-http2-compat-serverresponse-destroy.js @@ -7,8 +7,7 @@ const http2 = require('http2'); const Countdown = require('../common/countdown'); // Check that destroying the Http2ServerResponse stream produces -// the expected result, including the ability to throw an error -// which is emitted on server.streamError +// the expected result. const errors = [ 'test-error', diff --git a/test/parallel/test-http2-compat-serverresponse-finished.js b/test/parallel/test-http2-compat-serverresponse-finished.js index ceaa6eb5c3cf..4da592a5b354 100644 --- a/test/parallel/test-http2-compat-serverresponse-finished.js +++ b/test/parallel/test-http2-compat-serverresponse-finished.js @@ -9,14 +9,14 @@ const net = require('net'); // Http2ServerResponse.finished const server = h2.createServer(); -server.listen(0, common.mustCall(function() { +server.listen(0, common.mustCall(() => { const port = server.address().port; - server.once('request', common.mustCall(function(request, response) { + server.once('request', common.mustCall((request, response) => { assert.ok(response.socket instanceof net.Socket); assert.ok(response.connection instanceof net.Socket); assert.strictEqual(response.socket, response.connection); - response.on('finish', common.mustCall(function() { + response.on('finish', common.mustCall(() => { assert.strictEqual(response.socket, undefined); assert.strictEqual(response.connection, undefined); process.nextTick(common.mustCall(() => { @@ -30,7 +30,7 @@ server.listen(0, common.mustCall(function() { })); const url = `http://localhost:${port}`; - const client = h2.connect(url, common.mustCall(function() { + const client = h2.connect(url, common.mustCall(() => { const headers = { ':path': '/', ':method': 'GET', @@ -38,7 +38,7 @@ server.listen(0, common.mustCall(function() { ':authority': `localhost:${port}` }; const request = client.request(headers); - request.on('end', common.mustCall(function() { + request.on('end', common.mustCall(() => { client.close(); })); request.end(); diff --git a/test/parallel/test-http2-server-push-stream.js b/test/parallel/test-http2-server-push-stream.js index 6ac10cae77f9..69e74349475c 100644 --- a/test/parallel/test-http2-server-push-stream.js +++ b/test/parallel/test-http2-server-push-stream.js @@ -22,6 +22,14 @@ server.on('stream', common.mustCall((stream, headers) => { 'x-push-data': 'pushed by server', }); push.end('pushed by server data'); + + common.expectsError(() => { + push.pushStream({}, common.mustNotCall()); + }, { + code: 'ERR_HTTP2_NESTED_PUSH', + type: Error + }); + stream.end('test'); })); } diff --git a/test/parallel/test-https-req-split.js b/test/parallel/test-https-req-split.js deleted file mode 100644 index 05fc85fc07b7..000000000000 --- a/test/parallel/test-https-req-split.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - -'use strict'; -const common = require('../common'); -const fixtures = require('../common/fixtures'); -if (!common.hasCrypto) - common.skip('missing crypto'); - -// disable strict server certificate validation by the client -process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - -const https = require('https'); - -const tls = require('tls'); - -const options = { - key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') -}; - -// Force splitting incoming data -tls.SLAB_BUFFER_SIZE = 1; - -const server = https.createServer(options); -server.on('upgrade', common.mustCall(function(req, socket, upgrade) { - socket.on('data', function(data) { - throw new Error(`Unexpected data: ${data}`); - }); - socket.end('HTTP/1.1 200 Ok\r\n\r\n'); -})); - -server.listen(0, function() { - const req = https.request({ - host: '127.0.0.1', - port: this.address().port, - agent: false, - headers: { - Connection: 'Upgrade', - Upgrade: 'Websocket' - } - }, function() { - req.socket.destroy(); - server.close(); - }); - - req.end(); -}); diff --git a/test/parallel/test-https-request-arguments.js b/test/parallel/test-https-request-arguments.js new file mode 100644 index 000000000000..9dc80094be0d --- /dev/null +++ b/test/parallel/test-https-request-arguments.js @@ -0,0 +1,46 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const fixtures = require('../common/fixtures'); + +if (!common.hasCrypto) + common.skip('missing crypto'); +const https = require('https'); + +const options = { + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('agent1-cert.pem'), + ca: fixtures.readKey('ca1-cert.pem') +}; + +// Test providing both a url and options, with the options partially +// replacing address and port portions of the URL provided. +{ + const server = https.createServer( + options, + common.mustCall((req, res) => { + assert.strictEqual(req.url, '/testpath'); + res.end(); + server.close(); + }) + ); + + server.listen( + 0, + common.mustCall(() => { + https.get( + 'https://example.com/testpath', + + { + hostname: 'localhost', + port: server.address().port, + rejectUnauthorized: false + }, + + common.mustCall((res) => { + res.resume(); + }) + ); + }) + ); +} diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index aad8d663c915..b4fce58c9339 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -53,7 +53,7 @@ function test() { function next() { console.error('output from parent = %s', json); const child = JSON.parse(json); - // now make sure that we can request to the child, then kill it. + // now make sure that we can request to the subprocess, then kill it. http.get({ server: 'localhost', port: child.port, @@ -64,7 +64,7 @@ function test() { s += c.toString(); }); res.on('end', function() { - // kill the child before we start doing asserts. + // kill the subprocess before we start doing asserts. // it's really annoying when tests leave orphans! process.kill(child.pid, 'SIGKILL'); try { diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index b2b9c74a9a2d..6fbc93832454 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -53,7 +53,7 @@ function test() { function next() { console.error('output from parent = %s', json); const child = JSON.parse(json); - // now make sure that we can request to the child, then kill it. + // now make sure that we can request to the subprocess, then kill it. http.get({ server: 'localhost', port: child.port, @@ -64,7 +64,7 @@ function test() { s += c.toString(); }); res.on('end', function() { - // kill the child before we start doing asserts. + // kill the subprocess before we start doing asserts. // it's really annoying when tests leave orphans! process.kill(child.pid, 'SIGKILL'); try { diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index b21b5ee55d2e..7cdba8b40589 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -44,7 +44,7 @@ process.on('exit', function() { // concurrency in HTTP servers! Use the cluster module, or if you want // a more low-level approach, use child process IPC manually. test(function(child, port) { - // now make sure that we can request to the child, then kill it. + // now make sure that we can request to the subprocess, then kill it. http.get({ server: 'localhost', port: port, diff --git a/test/parallel/test-net-server-listen-path.js b/test/parallel/test-net-server-listen-path.js index 22ad50f11ea2..cc73c3fd438a 100644 --- a/test/parallel/test-net-server-listen-path.js +++ b/test/parallel/test-net-server-listen-path.js @@ -63,8 +63,8 @@ function randomPipePath() { }, common.mustCall(() => { if (process.platform !== 'win32') { const mode = fs.statSync(handlePath).mode; - assert.ok(mode & fs.constants.S_IROTH !== 0); - assert.ok(mode & fs.constants.S_IWOTH !== 0); + assert.notStrictEqual(mode & fs.constants.S_IROTH, 0); + assert.notStrictEqual(mode & fs.constants.S_IWOTH, 0); } srv.close(); })); diff --git a/test/parallel/test-next-tick-intentional-starvation.js b/test/parallel/test-next-tick-intentional-starvation.js index fdcdd6a7a609..26d07e02eaa2 100644 --- a/test/parallel/test-next-tick-intentional-starvation.js +++ b/test/parallel/test-next-tick-intentional-starvation.js @@ -23,12 +23,8 @@ require('../common'); const assert = require('assert'); -// this is the inverse of test-next-tick-starvation. -// it verifies that process.nextTick will *always* come before other -// events, up to the limit of the process.maxTickDepth value. - -// WARNING: unsafe! -process.maxTickDepth = Infinity; +// this is the inverse of test-next-tick-starvation. it verifies +// that process.nextTick will *always* come before other events let ran = false; let starved = false; diff --git a/test/parallel/test-readable-single-end.js b/test/parallel/test-readable-single-end.js new file mode 100644 index 000000000000..0969d49aa48e --- /dev/null +++ b/test/parallel/test-readable-single-end.js @@ -0,0 +1,16 @@ +'use strict'; + +const common = require('../common'); +const { Readable } = require('stream'); + +// This test ensures that there will not be an additional empty 'readable' +// event when stream has ended (only 1 event signalling about end) + +const r = new Readable({ + read: () => {}, +}); + +r.push(null); + +r.on('readable', common.mustCall()); +r.on('end', common.mustCall()); diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 35cd3e11afab..8cb4b686b85e 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -162,13 +162,11 @@ const errorTests = [ // Template expressions { send: '`io.js ${"1.0"', - expect: [ - kSource, - kArrow, - '', - /^SyntaxError: /, - '' - ] + expect: '... ' + }, + { + send: '+ ".2"}`', + expect: '\'io.js 1.0.2\'' }, { send: '`io.js ${', @@ -315,6 +313,15 @@ const errorTests = [ send: '1 }', expect: '{ a: 1 }' }, + // Multiline string-keyed object (e.g. JSON) + { + send: '{ "a": ', + expect: '... ' + }, + { + send: '1 }', + expect: '{ a: 1 }' + }, // Multiline anonymous function with comment { send: '(function() {', diff --git a/test/parallel/test-require-exceptions.js b/test/parallel/test-require-exceptions.js index 39298d3ec499..132bffed0f65 100644 --- a/test/parallel/test-require-exceptions.js +++ b/test/parallel/test-require-exceptions.js @@ -20,8 +20,9 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); +const fs = require('fs'); const fixtures = require('../common/fixtures'); // A module with an error in it should throw @@ -52,5 +53,5 @@ function assertModuleNotFound(path) { } function assertExists(fixture) { - assert(common.fileExists(fixtures.path(fixture))); + assert(fs.existsSync(fixtures.path(fixture))); } diff --git a/test/parallel/test-stream-readable-hwm-0.js b/test/parallel/test-stream-readable-hwm-0.js new file mode 100644 index 000000000000..ecbc197d4820 --- /dev/null +++ b/test/parallel/test-stream-readable-hwm-0.js @@ -0,0 +1,30 @@ +'use strict'; + +const common = require('../common'); + +// This test ensures that Readable stream will call _read() for streams +// with highWaterMark === 0 upon .read(0) instead of just trying to +// emit 'readable' event. + +const assert = require('assert'); +const { Readable } = require('stream'); + +const r = new Readable({ + // must be called only once upon setting 'readable' listener + read: common.mustCall(), + highWaterMark: 0, +}); + +let pushedNull = false; +// this will trigger read(0) but must only be called after push(null) +// because the we haven't pushed any data +r.on('readable', common.mustCall(() => { + assert.strictEqual(r.read(), null); + assert.strictEqual(pushedNull, true); +})); +r.on('end', common.mustCall()); +process.nextTick(() => { + assert.strictEqual(r.read(), null); + pushedNull = true; + r.push(null); +}); diff --git a/test/parallel/test-stream-transform-final.js b/test/parallel/test-stream-transform-final.js index 22128b4d9a9f..3d6c4563c6e1 100644 --- a/test/parallel/test-stream-transform-final.js +++ b/test/parallel/test-stream-transform-final.js @@ -59,44 +59,54 @@ The order things are called const t = new stream.Transform({ objectMode: true, transform: common.mustCall(function(chunk, _, next) { - assert.strictEqual(++state, chunk, 'transformCallback part 1'); + // transformCallback part 1 + assert.strictEqual(++state, chunk); this.push(state); - assert.strictEqual(++state, chunk + 2, 'transformCallback part 2'); + // transformCallback part 2 + assert.strictEqual(++state, chunk + 2); process.nextTick(next); }, 3), final: common.mustCall(function(done) { state++; - assert.strictEqual(state, 10, 'finalCallback part 1'); + // finalCallback part 1 + assert.strictEqual(state, 10); setTimeout(function() { state++; - assert.strictEqual(state, 11, 'finalCallback part 2'); + // finalCallback part 2 + assert.strictEqual(state, 11); done(); }, 100); }, 1), flush: common.mustCall(function(done) { state++; - assert.strictEqual(state, 12, 'flushCallback part 1'); + // flushCallback part 1 + assert.strictEqual(state, 12); process.nextTick(function() { state++; - assert.strictEqual(state, 15, 'flushCallback part 2'); + // flushCallback part 2 + assert.strictEqual(state, 15); done(); }); }, 1) }); t.on('finish', common.mustCall(function() { state++; - assert.strictEqual(state, 13, 'finishListener'); + // finishListener + assert.strictEqual(state, 13); }, 1)); t.on('end', common.mustCall(function() { state++; - assert.strictEqual(state, 16, 'end event'); + // end event + assert.strictEqual(state, 16); }, 1)); t.on('data', common.mustCall(function(d) { - assert.strictEqual(++state, d + 1, 'dataListener'); + // dataListener + assert.strictEqual(++state, d + 1); }, 3)); t.write(1); t.write(4); t.end(7, common.mustCall(function() { state++; - assert.strictEqual(state, 14, 'endMethodCallback'); + // endMethodCallback + assert.strictEqual(state, 14); }, 1)); diff --git a/test/parallel/test-stream2-read-sync-stack.js b/test/parallel/test-stream2-read-sync-stack.js index 3fa84547fe23..e6a5ea7e5216 100644 --- a/test/parallel/test-stream2-read-sync-stack.js +++ b/test/parallel/test-stream2-read-sync-stack.js @@ -22,13 +22,13 @@ 'use strict'; const common = require('../common'); const Readable = require('stream').Readable; + +// This tests synchronous read callbacks and verifies that even if they nest +// heavily the process handles it without an error + const r = new Readable(); const N = 256 * 1024; -// Go ahead and allow the pathological case for this test. -// Yes, it's an infinite loop, that's the point. -process.maxTickDepth = N + 2; - let reads = 0; r._read = function(n) { const chunk = reads++ === N ? null : Buffer.allocUnsafe(1); diff --git a/test/parallel/test-tls-cert-chains-concat.js b/test/parallel/test-tls-cert-chains-concat.js index 88f3d3348c37..e9adc6c31610 100644 --- a/test/parallel/test-tls-cert-chains-concat.js +++ b/test/parallel/test-tls-cert-chains-concat.js @@ -27,7 +27,7 @@ connect({ assert.strictEqual(peer.subject.emailAddress, 'adam.lippai@tresorit.com'); assert.strictEqual(peer.subject.CN, 'Ádám Lippai'), assert.strictEqual(peer.issuer.CN, 'ca3'); - assert.strictEqual(peer.serialNumber, 'C4CD893EF9A75DCC'); + assert.strictEqual(peer.serialNumber, 'E987DB4B683F4181'); const next = pair.client.conn.getPeerCertificate(true).issuerCertificate; const root = next.issuerCertificate; @@ -35,12 +35,12 @@ connect({ debug('next:\n', next); assert.strictEqual(next.subject.CN, 'ca3'); assert.strictEqual(next.issuer.CN, 'ca1'); - assert.strictEqual(next.serialNumber, '9A84ABCFB8A72ABF'); + assert.strictEqual(next.serialNumber, 'FAD50CC6A07F516D'); debug('root:\n', root); assert.strictEqual(root.subject.CN, 'ca1'); assert.strictEqual(root.issuer.CN, 'ca1'); - assert.strictEqual(root.serialNumber, '8DF21C01468AF393'); + assert.strictEqual(root.serialNumber, 'EE586A7D0951D7B3'); // No client cert, so empty object returned. assert.deepStrictEqual(pair.server.conn.getPeerCertificate(), {}); diff --git a/test/parallel/test-tls-cert-chains-in-ca.js b/test/parallel/test-tls-cert-chains-in-ca.js index 9cd33fcff641..b92b1df25736 100644 --- a/test/parallel/test-tls-cert-chains-in-ca.js +++ b/test/parallel/test-tls-cert-chains-in-ca.js @@ -30,16 +30,16 @@ connect({ const peer = pair.client.conn.getPeerCertificate(); debug('peer:\n', peer); - assert.strictEqual(peer.serialNumber, 'C4CD893EF9A75DCC'); + assert.strictEqual(peer.serialNumber, 'E987DB4B683F4181'); const next = pair.client.conn.getPeerCertificate(true).issuerCertificate; const root = next.issuerCertificate; delete next.issuerCertificate; debug('next:\n', next); - assert.strictEqual(next.serialNumber, '9A84ABCFB8A72ABF'); + assert.strictEqual(next.serialNumber, 'FAD50CC6A07F516D'); debug('root:\n', root); - assert.strictEqual(root.serialNumber, '8DF21C01468AF393'); + assert.strictEqual(root.serialNumber, 'EE586A7D0951D7B3'); return cleanup(); }); diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 5ce714554056..75b35c5f3c5b 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -27,14 +27,17 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); +const { ShutdownWrap } = process.binding('stream_wrap'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem') }, function(c) { // Send close-notify without shutting down TCP socket - if (c._handle.shutdownSSL() !== 1) - c._handle.shutdownSSL(); + const req = new ShutdownWrap(); + req.oncomplete = common.mustCall(() => {}); + req.handle = c._handle; + c._handle.shutdown(req); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { rejectUnauthorized: false diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index 4a7d8999c78d..4b92f6bde315 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -60,6 +60,7 @@ const server = tls.createServer(options, function(c) { })); client.on('close', common.mustCall(function(hadError) { - assert.strictEqual(hadError, true, 'Client never errored'); + // Confirm that client errored + assert.strictEqual(hadError, true); })); })); diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index b183309af714..6ed19c74d22f 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -221,7 +221,7 @@ server.listen(0, common.mustCall(function() { }, common.mustCall()); })).unref(); -const errMessagePassword = /bad password read/; +const errMessagePassword = /bad decrypt/; // Missing passphrase assert.throws(function() { diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index e5de378675f2..266f5571410f 100644 --- a/test/parallel/test-tls-peer-certificate.js +++ b/test/parallel/test-tls-peer-certificate.js @@ -51,28 +51,28 @@ connect({ assert.ok(peerCert.issuerCertificate); assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org'); - assert.strictEqual(peerCert.serialNumber, '9A84ABCFB8A72AC0'); + assert.strictEqual(peerCert.serialNumber, 'FAD50CC6A07F516C'); assert.strictEqual(peerCert.exponent, '0x10001'); assert.strictEqual( peerCert.fingerprint, - '8D:06:3A:B3:E5:8B:85:29:72:4F:7D:1B:54:CD:95:19:3C:EF:6F:AA' + '6E:C0:F0:78:84:56:93:02:C9:07:AD:0C:6D:96:80:CC:85:6D:CE:3B' ); assert.strictEqual( peerCert.fingerprint256, - 'A1:DC:01:1A:EC:A3:7B:86:A8:C2:3E:26:9F:EB:EE:5C:A9:3B:BE:06' + - ':4C:A4:00:53:93:A9:66:07:A7:BC:13:32' + 'CC:CC:38:43:CB:DF:CC:C6:DD:15:96:F3:3A:D2:44:F9:23:AE:43:C4:DF:A6:AC:E5:' + + '12:C8:9D:1C:8F:DE:41:ED' ); // SHA256 fingerprint of the public key assert.strictEqual( sha256(peerCert.pubkey).digest('hex'), - 'fa5152e4407bad1e7537ef5bfc3f19fa9a62ee04432fd75e109b1803704c31ba' + '479b505833d21ee26565568def9b92b4771d052cdb2109db5ad6e3747075aa26' ); // HPKP / RFC7469 "pin-sha256" of the public key assert.strictEqual( sha256(peerCert.pubkey).digest('base64'), - '+lFS5EB7rR51N+9b/D8Z+ppi7gRDL9deEJsYA3BMMbo=' + 'R5tQWDPSHuJlZVaN75uStHcdBSzbIQnbWtbjdHB1qiY=' ); assert.deepStrictEqual(peerCert.infoAccess['OCSP - URI'], @@ -80,7 +80,7 @@ connect({ const issuer = peerCert.issuerCertificate; assert.strictEqual(issuer.issuerCertificate, issuer); - assert.strictEqual(issuer.serialNumber, '8DF21C01468AF393'); + assert.strictEqual(issuer.serialNumber, 'EE586A7D0951D7B3'); return cleanup(); }); diff --git a/test/parallel/test-trace-event-promises.js b/test/parallel/test-trace-event-promises.js new file mode 100644 index 000000000000..3088be529600 --- /dev/null +++ b/test/parallel/test-trace-event-promises.js @@ -0,0 +1,48 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const cp = require('child_process'); +const path = require('path'); +const fs = require('fs'); +const tmpdir = require('../common/tmpdir'); + +common.disableCrashOnUnhandledRejection(); + +if (!common.isMainThread) + common.skip('process.chdir is not available in Workers'); + +if (process.argv[2] === 'child') { + const p = Promise.reject(1); // Handled later + Promise.reject(2); // Unhandled + setImmediate(() => { + p.catch(() => { /* intentional noop */ }); + }); +} else { + tmpdir.refresh(); + process.chdir(tmpdir.path); + + const proc = cp.fork(__filename, + [ 'child' ], { + execArgv: [ + '--no-warnings', + '--trace-event-categories', + 'node.promises.rejections' + ] + }); + + proc.once('exit', common.mustCall(() => { + const file = path.join(tmpdir.path, 'node_trace.1.log'); + + assert(fs.existsSync(file)); + fs.readFile(file, common.mustCall((err, data) => { + const traces = JSON.parse(data.toString()).traceEvents + .filter((trace) => trace.cat !== '__metadata'); + traces.forEach((trace) => { + assert.strictEqual(trace.pid, proc.pid); + assert.strictEqual(trace.name, 'rejections'); + assert(trace.args.unhandled <= 2); + assert(trace.args.handledAfter <= 1); + }); + })); + })); +} diff --git a/test/parallel/test-trace-events-all.js b/test/parallel/test-trace-events-all.js index 585d4acd18e6..f3d38cb4286b 100644 --- a/test/parallel/test-trace-events-all.js +++ b/test/parallel/test-trace-events-all.js @@ -19,7 +19,7 @@ const proc = cp.spawn(process.execPath, [ '--trace-events-enabled', '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-api.js b/test/parallel/test-trace-events-api.js index 5dd4c623c022..44193cec0e2b 100644 --- a/test/parallel/test-trace-events-api.js +++ b/test/parallel/test-trace-events-api.js @@ -130,7 +130,7 @@ if (isChild) { proc.once('exit', common.mustCall(() => { const file = path.join(tmpdir.path, 'node_trace.1.log'); - assert(common.fileExists(file)); + assert(fs.existsSync(file)); fs.readFile(file, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat !== '__metadata'); diff --git a/test/parallel/test-trace-events-async-hooks.js b/test/parallel/test-trace-events-async-hooks.js index 9dd71eda4c6d..8374b6546a6e 100644 --- a/test/parallel/test-trace-events-async-hooks.js +++ b/test/parallel/test-trace-events-async-hooks.js @@ -21,7 +21,7 @@ const proc = cp.spawn(process.execPath, '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-binding.js b/test/parallel/test-trace-events-binding.js index f50c13218409..7ce75ace3309 100644 --- a/test/parallel/test-trace-events-binding.js +++ b/test/parallel/test-trace-events-binding.js @@ -32,7 +32,7 @@ const proc = cp.spawn(process.execPath, '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat !== '__metadata'); diff --git a/test/parallel/test-trace-events-bootstrap.js b/test/parallel/test-trace-events-bootstrap.js index c0f8a49c855b..8d5e00f00f8b 100644 --- a/test/parallel/test-trace-events-bootstrap.js +++ b/test/parallel/test-trace-events-bootstrap.js @@ -43,7 +43,7 @@ if (process.argv[2] === 'child') { proc.once('exit', common.mustCall(() => { const file = path.join(tmpdir.path, 'node_trace.1.log'); - assert(common.fileExists(file)); + assert(fs.existsSync(file)); fs.readFile(file, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat !== '__metadata'); diff --git a/test/parallel/test-trace-events-file-pattern.js b/test/parallel/test-trace-events-file-pattern.js index c8098a43979b..60a3296c6429 100644 --- a/test/parallel/test-trace-events-file-pattern.js +++ b/test/parallel/test-trace-events-file-pattern.js @@ -25,7 +25,7 @@ const proc = cp.spawn(process.execPath, [ proc.once('exit', common.mustCall(() => { const expectedFilename = `${proc.pid}-1-${proc.pid}-1.tracing.log`; - assert(common.fileExists(expectedFilename)); + assert(fs.existsSync(expectedFilename)); fs.readFile(expectedFilename, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-fs-sync.js b/test/parallel/test-trace-events-fs-sync.js index 77ec08634063..71ffc9da726f 100644 --- a/test/parallel/test-trace-events-fs-sync.js +++ b/test/parallel/test-trace-events-fs-sync.js @@ -139,7 +139,7 @@ for (const tr in tests) { assert.strictEqual(proc.status, 0, `${tr}:\n${util.inspect(proc)}`); // Confirm that trace log file is created. - assert(common.fileExists(traceFile)); + assert(fs.existsSync(traceFile)); const data = fs.readFileSync(traceFile); const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-metadata.js b/test/parallel/test-trace-events-metadata.js index 01e019c19069..aeb605beb0cb 100644 --- a/test/parallel/test-trace-events-metadata.js +++ b/test/parallel/test-trace-events-metadata.js @@ -21,7 +21,7 @@ const proc = cp.spawn(process.execPath, '--title=bar', '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat === '__metadata'); diff --git a/test/parallel/test-trace-events-none.js b/test/parallel/test-trace-events-none.js index e6beea3b9753..4c2fe0ca2161 100644 --- a/test/parallel/test-trace-events-none.js +++ b/test/parallel/test-trace-events-none.js @@ -21,7 +21,7 @@ const proc_no_categories = cp.spawn( ); proc_no_categories.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); // Only __metadata categories should have been emitted. fs.readFile(FILE_NAME, common.mustCall((err, data) => { assert.ok(JSON.parse(data.toString()).traceEvents.every( diff --git a/test/parallel/test-trace-events-perf.js b/test/parallel/test-trace-events-perf.js index 8ca5a41eac23..27eef28fb123 100644 --- a/test/parallel/test-trace-events-perf.js +++ b/test/parallel/test-trace-events-perf.js @@ -50,7 +50,7 @@ if (process.argv[2] === 'child') { proc.once('exit', common.mustCall(() => { const file = path.join(tmpdir.path, 'node_trace.1.log'); - assert(common.fileExists(file)); + assert(fs.existsSync(file)); fs.readFile(file, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat !== '__metadata'); diff --git a/test/parallel/test-trace-events-process-exit.js b/test/parallel/test-trace-events-process-exit.js index aeb9fc19c298..254963c2d3a7 100644 --- a/test/parallel/test-trace-events-process-exit.js +++ b/test/parallel/test-trace-events-process-exit.js @@ -19,7 +19,7 @@ const proc = cp.spawn(process.execPath, '-e', 'process.exit()' ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-v8.js b/test/parallel/test-trace-events-v8.js index 325789e96865..183a8382a4e5 100644 --- a/test/parallel/test-trace-events-v8.js +++ b/test/parallel/test-trace-events-v8.js @@ -21,7 +21,7 @@ const proc = cp.spawn(process.execPath, '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-trace-events-vm.js b/test/parallel/test-trace-events-vm.js index 45724e3e4c88..758de3e964f7 100644 --- a/test/parallel/test-trace-events-vm.js +++ b/test/parallel/test-trace-events-vm.js @@ -33,7 +33,7 @@ if (process.argv[2] === 'child') { proc.once('exit', common.mustCall(() => { const file = path.join(tmpdir.path, 'node_trace.1.log'); - assert(common.fileExists(file)); + assert(fs.existsSync(file)); fs.readFile(file, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents .filter((trace) => trace.cat !== '__metadata'); diff --git a/test/parallel/test-trace-events-worker-metadata.js b/test/parallel/test-trace-events-worker-metadata.js index 8d21d6b7ab9e..e672aeefd721 100644 --- a/test/parallel/test-trace-events-worker-metadata.js +++ b/test/parallel/test-trace-events-worker-metadata.js @@ -19,7 +19,7 @@ if (isMainThread) { '--trace-event-categories', 'node', '-e', CODE ]); proc.once('exit', common.mustCall(() => { - assert(common.fileExists(FILE_NAME)); + assert(fs.existsSync(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { const traces = JSON.parse(data.toString()).traceEvents; assert(traces.length > 0); diff --git a/test/parallel/test-tracing-no-crash.js b/test/parallel/test-tracing-no-crash.js new file mode 100644 index 000000000000..816bd95df02e --- /dev/null +++ b/test/parallel/test-tracing-no-crash.js @@ -0,0 +1,14 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { spawn } = require('child_process'); + +function CheckNoSignalAndErrorCodeOne(code, signal) { + assert.strictEqual(null, signal); + assert.strictEqual(1, code); +} + +const child = spawn(process.execPath, + ['--trace-event-categories', 'madeup', '-e', + 'throw new Error()'], { stdio: 'inherit' }); +child.on('exit', common.mustCall(CheckNoSignalAndErrorCodeOne)); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 708eccee2734..183fbb16e39c 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -447,13 +447,15 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324'); { const map = new Map(); map.set(1, 2); - const [ vals ] = previewEntries(map.entries()); - const valsOutput = []; - for (const o of vals) { - valsOutput.push(o); - } - - assert.strictEqual(util.inspect(valsOutput), '[ 1, 2 ]'); + // Passing only a single argument to indicate a set iterator. + const valsSetIterator = previewEntries(map.entries()); + // Passing through true to indicate a map iterator. + const valsMapIterEntries = previewEntries(map.entries(), true); + const valsMapIterKeys = previewEntries(map.keys(), true); + + assert.strictEqual(util.inspect(valsSetIterator), '[ 1, 2 ]'); + assert.strictEqual(util.inspect(valsMapIterEntries), '[ [ 1, 2 ], true ]'); + assert.strictEqual(util.inspect(valsMapIterKeys), '[ [ 1 ], false ]'); } // Test for other constructors in different context. @@ -965,18 +967,19 @@ if (typeof Symbol !== 'undefined') { // Test Map iterators. { const map = new Map([['foo', 'bar']]); - assert.strictEqual(util.inspect(map.keys()), "[Map Iterator] { 'foo' }"); - assert.strictEqual(util.inspect(map.values()), "[Map Iterator] { 'bar' }"); - assert.strictEqual(util.inspect(map.entries()), - "[Map Iterator] { [ 'foo', 'bar' ] }"); + assert.strictEqual(util.inspect(map.keys()), '[Map Iterator] { \'foo\' }'); + assert.strictEqual(util.inspect(map.values()), '[Map Iterator] { \'bar\' }'); + map.set('A', 'B!'); + assert.strictEqual(util.inspect(map.entries(), { maxArrayLength: 1 }), + "[Map Iterator] { [ 'foo', 'bar' ], ... 1 more item }"); // Make sure the iterator doesn't get consumed. const keys = map.keys(); - assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo' }"); - assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo' }"); + assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo', 'A' }"); + assert.strictEqual(util.inspect(keys), "[Map Iterator] { 'foo', 'A' }"); keys.extra = true; assert.strictEqual( util.inspect(keys, { maxArrayLength: 0 }), - '[Map Iterator] { ... more items, extra: true }'); + '[Map Iterator] { ... 2 more items, extra: true }'); } // Test Set iterators. @@ -992,7 +995,7 @@ if (typeof Symbol !== 'undefined') { keys.extra = true; assert.strictEqual( util.inspect(keys, { maxArrayLength: 1 }), - '[Set Iterator] { 1, ... more items, extra: true }'); + '[Set Iterator] { 1, ... 1 more item, extra: true }'); } // Test alignment of items in container. @@ -1413,17 +1416,17 @@ util.inspect(process); assert.strictEqual(out, expect); out = util.inspect(weakMap, { maxArrayLength: 0, showHidden: true }); - expect = 'WeakMap { ... more items }'; + expect = 'WeakMap { ... 2 more items }'; assert.strictEqual(out, expect); weakMap.extra = true; out = util.inspect(weakMap, { maxArrayLength: 1, showHidden: true }); // It is not possible to determine the output reliable. - expect = 'WeakMap { [ [length]: 0 ] => {}, ... more items, extra: true }'; - const expectAlt = 'WeakMap { {} => [ [length]: 0 ], ... more items, ' + + expect = 'WeakMap { [ [length]: 0 ] => {}, ... 1 more item, extra: true }'; + const expectAlt = 'WeakMap { {} => [ [length]: 0 ], ... 1 more item, ' + 'extra: true }'; assert(out === expect || out === expectAlt, - `Found "${out}" rather than "${expect}" or "${expectAlt}"`); + `Found: "${out}"\nrather than: "${expect}"\nor: "${expectAlt}"`); } { // Test WeakSet @@ -1437,17 +1440,17 @@ util.inspect(process); assert.strictEqual(out, expect); out = util.inspect(weakSet, { maxArrayLength: -2, showHidden: true }); - expect = 'WeakSet { ... more items }'; + expect = 'WeakSet { ... 2 more items }'; assert.strictEqual(out, expect); weakSet.extra = true; out = util.inspect(weakSet, { maxArrayLength: 1, showHidden: true }); // It is not possible to determine the output reliable. - expect = 'WeakSet { {}, ... more items, extra: true }'; - const expectAlt = 'WeakSet { [ 1, [length]: 1 ], ... more items, ' + + expect = 'WeakSet { {}, ... 1 more item, extra: true }'; + const expectAlt = 'WeakSet { [ 1, [length]: 1 ], ... 1 more item, ' + 'extra: true }'; assert(out === expect || out === expectAlt, - `Found "${out}" rather than "${expect}" or "${expectAlt}"`); + `Found: "${out}"\nrather than: "${expect}"\nor: "${expectAlt}"`); } { // Test argument objects. diff --git a/test/pseudo-tty/test-readable-tty-keepalive.js b/test/pseudo-tty/test-readable-tty-keepalive.js new file mode 100644 index 000000000000..4cf0b9fb2963 --- /dev/null +++ b/test/pseudo-tty/test-readable-tty-keepalive.js @@ -0,0 +1,29 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +// This test ensures that Node.js will not ignore tty 'readable' subscribers +// when it's the only tty subscriber and the only thing keeping event loop alive +// https://github.com/nodejs/node/issues/20503 + +process.stdin.setEncoding('utf8'); + +const expectedInput = ['foo', 'bar', null]; + +process.stdin.on('readable', common.mustCall(function() { + const data = process.stdin.read(); + assert.strictEqual(data, expectedInput.shift()); +}, 3)); // first 2 data, then end + +process.stdin.on('end', common.mustCall()); + +setTimeout(() => { + process.stdin.push('foo'); + process.nextTick(() => { + process.stdin.push('bar'); + process.nextTick(() => { + process.stdin.push(null); + }); + }); +}, 1); diff --git a/test/pseudo-tty/test-readable-tty-keepalive.out b/test/pseudo-tty/test-readable-tty-keepalive.out new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/pummel/test-fs-watch-file-slow.js b/test/pummel/test-fs-watch-file-slow.js index 7b7065cffbfe..cf7adc913db2 100644 --- a/test/pummel/test-fs-watch-file-slow.js +++ b/test/pummel/test-fs-watch-file-slow.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const path = require('path'); const fs = require('fs'); @@ -42,14 +42,14 @@ fs.watchFile(FILENAME, { interval: TIMEOUT - 250 }, function(curr, prev) { console.log([curr, prev]); switch (++nevents) { case 1: - assert.strictEqual(common.fileExists(FILENAME), false); + assert.strictEqual(fs.existsSync(FILENAME), false); break; case 2: case 3: - assert.strictEqual(common.fileExists(FILENAME), true); + assert.strictEqual(fs.existsSync(FILENAME), true); break; case 4: - assert.strictEqual(common.fileExists(FILENAME), false); + assert.strictEqual(fs.existsSync(FILENAME), false); fs.unwatchFile(FILENAME); break; default: diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status index c5873b9060f8..ab94c7dbec50 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -10,10 +10,6 @@ prefix sequential test-fs-readfile-tostring-fail: PASS, FLAKY [$system==win32] -test-inspector-async-call-stack : PASS, FLAKY -test-inspector-async-hook-setup-at-signal: PASS, FLAKY -test-inspector-bindings : PASS, FLAKY -test-inspector-debug-end : PASS, FLAKY [$system==linux] diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index 931763cf3c70..9a8f97c2bb28 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.js @@ -58,8 +58,8 @@ if (process.argv[2] === 'child') { const child = fork(process.argv[1], ['child']); child.on('exit', function(code, signal) { - if (!childKilled) - throw new Error('child died unexpectedly!'); + if (!subprocessKilled) + throw new Error('subprocess died unexpectedly!'); }); const server = net.createServer(); @@ -86,10 +86,10 @@ if (process.argv[2] === 'child') { } }); - let childKilled = false; + let subprocessKilled = false; function closeSockets(i) { if (i === count) { - childKilled = true; + subprocessKilled = true; server.close(); child.kill(); return; diff --git a/test/parallel/test-http-client-timeout-option-with-agent.js b/test/sequential/test-http-client-timeout-option-with-agent.js similarity index 100% rename from test/parallel/test-http-client-timeout-option-with-agent.js rename to test/sequential/test-http-client-timeout-option-with-agent.js diff --git a/test/sequential/test-http2-large-file.js b/test/sequential/test-http2-large-file.js new file mode 100644 index 000000000000..d1a44e8d6be5 --- /dev/null +++ b/test/sequential/test-http2-large-file.js @@ -0,0 +1,39 @@ +'use strict'; + +// Test to ensure sending a large stream with a large initial window size works +// See: https://github.com/nodejs/node/issues/19141 + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const http2 = require('http2'); + +const server = http2.createServer({ settings: { initialWindowSize: 6553500 } }); +server.on('stream', (stream) => { + stream.resume(); + stream.respond(); + stream.end('ok'); +}); + +server.listen(0, common.mustCall(() => { + let remaining = 1e8; + const chunk = 1e6; + const client = http2.connect(`http://localhost:${server.address().port}`, + { settings: { initialWindowSize: 6553500 } }); + const request = client.request({ ':method': 'POST' }); + function writeChunk() { + if (remaining > 0) { + remaining -= chunk; + request.write(Buffer.alloc(chunk, 'a'), writeChunk); + } else { + request.end(); + } + } + writeChunk(); + request.on('close', common.mustCall(() => { + client.close(); + server.close(); + })); + request.resume(); +})); diff --git a/test/sequential/test-http2-session-timeout.js b/test/sequential/test-http2-session-timeout.js index 48e98998c700..5c4f047b338e 100644 --- a/test/sequential/test-http2-session-timeout.js +++ b/test/sequential/test-http2-session-timeout.js @@ -3,13 +3,12 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -const h2 = require('http2'); +const http2 = require('http2'); const serverTimeout = common.platformTimeout(200); -const callTimeout = common.platformTimeout(20); const mustNotCall = common.mustNotCall(); -const server = h2.createServer(); +const server = http2.createServer(); server.timeout = serverTimeout; server.on('request', (req, res) => res.end()); @@ -19,7 +18,7 @@ server.listen(0, common.mustCall(() => { const port = server.address().port; const url = `http://localhost:${port}`; - const client = h2.connect(url); + const client = http2.connect(url); const startTime = process.hrtime(); makeReq(); @@ -37,7 +36,7 @@ server.listen(0, common.mustCall(() => { const diff = process.hrtime(startTime); const milliseconds = (diff[0] * 1e3 + diff[1] / 1e6); if (milliseconds < serverTimeout * 2) { - setTimeout(makeReq, callTimeout); + setImmediate(makeReq); } else { server.removeListener('timeout', mustNotCall); server.close(); diff --git a/test/sequential/test-inspector-scriptparsed-context.js b/test/sequential/test-inspector-scriptparsed-context.js index 1e862e9174cb..e5c3acfdbb8f 100644 --- a/test/sequential/test-inspector-scriptparsed-context.js +++ b/test/sequential/test-inspector-scriptparsed-context.js @@ -9,27 +9,17 @@ const script = ` 'use strict'; const assert = require('assert'); const vm = require('vm'); - const { kParsingContext } = process.binding('contextify'); global.outer = true; global.inner = false; const context = vm.createContext({ outer: false, inner: true }); + const script = new vm.Script("outer"); debugger; - const scriptMain = new vm.Script("outer"); - debugger; - - const scriptContext = new vm.Script("inner", { - [kParsingContext]: context - }); - debugger; - - assert.strictEqual(scriptMain.runInThisContext(), true); - assert.strictEqual(scriptMain.runInContext(context), false); - assert.strictEqual(scriptContext.runInThisContext(), false); - assert.strictEqual(scriptContext.runInContext(context), true); + assert.strictEqual(script.runInThisContext(), true); + assert.strictEqual(script.runInContext(context), false); debugger; vm.runInContext('inner', context); @@ -64,35 +54,25 @@ async function runTests() { await session.waitForBreakOnLine(0, '[eval]'); await session.send({ 'method': 'Runtime.enable' }); - const topContext = await getContext(session); + await getContext(session); await session.send({ 'method': 'Debugger.resume' }); const childContext = await getContext(session); await session.waitForBreakOnLine(13, '[eval]'); - console.error('[test]', 'Script associated with current context by default'); - await session.send({ 'method': 'Debugger.resume' }); - await checkScriptContext(session, topContext); - await session.waitForBreakOnLine(16, '[eval]'); - - console.error('[test]', 'Script associated with selected context'); - await session.send({ 'method': 'Debugger.resume' }); - await checkScriptContext(session, childContext); - await session.waitForBreakOnLine(21, '[eval]'); - console.error('[test]', 'Script is unbound'); await session.send({ 'method': 'Debugger.resume' }); - await session.waitForBreakOnLine(27, '[eval]'); + await session.waitForBreakOnLine(17, '[eval]'); console.error('[test]', 'vm.runInContext associates script with context'); await session.send({ 'method': 'Debugger.resume' }); await checkScriptContext(session, childContext); - await session.waitForBreakOnLine(30, '[eval]'); + await session.waitForBreakOnLine(20, '[eval]'); console.error('[test]', 'vm.runInNewContext associates script with context'); await session.send({ 'method': 'Debugger.resume' }); const thirdContext = await getContext(session); await checkScriptContext(session, thirdContext); - await session.waitForBreakOnLine(33, '[eval]'); + await session.waitForBreakOnLine(23, '[eval]'); console.error('[test]', 'vm.runInNewContext can contain debugger statements'); await session.send({ 'method': 'Debugger.resume' }); diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index 565cdb458cfd..70d924cfa34b 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -39,7 +39,6 @@ if (process.argv[2] !== 'child') { const domain = require('domain'); const d = domain.create(); - process.maxTickDepth = 10; // in the error handler, we trigger several MakeCallback events d.on('error', function() { diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js deleted file mode 100644 index 96986a74a631..000000000000 --- a/test/timers/test-timers-reliability.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; -// FaketimeFlags: --exclude-monotonic -f '2014-07-21 09:00:00' - -require('../common'); - -const Timer = process.binding('timer_wrap').Timer; -const assert = require('assert'); - -let timerFired = false; -let intervalFired = false; - -/* - * This test case aims at making sure that timing utilities such - * as setTimeout and setInterval are not vulnerable to time - * drifting or inconsistent time changes (such as ntp time sync - * in the past, etc.). - * - * It is run using faketime so that we change how - * non-monotonic clocks perceive time movement. We freeze - * non-monotonic time, and check if setTimeout and setInterval - * work properly in that situation. - * - * We check this by setting a timer based on a monotonic clock - * to fire after setTimeout's callback is supposed to be called. - * This monotonic timer, by definition, is not subject to time drifting - * and inconsistent time changes, so it can be considered as a solid - * reference. - * - * When the monotonic timer fires, if the setTimeout's callback - * hasn't been called yet, it means that setTimeout's underlying timer - * is vulnerable to time drift or inconsistent time changes. - */ - -const monoTimer = new Timer(); -monoTimer[Timer.kOnTimeout] = function() { - /* - * Make sure that setTimeout's and setInterval's callbacks have - * already fired, otherwise it means that they are vulnerable to - * time drifting or inconsistent time changes. - */ - assert(timerFired); - assert(intervalFired); -}; - -monoTimer.start(300); - -setTimeout(function() { - timerFired = true; -}, 200); - -const interval = setInterval(function() { - intervalFired = true; - clearInterval(interval); -}, 200); diff --git a/test/timers/testcfg.py b/test/timers/testcfg.py deleted file mode 100644 index b766db16910c..000000000000 --- a/test/timers/testcfg.py +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2008 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import test -import os -from os.path import join, exists -import re -import shlex - -FAKETIME_FLAGS_PATTERN = re.compile(r"//\s+FaketimeFlags:(.*)") -FAKETIME_BIN_PATH = os.path.join("tools", "faketime", "src", "faketime") - -class TimersTestCase(test.TestCase): - - def __init__(self, path, file, arch, mode, context, config): - super(TimersTestCase, self).__init__(context, path, arch, mode) - self.file = file - self.config = config - self.arch = arch - self.mode = mode - - def GetLabel(self): - return "%s %s" % (self.mode, self.GetName()) - - def GetName(self): - return self.path[-1] - - def GetCommand(self): - result = [FAKETIME_BIN_PATH]; - - source = open(self.file).read() - faketime_flags_match = FAKETIME_FLAGS_PATTERN.search(source) - if faketime_flags_match: - result += shlex.split(faketime_flags_match.group(1).strip()) - - result += [self.config.context.GetVm(self.arch, self.mode)] - result += [self.file] - - return result - - def GetSource(self): - return open(self.file).read() - - -class TimersTestConfiguration(test.TestConfiguration): - - def __init__(self, context, root): - super(TimersTestConfiguration, self).__init__(context, root) - - def Ls(self, path): - def SelectTest(name): - return name.startswith('test-') and name.endswith('.js') - return [f[:-3] for f in os.listdir(path) if SelectTest(f)] - - def ListTests(self, current_path, path, arch, mode): - all_tests = [current_path + [t] for t in self.Ls(join(self.root))] - result = [] - for test in all_tests: - if self.Contains(path, test): - file_path = join(self.root, reduce(join, test[1:], "") + ".js") - result.append(TimersTestCase(test, file_path, arch, mode, - self.context, self)) - return result - - def GetBuildRequirements(self): - return ['sample', 'sample=shell'] - - def GetTestStatus(self, sections, defs): - status_file = join(self.root, 'simple.status') - if exists(status_file): - test.ReadConfigurationInto(status_file, sections, defs) - - - -def GetConfiguration(context, root): - return TimersTestConfiguration(context, root) diff --git a/test/v8-updates/test-postmortem-metadata.js b/test/v8-updates/test-postmortem-metadata.js index 82dfb2c9a9fb..2efaf16135ad 100644 --- a/test/v8-updates/test-postmortem-metadata.js +++ b/test/v8-updates/test-postmortem-metadata.js @@ -105,7 +105,7 @@ function getExpectedSymbols() { 'v8dbg_class_SlicedString__parent__String', 'v8dbg_class_String__length__SMI', 'v8dbg_class_ThinString__actual__String', - 'v8dbg_context_idx_closure', + 'v8dbg_context_idx_scope_info', 'v8dbg_context_idx_prev', 'v8dbg_context_min_slots', 'v8dbg_frametype_ArgumentsAdaptorFrame', diff --git a/tools/Makefile b/tools/Makefile deleted file mode 100644 index d627c149d674..000000000000 --- a/tools/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -FAKETIME_REPO := git://github.com/wolfcw/libfaketime.git -FAKETIME_LOCAL_REPO := $(CURDIR)/faketime -FAKETIME_BRANCH := master -FAKETIME_BINARY := $(FAKETIME_PREFIX)/bin/faketime - -.PHONY: faketime - -faketime: $(FAKETIME_BINARY) - -clean: - $(RM) -r $(FAKETIME_LOCAL_REPO) - -$(FAKETIME_BINARY): $(FAKETIME_LOCAL_REPO) - cd $(FAKETIME_LOCAL_REPO) && \ - git checkout $(FAKETIME_BRANCH) && \ - PREFIX=$(FAKETIME_LOCAL_REPO)/src make - -$(FAKETIME_LOCAL_REPO): - git clone $(FAKETIME_REPO) $(FAKETIME_LOCAL_REPO) - diff --git a/tools/clang-format/package.json b/tools/clang-format/package.json new file mode 100644 index 000000000000..8432296ed6f1 --- /dev/null +++ b/tools/clang-format/package.json @@ -0,0 +1,9 @@ +{ + "name": "node-core-clang-format", + "version": "1.0.0", + "description": "Formatting C++ files for Node.js core", + "license": "MIT", + "dependencies": { + "clang-format": "1.2.3" + } +} diff --git a/tools/doc/addon-verify.js b/tools/doc/addon-verify.js index a3d1beb4b8e1..ae6a08b2cc64 100644 --- a/tools/doc/addon-verify.js +++ b/tools/doc/addon-verify.js @@ -1,28 +1,38 @@ 'use strict'; -const { mkdir, readFileSync, writeFile } = require('fs'); +// doc/api/addons.md has a bunch of code. Extract it for verification +// that the C++ code compiles and the js code runs. +// Add .gyp files which will be used to compile the C++ code. +// Modify the require paths in the js code to pull from the build tree. +// Triggered from the build-addons target in the Makefile and vcbuild.bat. + +const { mkdir, writeFile } = require('fs'); const { resolve } = require('path'); -const { lexer } = require('marked'); +const vfile = require('to-vfile'); +const unified = require('unified'); +const remarkParse = require('remark-parse'); const rootDir = resolve(__dirname, '..', '..'); const doc = resolve(rootDir, 'doc', 'api', 'addons.md'); const verifyDir = resolve(rootDir, 'test', 'addons'); -const tokens = lexer(readFileSync(doc, 'utf8')); +const file = vfile.readSync(doc, 'utf8'); +const tree = unified().use(remarkParse).parse(file); const addons = {}; let id = 0; let currentHeader; const validNames = /^\/\/\s+(.*\.(?:cc|h|js))[\r\n]/; -tokens.forEach(({ type, text }) => { - if (type === 'heading') { - currentHeader = text; +tree.children.forEach((node) => { + if (node.type === 'heading') { + currentHeader = file.contents.slice( + node.children[0].position.start.offset, + node.position.end.offset); addons[currentHeader] = { files: {} }; - } - if (type === 'code') { - const match = text.match(validNames); + } else if (node.type === 'code') { + const match = node.value.match(validNames); if (match !== null) { - addons[currentHeader].files[match[1]] = text; + addons[currentHeader].files[match[1]] = node.value; } } }); diff --git a/tools/doc/generate.js b/tools/doc/generate.js index 8ed97610cf3b..f2e3e8a16499 100644 --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -22,25 +22,34 @@ 'use strict'; const fs = require('fs'); +const path = require('path'); +const unified = require('unified'); +const markdown = require('remark-parse'); +const remark2rehype = require('remark-rehype'); +const raw = require('rehype-raw'); +const htmlStringify = require('rehype-stringify'); + +const html = require('./html'); +const json = require('./json'); // Parse the args. // Don't use nopt or whatever for this. It's simple enough. const args = process.argv.slice(2); -let format = 'json'; let filename = null; let nodeVersion = null; let analytics = null; +let outputDir = null; args.forEach(function(arg) { if (!arg.startsWith('--')) { filename = arg; - } else if (arg.startsWith('--format=')) { - format = arg.replace(/^--format=/, ''); } else if (arg.startsWith('--node-version=')) { nodeVersion = arg.replace(/^--node-version=/, ''); } else if (arg.startsWith('--analytics=')) { analytics = arg.replace(/^--analytics=/, ''); + } else if (arg.startsWith('--output-directory=')) { + outputDir = arg.replace(/^--output-directory=/, ''); } }); @@ -48,27 +57,37 @@ nodeVersion = nodeVersion || process.version; if (!filename) { throw new Error('No input file specified'); +} else if (!outputDir) { + throw new Error('No output directory specified'); } + fs.readFile(filename, 'utf8', (er, input) => { if (er) throw er; - switch (format) { - case 'json': - require('./json.js')(input, filename, (er, obj) => { - if (er) throw er; - console.log(JSON.stringify(obj, null, 2)); - }); - break; - case 'html': - require('./html')({ input, filename, nodeVersion, analytics }, - (err, html) => { - if (err) throw err; - console.log(html); - }); - break; + const content = unified() + .use(markdown) + .use(html.preprocessText) + .use(json.jsonAPI, { filename }) + .use(html.firstHeader) + .use(html.preprocessElements, { filename }) + .use(html.buildToc, { filename }) + .use(remark2rehype, { allowDangerousHTML: true }) + .use(raw) + .use(htmlStringify) + .processSync(input); - default: - throw new Error(`Invalid format: ${format}`); - } + const basename = path.basename(filename, '.md'); + + html.toHTML( + { input, content, filename, nodeVersion, analytics }, + (err, html) => { + const target = path.join(outputDir, `${basename}.html`); + if (err) throw err; + fs.writeFileSync(target, html); + } + ); + + const target = path.join(outputDir, `${basename}.json`); + fs.writeFileSync(target, JSON.stringify(content.json, null, 2)); }); diff --git a/tools/doc/html.js b/tools/doc/html.js index d759270e0f83..d65a4b323aef 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -29,11 +29,13 @@ const visit = require('unist-util-visit'); const markdown = require('remark-parse'); const remark2rehype = require('remark-rehype'); const raw = require('rehype-raw'); -const html = require('rehype-stringify'); +const htmlStringify = require('rehype-stringify'); const path = require('path'); const typeParser = require('./type-parser.js'); -module.exports = toHTML; +module.exports = { + toHTML, firstHeader, preprocessText, preprocessElements, buildToc +}; const docPath = path.resolve(__dirname, '..', '..', 'doc'); @@ -54,26 +56,15 @@ const gtocHTML = unified() .use(remark2rehype, { allowDangerousHTML: true }) .use(raw) .use(navClasses) - .use(html) + .use(htmlStringify) .processSync(gtocMD).toString(); const templatePath = path.join(docPath, 'template.html'); const template = fs.readFileSync(templatePath, 'utf8'); -function toHTML({ input, filename, nodeVersion, analytics }, cb) { +function toHTML({ input, content, filename, nodeVersion, analytics }, cb) { filename = path.basename(filename, '.md'); - const content = unified() - .use(markdown) - .use(firstHeader) - .use(preprocessText) - .use(preprocessElements, { filename }) - .use(buildToc, { filename }) - .use(remark2rehype, { allowDangerousHTML: true }) - .use(raw) - .use(html) - .processSync(input); - const id = filename.replace(/\W+/g, '-'); let HTML = template.replace('__ID__', id) @@ -207,7 +198,10 @@ function preprocessElements({ filename }) { heading.children = [{ type: 'text', value: file.contents.slice( - position.start.offset, position.end.offset), + position.start.offset, position.end.offset) + .replace('<', '<') + .replace('>', '>') + .replace(/\\(.{1})/g, '$1'), position }]; } @@ -235,8 +229,8 @@ function preprocessElements({ filename }) { } // Do not link to the section we are already in. - const noLinking = filename === 'documentation' && - heading !== null && heading.value === 'Stability Index'; + const noLinking = filename.includes('documentation') && + heading !== null && heading.children[0].value === 'Stability Index'; // collapse blockquote and paragraph into a single node node.type = 'paragraph'; @@ -296,7 +290,7 @@ function parseYAML(text) { .use(markdown) .use(remark2rehype, { allowDangerousHTML: true }) .use(raw) - .use(html) + .use(htmlStringify) .processSync(change.description).toString(); result += `${change.version}\n` + @@ -381,7 +375,7 @@ function buildToc({ filename }) { .use(markdown) .use(remark2rehype, { allowDangerousHTML: true }) .use(raw) - .use(html) + .use(htmlStringify) .processSync(toc).toString(); }; } diff --git a/tools/doc/json.js b/tools/doc/json.js index 44b67e3e284b..e07486265cf0 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -21,304 +21,267 @@ 'use strict'; -module.exports = doJSON; - -// Take the lexed input, and return a JSON-encoded object. -// A module looks like this: https://gist.github.com/1777387. - +const unified = require('unified'); const common = require('./common.js'); -const marked = require('marked'); - -// Customized heading without id attribute. -const renderer = new marked.Renderer(); -renderer.heading = (text, level) => `${text}\n`; -marked.setOptions({ renderer }); - - -function doJSON(input, filename, cb) { - const root = { source: filename }; - const stack = [root]; - let depth = 0; - let current = root; - let state = null; - - const exampleHeading = /^example/i; - const metaExpr = /\n*/g; - const stabilityExpr = /^Stability: ([0-5])(?:\s*-\s*)?(.*)$/; - - const lexed = marked.lexer(input); - lexed.forEach((tok) => { - const { type } = tok; - let { text } = tok; - - // - // This is for cases where the markdown semantic structure is lacking. - if (type === 'paragraph' || type === 'html') { - text = text.replace(metaExpr, (_0, key, value) => { - current[key.trim()] = value.trim(); - return ''; - }); - text = text.trim(); - if (!text) return; +const html = require('remark-html'); +const select = require('unist-util-select'); + +module.exports = { jsonAPI }; + +// Unified processor: input is https://github.com/syntax-tree/mdast, +// output is: https://gist.github.com/1777387. +function jsonAPI({ filename }) { + return (tree, file) => { + + const exampleHeading = /^example/i; + const metaExpr = /\n*/g; + const stabilityExpr = /^Stability: ([0-5])(?:\s*-\s*)?(.*)$/s; + + // Extract definitions. + const definitions = select(tree, 'definition'); + + // Determine the start, stop, and depth of each section. + const sections = []; + let section = null; + tree.children.forEach((node, i) => { + if (node.type === 'heading' && + !exampleHeading.test(textJoin(node.children, file))) { + if (section) section.stop = i - 1; + section = { start: i, stop: tree.children.length, depth: node.depth }; + sections.push(section); + } + }); + + // Collect and capture results. + const result = { type: 'module', source: filename }; + while (sections.length > 0) { + doSection(sections.shift(), result); } + file.json = result; - if (type === 'heading' && !exampleHeading.test(text.trim())) { - if (tok.depth - depth > 1) { - return cb( - new Error(`Inappropriate heading level\n${JSON.stringify(tok)}`)); + // Process a single section (recursively, including subsections). + function doSection(section, parent) { + if (section.depth - parent.depth > 1) { + throw new Error('Inappropriate heading level\n' + + JSON.stringify(section)); } + const current = newSection(tree.children[section.start], file); + let nodes = tree.children.slice(section.start + 1, section.stop + 1); + // Sometimes we have two headings with a single blob of description. // Treat as a clone. - if (state === 'AFTERHEADING' && depth === tok.depth) { - const clone = current; - current = newSection(tok); - current.clone = clone; - // Don't keep it around on the stack. - stack.pop(); - } else { - // If the level is greater than the current depth, - // then it's a child, so we should just leave the stack as it is. - // However, if it's a sibling or higher, then it implies - // the closure of the other sections that came before. - // root is always considered the level=0 section, - // and the lowest heading is 1, so this should always - // result in having a valid parent node. - let closingDepth = tok.depth; - while (closingDepth <= depth) { - finishSection(stack.pop(), stack[stack.length - 1]); - closingDepth++; - } - current = newSection(tok); + if ( + nodes.length === 0 && sections.length > 0 && + section.depth === sections[0].depth + ) { + nodes = tree.children.slice(sections[0].start + 1, + sections[0].stop + 1); } - ({ depth } = tok); - stack.push(current); - state = 'AFTERHEADING'; - return; - } + // Extract (and remove) metadata that is not directly inferable + // from the markdown itself. + nodes.forEach((node, i) => { + // Input: ; output: {name: module}. + if (node.type === 'html') { + node.value = node.value.replace(metaExpr, (_0, key, value) => { + current[key.trim()] = value.trim(); + return ''; + }); + if (!node.value.trim()) delete nodes[i]; + } - // Immediately after a heading, we can expect the following: - // - // { type: 'blockquote_start' }, - // { type: 'paragraph', text: 'Stability: ...' }, - // { type: 'blockquote_end' }, - // - // A list: starting with list_start, ending with list_end, - // maybe containing other nested lists in each item. - // - // A metadata: - // - // - // If one of these isn't found, then anything that comes - // between here and the next heading should be parsed as the desc. - if (state === 'AFTERHEADING') { - if (type === 'blockquote_start') { - state = 'AFTERHEADING_BLOCKQUOTE'; - return; - } else if (type === 'list_start' && !tok.ordered) { - state = 'AFTERHEADING_LIST'; - current.list = current.list || []; - current.list.push(tok); - current.list.level = 1; - } else if (type === 'html' && common.isYAMLBlock(tok.text)) { - current.meta = common.extractAndParseYAML(tok.text); - } else { - current.desc = current.desc || []; - if (!Array.isArray(current.desc)) { - current.shortDesc = current.desc; - current.desc = []; + // Process metadata: + // + if (node.type === 'html' && common.isYAMLBlock(node.value)) { + current.meta = common.extractAndParseYAML(node.value); + delete nodes[i]; } - current.desc.links = lexed.links; - current.desc.push(tok); - state = 'DESC'; - } - return; - } - if (state === 'AFTERHEADING_LIST') { - current.list.push(tok); - if (type === 'list_start') { - current.list.level++; - } else if (type === 'list_end') { - current.list.level--; - } - if (current.list.level === 0) { - state = 'AFTERHEADING'; - processList(current); - } - return; - } + // Stability marker: > Stability: ... + if ( + node.type === 'blockquote' && node.children.length === 1 && + node.children[0].type === 'paragraph' && + nodes.slice(0, i).every((node) => node.type === 'list') + ) { + const text = textJoin(node.children[0].children, file); + const stability = text.match(stabilityExpr); + if (stability) { + current.stability = parseInt(stability[1], 10); + current.stabilityText = stability[2].trim(); + delete nodes[i]; + } + } + }); - if (state === 'AFTERHEADING_BLOCKQUOTE') { - if (type === 'blockquote_end') { - state = 'AFTERHEADING'; - return; - } + // Compress the node array. + nodes = nodes.filter(() => true); + + // If the first node is a list, extract it. + const list = nodes[0] && nodes[0].type === 'list' ? + nodes.shift() : null; + + // Now figure out what this list actually means. + // Depending on the section type, the list could be different things. + const values = list ? + list.children.map((child) => parseListItem(child, file)) : []; + + switch (current.type) { + case 'ctor': + case 'classMethod': + case 'method': + // Each item is an argument, unless the name is 'return', + // in which case it's the return value. + const sig = {}; + sig.params = values.filter((value) => { + if (value.name === 'return') { + sig.return = value; + return false; + } + return true; + }); + parseSignature(current.textRaw, sig); + current.signatures = [sig]; + break; + + case 'property': + // There should be only one item, which is the value. + // Copy the data up to the section. + if (values.length) { + const signature = values[0]; + + // Shove the name in there for properties, + // since they are always just going to be the value etc. + signature.textRaw = `\`${current.name}\` ${signature.textRaw}`; + + for (const key in signature) { + if (signature[key]) { + if (key === 'type') { + current.typeof = signature.type; + } else { + current[key] = signature[key]; + } + } + } + } + break; - let stability; - if (type === 'paragraph' && (stability = text.match(stabilityExpr))) { - current.stability = parseInt(stability[1], 10); - current.stabilityText = stability[2].trim(); - return; - } - } + case 'event': + // Event: each item is an argument. + current.params = values; + break; - current.desc = current.desc || []; - current.desc.links = lexed.links; - current.desc.push(tok); - }); + default: + // If list wasn't consumed, put it back in the nodes list. + if (list) nodes.unshift(list); + } - // Finish any sections left open. - while (root !== (current = stack.pop())) { - finishSection(current, stack[stack.length - 1]); - } + // Convert remaining nodes to a 'desc'. + // Unified expects to process a string; but we ignore that as we + // already have pre-parsed input that we can inject. + if (nodes.length) { + if (current.desc) current.shortDesc = current.desc; + + current.desc = unified() + .use(function() { + this.Parser = () => ( + { type: 'root', children: nodes.concat(definitions) } + ); + }) + .use(html) + .processSync('').toString().trim(); + if (!current.desc) delete current.desc; + } - return cb(null, root); -} + // Process subsections. + while (sections.length > 0 && sections[0].depth > section.depth) { + doSection(sections.shift(), current); + } + // If type is not set, default type based on parent type, and + // set displayName and name properties. + if (!current.type) { + current.type = (parent.type === 'misc' ? 'misc' : 'module'); + current.displayName = current.name; + current.name = current.name.toLowerCase() + .trim().replace(/\s+/g, '_'); + } -// Go from something like this: -// -// [ { type: "list_item_start" }, -// { type: "text", -// text: "`options` {Object|string}" }, -// { type: "list_start", -// ordered: false }, -// { type: "list_item_start" }, -// { type: "text", -// text: "`encoding` {string|null} **Default:** `'utf8'`" }, -// { type: "list_item_end" }, -// { type: "list_item_start" }, -// { type: "text", -// text: "`mode` {integer} **Default:** `0o666`" }, -// { type: "list_item_end" }, -// { type: "list_item_start" }, -// { type: "text", -// text: "`flag` {string} **Default:** `'a'`" }, -// { type: "space" }, -// { type: "list_item_end" }, -// { type: "list_end" }, -// { type: "list_item_end" } ] -// -// to something like: -// -// [ { textRaw: "`options` {Object|string} ", -// options: [ -// { textRaw: "`encoding` {string|null} **Default:** `'utf8'` ", -// name: "encoding", -// type: "string|null", -// default: "`'utf8'`" }, -// { textRaw: "`mode` {integer} **Default:** `0o666` ", -// name: "mode", -// type: "integer", -// default: "`0o666`" }, -// { textRaw: "`flag` {string} **Default:** `'a'` ", -// name: "flag", -// type: "string", -// default: "`'a'`" } ], -// name: "options", -// type: "Object|string", -// optional: true } ] - -function processList(section) { - const { list } = section; - const values = []; - const stack = []; - let current; - - // For now, *just* build the hierarchical list. - list.forEach((tok) => { - const { type } = tok; - if (type === 'space') return; - if (type === 'list_item_start' || type === 'loose_item_start') { - const item = {}; - if (!current) { - values.push(item); - current = item; + // Pluralize type to determine which 'bucket' to put this section in. + let plur; + if (current.type.slice(-1) === 's') { + plur = `${current.type}es`; + } else if (current.type.slice(-1) === 'y') { + plur = current.type.replace(/y$/, 'ies'); } else { - current.options = current.options || []; - stack.push(current); - current.options.push(item); - current = item; - } - } else if (type === 'list_item_end') { - if (!current) { - throw new Error('invalid list - end without current item\n' + - `${JSON.stringify(tok)}\n` + - JSON.stringify(list)); + plur = `${current.type}s`; } - current = stack.pop(); - } else if (type === 'text') { - if (!current) { - throw new Error('invalid list - text without current item\n' + - `${JSON.stringify(tok)}\n` + - JSON.stringify(list)); - } - current.textRaw = `${current.textRaw || ''}${tok.text} `; - } - }); - // Shove the name in there for properties, - // since they are always just going to be the value etc. - if (section.type === 'property' && values[0]) { - values[0].textRaw = `\`${section.name}\` ${values[0].textRaw}`; - } + // Classes sometimes have various 'ctor' children + // which are actually just descriptions of a constructor class signature. + // Merge them into the parent. + if (current.type === 'class' && current.ctors) { + current.signatures = current.signatures || []; + const sigs = current.signatures; + current.ctors.forEach((ctor) => { + ctor.signatures = ctor.signatures || [{}]; + ctor.signatures.forEach((sig) => { + sig.desc = ctor.desc; + }); + sigs.push(...ctor.signatures); + }); + delete current.ctors; + } - // Now pull the actual values out of the text bits. - values.forEach(parseListItem); - - // Now figure out what this list actually means. - // Depending on the section type, the list could be different things. - - switch (section.type) { - case 'ctor': - case 'classMethod': - case 'method': { - // Each item is an argument, unless the name is 'return', - // in which case it's the return value. - section.signatures = section.signatures || []; - const sig = {}; - section.signatures.push(sig); - sig.params = values.filter((value) => { - if (value.name === 'return') { - sig.return = value; - return false; + // Properties are a bit special. + // Their "type" is the type of object, not "property". + if (current.type === 'property') { + if (current.typeof) { + current.type = current.typeof; + delete current.typeof; + } else { + delete current.type; } - return true; - }); - parseSignature(section.textRaw, sig); - break; - } - - case 'property': { - // There should be only one item, which is the value. - // Copy the data up to the section. - const value = values[0] || {}; - delete value.name; - section.typeof = value.type || section.typeof; - delete value.type; - Object.keys(value).forEach((key) => { - section[key] = value[key]; - }); - break; - } - - case 'event': - // Event: each item is an argument. - section.params = values; - break; + } - default: - if (section.list.length > 0) { - section.desc = section.desc || []; - section.desc.push(...section.list); + // If the parent's type is 'misc', then it's just a random + // collection of stuff, like the "globals" section. + // Make the children top-level items. + if (current.type === 'misc') { + Object.keys(current).forEach((key) => { + switch (key) { + case 'textRaw': + case 'name': + case 'type': + case 'desc': + case 'miscs': + return; + default: + if (parent.type === 'misc') { + return; + } + if (parent[key] && Array.isArray(parent[key])) { + parent[key] = parent[key].concat(current[key]); + } else if (!parent[key]) { + parent[key] = current[key]; + } + } + }); } - } - delete section.list; + // Add this section to the parent. Sometimes we have two headings with a + // single blob of description. If the preceding entry at this level + // shares a name and is lacking a description, copy it backwards. + if (!parent[plur]) parent[plur] = []; + const prev = parent[plur].slice(-1)[0]; + if (prev && prev.name === current.name && !prev.desc) { + prev.desc = current.desc; + } + parent[plur].push(current); + } + }; } @@ -326,6 +289,8 @@ const paramExpr = /\((.+)\);?$/; // text: "someobject.someMethod(a[, b=100][, c])" function parseSignature(text, sig) { + const list = []; + let [, sigParams] = text.match(paramExpr) || []; if (!sigParams) return; sigParams = sigParams.split(','); @@ -361,20 +326,45 @@ function parseSignature(text, sig) { defaultValue = sigParam.substr(eq + 1); sigParam = sigParam.substr(0, eq); } - if (!listParam) { - listParam = sig.params[i] = { name: sigParam }; - } - // At this point, the name should match. - if (sigParam !== listParam.name) { - throw new Error( - `Warning: invalid param "${sigParam}"\n` + - ` > ${JSON.stringify(listParam)}\n` + - ` > ${text}` - ); + + // At this point, the name should match. If it doesn't find one that does. + // Example: shared signatures for: + // ### new Console(stdout[, stderr][, ignoreErrors]) + // ### new Console(options) + if (!listParam || sigParam !== listParam.name) { + listParam = null; + for (const param of sig.params) { + if (param.name === sigParam) { + listParam = param; + } else if (param.options) { + for (const option of param.options) { + if (option.name === sigParam) { + listParam = Object.assign({}, option); + } + } + } + } + + if (!listParam) { + if (sigParam.startsWith('...')) { + listParam = { name: sigParam }; + } else { + throw new Error( + `Invalid param "${sigParam}"\n` + + ` > ${JSON.stringify(listParam)}\n` + + ` > ${text}` + ); + } + } } + if (optional) listParam.optional = true; if (defaultValue !== undefined) listParam.default = defaultValue.trim(); + + list.push(listParam); }); + + sig.params = list; } @@ -384,30 +374,37 @@ const typeExpr = /^\{([^}]+)\}\s*/; const leadingHyphen = /^-\s*/; const defaultExpr = /\s*\*\*Default:\*\*\s*([^]+)$/i; -function parseListItem(item) { - if (item.options) item.options.forEach(parseListItem); - if (!item.textRaw) { +function parseListItem(item, file) { + const current = {}; + + current.textRaw = item.children.filter((node) => node.type !== 'list') + .map((node) => ( + file.contents.slice(node.position.start.offset, node.position.end.offset)) + ) + .join('').replace(/\s+/g, ' ').replace(//sg, ''); + let text = current.textRaw; + + if (!text) { throw new Error(`Empty list item: ${JSON.stringify(item)}`); } - // The goal here is to find the name, type, default, and optional. + // The goal here is to find the name, type, default. // Anything left over is 'desc'. - let text = item.textRaw.trim(); if (returnExpr.test(text)) { - item.name = 'return'; + current.name = 'return'; text = text.replace(returnExpr, ''); } else { const [, name] = text.match(nameExpr) || []; if (name) { - item.name = name; + current.name = name; text = text.replace(nameExpr, ''); } } const [, type] = text.match(typeExpr) || []; if (type) { - item.type = type; + current.type = type; text = text.replace(typeExpr, ''); } @@ -415,147 +412,25 @@ function parseListItem(item) { const [, defaultValue] = text.match(defaultExpr) || []; if (defaultValue) { - item.default = defaultValue.replace(/\.$/, ''); + current.default = defaultValue.replace(/\.$/, ''); text = text.replace(defaultExpr, ''); } - if (text) item.desc = text; -} - - -function finishSection(section, parent) { - if (!section || !parent) { - throw new Error('Invalid finishSection call\n' + - `${JSON.stringify(section)}\n` + - JSON.stringify(parent)); - } - - if (!section.type) { - section.type = 'module'; - if (parent.type === 'misc') { - section.type = 'misc'; - } - section.displayName = section.name; - section.name = section.name.toLowerCase() - .trim().replace(/\s+/g, '_'); - } - - if (section.desc && Array.isArray(section.desc)) { - section.desc.links = section.desc.links || []; - section.desc = marked.parser(section.desc); - } - - if (!section.list) section.list = []; - processList(section); - - // Classes sometimes have various 'ctor' children - // which are actually just descriptions of a constructor class signature. - // Merge them into the parent. - if (section.type === 'class' && section.ctors) { - section.signatures = section.signatures || []; - const sigs = section.signatures; - section.ctors.forEach((ctor) => { - ctor.signatures = ctor.signatures || [{}]; - ctor.signatures.forEach((sig) => { - sig.desc = ctor.desc; - }); - sigs.push(...ctor.signatures); - }); - delete section.ctors; - } - - // Properties are a bit special. - // Their "type" is the type of object, not "property". - if (section.properties) { - section.properties.forEach((prop) => { - if (prop.typeof) { - prop.type = prop.typeof; - delete prop.typeof; - } else { - delete prop.type; - } - }); - } - - // Handle clones. - if (section.clone) { - const { clone } = section; - delete section.clone; - delete clone.clone; - deepCopy(section, clone); - finishSection(clone, parent); - } - - let plur; - if (section.type.slice(-1) === 's') { - plur = `${section.type}es`; - } else if (section.type.slice(-1) === 'y') { - plur = section.type.replace(/y$/, 'ies'); - } else { - plur = `${section.type}s`; - } + if (text) current.desc = text; - // If the parent's type is 'misc', then it's just a random - // collection of stuff, like the "globals" section. - // Make the children top-level items. - if (section.type === 'misc') { - Object.keys(section).forEach((key) => { - switch (key) { - case 'textRaw': - case 'name': - case 'type': - case 'desc': - case 'miscs': - return; - default: - if (parent.type === 'misc') { - return; - } - if (parent[key] && Array.isArray(parent[key])) { - parent[key] = parent[key].concat(section[key]); - } else if (!parent[key]) { - parent[key] = section[key]; - } - } - }); + const options = item.children.find((child) => child.type === 'list'); + if (options) { + current.options = options.children.map((child) => ( + parseListItem(child, file) + )); } - parent[plur] = parent[plur] || []; - parent[plur].push(section); + return current; } +// This section parses out the contents of an H# tag. -// Not a general purpose deep copy. -// But sufficient for these basic things. -function deepCopy(src, dest) { - Object.keys(src) - .filter((key) => !dest.hasOwnProperty(key)) - .forEach((key) => { dest[key] = cloneValue(src[key]); }); -} - -function cloneValue(src) { - if (!src) return src; - if (Array.isArray(src)) { - const clone = new Array(src.length); - src.forEach((value, i) => { - clone[i] = cloneValue(value); - }); - return clone; - } - if (typeof src === 'object') { - const clone = {}; - Object.keys(src).forEach((key) => { - clone[key] = cloneValue(src[key]); - }); - return clone; - } - return src; -} - - -// This section parse out the contents of an H# tag. - -// To reduse escape slashes in RegExp string components. +// To reduce escape slashes in RegExp string components. const r = String.raw; const eventPrefix = '^Event: +'; @@ -603,7 +478,9 @@ const headingExpressions = [ `^${maybeClassPropertyPrefix}${ancestors}(${id})${noCallOrProp}$`, 'i') }, ]; -function newSection({ text }) { +function newSection(header, file) { + const text = textJoin(header.children, file); + // Infer the type from the text. for (const { type, re } of headingExpressions) { const [, name] = text.match(re) || []; @@ -613,3 +490,22 @@ function newSection({ text }) { } return { textRaw: text, name: text }; } + +function textJoin(nodes, file) { + return nodes.map((node) => { + if (node.type === 'linkReference') { + return file.contents.slice(node.position.start.offset, + node.position.end.offset); + } else if (node.type === 'inlineCode') { + return `\`${node.value}\``; + } else if (node.type === 'strong') { + return `**${textJoin(node.children, file)}**`; + } else if (node.type === 'emphasis') { + return `_${textJoin(node.children, file)}_`; + } else if (node.children) { + return textJoin(node.children, file); + } else { + return node.value; + } + }).join(''); +} diff --git a/tools/doc/node_modules/.bin/esparse b/tools/doc/node_modules/.bin/esparse deleted file mode 120000 index 7423b18b24ef..000000000000 --- a/tools/doc/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/tools/doc/node_modules/.bin/esvalidate b/tools/doc/node_modules/.bin/esvalidate deleted file mode 120000 index 16069effbc99..000000000000 --- a/tools/doc/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/tools/doc/node_modules/.bin/js-yaml b/tools/doc/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010d4703..000000000000 --- a/tools/doc/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/tools/doc/node_modules/argparse/LICENSE b/tools/doc/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae558405..000000000000 --- a/tools/doc/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2012 by Vitaly Puzrin - -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. diff --git a/tools/doc/node_modules/argparse/README.md b/tools/doc/node_modules/argparse/README.md deleted file mode 100644 index 90dfd2c662c5..000000000000 --- a/tools/doc/node_modules/argparse/README.md +++ /dev/null @@ -1,255 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) -[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) - -CLI arguments parser for node.js. Javascript port of python's -[argparse](http://docs.python.org/dev/library/argparse.html) module -(original version 3.2). That's a full port, except some very rare options, -recorded in issue tracker. - -**NB. Difference with original.** - -- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). -- Use `defaultValue` instead of `default`. -- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and - similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE` - (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and - `SUPPRESS`. - - -Example -======= - -test.js file: - -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse example' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); -parser.addArgument( - '--baz', - { - help: 'baz bar' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] - -Argparse example - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo - --baz BAZ baz bar -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 --baz 5 -{ foo: '3', bar: '4', baz: '5' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({parameters hash}); -``` - -Creates a new ArgumentParser object. - -**Supported params:** - -- ```description``` - Text to display before the argument help. -- ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: true) -- ```argumentDefault``` - Set the global default value for arguments. (default: null) -- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. -- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) -- ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) -- ```usage``` - The string describing the program usage (default: generated) -- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. - -**Not supported yet** - -- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. - - -Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) - - -addArgument() method -==================== - -``` -ArgumentParser.addArgument(name or flag or [name] or [flags...], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flag or [name] or [flags...]``` - Either a positional name - (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array - of a single positional name (e.g., `['foo']`), or an array of options - (e.g., `['-f', '--foo']`). - -Options: - -- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. -- ```nargs```- The number of command-line arguments that should be consumed. -- ```constant``` - A constant value required by some action and nargs selections. -- ```defaultValue``` - The value produced if the argument is absent from the command line. -- ```type``` - The type to which the command-line argument should be converted. -- ```choices``` - A container of the allowable values for the argument. -- ```required``` - Whether or not the command-line option may be omitted (optionals only). -- ```help``` - A brief description of what the argument does. -- ```metavar``` - A name for the argument in usage messages. -- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). - -Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) - - -Action (some details) -================ - -ArgumentParser objects associate command-line arguments with actions. -These actions can do just about anything with the command-line arguments associated -with them, though most actions simply add an attribute to the object returned by -parseArgs(). The action keyword argument specifies how the command-line arguments -should be handled. The supported actions are: - -- ```store``` - Just stores the argument’s value. This is the default action. -- ```storeConst``` - Stores value, specified by the const keyword argument. - (Note that the const keyword argument defaults to the rather unhelpful None.) - The 'storeConst' action is most commonly used with optional arguments, that - specify some sort of flag. -- ```storeTrue``` and ```storeFalse``` - Stores values True and False - respectively. These are special cases of 'storeConst'. -- ```append``` - Stores a list, and appends each argument value to the list. - This is useful to allow an option to be specified multiple times. -- ```appendConst``` - Stores a list, and appends value, specified by the - const keyword argument to the list. (Note, that the const keyword argument defaults - is None.) The 'appendConst' action is typically used when multiple arguments need - to store constants to the same list. -- ```count``` - Counts the number of times a keyword argument occurs. For example, - used for increasing verbosity levels. -- ```help``` - Prints a complete help message for all the options in the current - parser and then exits. By default a help action is automatically added to the parser. - See ArgumentParser for details of how the output is created. -- ```version``` - Prints version information and exit. Expects a `version=` - keyword argument in the addArgument() call. - -Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) - - -Sub-commands -============ - -ArgumentParser.addSubparsers() - -Many programs split their functionality into a number of sub-commands, for -example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, -and `svn commit`. Splitting up functionality this way can be a particularly good -idea when a program performs several different functions which require different -kinds of command-line arguments. `ArgumentParser` supports creation of such -sub-commands with `addSubparsers()` method. The `addSubparsers()` method is -normally called with no arguments and returns an special action object. -This object has a single method `addParser()`, which takes a command name and -any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object -that can be modified as usual. - -Example: - -sub_commands.js -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse examples: sub-commands', -}); - -var subparsers = parser.addSubparsers({ - title:'subcommands', - dest:"subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp:true}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases:['co'], addHelp:true} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); - -var args = parser.parseArgs(); -console.dir(args); - -``` - -Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) - - -Contributors -============ - -- [Eugene Shkuropat](https://github.com/shkuropat) -- [Paul Jacobson](https://github.com/hpaulj) - -[others](https://github.com/nodeca/argparse/graphs/contributors) - -License -======= - -Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). -Released under the MIT license. See -[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. diff --git a/tools/doc/node_modules/argparse/index.js b/tools/doc/node_modules/argparse/index.js deleted file mode 100644 index 3bbc14320048..000000000000 --- a/tools/doc/node_modules/argparse/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/argparse'); diff --git a/tools/doc/node_modules/argparse/lib/action.js b/tools/doc/node_modules/argparse/lib/action.js deleted file mode 100644 index 1483c79ffa53..000000000000 --- a/tools/doc/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * class Action - * - * Base class for all actions - * Do not call in your code, use this class only for inherits your own action - * - * Information about how to convert command line strings to Javascript objects. - * Action objects are used by an ArgumentParser to represent the information - * needed to parse a single argument from one or more strings from the command - * line. The keyword arguments to the Action constructor are also all attributes - * of Action instances. - * - * ##### Allowed keywords: - * - * - `store` - * - `storeConstant` - * - `storeTrue` - * - `storeFalse` - * - `append` - * - `appendConstant` - * - `count` - * - `help` - * - `version` - * - * Information about action options see [[Action.new]] - * - * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) - * - **/ - -'use strict'; - - -// Constants -var c = require('./const'); - - -/** - * new Action(options) - * - * Base class for all actions. Used only for inherits - * - * - * ##### Options: - * - * - `optionStrings` A list of command-line option strings for the action. - * - `dest` Attribute to hold the created object(s) - * - `nargs` The number of command-line arguments that should be consumed. - * By default, one argument will be consumed and a single value will be - * produced. - * - `constant` Default value for an action with no value. - * - `defaultValue` The value to be produced if the option is not specified. - * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If - * None, 'string'. - * - `choices` The choices available. - * - `required` True if the action must always be specified at the command - * line. - * - `help` The help describing the argument. - * - `metavar` The name to be used for the option's argument with the help - * string. If None, the 'dest' value will be used as the name. - * - * ##### nargs supported values: - * - * - `N` (an integer) consumes N arguments (and produces a list) - * - `?` consumes zero or one arguments - * - `*` consumes zero or more arguments (and produces a list) - * - `+` consumes one or more arguments (and produces a list) - * - * Note: that the difference between the default and nargs=1 is that with the - * default, a single value will be produced, while with nargs=1, a list - * containing a single value will be produced. - **/ -var Action = module.exports = function Action(options) { - options = options || {}; - this.optionStrings = options.optionStrings || []; - this.dest = options.dest; - this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null; - this.constant = typeof options.constant !== 'undefined' ? options.constant : null; - this.defaultValue = options.defaultValue; - this.type = typeof options.type !== 'undefined' ? options.type : null; - this.choices = typeof options.choices !== 'undefined' ? options.choices : null; - this.required = typeof options.required !== 'undefined' ? options.required : false; - this.help = typeof options.help !== 'undefined' ? options.help : null; - this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null; - - if (!(this.optionStrings instanceof Array)) { - throw new Error('optionStrings should be an array'); - } - if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') { - throw new Error('required should be a boolean'); - } -}; - -/** - * Action#getName -> String - * - * Tells action name - **/ -Action.prototype.getName = function () { - if (this.optionStrings.length > 0) { - return this.optionStrings.join('/'); - } else if (this.metavar !== null && this.metavar !== c.SUPPRESS) { - return this.metavar; - } else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) { - return this.dest; - } - return null; -}; - -/** - * Action#isOptional -> Boolean - * - * Return true if optional - **/ -Action.prototype.isOptional = function () { - return !this.isPositional(); -}; - -/** - * Action#isPositional -> Boolean - * - * Return true if positional - **/ -Action.prototype.isPositional = function () { - return (this.optionStrings.length === 0); -}; - -/** - * Action#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Should be implemented in inherited classes - * - * ##### Example - * - * ActionCount.prototype.call = function (parser, namespace, values, optionString) { - * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); - * }; - * - **/ -Action.prototype.call = function () { - throw new Error('.call() not defined');// Not Implemented error -}; diff --git a/tools/doc/node_modules/argparse/lib/action/append.js b/tools/doc/node_modules/argparse/lib/action/append.js deleted file mode 100644 index b5da0de23275..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,53 +0,0 @@ -/*:nodoc:* - * class ActionAppend - * - * This action stores a list, and appends each argument value to the list. - * This is useful to allow an option to be specified multiple times. - * This class inherided from [[Action]] - * - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -/*:nodoc:* - * new ActionAppend(options) - * - options (object): options hash see [[Action.new]] - * - * Note: options.nargs should be optional for constants - * and more then zero for other - **/ -var ActionAppend = module.exports = function ActionAppend(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for append actions must be > 0; if arg ' + - 'strings are not supplying the value to append, ' + - 'the append const action may be more appropriate'); - } - if (!!this.constant && this.nargs !== c.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionAppend, Action); - -/*:nodoc:* - * ActionAppend#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppend.prototype.call = function (parser, namespace, values) { - var items = (namespace[this.dest] || []).slice(); - items.push(values); - namespace.set(this.dest, items); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/append/constant.js b/tools/doc/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 313f5d2efcb0..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionAppendConstant - * - * This stores a list, and appends the value specified by - * the const keyword argument to the list. - * (Note that the const keyword argument defaults to null.) - * The 'appendConst' action is typically useful when multiple - * arguments need to store constants to the same list. - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionAppendConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { - options = options || {}; - options.nargs = 0; - if (typeof options.constant === 'undefined') { - throw new Error('constant option is required for appendAction'); - } - Action.call(this, options); -}; -util.inherits(ActionAppendConstant, Action); - -/*:nodoc:* - * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppendConstant.prototype.call = function (parser, namespace) { - var items = [].concat(namespace[this.dest] || []); - items.push(this.constant); - namespace.set(this.dest, items); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/count.js b/tools/doc/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899d07ef..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*:nodoc:* - * class ActionCount - * - * This counts the number of times a keyword argument occurs. - * For example, this is useful for increasing verbosity levels - * - * This class inherided from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -/*:nodoc:* - * new ActionCount(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionCount = module.exports = function ActionCount(options) { - options = options || {}; - options.nargs = 0; - - Action.call(this, options); -}; -util.inherits(ActionCount, Action); - -/*:nodoc:* - * ActionCount#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionCount.prototype.call = function (parser, namespace) { - namespace.set(this.dest, (namespace[this.dest] || 0) + 1); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/help.js b/tools/doc/node_modules/argparse/lib/action/help.js deleted file mode 100644 index b40e05a6f0b3..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionHelp - * - * Support action for printing help - * This class inherided from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -/*:nodoc:* - * new ActionHelp(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionHelp = module.exports = function ActionHelp(options) { - options = options || {}; - if (options.defaultValue !== null) { - options.defaultValue = options.defaultValue; - } else { - options.defaultValue = c.SUPPRESS; - } - options.dest = (options.dest !== null ? options.dest : c.SUPPRESS); - options.nargs = 0; - Action.call(this, options); - -}; -util.inherits(ActionHelp, Action); - -/*:nodoc:* - * ActionHelp#call(parser, namespace, values, optionString) - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print help and exit - **/ -ActionHelp.prototype.call = function (parser) { - parser.printHelp(); - parser.exit(); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/store.js b/tools/doc/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 283b86092175..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*:nodoc:* - * class ActionStore - * - * This action just stores the argument’s value. This is the default action. - * - * This class inherited from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var c = require('../const'); - - -/*:nodoc:* - * new ActionStore(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStore = module.exports = function ActionStore(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for store actions must be > 0; if you ' + - 'have nothing to store, actions such as store ' + - 'true or store const may be more appropriate'); - - } - if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionStore, Action); - -/*:nodoc:* - * ActionStore#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStore.prototype.call = function (parser, namespace, values) { - namespace.set(this.dest, values); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/store/constant.js b/tools/doc/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 23caa897b375..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*:nodoc:* - * class ActionStoreConstant - * - * This action stores the value specified by the const keyword argument. - * (Note that the const keyword argument defaults to the rather unhelpful null.) - * The 'store_const' action is most commonly used with optional - * arguments that specify some sort of flag. - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionStoreConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { - options = options || {}; - options.nargs = 0; - if (typeof options.constant === 'undefined') { - throw new Error('constant option is required for storeAction'); - } - Action.call(this, options); -}; -util.inherits(ActionStoreConstant, Action); - -/*:nodoc:* - * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStoreConstant.prototype.call = function (parser, namespace) { - namespace.set(this.dest, this.constant); -}; diff --git a/tools/doc/node_modules/argparse/lib/action/store/false.js b/tools/doc/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 9924f461dadf..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*:nodoc:* - * class ActionStoreFalse - * - * This action store the values False respectively. - * This is special cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreFalse(options) - * - options (object): hash of options see [[Action.new]] - * - **/ -var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { - options = options || {}; - options.constant = false; - options.defaultValue = options.defaultValue !== null ? options.defaultValue : true; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreFalse, ActionStoreConstant); diff --git a/tools/doc/node_modules/argparse/lib/action/store/true.js b/tools/doc/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 9e22f7d4419e..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*:nodoc:* - * class ActionStoreTrue - * - * This action store the values True respectively. - * This isspecial cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreTrue(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { - options = options || {}; - options.constant = true; - options.defaultValue = options.defaultValue !== null ? options.defaultValue : false; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreTrue, ActionStoreConstant); diff --git a/tools/doc/node_modules/argparse/lib/action/subparsers.js b/tools/doc/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index 99dfedd0f1aa..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,149 +0,0 @@ -/** internal - * class ActionSubparsers - * - * Support the creation of such sub-commands with the addSubparsers() - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; - - -var Action = require('../action'); - -// Constants -var c = require('../const'); - -// Errors -var argumentErrorHelper = require('../argument/error'); - - -/*:nodoc:* - * new ChoicesPseudoAction(name, help) - * - * Create pseudo action for correct help text - * - **/ -function ChoicesPseudoAction(name, help) { - var options = { - optionStrings: [], - dest: name, - help: help - }; - - Action.call(this, options); -} - -util.inherits(ChoicesPseudoAction, Action); - -/** - * new ActionSubparsers(options) - * - options (object): options hash see [[Action.new]] - * - **/ -function ActionSubparsers(options) { - options = options || {}; - options.dest = options.dest || c.SUPPRESS; - options.nargs = c.PARSER; - - this.debug = (options.debug === true); - - this._progPrefix = options.prog; - this._parserClass = options.parserClass; - this._nameParserMap = {}; - this._choicesActions = []; - - options.choices = this._nameParserMap; - Action.call(this, options); -} - -util.inherits(ActionSubparsers, Action); - -/*:nodoc:* - * ActionSubparsers#addParser(name, options) -> ArgumentParser - * - name (string): sub-command name - * - options (object): see [[ArgumentParser.new]] - * - * Note: - * addParser supports an additional aliases option, - * which allows multiple strings to refer to the same subparser. - * This example, like svn, aliases co as a shorthand for checkout - * - **/ -ActionSubparsers.prototype.addParser = function (name, options) { - var parser; - - var self = this; - - options = options || {}; - - options.debug = (this.debug === true); - - // set program from the existing prefix - if (!options.prog) { - options.prog = this._progPrefix + ' ' + name; - } - - var aliases = options.aliases || []; - - // create a pseudo-action to hold the choice help - if (!!options.help || typeof options.help === 'string') { - var help = options.help; - delete options.help; - - var choiceAction = new ChoicesPseudoAction(name, help); - this._choicesActions.push(choiceAction); - } - - // create the parser and add it to the map - parser = new this._parserClass(options); - this._nameParserMap[name] = parser; - - // make parser available under aliases also - aliases.forEach(function (alias) { - self._nameParserMap[alias] = parser; - }); - - return parser; -}; - -ActionSubparsers.prototype._getSubactions = function () { - return this._choicesActions; -}; - -/*:nodoc:* - * ActionSubparsers#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Parse input aguments - **/ -ActionSubparsers.prototype.call = function (parser, namespace, values) { - var parserName = values[0]; - var argStrings = values.slice(1); - - // set the parser name if requested - if (this.dest !== c.SUPPRESS) { - namespace[this.dest] = parserName; - } - - // select the parser - if (this._nameParserMap[parserName]) { - parser = this._nameParserMap[parserName]; - } else { - throw argumentErrorHelper(format( - 'Unknown parser "%s" (choices: [%s]).', - parserName, - Object.keys(this._nameParserMap).join(', ') - )); - } - - // parse all the remaining options into the namespace - parser.parseArgs(argStrings, namespace); -}; - -module.exports = ActionSubparsers; diff --git a/tools/doc/node_modules/argparse/lib/action/version.js b/tools/doc/node_modules/argparse/lib/action/version.js deleted file mode 100644 index 8053328cdef4..000000000000 --- a/tools/doc/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionVersion - * - * Support action for printing program version - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// -// Constants -// -var c = require('../const'); - -/*:nodoc:* - * new ActionVersion(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionVersion = module.exports = function ActionVersion(options) { - options = options || {}; - options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS); - options.dest = (options.dest || c.SUPPRESS); - options.nargs = 0; - this.version = options.version; - Action.call(this, options); -}; -util.inherits(ActionVersion, Action); - -/*:nodoc:* - * ActionVersion#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print version and exit - **/ -ActionVersion.prototype.call = function (parser) { - var version = this.version || parser.version; - var formatter = parser._getFormatter(); - formatter.addText(version); - parser.exit(0, formatter.formatHelp()); -}; diff --git a/tools/doc/node_modules/argparse/lib/action_container.js b/tools/doc/node_modules/argparse/lib/action_container.js deleted file mode 100644 index 6f1237bea23d..000000000000 --- a/tools/doc/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,482 +0,0 @@ -/** internal - * class ActionContainer - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - **/ - -'use strict'; - -var format = require('util').format; - -// Constants -var c = require('./const'); - -var $$ = require('./utils'); - -//Actions -var ActionHelp = require('./action/help'); -var ActionAppend = require('./action/append'); -var ActionAppendConstant = require('./action/append/constant'); -var ActionCount = require('./action/count'); -var ActionStore = require('./action/store'); -var ActionStoreConstant = require('./action/store/constant'); -var ActionStoreTrue = require('./action/store/true'); -var ActionStoreFalse = require('./action/store/false'); -var ActionVersion = require('./action/version'); -var ActionSubparsers = require('./action/subparsers'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -/** - * new ActionContainer(options) - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - * - * ##### Options: - * - * - `description` -- A description of what the program does - * - `prefixChars` -- Characters that prefix optional arguments - * - `argumentDefault` -- The default value for all arguments - * - `conflictHandler` -- The conflict handler to use for duplicate arguments - **/ -var ActionContainer = module.exports = function ActionContainer(options) { - options = options || {}; - - this.description = options.description; - this.argumentDefault = options.argumentDefault; - this.prefixChars = options.prefixChars || ''; - this.conflictHandler = options.conflictHandler; - - // set up registries - this._registries = {}; - - // register actions - this.register('action', null, ActionStore); - this.register('action', 'store', ActionStore); - this.register('action', 'storeConst', ActionStoreConstant); - this.register('action', 'storeTrue', ActionStoreTrue); - this.register('action', 'storeFalse', ActionStoreFalse); - this.register('action', 'append', ActionAppend); - this.register('action', 'appendConst', ActionAppendConstant); - this.register('action', 'count', ActionCount); - this.register('action', 'help', ActionHelp); - this.register('action', 'version', ActionVersion); - this.register('action', 'parsers', ActionSubparsers); - - // raise an exception if the conflict handler is invalid - this._getHandler(); - - // action storage - this._actions = []; - this._optionStringActions = {}; - - // groups - this._actionGroups = []; - this._mutuallyExclusiveGroups = []; - - // defaults storage - this._defaults = {}; - - // determines whether an "option" looks like a negative number - // -1, -1.5 -5e+4 - this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$'); - - // whether or not there are any optionals that look like negative - // numbers -- uses a list so it can be shared and edited - this._hasNegativeNumberOptionals = []; -}; - -// Groups must be required, then ActionContainer already defined -var ArgumentGroup = require('./argument/group'); -var MutuallyExclusiveGroup = require('./argument/exclusive'); - -// -// Registration methods -// - -/** - * ActionContainer#register(registryName, value, object) -> Void - * - registryName (String) : object type action|type - * - value (string) : keyword - * - object (Object|Function) : handler - * - * Register handlers - **/ -ActionContainer.prototype.register = function (registryName, value, object) { - this._registries[registryName] = this._registries[registryName] || {}; - this._registries[registryName][value] = object; -}; - -ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) { - if (arguments.length < 3) { - defaultValue = null; - } - return this._registries[registryName][value] || defaultValue; -}; - -// -// Namespace default accessor methods -// - -/** - * ActionContainer#setDefaults(options) -> Void - * - options (object):hash of options see [[Action.new]] - * - * Set defaults - **/ -ActionContainer.prototype.setDefaults = function (options) { - options = options || {}; - for (var property in options) { - if ($$.has(options, property)) { - this._defaults[property] = options[property]; - } - } - - // if these defaults match any existing arguments, replace the previous - // default on the object with the new one - this._actions.forEach(function (action) { - if ($$.has(options, action.dest)) { - action.defaultValue = options[action.dest]; - } - }); -}; - -/** - * ActionContainer#getDefault(dest) -> Mixed - * - dest (string): action destination - * - * Return action default value - **/ -ActionContainer.prototype.getDefault = function (dest) { - var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null; - - this._actions.forEach(function (action) { - if (action.dest === dest && $$.has(action, 'defaultValue')) { - result = action.defaultValue; - } - }); - - return result; -}; -// -// Adding argument actions -// - -/** - * ActionContainer#addArgument(args, options) -> Object - * - args (String|Array): argument key, or array of argument keys - * - options (Object): action objects see [[Action.new]] - * - * #### Examples - * - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... }) - * - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... }) - * - addArgument('--baz', { action: 'store', nargs: 1, ... }) - **/ -ActionContainer.prototype.addArgument = function (args, options) { - args = args; - options = options || {}; - - if (typeof args === 'string') { - args = [ args ]; - } - if (!Array.isArray(args)) { - throw new TypeError('addArgument first argument should be a string or an array'); - } - if (typeof options !== 'object' || Array.isArray(options)) { - throw new TypeError('addArgument second argument should be a hash'); - } - - // if no positional args are supplied or only one is supplied and - // it doesn't look like an option string, parse a positional argument - if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) { - if (args && !!options.dest) { - throw new Error('dest supplied twice for positional argument'); - } - options = this._getPositional(args, options); - - // otherwise, we're adding an optional argument - } else { - options = this._getOptional(args, options); - } - - // if no default was supplied, use the parser-level default - if (typeof options.defaultValue === 'undefined') { - var dest = options.dest; - if ($$.has(this._defaults, dest)) { - options.defaultValue = this._defaults[dest]; - } else if (typeof this.argumentDefault !== 'undefined') { - options.defaultValue = this.argumentDefault; - } - } - - // create the action object, and add it to the parser - var ActionClass = this._popActionClass(options); - if (typeof ActionClass !== 'function') { - throw new Error(format('Unknown action "%s".', ActionClass)); - } - var action = new ActionClass(options); - - // throw an error if the action type is not callable - var typeFunction = this._registryGet('type', action.type, action.type); - if (typeof typeFunction !== 'function') { - throw new Error(format('"%s" is not callable', typeFunction)); - } - - return this._addAction(action); -}; - -/** - * ActionContainer#addArgumentGroup(options) -> ArgumentGroup - * - options (Object): hash of options see [[ArgumentGroup.new]] - * - * Create new arguments groups - **/ -ActionContainer.prototype.addArgumentGroup = function (options) { - var group = new ArgumentGroup(this, options); - this._actionGroups.push(group); - return group; -}; - -/** - * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup - * - options (Object): {required: false} - * - * Create new mutual exclusive groups - **/ -ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) { - var group = new MutuallyExclusiveGroup(this, options); - this._mutuallyExclusiveGroups.push(group); - return group; -}; - -ActionContainer.prototype._addAction = function (action) { - var self = this; - - // resolve any conflicts - this._checkConflict(action); - - // add to actions list - this._actions.push(action); - action.container = this; - - // index the action by any option strings it has - action.optionStrings.forEach(function (optionString) { - self._optionStringActions[optionString] = action; - }); - - // set the flag if any option strings look like negative numbers - action.optionStrings.forEach(function (optionString) { - if (optionString.match(self._regexpNegativeNumber)) { - if (!self._hasNegativeNumberOptionals.some(Boolean)) { - self._hasNegativeNumberOptionals.push(true); - } - } - }); - - // return the created action - return action; -}; - -ActionContainer.prototype._removeAction = function (action) { - var actionIndex = this._actions.indexOf(action); - if (actionIndex >= 0) { - this._actions.splice(actionIndex, 1); - } -}; - -ActionContainer.prototype._addContainerActions = function (container) { - // collect groups by titles - var titleGroupMap = {}; - this._actionGroups.forEach(function (group) { - if (titleGroupMap[group.title]) { - throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title)); - } - titleGroupMap[group.title] = group; - }); - - // map each action to its group - var groupMap = {}; - function actionHash(action) { - // unique (hopefully?) string suitable as dictionary key - return action.getName(); - } - container._actionGroups.forEach(function (group) { - // if a group with the title exists, use that, otherwise - // create a new group matching the container's group - if (!titleGroupMap[group.title]) { - titleGroupMap[group.title] = this.addArgumentGroup({ - title: group.title, - description: group.description - }); - } - - // map the actions to their new group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = titleGroupMap[group.title]; - }); - }, this); - - // add container's mutually exclusive groups - // NOTE: if add_mutually_exclusive_group ever gains title= and - // description= then this code will need to be expanded as above - var mutexGroup; - container._mutuallyExclusiveGroups.forEach(function (group) { - mutexGroup = this.addMutuallyExclusiveGroup({ - required: group.required - }); - // map the actions to their new mutex group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = mutexGroup; - }); - }, this); // forEach takes a 'this' argument - - // add all actions to this container or their group - container._actions.forEach(function (action) { - var key = actionHash(action); - if (groupMap[key]) { - groupMap[key]._addAction(action); - } else { - this._addAction(action); - } - }); -}; - -ActionContainer.prototype._getPositional = function (dest, options) { - if (Array.isArray(dest)) { - dest = dest[0]; - } - // make sure required is not specified - if (options.required) { - throw new Error('"required" is an invalid argument for positionals.'); - } - - // mark positional arguments as required if at least one is - // always required - if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) { - options.required = true; - } - if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') { - options.required = true; - } - - // return the keyword arguments with no option strings - options.dest = dest; - options.optionStrings = []; - return options; -}; - -ActionContainer.prototype._getOptional = function (args, options) { - var prefixChars = this.prefixChars; - var optionStrings = []; - var optionStringsLong = []; - - // determine short and long option strings - args.forEach(function (optionString) { - // error on strings that don't start with an appropriate prefix - if (prefixChars.indexOf(optionString[0]) < 0) { - throw new Error(format('Invalid option string "%s": must start with a "%s".', - optionString, - prefixChars - )); - } - - // strings starting with two prefix characters are long options - optionStrings.push(optionString); - if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) { - optionStringsLong.push(optionString); - } - }); - - // infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' - var dest = options.dest || null; - delete options.dest; - - if (!dest) { - var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0]; - dest = $$.trimChars(optionStringDest, this.prefixChars); - - if (dest.length === 0) { - throw new Error( - format('dest= is required for options like "%s"', optionStrings.join(', ')) - ); - } - dest = dest.replace(/-/g, '_'); - } - - // return the updated keyword arguments - options.dest = dest; - options.optionStrings = optionStrings; - - return options; -}; - -ActionContainer.prototype._popActionClass = function (options, defaultValue) { - defaultValue = defaultValue || null; - - var action = (options.action || defaultValue); - delete options.action; - - var actionClass = this._registryGet('action', action, action); - return actionClass; -}; - -ActionContainer.prototype._getHandler = function () { - var handlerString = this.conflictHandler; - var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString); - var func = this[handlerFuncName]; - if (typeof func === 'undefined') { - var msg = 'invalid conflict resolution value: ' + handlerString; - throw new Error(msg); - } else { - return func; - } -}; - -ActionContainer.prototype._checkConflict = function (action) { - var optionStringActions = this._optionStringActions; - var conflictOptionals = []; - - // find all options that conflict with this option - // collect pairs, the string, and an existing action that it conflicts with - action.optionStrings.forEach(function (optionString) { - var conflOptional = optionStringActions[optionString]; - if (typeof conflOptional !== 'undefined') { - conflictOptionals.push([ optionString, conflOptional ]); - } - }); - - if (conflictOptionals.length > 0) { - var conflictHandler = this._getHandler(); - conflictHandler.call(this, action, conflictOptionals); - } -}; - -ActionContainer.prototype._handleConflictError = function (action, conflOptionals) { - var conflicts = conflOptionals.map(function (pair) { return pair[0]; }); - conflicts = conflicts.join(', '); - throw argumentErrorHelper( - action, - format('Conflicting option string(s): %s', conflicts) - ); -}; - -ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) { - // remove all conflicting options - var self = this; - conflOptionals.forEach(function (pair) { - var optionString = pair[0]; - var conflictingAction = pair[1]; - // remove the conflicting option string - var i = conflictingAction.optionStrings.indexOf(optionString); - if (i >= 0) { - conflictingAction.optionStrings.splice(i, 1); - } - delete self._optionStringActions[optionString]; - // if the option now has no option string, remove it from the - // container holding it - if (conflictingAction.optionStrings.length === 0) { - conflictingAction.container._removeAction(conflictingAction); - } - }); -}; diff --git a/tools/doc/node_modules/argparse/lib/argparse.js b/tools/doc/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51d9a89..000000000000 --- a/tools/doc/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports.ArgumentParser = require('./argument_parser.js'); -module.exports.Namespace = require('./namespace'); -module.exports.Action = require('./action'); -module.exports.HelpFormatter = require('./help/formatter.js'); -module.exports.Const = require('./const.js'); - -module.exports.ArgumentDefaultsHelpFormatter = - require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; -module.exports.RawDescriptionHelpFormatter = - require('./help/added_formatters.js').RawDescriptionHelpFormatter; -module.exports.RawTextHelpFormatter = - require('./help/added_formatters.js').RawTextHelpFormatter; diff --git a/tools/doc/node_modules/argparse/lib/argument/error.js b/tools/doc/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a08b8fb..000000000000 --- a/tools/doc/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - - -var format = require('util').format; - - -var ERR_CODE = 'ARGError'; - -/*:nodoc:* - * argumentError(argument, message) -> TypeError - * - argument (Object): action with broken argument - * - message (String): error message - * - * Error format helper. An error from creating or using an argument - * (optional or positional). The string value of this exception - * is the message, augmented with information - * about the argument that caused it. - * - * #####Example - * - * var argumentErrorHelper = require('./argument/error'); - * if (conflictOptionals.length > 0) { - * throw argumentErrorHelper( - * action, - * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) - * ); - * } - * - **/ -module.exports = function (argument, message) { - var argumentName = null; - var errMessage; - var err; - - if (argument.getName) { - argumentName = argument.getName(); - } else { - argumentName = '' + argument; - } - - if (!argumentName) { - errMessage = message; - } else { - errMessage = format('argument "%s": %s', argumentName, message); - } - - err = new TypeError(errMessage); - err.code = ERR_CODE; - return err; -}; diff --git a/tools/doc/node_modules/argparse/lib/argument/exclusive.js b/tools/doc/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index deaca28b8303..000000000000 --- a/tools/doc/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,53 +0,0 @@ -/** internal - * class MutuallyExclusiveGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ArgumentGroup = require('./group'); - -/** - * new MutuallyExclusiveGroup(container, options) - * - container (object): main container - * - options (object): options.required -> true/false - * - * `required` could be an argument itself, but making it a property of - * the options argument is more consistent with the JS adaptation of the Python) - **/ -var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { - var required; - options = options || {}; - required = options.required || false; - ArgumentGroup.call(this, container); - this.required = required; - -}; -util.inherits(MutuallyExclusiveGroup, ArgumentGroup); - - -MutuallyExclusiveGroup.prototype._addAction = function (action) { - var msg; - if (action.required) { - msg = 'mutually exclusive arguments must be optional'; - throw new Error(msg); - } - action = this._container._addAction(action); - this._groupActions.push(action); - return action; -}; - - -MutuallyExclusiveGroup.prototype._removeAction = function (action) { - this._container._removeAction(action); - this._groupActions.remove(action); -}; diff --git a/tools/doc/node_modules/argparse/lib/argument/group.js b/tools/doc/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index ad7693869bc4..000000000000 --- a/tools/doc/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,74 +0,0 @@ -/** internal - * class ArgumentGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ActionContainer = require('../action_container'); - - -/** - * new ArgumentGroup(container, options) - * - container (object): main container - * - options (object): hash of group options - * - * #### options - * - **prefixChars** group name prefix - * - **argumentDefault** default argument value - * - **title** group title - * - **description** group description - * - **/ -var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { - - options = options || {}; - - // add any missing keyword arguments by checking the container - options.conflictHandler = (options.conflictHandler || container.conflictHandler); - options.prefixChars = (options.prefixChars || container.prefixChars); - options.argumentDefault = (options.argumentDefault || container.argumentDefault); - - ActionContainer.call(this, options); - - // group attributes - this.title = options.title; - this._groupActions = []; - - // share most attributes with the container - this._container = container; - this._registries = container._registries; - this._actions = container._actions; - this._optionStringActions = container._optionStringActions; - this._defaults = container._defaults; - this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; - this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; -}; -util.inherits(ArgumentGroup, ActionContainer); - - -ArgumentGroup.prototype._addAction = function (action) { - // Parent add action - action = ActionContainer.prototype._addAction.call(this, action); - this._groupActions.push(action); - return action; -}; - - -ArgumentGroup.prototype._removeAction = function (action) { - // Parent remove action - ActionContainer.prototype._removeAction.call(this, action); - var actionIndex = this._groupActions.indexOf(action); - if (actionIndex >= 0) { - this._groupActions.splice(actionIndex, 1); - } -}; diff --git a/tools/doc/node_modules/argparse/lib/argument_parser.js b/tools/doc/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index bd9a59a453c9..000000000000 --- a/tools/doc/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1161 +0,0 @@ -/** - * class ArgumentParser - * - * Object for parsing command line strings into js objects. - * - * Inherited from [[ActionContainer]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; -var Path = require('path'); -var sprintf = require('sprintf-js').sprintf; - -// Constants -var c = require('./const'); - -var $$ = require('./utils'); - -var ActionContainer = require('./action_container'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -var HelpFormatter = require('./help/formatter'); - -var Namespace = require('./namespace'); - - -/** - * new ArgumentParser(options) - * - * Create a new ArgumentParser object. - * - * ##### Options: - * - `prog` The name of the program (default: Path.basename(process.argv[1])) - * - `usage` A usage message (default: auto-generated from arguments) - * - `description` A description of what the program does - * - `epilog` Text following the argument descriptions - * - `parents` Parsers whose arguments should be copied into this one - * - `formatterClass` HelpFormatter class for printing help messages - * - `prefixChars` Characters that prefix optional arguments - * - `fromfilePrefixChars` Characters that prefix files containing additional arguments - * - `argumentDefault` The default value for all arguments - * - `addHelp` Add a -h/-help option - * - `conflictHandler` Specifies how to handle conflicting argument names - * - `debug` Enable debug mode. Argument errors throw exception in - * debug mode and process.exit in normal. Used for development and - * testing (default: false) - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects - **/ -function ArgumentParser(options) { - if (!(this instanceof ArgumentParser)) { - return new ArgumentParser(options); - } - var self = this; - options = options || {}; - - options.description = (options.description || null); - options.argumentDefault = (options.argumentDefault || null); - options.prefixChars = (options.prefixChars || '-'); - options.conflictHandler = (options.conflictHandler || 'error'); - ActionContainer.call(this, options); - - options.addHelp = typeof options.addHelp === 'undefined' || !!options.addHelp; - options.parents = options.parents || []; - // default program name - options.prog = (options.prog || Path.basename(process.argv[1])); - this.prog = options.prog; - this.usage = options.usage; - this.epilog = options.epilog; - this.version = options.version; - - this.debug = (options.debug === true); - - this.formatterClass = (options.formatterClass || HelpFormatter); - this.fromfilePrefixChars = options.fromfilePrefixChars || null; - this._positionals = this.addArgumentGroup({ title: 'Positional arguments' }); - this._optionals = this.addArgumentGroup({ title: 'Optional arguments' }); - this._subparsers = null; - - // register types - function FUNCTION_IDENTITY(o) { - return o; - } - this.register('type', 'auto', FUNCTION_IDENTITY); - this.register('type', null, FUNCTION_IDENTITY); - this.register('type', 'int', function (x) { - var result = parseInt(x, 10); - if (isNaN(result)) { - throw new Error(x + ' is not a valid integer.'); - } - return result; - }); - this.register('type', 'float', function (x) { - var result = parseFloat(x); - if (isNaN(result)) { - throw new Error(x + ' is not a valid float.'); - } - return result; - }); - this.register('type', 'string', function (x) { - return '' + x; - }); - - // add help and version arguments if necessary - var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; - if (options.addHelp) { - this.addArgument( - [ defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help' ], - { - action: 'help', - defaultValue: c.SUPPRESS, - help: 'Show this help message and exit.' - } - ); - } - if (typeof this.version !== 'undefined') { - this.addArgument( - [ defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version' ], - { - action: 'version', - version: this.version, - defaultValue: c.SUPPRESS, - help: "Show program's version number and exit." - } - ); - } - - // add parent arguments and defaults - options.parents.forEach(function (parent) { - self._addContainerActions(parent); - if (typeof parent._defaults !== 'undefined') { - for (var defaultKey in parent._defaults) { - if (parent._defaults.hasOwnProperty(defaultKey)) { - self._defaults[defaultKey] = parent._defaults[defaultKey]; - } - } - } - }); -} - -util.inherits(ArgumentParser, ActionContainer); - -/** - * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] - * - options (object): hash of options see [[ActionSubparsers.new]] - * - * See also [subcommands][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands - **/ -ArgumentParser.prototype.addSubparsers = function (options) { - if (this._subparsers) { - this.error('Cannot have multiple subparser arguments.'); - } - - options = options || {}; - options.debug = (this.debug === true); - options.optionStrings = []; - options.parserClass = (options.parserClass || ArgumentParser); - - - if (!!options.title || !!options.description) { - - this._subparsers = this.addArgumentGroup({ - title: (options.title || 'subcommands'), - description: options.description - }); - delete options.title; - delete options.description; - - } else { - this._subparsers = this._positionals; - } - - // prog defaults to the usage message of this parser, skipping - // optional arguments and with no "usage:" prefix - if (!options.prog) { - var formatter = this._getFormatter(); - var positionals = this._getPositionalActions(); - var groups = this._mutuallyExclusiveGroups; - formatter.addUsage(this.usage, positionals, groups, ''); - options.prog = formatter.formatHelp().trim(); - } - - // create the parsers action and add it to the positionals list - var ParsersClass = this._popActionClass(options, 'parsers'); - var action = new ParsersClass(options); - this._subparsers._addAction(action); - - // return the created parsers action - return action; -}; - -ArgumentParser.prototype._addAction = function (action) { - if (action.isOptional()) { - this._optionals._addAction(action); - } else { - this._positionals._addAction(action); - } - return action; -}; - -ArgumentParser.prototype._getOptionalActions = function () { - return this._actions.filter(function (action) { - return action.isOptional(); - }); -}; - -ArgumentParser.prototype._getPositionalActions = function () { - return this._actions.filter(function (action) { - return action.isPositional(); - }); -}; - - -/** - * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object - * - args (array): input elements - * - namespace (Namespace|Object): result object - * - * Parsed args and throws error if some arguments are not recognized - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method - **/ -ArgumentParser.prototype.parseArgs = function (args, namespace) { - var argv; - var result = this.parseKnownArgs(args, namespace); - - args = result[0]; - argv = result[1]; - if (argv && argv.length > 0) { - this.error( - format('Unrecognized arguments: %s.', argv.join(' ')) - ); - } - return args; -}; - -/** - * ArgumentParser#parseKnownArgs(args, namespace) -> array - * - args (array): input options - * - namespace (Namespace|Object): result object - * - * Parse known arguments and return tuple of result object - * and unknown args - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing - **/ -ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { - var self = this; - - // args default to the system args - args = args || process.argv.slice(2); - - // default Namespace built from parser defaults - namespace = namespace || new Namespace(); - - self._actions.forEach(function (action) { - if (action.dest !== c.SUPPRESS) { - if (!$$.has(namespace, action.dest)) { - if (action.defaultValue !== c.SUPPRESS) { - var defaultValue = action.defaultValue; - if (typeof action.defaultValue === 'string') { - defaultValue = self._getValue(action, defaultValue); - } - namespace[action.dest] = defaultValue; - } - } - } - }); - - Object.keys(self._defaults).forEach(function (dest) { - namespace[dest] = self._defaults[dest]; - }); - - // parse the arguments and exit if there are any errors - try { - var res = this._parseKnownArgs(args, namespace); - - namespace = res[0]; - args = res[1]; - if ($$.has(namespace, c._UNRECOGNIZED_ARGS_ATTR)) { - args = $$.arrayUnion(args, namespace[c._UNRECOGNIZED_ARGS_ATTR]); - delete namespace[c._UNRECOGNIZED_ARGS_ATTR]; - } - return [ namespace, args ]; - } catch (e) { - this.error(e); - } -}; - -ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { - var self = this; - - var extras = []; - - // replace arg strings that are file references - if (this.fromfilePrefixChars !== null) { - argStrings = this._readArgsFromFiles(argStrings); - } - // map all mutually exclusive arguments to the other arguments - // they can't occur with - // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' - // though I can't conceive of a way in which an action could be a member - // of two different mutually exclusive groups. - - function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } - - var conflicts, key; - var actionConflicts = {}; - - this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { - mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { - key = actionHash(mutexAction); - if (!$$.has(actionConflicts, key)) { - actionConflicts[key] = []; - } - conflicts = actionConflicts[key]; - conflicts.push.apply(conflicts, groupActions.slice(0, i)); - conflicts.push.apply(conflicts, groupActions.slice(i + 1)); - }); - }); - - // find all option indices, and determine the arg_string_pattern - // which has an 'O' if there is an option at an index, - // an 'A' if there is an argument, or a '-' if there is a '--' - var optionStringIndices = {}; - - var argStringPatternParts = []; - - argStrings.forEach(function (argString, argStringIndex) { - if (argString === '--') { - argStringPatternParts.push('-'); - while (argStringIndex < argStrings.length) { - argStringPatternParts.push('A'); - argStringIndex++; - } - } else { - // otherwise, add the arg to the arg strings - // and note the index if it was an option - var pattern; - var optionTuple = self._parseOptional(argString); - if (!optionTuple) { - pattern = 'A'; - } else { - optionStringIndices[argStringIndex] = optionTuple; - pattern = 'O'; - } - argStringPatternParts.push(pattern); - } - }); - var argStringsPattern = argStringPatternParts.join(''); - - var seenActions = []; - var seenNonDefaultActions = []; - - - function takeAction(action, argumentStrings, optionString) { - seenActions.push(action); - var argumentValues = self._getValues(action, argumentStrings); - - // error if this argument is not allowed with other previously - // seen arguments, assuming that actions that use the default - // value don't really count as "present" - if (argumentValues !== action.defaultValue) { - seenNonDefaultActions.push(action); - if (actionConflicts[actionHash(action)]) { - actionConflicts[actionHash(action)].forEach(function (actionConflict) { - if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { - throw argumentErrorHelper( - action, - format('Not allowed with argument "%s".', actionConflict.getName()) - ); - } - }); - } - } - - if (argumentValues !== c.SUPPRESS) { - action.call(self, namespace, argumentValues, optionString); - } - } - - function consumeOptional(startIndex) { - // get the optional identified at this index - var optionTuple = optionStringIndices[startIndex]; - var action = optionTuple[0]; - var optionString = optionTuple[1]; - var explicitArg = optionTuple[2]; - - // identify additional optionals in the same arg string - // (e.g. -xyz is the same as -x -y -z if no args are required) - var actionTuples = []; - - var args, argCount, start, stop; - - for (;;) { - if (!action) { - extras.push(argStrings[startIndex]); - return startIndex + 1; - } - if (explicitArg) { - argCount = self._matchArgument(action, 'A'); - - // if the action is a single-dash option and takes no - // arguments, try to parse more single-dash options out - // of the tail of the option string - var chars = self.prefixChars; - if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { - actionTuples.push([ action, [], optionString ]); - optionString = optionString[0] + explicitArg[0]; - var newExplicitArg = explicitArg.slice(1) || null; - var optionalsMap = self._optionStringActions; - - if (Object.keys(optionalsMap).indexOf(optionString) >= 0) { - action = optionalsMap[optionString]; - explicitArg = newExplicitArg; - } else { - throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); - } - } else if (argCount === 1) { - // if the action expect exactly one argument, we've - // successfully matched the option; exit the loop - stop = startIndex + 1; - args = [ explicitArg ]; - actionTuples.push([ action, args, optionString ]); - break; - } else { - // error if a double-dash option did not use the - // explicit argument - throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); - } - } else { - // if there is no explicit argument, try to match the - // optional's string arguments with the following strings - // if successful, exit the loop - - start = startIndex + 1; - var selectedPatterns = argStringsPattern.substr(start); - - argCount = self._matchArgument(action, selectedPatterns); - stop = start + argCount; - - - args = argStrings.slice(start, stop); - - actionTuples.push([ action, args, optionString ]); - break; - } - - } - - // add the Optional to the list and return the index at which - // the Optional's string args stopped - if (actionTuples.length < 1) { - throw new Error('length should be > 0'); - } - for (var i = 0; i < actionTuples.length; i++) { - takeAction.apply(self, actionTuples[i]); - } - return stop; - } - - // the list of Positionals left to be parsed; this is modified - // by consume_positionals() - var positionals = self._getPositionalActions(); - - function consumePositionals(startIndex) { - // match as many Positionals as possible - var selectedPattern = argStringsPattern.substr(startIndex); - var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); - - // slice off the appropriate arg strings for each Positional - // and add the Positional and its args to the list - for (var i = 0; i < positionals.length; i++) { - var action = positionals[i]; - var argCount = argCounts[i]; - if (typeof argCount === 'undefined') { - continue; - } - var args = argStrings.slice(startIndex, startIndex + argCount); - - startIndex += argCount; - takeAction(action, args); - } - - // slice off the Positionals that we just parsed and return the - // index at which the Positionals' string args stopped - positionals = positionals.slice(argCounts.length); - return startIndex; - } - - // consume Positionals and Optionals alternately, until we have - // passed the last option string - var startIndex = 0; - var position; - - var maxOptionStringIndex = -1; - - Object.keys(optionStringIndices).forEach(function (position) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - }); - - var positionalsEndIndex, nextOptionStringIndex; - - while (startIndex <= maxOptionStringIndex) { - // consume any Positionals preceding the next option - nextOptionStringIndex = null; - for (position in optionStringIndices) { - if (!optionStringIndices.hasOwnProperty(position)) { continue; } - - position = parseInt(position, 10); - if (position >= startIndex) { - if (nextOptionStringIndex !== null) { - nextOptionStringIndex = Math.min(nextOptionStringIndex, position); - } else { - nextOptionStringIndex = position; - } - } - } - - if (startIndex !== nextOptionStringIndex) { - positionalsEndIndex = consumePositionals(startIndex); - // only try to parse the next optional if we didn't consume - // the option string during the positionals parsing - if (positionalsEndIndex > startIndex) { - startIndex = positionalsEndIndex; - continue; - } else { - startIndex = positionalsEndIndex; - } - } - - // if we consumed all the positionals we could and we're not - // at the index of an option string, there were extra arguments - if (!optionStringIndices[startIndex]) { - var strings = argStrings.slice(startIndex, nextOptionStringIndex); - extras = extras.concat(strings); - startIndex = nextOptionStringIndex; - } - // consume the next optional and any arguments for it - startIndex = consumeOptional(startIndex); - } - - // consume any positionals following the last Optional - var stopIndex = consumePositionals(startIndex); - - // if we didn't consume all the argument strings, there were extras - extras = extras.concat(argStrings.slice(stopIndex)); - - // if we didn't use all the Positional objects, there were too few - // arg strings supplied. - if (positionals.length > 0) { - self.error('too few arguments'); - } - - // make sure all required actions were present - self._actions.forEach(function (action) { - if (action.required) { - if (seenActions.indexOf(action) < 0) { - self.error(format('Argument "%s" is required', action.getName())); - } - } - }); - - // make sure all required groups have one option present - var actionUsed = false; - self._mutuallyExclusiveGroups.forEach(function (group) { - if (group.required) { - actionUsed = group._groupActions.some(function (action) { - return seenNonDefaultActions.indexOf(action) !== -1; - }); - - // if no actions were used, report the error - if (!actionUsed) { - var names = []; - group._groupActions.forEach(function (action) { - if (action.help !== c.SUPPRESS) { - names.push(action.getName()); - } - }); - names = names.join(' '); - var msg = 'one of the arguments ' + names + ' is required'; - self.error(msg); - } - } - }); - - // return the updated namespace and the extra arguments - return [ namespace, extras ]; -}; - -ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { - // expand arguments referencing files - var self = this; - var fs = require('fs'); - var newArgStrings = []; - argStrings.forEach(function (argString) { - if (self.fromfilePrefixChars.indexOf(argString[0]) < 0) { - // for regular arguments, just add them back into the list - newArgStrings.push(argString); - } else { - // replace arguments referencing files with the file content - try { - var argstrs = []; - var filename = argString.slice(1); - var content = fs.readFileSync(filename, 'utf8'); - content = content.trim().split('\n'); - content.forEach(function (argLine) { - self.convertArgLineToArgs(argLine).forEach(function (arg) { - argstrs.push(arg); - }); - argstrs = self._readArgsFromFiles(argstrs); - }); - newArgStrings.push.apply(newArgStrings, argstrs); - } catch (error) { - return self.error(error.message); - } - } - }); - return newArgStrings; -}; - -ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { - return [ argLine ]; -}; - -ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { - - // match the pattern for this action to the arg strings - var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); - var matches = regexpArgStrings.match(regexpNargs); - var message; - - // throw an exception if we weren't able to find a match - if (!matches) { - switch (action.nargs) { - /*eslint-disable no-undefined*/ - case undefined: - case null: - message = 'Expected one argument.'; - break; - case c.OPTIONAL: - message = 'Expected at most one argument.'; - break; - case c.ONE_OR_MORE: - message = 'Expected at least one argument.'; - break; - default: - message = 'Expected %s argument(s)'; - } - - throw argumentErrorHelper( - action, - format(message, action.nargs) - ); - } - // return the number of arguments matched - return matches[1].length; -}; - -ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { - // progressively shorten the actions list by slicing off the - // final actions until we find a match - var self = this; - var result = []; - var actionSlice, pattern, matches; - var i, j; - - function getLength(string) { - return string.length; - } - - for (i = actions.length; i > 0; i--) { - pattern = ''; - actionSlice = actions.slice(0, i); - for (j = 0; j < actionSlice.length; j++) { - pattern += self._getNargsPattern(actionSlice[j]); - } - - pattern = new RegExp('^' + pattern); - matches = regexpArgStrings.match(pattern); - - if (matches && matches.length > 0) { - // need only groups - matches = matches.splice(1); - result = result.concat(matches.map(getLength)); - break; - } - } - - // return the list of arg string counts - return result; -}; - -ArgumentParser.prototype._parseOptional = function (argString) { - var action, optionString, argExplicit, optionTuples; - - // if it's an empty string, it was meant to be a positional - if (!argString) { - return null; - } - - // if it doesn't start with a prefix, it was meant to be positional - if (this.prefixChars.indexOf(argString[0]) < 0) { - return null; - } - - // if the option string is present in the parser, return the action - if (this._optionStringActions[argString]) { - return [ this._optionStringActions[argString], argString, null ]; - } - - // if it's just a single character, it was meant to be positional - if (argString.length === 1) { - return null; - } - - // if the option string before the "=" is present, return the action - if (argString.indexOf('=') >= 0) { - optionString = argString.split('=', 1)[0]; - argExplicit = argString.slice(optionString.length + 1); - - if (this._optionStringActions[optionString]) { - action = this._optionStringActions[optionString]; - return [ action, optionString, argExplicit ]; - } - } - - // search through all possible prefixes of the option string - // and all actions in the parser for possible interpretations - optionTuples = this._getOptionTuples(argString); - - // if multiple actions match, the option string was ambiguous - if (optionTuples.length > 1) { - var optionStrings = optionTuples.map(function (optionTuple) { - return optionTuple[1]; - }); - this.error(format( - 'Ambiguous option: "%s" could match %s.', - argString, optionStrings.join(', ') - )); - // if exactly one action matched, this segmentation is good, - // so return the parsed action - } else if (optionTuples.length === 1) { - return optionTuples[0]; - } - - // if it was not found as an option, but it looks like a negative - // number, it was meant to be positional - // unless there are negative-number-like options - if (argString.match(this._regexpNegativeNumber)) { - if (!this._hasNegativeNumberOptionals.some(Boolean)) { - return null; - } - } - // if it contains a space, it was meant to be a positional - if (argString.search(' ') >= 0) { - return null; - } - - // it was meant to be an optional but there is no such option - // in this parser (though it might be a valid option in a subparser) - return [ null, argString, null ]; -}; - -ArgumentParser.prototype._getOptionTuples = function (optionString) { - var result = []; - var chars = this.prefixChars; - var optionPrefix; - var argExplicit; - var action; - var actionOptionString; - - // option strings starting with two prefix characters are only split at - // the '=' - if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { - if (optionString.indexOf('=') >= 0) { - var optionStringSplit = optionString.split('=', 1); - - optionPrefix = optionStringSplit[0]; - argExplicit = optionStringSplit[1]; - } else { - optionPrefix = optionString; - argExplicit = null; - } - - for (actionOptionString in this._optionStringActions) { - if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - action = this._optionStringActions[actionOptionString]; - result.push([ action, actionOptionString, argExplicit ]); - } - } - - // single character options can be concatenated with their arguments - // but multiple character options always have to have their argument - // separate - } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { - optionPrefix = optionString; - argExplicit = null; - var optionPrefixShort = optionString.substr(0, 2); - var argExplicitShort = optionString.substr(2); - - for (actionOptionString in this._optionStringActions) { - if (!$$.has(this._optionStringActions, actionOptionString)) continue; - - action = this._optionStringActions[actionOptionString]; - if (actionOptionString === optionPrefixShort) { - result.push([ action, actionOptionString, argExplicitShort ]); - } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - result.push([ action, actionOptionString, argExplicit ]); - } - } - - // shouldn't ever get here - } else { - throw new Error(format('Unexpected option string: %s.', optionString)); - } - // return the collected option tuples - return result; -}; - -ArgumentParser.prototype._getNargsPattern = function (action) { - // in all examples below, we have to allow for '--' args - // which are represented as '-' in the pattern - var regexpNargs; - - switch (action.nargs) { - // the default (null) is assumed to be a single argument - case undefined: - case null: - regexpNargs = '(-*A-*)'; - break; - // allow zero or more arguments - case c.OPTIONAL: - regexpNargs = '(-*A?-*)'; - break; - // allow zero or more arguments - case c.ZERO_OR_MORE: - regexpNargs = '(-*[A-]*)'; - break; - // allow one or more arguments - case c.ONE_OR_MORE: - regexpNargs = '(-*A[A-]*)'; - break; - // allow any number of options or arguments - case c.REMAINDER: - regexpNargs = '([-AO]*)'; - break; - // allow one argument followed by any number of options or arguments - case c.PARSER: - regexpNargs = '(-*A[-AO]*)'; - break; - // all others should be integers - default: - regexpNargs = '(-*' + $$.repeat('-*A', action.nargs) + '-*)'; - } - - // if this is an optional action, -- is not allowed - if (action.isOptional()) { - regexpNargs = regexpNargs.replace(/-\*/g, ''); - regexpNargs = regexpNargs.replace(/-/g, ''); - } - - // return the pattern - return regexpNargs; -}; - -// -// Value conversion methods -// - -ArgumentParser.prototype._getValues = function (action, argStrings) { - var self = this; - - // for everything but PARSER args, strip out '--' - if (action.nargs !== c.PARSER && action.nargs !== c.REMAINDER) { - argStrings = argStrings.filter(function (arrayElement) { - return arrayElement !== '--'; - }); - } - - var value, argString; - - // optional argument produces a default when not present - if (argStrings.length === 0 && action.nargs === c.OPTIONAL) { - - value = (action.isOptional()) ? action.constant : action.defaultValue; - - if (typeof (value) === 'string') { - value = this._getValue(action, value); - this._checkValue(action, value); - } - - // when nargs='*' on a positional, if there were no command-line - // args, use the default if it is anything other than None - } else if (argStrings.length === 0 && action.nargs === c.ZERO_OR_MORE && - action.optionStrings.length === 0) { - - value = (action.defaultValue || argStrings); - this._checkValue(action, value); - - // single argument or optional argument produces a single value - } else if (argStrings.length === 1 && - (!action.nargs || action.nargs === c.OPTIONAL)) { - - argString = argStrings[0]; - value = this._getValue(action, argString); - this._checkValue(action, value); - - // REMAINDER arguments convert all values, checking none - } else if (action.nargs === c.REMAINDER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - - // PARSER arguments convert all values, but check only the first - } else if (action.nargs === c.PARSER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - this._checkValue(action, value[0]); - - // all other types of nargs produce a list - } else { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - value.forEach(function (v) { - self._checkValue(action, v); - }); - } - - // return the converted value - return value; -}; - -ArgumentParser.prototype._getValue = function (action, argString) { - var result; - - var typeFunction = this._registryGet('type', action.type, action.type); - if (typeof typeFunction !== 'function') { - var message = format('%s is not callable', typeFunction); - throw argumentErrorHelper(action, message); - } - - // convert the value to the appropriate type - try { - result = typeFunction(argString); - - // ArgumentTypeErrors indicate errors - // If action.type is not a registered string, it is a function - // Try to deduce its name for inclusion in the error message - // Failing that, include the error message it raised. - } catch (e) { - var name = null; - if (typeof action.type === 'string') { - name = action.type; - } else { - name = action.type.name || action.type.displayName || ''; - } - var msg = format('Invalid %s value: %s', name, argString); - if (name === '') { msg += '\n' + e.message; } - throw argumentErrorHelper(action, msg); - } - // return the converted value - return result; -}; - -ArgumentParser.prototype._checkValue = function (action, value) { - // converted value must be one of the choices (if specified) - var choices = action.choices; - if (choices) { - // choise for argument can by array or string - if ((typeof choices === 'string' || Array.isArray(choices)) && - choices.indexOf(value) !== -1) { - return; - } - // choise for subparsers can by only hash - if (typeof choices === 'object' && !Array.isArray(choices) && choices[value]) { - return; - } - - if (typeof choices === 'string') { - choices = choices.split('').join(', '); - } else if (Array.isArray(choices)) { - choices = choices.join(', '); - } else { - choices = Object.keys(choices).join(', '); - } - var message = format('Invalid choice: %s (choose from [%s])', value, choices); - throw argumentErrorHelper(action, message); - } -}; - -// -// Help formatting methods -// - -/** - * ArgumentParser#formatUsage -> string - * - * Return usage string - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatUsage = function () { - var formatter = this._getFormatter(); - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - return formatter.formatHelp(); -}; - -/** - * ArgumentParser#formatHelp -> string - * - * Return help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatHelp = function () { - var formatter = this._getFormatter(); - - // usage - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - - // description - formatter.addText(this.description); - - // positionals, optionals and user-defined groups - this._actionGroups.forEach(function (actionGroup) { - formatter.startSection(actionGroup.title); - formatter.addText(actionGroup.description); - formatter.addArguments(actionGroup._groupActions); - formatter.endSection(); - }); - - // epilog - formatter.addText(this.epilog); - - // determine help from format above - return formatter.formatHelp(); -}; - -ArgumentParser.prototype._getFormatter = function () { - var FormatterClass = this.formatterClass; - var formatter = new FormatterClass({ prog: this.prog }); - return formatter; -}; - -// -// Print functions -// - -/** - * ArgumentParser#printUsage() -> Void - * - * Print usage - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printUsage = function () { - this._printMessage(this.formatUsage()); -}; - -/** - * ArgumentParser#printHelp() -> Void - * - * Print help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printHelp = function () { - this._printMessage(this.formatHelp()); -}; - -ArgumentParser.prototype._printMessage = function (message, stream) { - if (!stream) { - stream = process.stdout; - } - if (message) { - stream.write('' + message); - } -}; - -// -// Exit functions -// - -/** - * ArgumentParser#exit(status=0, message) -> Void - * - status (int): exit status - * - message (string): message - * - * Print message in stderr/stdout and exit program - **/ -ArgumentParser.prototype.exit = function (status, message) { - if (message) { - if (status === 0) { - this._printMessage(message); - } else { - this._printMessage(message, process.stderr); - } - } - - process.exit(status); -}; - -/** - * ArgumentParser#error(message) -> Void - * - err (Error|string): message - * - * Error method Prints a usage message incorporating the message to stderr and - * exits. If you override this in a subclass, - * it should not return -- it should - * either exit or throw an exception. - * - **/ -ArgumentParser.prototype.error = function (err) { - var message; - if (err instanceof Error) { - if (this.debug === true) { - throw err; - } - message = err.message; - } else { - message = err; - } - var msg = format('%s: error: %s', this.prog, message) + c.EOL; - - if (this.debug === true) { - throw new Error(msg); - } - - this.printUsage(process.stderr); - - return this.exit(2, msg); -}; - -module.exports = ArgumentParser; diff --git a/tools/doc/node_modules/argparse/lib/const.js b/tools/doc/node_modules/argparse/lib/const.js deleted file mode 100644 index b1fd4ced4e88..000000000000 --- a/tools/doc/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,21 +0,0 @@ -// -// Constants -// - -'use strict'; - -module.exports.EOL = '\n'; - -module.exports.SUPPRESS = '==SUPPRESS=='; - -module.exports.OPTIONAL = '?'; - -module.exports.ZERO_OR_MORE = '*'; - -module.exports.ONE_OR_MORE = '+'; - -module.exports.PARSER = 'A...'; - -module.exports.REMAINDER = '...'; - -module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; diff --git a/tools/doc/node_modules/argparse/lib/help/added_formatters.js b/tools/doc/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index f8e42998e9bf..000000000000 --- a/tools/doc/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var util = require('util'); - -// Constants -var c = require('../const'); - -var $$ = require('../utils'); -var HelpFormatter = require('./formatter.js'); - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which adds default values to argument help. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function ArgumentDefaultsHelpFormatter(options) { - HelpFormatter.call(this, options); -} - -util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); - -ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { - var help = action.help; - if (action.help.indexOf('%(defaultValue)s') === -1) { - if (action.defaultValue !== c.SUPPRESS) { - var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ]; - if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { - help += ' (default: %(defaultValue)s)'; - } - } - } - return help; -}; - -module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which retains any formatting in descriptions. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function RawDescriptionHelpFormatter(options) { - HelpFormatter.call(this, options); -} - -util.inherits(RawDescriptionHelpFormatter, HelpFormatter); - -RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = text.split('\n'); - lines = lines.map(function (line) { - return $$.trimEnd(indent + line); - }); - return lines.join('\n'); -}; -module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; - -/** - * new RawTextHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) - * - * Help message formatter which retains formatting of all help text. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -function RawTextHelpFormatter(options) { - RawDescriptionHelpFormatter.call(this, options); -} - -util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); - -RawTextHelpFormatter.prototype._splitLines = function (text) { - return text.split('\n'); -}; - -module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/tools/doc/node_modules/argparse/lib/help/formatter.js b/tools/doc/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index 29036c14b2e1..000000000000 --- a/tools/doc/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,795 +0,0 @@ -/** - * class HelpFormatter - * - * Formatter for generating usage messages and argument help strings. Only the - * name of this class is considered a public API. All the methods provided by - * the class are considered an implementation detail. - * - * Do not call in your code, use this class only for inherits your own forvatter - * - * ToDo add [additonal formatters][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#formatter-class - **/ -'use strict'; - -var sprintf = require('sprintf-js').sprintf; - -// Constants -var c = require('../const'); - -var $$ = require('../utils'); - - -/*:nodoc:* internal - * new Support(parent, heding) - * - parent (object): parent section - * - heading (string): header string - * - **/ -function Section(parent, heading) { - this._parent = parent; - this._heading = heading; - this._items = []; -} - -/*:nodoc:* internal - * Section#addItem(callback) -> Void - * - callback (array): tuple with function and args - * - * Add function for single element - **/ -Section.prototype.addItem = function (callback) { - this._items.push(callback); -}; - -/*:nodoc:* internal - * Section#formatHelp(formatter) -> string - * - formatter (HelpFormatter): current formatter - * - * Form help section string - * - **/ -Section.prototype.formatHelp = function (formatter) { - var itemHelp, heading; - - // format the indented section - if (this._parent) { - formatter._indent(); - } - - itemHelp = this._items.map(function (item) { - var obj, func, args; - - obj = formatter; - func = item[0]; - args = item[1]; - return func.apply(obj, args); - }); - itemHelp = formatter._joinParts(itemHelp); - - if (this._parent) { - formatter._dedent(); - } - - // return nothing if the section was empty - if (!itemHelp) { - return ''; - } - - // add the heading if the section was non-empty - heading = ''; - if (this._heading && this._heading !== c.SUPPRESS) { - var currentIndent = formatter.currentIndent; - heading = $$.repeat(' ', currentIndent) + this._heading + ':' + c.EOL; - } - - // join the section-initialize newline, the heading and the help - return formatter._joinParts([ c.EOL, heading, itemHelp, c.EOL ]); -}; - -/** - * new HelpFormatter(options) - * - * #### Options: - * - `prog`: program name - * - `indentIncriment`: indent step, default value 2 - * - `maxHelpPosition`: max help position, default value = 24 - * - `width`: line width - * - **/ -var HelpFormatter = module.exports = function HelpFormatter(options) { - options = options || {}; - - this._prog = options.prog; - - this._maxHelpPosition = options.maxHelpPosition || 24; - this._width = (options.width || ((process.env.COLUMNS || 80) - 2)); - - this._currentIndent = 0; - this._indentIncriment = options.indentIncriment || 2; - this._level = 0; - this._actionMaxLength = 0; - - this._rootSection = new Section(null); - this._currentSection = this._rootSection; - - this._whitespaceMatcher = new RegExp('\\s+', 'g'); - this._longBreakMatcher = new RegExp(c.EOL + c.EOL + c.EOL + '+', 'g'); -}; - -HelpFormatter.prototype._indent = function () { - this._currentIndent += this._indentIncriment; - this._level += 1; -}; - -HelpFormatter.prototype._dedent = function () { - this._currentIndent -= this._indentIncriment; - this._level -= 1; - if (this._currentIndent < 0) { - throw new Error('Indent decreased below 0.'); - } -}; - -HelpFormatter.prototype._addItem = function (func, args) { - this._currentSection.addItem([ func, args ]); -}; - -// -// Message building methods -// - -/** - * HelpFormatter#startSection(heading) -> Void - * - heading (string): header string - * - * Start new help section - * - * See alse [code example][1] - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.startSection = function (heading) { - this._indent(); - var section = new Section(this._currentSection, heading); - var func = section.formatHelp.bind(section); - this._addItem(func, [ this ]); - this._currentSection = section; -}; - -/** - * HelpFormatter#endSection -> Void - * - * End help section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - **/ -HelpFormatter.prototype.endSection = function () { - this._currentSection = this._currentSection._parent; - this._dedent(); -}; - -/** - * HelpFormatter#addText(text) -> Void - * - text (string): plain text - * - * Add plain text into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addText = function (text) { - if (text && text !== c.SUPPRESS) { - this._addItem(this._formatText, [ text ]); - } -}; - -/** - * HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void - * - usage (string): usage text - * - actions (array): actions list - * - groups (array): groups list - * - prefix (string): usage prefix - * - * Add usage data into current section - * - * ##### Example - * - * formatter.addUsage(this.usage, this._actions, []); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) { - if (usage !== c.SUPPRESS) { - this._addItem(this._formatUsage, [ usage, actions, groups, prefix ]); - } -}; - -/** - * HelpFormatter#addArgument(action) -> Void - * - action (object): action - * - * Add argument into current section - * - * Single variant of [[HelpFormatter#addArguments]] - **/ -HelpFormatter.prototype.addArgument = function (action) { - if (action.help !== c.SUPPRESS) { - var self = this; - - // find all invocations - var invocations = [ this._formatActionInvocation(action) ]; - var invocationLength = invocations[0].length; - - var actionLength; - - if (action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - - var invocationNew = self._formatActionInvocation(subaction); - invocations.push(invocationNew); - invocationLength = Math.max(invocationLength, invocationNew.length); - - }); - this._dedent(); - } - - // update the maximum item length - actionLength = invocationLength + this._currentIndent; - this._actionMaxLength = Math.max(this._actionMaxLength, actionLength); - - // add the item to the list - this._addItem(this._formatAction, [ action ]); - } -}; - -/** - * HelpFormatter#addArguments(actions) -> Void - * - actions (array): actions list - * - * Mass add arguments into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addArguments = function (actions) { - var self = this; - actions.forEach(function (action) { - self.addArgument(action); - }); -}; - -// -// Help-formatting methods -// - -/** - * HelpFormatter#formatHelp -> string - * - * Format help - * - * ##### Example - * - * formatter.addText(this.epilog); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.formatHelp = function () { - var help = this._rootSection.formatHelp(this); - if (help) { - help = help.replace(this._longBreakMatcher, c.EOL + c.EOL); - help = $$.trimChars(help, c.EOL) + c.EOL; - } - return help; -}; - -HelpFormatter.prototype._joinParts = function (partStrings) { - return partStrings.filter(function (part) { - return (part && part !== c.SUPPRESS); - }).join(''); -}; - -HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { - if (!prefix && typeof prefix !== 'string') { - prefix = 'usage: '; - } - - actions = actions || []; - groups = groups || []; - - - // if usage is specified, use that - if (usage) { - usage = sprintf(usage, { prog: this._prog }); - - // if no optionals or positionals are available, usage is just prog - } else if (!usage && actions.length === 0) { - usage = this._prog; - - // if optionals and positionals are available, calculate usage - } else if (!usage) { - var prog = this._prog; - var optionals = []; - var positionals = []; - var actionUsage; - var textWidth; - - // split optionals from positionals - actions.forEach(function (action) { - if (action.isOptional()) { - optionals.push(action); - } else { - positionals.push(action); - } - }); - - // build full usage string - actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups); - usage = [ prog, actionUsage ].join(' '); - - // wrap the usage parts if it's too long - textWidth = this._width - this._currentIndent; - if ((prefix.length + usage.length) > textWidth) { - - // break usage into wrappable parts - var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g'); - var optionalUsage = this._formatActionsUsage(optionals, groups); - var positionalUsage = this._formatActionsUsage(positionals, groups); - - - var optionalParts = optionalUsage.match(regexpPart); - var positionalParts = positionalUsage.match(regexpPart) || []; - - if (optionalParts.join(' ') !== optionalUsage) { - throw new Error('assert "optionalParts.join(\' \') === optionalUsage"'); - } - if (positionalParts.join(' ') !== positionalUsage) { - throw new Error('assert "positionalParts.join(\' \') === positionalUsage"'); - } - - // helper for wrapping lines - /*eslint-disable func-style*/ // node 0.10 compat - var _getLines = function (parts, indent, prefix) { - var lines = []; - var line = []; - - var lineLength = prefix ? prefix.length - 1 : indent.length - 1; - - parts.forEach(function (part) { - if (lineLength + 1 + part.length > textWidth) { - lines.push(indent + line.join(' ')); - line = []; - lineLength = indent.length - 1; - } - line.push(part); - lineLength += part.length + 1; - }); - - if (line) { - lines.push(indent + line.join(' ')); - } - if (prefix) { - lines[0] = lines[0].substr(indent.length); - } - return lines; - }; - - var lines, indent, parts; - // if prog is short, follow it with optionals or positionals - if (prefix.length + prog.length <= 0.75 * textWidth) { - indent = $$.repeat(' ', (prefix.length + prog.length + 1)); - if (optionalParts) { - lines = [].concat( - _getLines([ prog ].concat(optionalParts), indent, prefix), - _getLines(positionalParts, indent) - ); - } else if (positionalParts) { - lines = _getLines([ prog ].concat(positionalParts), indent, prefix); - } else { - lines = [ prog ]; - } - - // if prog is long, put it on its own line - } else { - indent = $$.repeat(' ', prefix.length); - parts = optionalParts.concat(positionalParts); - lines = _getLines(parts, indent); - if (lines.length > 1) { - lines = [].concat( - _getLines(optionalParts, indent), - _getLines(positionalParts, indent) - ); - } - lines = [ prog ].concat(lines); - } - // join lines into usage - usage = lines.join(c.EOL); - } - } - - // prefix with 'usage:' - return prefix + usage + c.EOL + c.EOL; -}; - -HelpFormatter.prototype._formatActionsUsage = function (actions, groups) { - // find group indices and identify actions in groups - var groupActions = []; - var inserts = []; - var self = this; - - groups.forEach(function (group) { - var end; - var i; - - var start = actions.indexOf(group._groupActions[0]); - if (start >= 0) { - end = start + group._groupActions.length; - - //if (actions.slice(start, end) === group._groupActions) { - if ($$.arrayEqual(actions.slice(start, end), group._groupActions)) { - group._groupActions.forEach(function (action) { - groupActions.push(action); - }); - - if (!group.required) { - if (inserts[start]) { - inserts[start] += ' ['; - } else { - inserts[start] = '['; - } - inserts[end] = ']'; - } else { - if (inserts[start]) { - inserts[start] += ' ('; - } else { - inserts[start] = '('; - } - inserts[end] = ')'; - } - for (i = start + 1; i < end; i += 1) { - inserts[i] = '|'; - } - } - } - }); - - // collect all actions format strings - var parts = []; - - actions.forEach(function (action, actionIndex) { - var part; - var optionString; - var argsDefault; - var argsString; - - // suppressed arguments are marked with None - // remove | separators for suppressed arguments - if (action.help === c.SUPPRESS) { - parts.push(null); - if (inserts[actionIndex] === '|') { - inserts.splice(actionIndex, actionIndex); - } else if (inserts[actionIndex + 1] === '|') { - inserts.splice(actionIndex + 1, actionIndex + 1); - } - - // produce all arg strings - } else if (!action.isOptional()) { - part = self._formatArgs(action, action.dest); - - // if it's in a group, strip the outer [] - if (groupActions.indexOf(action) >= 0) { - if (part[0] === '[' && part[part.length - 1] === ']') { - part = part.slice(1, -1); - } - } - // add the action string to the list - parts.push(part); - - // produce the first way to invoke the option in brackets - } else { - optionString = action.optionStrings[0]; - - // if the Optional doesn't take a value, format is: -s or --long - if (action.nargs === 0) { - part = '' + optionString; - - // if the Optional takes a value, format is: -s ARGS or --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = self._formatArgs(action, argsDefault); - part = optionString + ' ' + argsString; - } - // make it look optional if it's not required or in a group - if (!action.required && groupActions.indexOf(action) < 0) { - part = '[' + part + ']'; - } - // add the action string to the list - parts.push(part); - } - }); - - // insert things at the necessary indices - for (var i = inserts.length - 1; i >= 0; --i) { - if (inserts[i] !== null) { - parts.splice(i, 0, inserts[i]); - } - } - - // join all the action items with spaces - var text = parts.filter(function (part) { - return !!part; - }).join(' '); - - // clean up separators for mutually exclusive groups - text = text.replace(/([\[(]) /g, '$1'); // remove spaces - text = text.replace(/ ([\])])/g, '$1'); - text = text.replace(/\[ *\]/g, ''); // remove empty groups - text = text.replace(/\( *\)/g, ''); - text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups - - text = text.trim(); - - // return the text - return text; -}; - -HelpFormatter.prototype._formatText = function (text) { - text = sprintf(text, { prog: this._prog }); - var textWidth = this._width - this._currentIndent; - var indentIncriment = $$.repeat(' ', this._currentIndent); - return this._fillText(text, textWidth, indentIncriment) + c.EOL + c.EOL; -}; - -HelpFormatter.prototype._formatAction = function (action) { - var self = this; - - var helpText; - var helpLines; - var parts; - var indentFirst; - - // determine the required width and the entry label - var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition); - var helpWidth = this._width - helpPosition; - var actionWidth = helpPosition - this._currentIndent - 2; - var actionHeader = this._formatActionInvocation(action); - - // no help; start on same line and add a final newline - if (!action.help) { - actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; - - // short action name; start on the same line and pad two spaces - } else if (actionHeader.length <= actionWidth) { - actionHeader = $$.repeat(' ', this._currentIndent) + - actionHeader + - ' ' + - $$.repeat(' ', actionWidth - actionHeader.length); - indentFirst = 0; - - // long action name; start on the next line - } else { - actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; - indentFirst = helpPosition; - } - - // collect the pieces of the action help - parts = [ actionHeader ]; - - // if there was help for the action, add lines of help text - if (action.help) { - helpText = this._expandHelp(action); - helpLines = this._splitLines(helpText, helpWidth); - parts.push($$.repeat(' ', indentFirst) + helpLines[0] + c.EOL); - helpLines.slice(1).forEach(function (line) { - parts.push($$.repeat(' ', helpPosition) + line + c.EOL); - }); - - // or add a newline if the description doesn't end with one - } else if (actionHeader.charAt(actionHeader.length - 1) !== c.EOL) { - parts.push(c.EOL); - } - // if there are any sub-actions, add their help as well - if (action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - parts.push(self._formatAction(subaction)); - }); - this._dedent(); - } - // return a single string - return this._joinParts(parts); -}; - -HelpFormatter.prototype._formatActionInvocation = function (action) { - if (!action.isOptional()) { - var format_func = this._metavarFormatter(action, action.dest); - var metavars = format_func(1); - return metavars[0]; - } - - var parts = []; - var argsDefault; - var argsString; - - // if the Optional doesn't take a value, format is: -s, --long - if (action.nargs === 0) { - parts = parts.concat(action.optionStrings); - - // if the Optional takes a value, format is: -s ARGS, --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = this._formatArgs(action, argsDefault); - action.optionStrings.forEach(function (optionString) { - parts.push(optionString + ' ' + argsString); - }); - } - return parts.join(', '); -}; - -HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) { - var result; - - if (action.metavar || action.metavar === '') { - result = action.metavar; - } else if (action.choices) { - var choices = action.choices; - - if (typeof choices === 'string') { - choices = choices.split('').join(', '); - } else if (Array.isArray(choices)) { - choices = choices.join(','); - } else { - choices = Object.keys(choices).join(','); - } - result = '{' + choices + '}'; - } else { - result = metavarDefault; - } - - return function (size) { - if (Array.isArray(result)) { - return result; - } - - var metavars = []; - for (var i = 0; i < size; i += 1) { - metavars.push(result); - } - return metavars; - }; -}; - -HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { - var result; - var metavars; - - var buildMetavar = this._metavarFormatter(action, metavarDefault); - - switch (action.nargs) { - /*eslint-disable no-undefined*/ - case undefined: - case null: - metavars = buildMetavar(1); - result = '' + metavars[0]; - break; - case c.OPTIONAL: - metavars = buildMetavar(1); - result = '[' + metavars[0] + ']'; - break; - case c.ZERO_OR_MORE: - metavars = buildMetavar(2); - result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; - break; - case c.ONE_OR_MORE: - metavars = buildMetavar(2); - result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; - break; - case c.REMAINDER: - result = '...'; - break; - case c.PARSER: - metavars = buildMetavar(1); - result = metavars[0] + ' ...'; - break; - default: - metavars = buildMetavar(action.nargs); - result = metavars.join(' '); - } - return result; -}; - -HelpFormatter.prototype._expandHelp = function (action) { - var params = { prog: this._prog }; - - Object.keys(action).forEach(function (actionProperty) { - var actionValue = action[actionProperty]; - - if (actionValue !== c.SUPPRESS) { - params[actionProperty] = actionValue; - } - }); - - if (params.choices) { - if (typeof params.choices === 'string') { - params.choices = params.choices.split('').join(', '); - } else if (Array.isArray(params.choices)) { - params.choices = params.choices.join(', '); - } else { - params.choices = Object.keys(params.choices).join(', '); - } - } - - return sprintf(this._getHelpString(action), params); -}; - -HelpFormatter.prototype._splitLines = function (text, width) { - var lines = []; - var delimiters = [ ' ', '.', ',', '!', '?' ]; - var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$'); - - text = text.replace(/[\n\|\t]/g, ' '); - - text = text.trim(); - text = text.replace(this._whitespaceMatcher, ' '); - - // Wraps the single paragraph in text (a string) so every line - // is at most width characters long. - text.split(c.EOL).forEach(function (line) { - if (width >= line.length) { - lines.push(line); - return; - } - - var wrapStart = 0; - var wrapEnd = width; - var delimiterIndex = 0; - while (wrapEnd <= line.length) { - if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) { - delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index; - wrapEnd = wrapStart + delimiterIndex + 1; - } - lines.push(line.substring(wrapStart, wrapEnd)); - wrapStart = wrapEnd; - wrapEnd += width; - } - if (wrapStart < line.length) { - lines.push(line.substring(wrapStart, wrapEnd)); - } - }); - - return lines; -}; - -HelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = this._splitLines(text, width); - lines = lines.map(function (line) { - return indent + line; - }); - return lines.join(c.EOL); -}; - -HelpFormatter.prototype._getHelpString = function (action) { - return action.help; -}; diff --git a/tools/doc/node_modules/argparse/lib/namespace.js b/tools/doc/node_modules/argparse/lib/namespace.js deleted file mode 100644 index a860de9ecc48..000000000000 --- a/tools/doc/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * class Namespace - * - * Simple object for storing attributes. Implements equality by attribute names - * and values, and provides a simple string representation. - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object - **/ -'use strict'; - -var $$ = require('./utils'); - -/** - * new Namespace(options) - * - options(object): predefined propertis for result object - * - **/ -var Namespace = module.exports = function Namespace(options) { - $$.extend(this, options); -}; - -/** - * Namespace#isset(key) -> Boolean - * - key (string|number): property name - * - * Tells whenever `namespace` contains given `key` or not. - **/ -Namespace.prototype.isset = function (key) { - return $$.has(this, key); -}; - -/** - * Namespace#set(key, value) -> self - * -key (string|number|object): propery name - * -value (mixed): new property value - * - * Set the property named key with value. - * If key object then set all key properties to namespace object - **/ -Namespace.prototype.set = function (key, value) { - if (typeof (key) === 'object') { - $$.extend(this, key); - } else { - this[key] = value; - } - return this; -}; - -/** - * Namespace#get(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return the property key or defaulValue if not set - **/ -Namespace.prototype.get = function (key, defaultValue) { - return !this[key] ? defaultValue : this[key]; -}; - -/** - * Namespace#unset(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return data[key](and delete it) or defaultValue - **/ -Namespace.prototype.unset = function (key, defaultValue) { - var value = this[key]; - if (value !== null) { - delete this[key]; - return value; - } - return defaultValue; -}; diff --git a/tools/doc/node_modules/argparse/lib/utils.js b/tools/doc/node_modules/argparse/lib/utils.js deleted file mode 100644 index 4a9cf3edb615..000000000000 --- a/tools/doc/node_modules/argparse/lib/utils.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -exports.repeat = function (str, num) { - var result = ''; - for (var i = 0; i < num; i++) { result += str; } - return result; -}; - -exports.arrayEqual = function (a, b) { - if (a.length !== b.length) { return false; } - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { return false; } - } - return true; -}; - -exports.trimChars = function (str, chars) { - var start = 0; - var end = str.length - 1; - while (chars.indexOf(str.charAt(start)) >= 0) { start++; } - while (chars.indexOf(str.charAt(end)) >= 0) { end--; } - return str.slice(start, end + 1); -}; - -exports.capitalize = function (str) { - return str.charAt(0).toUpperCase() + str.slice(1); -}; - -exports.arrayUnion = function () { - var result = []; - for (var i = 0, values = {}; i < arguments.length; i++) { - var arr = arguments[i]; - for (var j = 0; j < arr.length; j++) { - if (!values[arr[j]]) { - values[arr[j]] = true; - result.push(arr[j]); - } - } - } - return result; -}; - -function has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -exports.has = has; - -exports.extend = function (dest, src) { - for (var i in src) { - if (has(src, i)) { dest[i] = src[i]; } - } -}; - -exports.trimEnd = function (str) { - return str.replace(/\s+$/g, ''); -}; diff --git a/tools/doc/node_modules/argparse/package.json b/tools/doc/node_modules/argparse/package.json deleted file mode 100644 index 24313f5e3c2a..000000000000 --- a/tools/doc/node_modules/argparse/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_args": [ - [ - "argparse@1.0.10", - "/Users/rubys/git/node/tools/doc" - ] - ], - "_development": true, - "_from": "argparse@1.0.10", - "_id": "argparse@1.0.10", - "_inBundle": false, - "_integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "_location": "/argparse", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "argparse@1.0.10", - "name": "argparse", - "escapedName": "argparse", - "rawSpec": "1.0.10", - "saveSpec": null, - "fetchSpec": "1.0.10" - }, - "_requiredBy": [ - "/js-yaml" - ], - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "_spec": "1.0.10", - "_where": "/Users/rubys/git/node/tools/doc", - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "dependencies": { - "sprintf-js": "~1.0.2" - }, - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "devDependencies": { - "eslint": "^2.13.1", - "istanbul": "^0.4.5", - "mocha": "^3.1.0", - "ndoc": "^5.0.1" - }, - "files": [ - "index.js", - "lib/" - ], - "homepage": "https://github.com/nodeca/argparse#readme", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "license": "MIT", - "name": "argparse", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/argparse.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.0.10" -} diff --git a/tools/doc/node_modules/esprima/LICENSE.BSD b/tools/doc/node_modules/esprima/LICENSE.BSD deleted file mode 100644 index 7a55160f562d..000000000000 --- a/tools/doc/node_modules/esprima/LICENSE.BSD +++ /dev/null @@ -1,21 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation/ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/doc/node_modules/esprima/README.md b/tools/doc/node_modules/esprima/README.md deleted file mode 100644 index 1ee10bfa0d1d..000000000000 --- a/tools/doc/node_modules/esprima/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) -[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) -[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) -[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) - -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) -- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) -- Optional tracking of syntax node location (index-based and line-column) -- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) - -### API - -Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. - -A simple example on Node.js REPL: - -```javascript -> var esprima = require('esprima'); -> var program = 'const answer = 42'; - -> esprima.tokenize(program); -[ { type: 'Keyword', value: 'const' }, - { type: 'Identifier', value: 'answer' }, - { type: 'Punctuator', value: '=' }, - { type: 'Numeric', value: '42' } ] - -> esprima.parseScript(program); -{ type: 'Program', - body: - [ { type: 'VariableDeclaration', - declarations: [Object], - kind: 'const' } ], - sourceType: 'script' } -``` - -For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/tools/doc/node_modules/esprima/bin/esparse.js b/tools/doc/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 45d05fbb7326..000000000000 --- a/tools/doc/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, forceFile, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] [file.js]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function run(content) { - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} - -try { - if (fname && (fname !== '-' || forceFile)) { - run(fs.readFileSync(fname, 'utf-8')); - } else { - var content = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(content); - }); - } -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/tools/doc/node_modules/esprima/bin/esvalidate.js b/tools/doc/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index d49a7e40a8c3..000000000000 --- a/tools/doc/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, forceFile, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { - argv: arguments, - exit: quit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] [file.js...]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - fnames.push(entry); - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -if (fnames.length === 0) { - fnames.push(''); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; - -function run(fname, content) { - var timestamp, syntax, name; - try { - if (typeof content !== 'string') { - throw content; - } - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); - } - } -} - -fnames.forEach(function (fname) { - var content = ''; - try { - if (fname && (fname !== '-' || forceFile)) { - content = fs.readFileSync(fname, 'utf-8'); - } else { - fname = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(fname, content); - }); - return; - } - } catch (e) { - content = e; - } - run(fname, content); -}); - -process.on('exit', function () { - if (options.format === 'junit') { - console.log(''); - } - - if (count > 0) { - process.exit(1); - } - - if (count === 0 && typeof phantom === 'object') { - process.exit(0); - } -}); diff --git a/tools/doc/node_modules/esprima/dist/esprima.js b/tools/doc/node_modules/esprima/dist/esprima.js deleted file mode 100644 index 2c2f93cbd34d..000000000000 --- a/tools/doc/node_modules/esprima/dist/esprima.js +++ /dev/null @@ -1,6700 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); -/* istanbul ignore next */ - else if(typeof exports === 'object') - exports["esprima"] = factory(); - else - root["esprima"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/* istanbul ignore if */ -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - /* - Copyright JS Foundation and other contributors, https://js.foundation/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - Object.defineProperty(exports, "__esModule", { value: true }); - var comment_handler_1 = __webpack_require__(1); - var jsx_parser_1 = __webpack_require__(3); - var parser_1 = __webpack_require__(8); - var tokenizer_1 = __webpack_require__(15); - function parse(code, options, delegate) { - var commentHandler = null; - var proxyDelegate = function (node, metadata) { - if (delegate) { - delegate(node, metadata); - } - if (commentHandler) { - commentHandler.visit(node, metadata); - } - }; - var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; - var collectComment = false; - if (options) { - collectComment = (typeof options.comment === 'boolean' && options.comment); - var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); - if (collectComment || attachComment) { - commentHandler = new comment_handler_1.CommentHandler(); - commentHandler.attach = attachComment; - options.comment = true; - parserDelegate = proxyDelegate; - } - } - var isModule = false; - if (options && typeof options.sourceType === 'string') { - isModule = (options.sourceType === 'module'); - } - var parser; - if (options && typeof options.jsx === 'boolean' && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); - } - else { - parser = new parser_1.Parser(code, options, parserDelegate); - } - var program = isModule ? parser.parseModule() : parser.parseScript(); - var ast = program; - if (collectComment && commentHandler) { - ast.comments = commentHandler.comments; - } - if (parser.config.tokens) { - ast.tokens = parser.tokens; - } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; - } - return ast; - } - exports.parse = parse; - function parseModule(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'module'; - return parse(code, parsingOptions, delegate); - } - exports.parseModule = parseModule; - function parseScript(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'script'; - return parse(code, parsingOptions, delegate); - } - exports.parseScript = parseScript; - function tokenize(code, options, delegate) { - var tokenizer = new tokenizer_1.Tokenizer(code, options); - var tokens; - tokens = []; - try { - while (true) { - var token = tokenizer.getNextToken(); - if (!token) { - break; - } - if (delegate) { - token = delegate(token); - } - tokens.push(token); - } - } - catch (e) { - tokenizer.errorHandler.tolerate(e); - } - if (tokenizer.errorHandler.tolerant) { - tokens.errors = tokenizer.errors(); - } - return tokens; - } - exports.tokenize = tokenize; - var syntax_1 = __webpack_require__(2); - exports.Syntax = syntax_1.Syntax; - // Sync with *.json manifests. - exports.version = '4.0.0'; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - var CommentHandler = (function () { - function CommentHandler() { - this.attach = false; - this.comments = []; - this.stack = []; - this.leading = []; - this.trailing = []; - } - CommentHandler.prototype.insertInnerComments = function (node, metadata) { - // innnerComments for properties empty block - // `function a() {/** comments **\/}` - if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { - var innerComments = []; - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (metadata.end.offset >= entry.start) { - innerComments.unshift(entry.comment); - this.leading.splice(i, 1); - this.trailing.splice(i, 1); - } - } - if (innerComments.length) { - node.innerComments = innerComments; - } - } - }; - CommentHandler.prototype.findTrailingComments = function (metadata) { - var trailingComments = []; - if (this.trailing.length > 0) { - for (var i = this.trailing.length - 1; i >= 0; --i) { - var entry_1 = this.trailing[i]; - if (entry_1.start >= metadata.end.offset) { - trailingComments.unshift(entry_1.comment); - } - } - this.trailing.length = 0; - return trailingComments; - } - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.node.trailingComments) { - var firstComment = entry.node.trailingComments[0]; - if (firstComment && firstComment.range[0] >= metadata.end.offset) { - trailingComments = entry.node.trailingComments; - delete entry.node.trailingComments; - } - } - return trailingComments; - }; - CommentHandler.prototype.findLeadingComments = function (metadata) { - var leadingComments = []; - var target; - while (this.stack.length > 0) { - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.start >= metadata.start.offset) { - target = entry.node; - this.stack.pop(); - } - else { - break; - } - } - if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { - var comment = target.leadingComments[i]; - if (comment.range[1] <= metadata.start.offset) { - leadingComments.unshift(comment); - target.leadingComments.splice(i, 1); - } - } - if (target.leadingComments && target.leadingComments.length === 0) { - delete target.leadingComments; - } - return leadingComments; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (entry.start <= metadata.start.offset) { - leadingComments.unshift(entry.comment); - this.leading.splice(i, 1); - } - } - return leadingComments; - }; - CommentHandler.prototype.visitNode = function (node, metadata) { - if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { - return; - } - this.insertInnerComments(node, metadata); - var trailingComments = this.findTrailingComments(metadata); - var leadingComments = this.findLeadingComments(metadata); - if (leadingComments.length > 0) { - node.leadingComments = leadingComments; - } - if (trailingComments.length > 0) { - node.trailingComments = trailingComments; - } - this.stack.push({ - node: node, - start: metadata.start.offset - }); - }; - CommentHandler.prototype.visitComment = function (node, metadata) { - var type = (node.type[0] === 'L') ? 'Line' : 'Block'; - var comment = { - type: type, - value: node.value - }; - if (node.range) { - comment.range = node.range; - } - if (node.loc) { - comment.loc = node.loc; - } - this.comments.push(comment); - if (this.attach) { - var entry = { - comment: { - type: type, - value: node.value, - range: [metadata.start.offset, metadata.end.offset] - }, - start: metadata.start.offset - }; - if (node.loc) { - entry.comment.loc = node.loc; - } - node.type = type; - this.leading.push(entry); - this.trailing.push(entry); - } - }; - CommentHandler.prototype.visit = function (node, metadata) { - if (node.type === 'LineComment') { - this.visitComment(node, metadata); - } - else if (node.type === 'BlockComment') { - this.visitComment(node, metadata); - } - else if (this.attach) { - this.visitNode(node, metadata); - } - }; - return CommentHandler; - }()); - exports.CommentHandler = CommentHandler; - - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; -/* istanbul ignore next */ - var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var character_1 = __webpack_require__(4); - var JSXNode = __webpack_require__(5); - var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); - var parser_1 = __webpack_require__(8); - var token_1 = __webpack_require__(13); - var xhtml_entities_1 = __webpack_require__(14); - token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; - token_1.TokenName[101 /* Text */] = 'JSXText'; - // Fully qualified element name, e.g. returns "svg:path" - function getQualifiedElementName(elementName) { - var qualifiedName; - switch (elementName.type) { - case jsx_syntax_1.JSXSyntax.JSXIdentifier: - var id = elementName; - qualifiedName = id.name; - break; - case jsx_syntax_1.JSXSyntax.JSXNamespacedName: - var ns = elementName; - qualifiedName = getQualifiedElementName(ns.namespace) + ':' + - getQualifiedElementName(ns.name); - break; - case jsx_syntax_1.JSXSyntax.JSXMemberExpression: - var expr = elementName; - qualifiedName = getQualifiedElementName(expr.object) + '.' + - getQualifiedElementName(expr.property); - break; - /* istanbul ignore next */ - default: - break; - } - return qualifiedName; - } - var JSXParser = (function (_super) { - __extends(JSXParser, _super); - function JSXParser(code, options, delegate) { - return _super.call(this, code, options, delegate) || this; - } - JSXParser.prototype.parsePrimaryExpression = function () { - return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); - }; - JSXParser.prototype.startJSX = function () { - // Unwind the scanner before the lookahead token. - this.scanner.index = this.startMarker.index; - this.scanner.lineNumber = this.startMarker.line; - this.scanner.lineStart = this.startMarker.index - this.startMarker.column; - }; - JSXParser.prototype.finishJSX = function () { - // Prime the next lookahead. - this.nextToken(); - }; - JSXParser.prototype.reenterJSX = function () { - this.startJSX(); - this.expectJSX('}'); - // Pop the closing '}' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - }; - JSXParser.prototype.createJSXNode = function () { - this.collectComments(); - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.createJSXChildNode = function () { - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.scanXHTMLEntity = function (quote) { - var result = '&'; - var valid = true; - var terminated = false; - var numeric = false; - var hex = false; - while (!this.scanner.eof() && valid && !terminated) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === quote) { - break; - } - terminated = (ch === ';'); - result += ch; - ++this.scanner.index; - if (!terminated) { - switch (result.length) { - case 2: - // e.g. '{' - numeric = (ch === '#'); - break; - case 3: - if (numeric) { - // e.g. 'A' - hex = (ch === 'x'); - valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); - numeric = numeric && !hex; - } - break; - default: - valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); - valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); - break; - } - } - } - if (valid && terminated && result.length > 2) { - // e.g. 'A' becomes just '#x41' - var str = result.substr(1, result.length - 2); - if (numeric && str.length > 1) { - result = String.fromCharCode(parseInt(str.substr(1), 10)); - } - else if (hex && str.length > 2) { - result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); - } - else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { - result = xhtml_entities_1.XHTMLEntities[str]; - } - } - return result; - }; - // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. - JSXParser.prototype.lexJSX = function () { - var cp = this.scanner.source.charCodeAt(this.scanner.index); - // < > / : = { } - if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { - var value = this.scanner.source[this.scanner.index++]; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index - 1, - end: this.scanner.index - }; - } - // " ' - if (cp === 34 || cp === 39) { - var start = this.scanner.index; - var quote = this.scanner.source[this.scanner.index++]; - var str = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index++]; - if (ch === quote) { - break; - } - else if (ch === '&') { - str += this.scanXHTMLEntity(quote); - } - else { - str += ch; - } - } - return { - type: 8 /* StringLiteral */, - value: str, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ... or . - if (cp === 46) { - var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); - var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); - var value = (n1 === 46 && n2 === 46) ? '...' : '.'; - var start = this.scanner.index; - this.scanner.index += value.length; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ` - if (cp === 96) { - // Only placeholder, since it will be rescanned as a real assignment expression. - return { - type: 10 /* Template */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index, - end: this.scanner.index - }; - } - // Identifer can not contain backslash (char code 92). - if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { - var start = this.scanner.index; - ++this.scanner.index; - while (!this.scanner.eof()) { - var ch = this.scanner.source.charCodeAt(this.scanner.index); - if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { - ++this.scanner.index; - } - else if (ch === 45) { - // Hyphen (char code 45) can be part of an identifier. - ++this.scanner.index; - } - else { - break; - } - } - var id = this.scanner.source.slice(start, this.scanner.index); - return { - type: 100 /* Identifier */, - value: id, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - return this.scanner.lex(); - }; - JSXParser.prototype.nextJSXToken = function () { - this.collectComments(); - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var token = this.lexJSX(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - if (this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.nextJSXText = function () { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var start = this.scanner.index; - var text = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === '{' || ch === '<') { - break; - } - ++this.scanner.index; - text += ch; - if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { - ++this.scanner.lineNumber; - if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { - ++this.scanner.index; - } - this.scanner.lineStart = this.scanner.index; - } - } - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - var token = { - type: 101 /* Text */, - value: text, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - if ((text.length > 0) && this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.peekJSXToken = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.lexJSX(); - this.scanner.restoreState(state); - return next; - }; - // Expect the next JSX token to match the specified punctuator. - // If not, an exception will be thrown. - JSXParser.prototype.expectJSX = function (value) { - var token = this.nextJSXToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next JSX token matches the specified punctuator. - JSXParser.prototype.matchJSX = function (value) { - var next = this.peekJSXToken(); - return next.type === 7 /* Punctuator */ && next.value === value; - }; - JSXParser.prototype.parseJSXIdentifier = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 100 /* Identifier */) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); - }; - JSXParser.prototype.parseJSXElementName = function () { - var node = this.createJSXNode(); - var elementName = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = elementName; - this.expectJSX(':'); - var name_1 = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); - } - else if (this.matchJSX('.')) { - while (this.matchJSX('.')) { - var object = elementName; - this.expectJSX('.'); - var property = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); - } - } - return elementName; - }; - JSXParser.prototype.parseJSXAttributeName = function () { - var node = this.createJSXNode(); - var attributeName; - var identifier = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = identifier; - this.expectJSX(':'); - var name_2 = this.parseJSXIdentifier(); - attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); - } - else { - attributeName = identifier; - } - return attributeName; - }; - JSXParser.prototype.parseJSXStringLiteralAttribute = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 8 /* StringLiteral */) { - this.throwUnexpectedToken(token); - } - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - JSXParser.prototype.parseJSXExpressionAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.finishJSX(); - if (this.match('}')) { - this.tolerateError('JSX attributes must only be assigned a non-empty expression'); - } - var expression = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXAttributeValue = function () { - return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : - this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); - }; - JSXParser.prototype.parseJSXNameValueAttribute = function () { - var node = this.createJSXNode(); - var name = this.parseJSXAttributeName(); - var value = null; - if (this.matchJSX('=')) { - this.expectJSX('='); - value = this.parseJSXAttributeValue(); - } - return this.finalize(node, new JSXNode.JSXAttribute(name, value)); - }; - JSXParser.prototype.parseJSXSpreadAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.expectJSX('...'); - this.finishJSX(); - var argument = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); - }; - JSXParser.prototype.parseJSXAttributes = function () { - var attributes = []; - while (!this.matchJSX('/') && !this.matchJSX('>')) { - var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : - this.parseJSXNameValueAttribute(); - attributes.push(attribute); - } - return attributes; - }; - JSXParser.prototype.parseJSXOpeningElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXBoundaryElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - if (this.matchJSX('/')) { - this.expectJSX('/'); - var name_3 = this.parseJSXElementName(); - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); - } - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXEmptyExpression = function () { - var node = this.createJSXChildNode(); - this.collectComments(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - return this.finalize(node, new JSXNode.JSXEmptyExpression()); - }; - JSXParser.prototype.parseJSXExpressionContainer = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - var expression; - if (this.matchJSX('}')) { - expression = this.parseJSXEmptyExpression(); - this.expectJSX('}'); - } - else { - this.finishJSX(); - expression = this.parseAssignmentExpression(); - this.reenterJSX(); - } - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXChildren = function () { - var children = []; - while (!this.scanner.eof()) { - var node = this.createJSXChildNode(); - var token = this.nextJSXText(); - if (token.start < token.end) { - var raw = this.getTokenRaw(token); - var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); - children.push(child); - } - if (this.scanner.source[this.scanner.index] === '{') { - var container = this.parseJSXExpressionContainer(); - children.push(container); - } - else { - break; - } - } - return children; - }; - JSXParser.prototype.parseComplexJSXElement = function (el) { - var stack = []; - while (!this.scanner.eof()) { - el.children = el.children.concat(this.parseJSXChildren()); - var node = this.createJSXChildNode(); - var element = this.parseJSXBoundaryElement(); - if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { - var opening = element; - if (opening.selfClosing) { - var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); - el.children.push(child); - } - else { - stack.push(el); - el = { node: node, opening: opening, closing: null, children: [] }; - } - } - if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { - el.closing = element; - var open_1 = getQualifiedElementName(el.opening.name); - var close_1 = getQualifiedElementName(el.closing.name); - if (open_1 !== close_1) { - this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); - } - if (stack.length > 0) { - var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); - el = stack[stack.length - 1]; - el.children.push(child); - stack.pop(); - } - else { - break; - } - } - } - return el; - }; - JSXParser.prototype.parseJSXElement = function () { - var node = this.createJSXNode(); - var opening = this.parseJSXOpeningElement(); - var children = []; - var closing = null; - if (!opening.selfClosing) { - var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); - children = el.children; - closing = el.closing; - } - return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); - }; - JSXParser.prototype.parseJSXRoot = function () { - // Pop the opening '<' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - this.startJSX(); - var element = this.parseJSXElement(); - this.finishJSX(); - return element; - }; - JSXParser.prototype.isStartOfExpression = function () { - return _super.prototype.isStartOfExpression.call(this) || this.match('<'); - }; - return JSXParser; - }(parser_1.Parser)); - exports.JSXParser = JSXParser; - - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // See also tools/generate-unicode-regex.js. - var Regex = { - // Unicode v8.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // Unicode v8.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - exports.Character = { - /* tslint:disable:no-bitwise */ - fromCodePoint: function (cp) { - return (cp < 0x10000) ? String.fromCharCode(cp) : - String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + - String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); - }, - // https://tc39.github.io/ecma262/#sec-white-space - isWhiteSpace: function (cp) { - return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || - (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); - }, - // https://tc39.github.io/ecma262/#sec-line-terminators - isLineTerminator: function (cp) { - return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); - }, - // https://tc39.github.io/ecma262/#sec-names-and-keywords - isIdentifierStart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); - }, - isIdentifierPart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp >= 0x30 && cp <= 0x39) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); - }, - // https://tc39.github.io/ecma262/#sec-literals-numeric-literals - isDecimalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39); // 0..9 - }, - isHexDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39) || - (cp >= 0x41 && cp <= 0x46) || - (cp >= 0x61 && cp <= 0x66); // a..f - }, - isOctalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x37); // 0..7 - } - }; - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var jsx_syntax_1 = __webpack_require__(6); - /* tslint:disable:max-classes-per-file */ - var JSXClosingElement = (function () { - function JSXClosingElement(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; - this.name = name; - } - return JSXClosingElement; - }()); - exports.JSXClosingElement = JSXClosingElement; - var JSXElement = (function () { - function JSXElement(openingElement, children, closingElement) { - this.type = jsx_syntax_1.JSXSyntax.JSXElement; - this.openingElement = openingElement; - this.children = children; - this.closingElement = closingElement; - } - return JSXElement; - }()); - exports.JSXElement = JSXElement; - var JSXEmptyExpression = (function () { - function JSXEmptyExpression() { - this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; - } - return JSXEmptyExpression; - }()); - exports.JSXEmptyExpression = JSXEmptyExpression; - var JSXExpressionContainer = (function () { - function JSXExpressionContainer(expression) { - this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; - this.expression = expression; - } - return JSXExpressionContainer; - }()); - exports.JSXExpressionContainer = JSXExpressionContainer; - var JSXIdentifier = (function () { - function JSXIdentifier(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; - this.name = name; - } - return JSXIdentifier; - }()); - exports.JSXIdentifier = JSXIdentifier; - var JSXMemberExpression = (function () { - function JSXMemberExpression(object, property) { - this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; - this.object = object; - this.property = property; - } - return JSXMemberExpression; - }()); - exports.JSXMemberExpression = JSXMemberExpression; - var JSXAttribute = (function () { - function JSXAttribute(name, value) { - this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; - this.name = name; - this.value = value; - } - return JSXAttribute; - }()); - exports.JSXAttribute = JSXAttribute; - var JSXNamespacedName = (function () { - function JSXNamespacedName(namespace, name) { - this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; - this.namespace = namespace; - this.name = name; - } - return JSXNamespacedName; - }()); - exports.JSXNamespacedName = JSXNamespacedName; - var JSXOpeningElement = (function () { - function JSXOpeningElement(name, selfClosing, attributes) { - this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; - this.name = name; - this.selfClosing = selfClosing; - this.attributes = attributes; - } - return JSXOpeningElement; - }()); - exports.JSXOpeningElement = JSXOpeningElement; - var JSXSpreadAttribute = (function () { - function JSXSpreadAttribute(argument) { - this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; - this.argument = argument; - } - return JSXSpreadAttribute; - }()); - exports.JSXSpreadAttribute = JSXSpreadAttribute; - var JSXText = (function () { - function JSXText(value, raw) { - this.type = jsx_syntax_1.JSXSyntax.JSXText; - this.value = value; - this.raw = raw; - } - return JSXText; - }()); - exports.JSXText = JSXText; - - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JSXSyntax = { - JSXAttribute: 'JSXAttribute', - JSXClosingElement: 'JSXClosingElement', - JSXElement: 'JSXElement', - JSXEmptyExpression: 'JSXEmptyExpression', - JSXExpressionContainer: 'JSXExpressionContainer', - JSXIdentifier: 'JSXIdentifier', - JSXMemberExpression: 'JSXMemberExpression', - JSXNamespacedName: 'JSXNamespacedName', - JSXOpeningElement: 'JSXOpeningElement', - JSXSpreadAttribute: 'JSXSpreadAttribute', - JSXText: 'JSXText' - }; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - /* tslint:disable:max-classes-per-file */ - var ArrayExpression = (function () { - function ArrayExpression(elements) { - this.type = syntax_1.Syntax.ArrayExpression; - this.elements = elements; - } - return ArrayExpression; - }()); - exports.ArrayExpression = ArrayExpression; - var ArrayPattern = (function () { - function ArrayPattern(elements) { - this.type = syntax_1.Syntax.ArrayPattern; - this.elements = elements; - } - return ArrayPattern; - }()); - exports.ArrayPattern = ArrayPattern; - var ArrowFunctionExpression = (function () { - function ArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = false; - } - return ArrowFunctionExpression; - }()); - exports.ArrowFunctionExpression = ArrowFunctionExpression; - var AssignmentExpression = (function () { - function AssignmentExpression(operator, left, right) { - this.type = syntax_1.Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return AssignmentExpression; - }()); - exports.AssignmentExpression = AssignmentExpression; - var AssignmentPattern = (function () { - function AssignmentPattern(left, right) { - this.type = syntax_1.Syntax.AssignmentPattern; - this.left = left; - this.right = right; - } - return AssignmentPattern; - }()); - exports.AssignmentPattern = AssignmentPattern; - var AsyncArrowFunctionExpression = (function () { - function AsyncArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = true; - } - return AsyncArrowFunctionExpression; - }()); - exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; - var AsyncFunctionDeclaration = (function () { - function AsyncFunctionDeclaration(id, params, body) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionDeclaration; - }()); - exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; - var AsyncFunctionExpression = (function () { - function AsyncFunctionExpression(id, params, body) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionExpression; - }()); - exports.AsyncFunctionExpression = AsyncFunctionExpression; - var AwaitExpression = (function () { - function AwaitExpression(argument) { - this.type = syntax_1.Syntax.AwaitExpression; - this.argument = argument; - } - return AwaitExpression; - }()); - exports.AwaitExpression = AwaitExpression; - var BinaryExpression = (function () { - function BinaryExpression(operator, left, right) { - var logical = (operator === '||' || operator === '&&'); - this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return BinaryExpression; - }()); - exports.BinaryExpression = BinaryExpression; - var BlockStatement = (function () { - function BlockStatement(body) { - this.type = syntax_1.Syntax.BlockStatement; - this.body = body; - } - return BlockStatement; - }()); - exports.BlockStatement = BlockStatement; - var BreakStatement = (function () { - function BreakStatement(label) { - this.type = syntax_1.Syntax.BreakStatement; - this.label = label; - } - return BreakStatement; - }()); - exports.BreakStatement = BreakStatement; - var CallExpression = (function () { - function CallExpression(callee, args) { - this.type = syntax_1.Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - } - return CallExpression; - }()); - exports.CallExpression = CallExpression; - var CatchClause = (function () { - function CatchClause(param, body) { - this.type = syntax_1.Syntax.CatchClause; - this.param = param; - this.body = body; - } - return CatchClause; - }()); - exports.CatchClause = CatchClause; - var ClassBody = (function () { - function ClassBody(body) { - this.type = syntax_1.Syntax.ClassBody; - this.body = body; - } - return ClassBody; - }()); - exports.ClassBody = ClassBody; - var ClassDeclaration = (function () { - function ClassDeclaration(id, superClass, body) { - this.type = syntax_1.Syntax.ClassDeclaration; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassDeclaration; - }()); - exports.ClassDeclaration = ClassDeclaration; - var ClassExpression = (function () { - function ClassExpression(id, superClass, body) { - this.type = syntax_1.Syntax.ClassExpression; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassExpression; - }()); - exports.ClassExpression = ClassExpression; - var ComputedMemberExpression = (function () { - function ComputedMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = true; - this.object = object; - this.property = property; - } - return ComputedMemberExpression; - }()); - exports.ComputedMemberExpression = ComputedMemberExpression; - var ConditionalExpression = (function () { - function ConditionalExpression(test, consequent, alternate) { - this.type = syntax_1.Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return ConditionalExpression; - }()); - exports.ConditionalExpression = ConditionalExpression; - var ContinueStatement = (function () { - function ContinueStatement(label) { - this.type = syntax_1.Syntax.ContinueStatement; - this.label = label; - } - return ContinueStatement; - }()); - exports.ContinueStatement = ContinueStatement; - var DebuggerStatement = (function () { - function DebuggerStatement() { - this.type = syntax_1.Syntax.DebuggerStatement; - } - return DebuggerStatement; - }()); - exports.DebuggerStatement = DebuggerStatement; - var Directive = (function () { - function Directive(expression, directive) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - this.directive = directive; - } - return Directive; - }()); - exports.Directive = Directive; - var DoWhileStatement = (function () { - function DoWhileStatement(body, test) { - this.type = syntax_1.Syntax.DoWhileStatement; - this.body = body; - this.test = test; - } - return DoWhileStatement; - }()); - exports.DoWhileStatement = DoWhileStatement; - var EmptyStatement = (function () { - function EmptyStatement() { - this.type = syntax_1.Syntax.EmptyStatement; - } - return EmptyStatement; - }()); - exports.EmptyStatement = EmptyStatement; - var ExportAllDeclaration = (function () { - function ExportAllDeclaration(source) { - this.type = syntax_1.Syntax.ExportAllDeclaration; - this.source = source; - } - return ExportAllDeclaration; - }()); - exports.ExportAllDeclaration = ExportAllDeclaration; - var ExportDefaultDeclaration = (function () { - function ExportDefaultDeclaration(declaration) { - this.type = syntax_1.Syntax.ExportDefaultDeclaration; - this.declaration = declaration; - } - return ExportDefaultDeclaration; - }()); - exports.ExportDefaultDeclaration = ExportDefaultDeclaration; - var ExportNamedDeclaration = (function () { - function ExportNamedDeclaration(declaration, specifiers, source) { - this.type = syntax_1.Syntax.ExportNamedDeclaration; - this.declaration = declaration; - this.specifiers = specifiers; - this.source = source; - } - return ExportNamedDeclaration; - }()); - exports.ExportNamedDeclaration = ExportNamedDeclaration; - var ExportSpecifier = (function () { - function ExportSpecifier(local, exported) { - this.type = syntax_1.Syntax.ExportSpecifier; - this.exported = exported; - this.local = local; - } - return ExportSpecifier; - }()); - exports.ExportSpecifier = ExportSpecifier; - var ExpressionStatement = (function () { - function ExpressionStatement(expression) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - } - return ExpressionStatement; - }()); - exports.ExpressionStatement = ExpressionStatement; - var ForInStatement = (function () { - function ForInStatement(left, right, body) { - this.type = syntax_1.Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - } - return ForInStatement; - }()); - exports.ForInStatement = ForInStatement; - var ForOfStatement = (function () { - function ForOfStatement(left, right, body) { - this.type = syntax_1.Syntax.ForOfStatement; - this.left = left; - this.right = right; - this.body = body; - } - return ForOfStatement; - }()); - exports.ForOfStatement = ForOfStatement; - var ForStatement = (function () { - function ForStatement(init, test, update, body) { - this.type = syntax_1.Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - } - return ForStatement; - }()); - exports.ForStatement = ForStatement; - var FunctionDeclaration = (function () { - function FunctionDeclaration(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionDeclaration; - }()); - exports.FunctionDeclaration = FunctionDeclaration; - var FunctionExpression = (function () { - function FunctionExpression(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionExpression; - }()); - exports.FunctionExpression = FunctionExpression; - var Identifier = (function () { - function Identifier(name) { - this.type = syntax_1.Syntax.Identifier; - this.name = name; - } - return Identifier; - }()); - exports.Identifier = Identifier; - var IfStatement = (function () { - function IfStatement(test, consequent, alternate) { - this.type = syntax_1.Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return IfStatement; - }()); - exports.IfStatement = IfStatement; - var ImportDeclaration = (function () { - function ImportDeclaration(specifiers, source) { - this.type = syntax_1.Syntax.ImportDeclaration; - this.specifiers = specifiers; - this.source = source; - } - return ImportDeclaration; - }()); - exports.ImportDeclaration = ImportDeclaration; - var ImportDefaultSpecifier = (function () { - function ImportDefaultSpecifier(local) { - this.type = syntax_1.Syntax.ImportDefaultSpecifier; - this.local = local; - } - return ImportDefaultSpecifier; - }()); - exports.ImportDefaultSpecifier = ImportDefaultSpecifier; - var ImportNamespaceSpecifier = (function () { - function ImportNamespaceSpecifier(local) { - this.type = syntax_1.Syntax.ImportNamespaceSpecifier; - this.local = local; - } - return ImportNamespaceSpecifier; - }()); - exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; - var ImportSpecifier = (function () { - function ImportSpecifier(local, imported) { - this.type = syntax_1.Syntax.ImportSpecifier; - this.local = local; - this.imported = imported; - } - return ImportSpecifier; - }()); - exports.ImportSpecifier = ImportSpecifier; - var LabeledStatement = (function () { - function LabeledStatement(label, body) { - this.type = syntax_1.Syntax.LabeledStatement; - this.label = label; - this.body = body; - } - return LabeledStatement; - }()); - exports.LabeledStatement = LabeledStatement; - var Literal = (function () { - function Literal(value, raw) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - } - return Literal; - }()); - exports.Literal = Literal; - var MetaProperty = (function () { - function MetaProperty(meta, property) { - this.type = syntax_1.Syntax.MetaProperty; - this.meta = meta; - this.property = property; - } - return MetaProperty; - }()); - exports.MetaProperty = MetaProperty; - var MethodDefinition = (function () { - function MethodDefinition(key, computed, value, kind, isStatic) { - this.type = syntax_1.Syntax.MethodDefinition; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.static = isStatic; - } - return MethodDefinition; - }()); - exports.MethodDefinition = MethodDefinition; - var Module = (function () { - function Module(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'module'; - } - return Module; - }()); - exports.Module = Module; - var NewExpression = (function () { - function NewExpression(callee, args) { - this.type = syntax_1.Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - } - return NewExpression; - }()); - exports.NewExpression = NewExpression; - var ObjectExpression = (function () { - function ObjectExpression(properties) { - this.type = syntax_1.Syntax.ObjectExpression; - this.properties = properties; - } - return ObjectExpression; - }()); - exports.ObjectExpression = ObjectExpression; - var ObjectPattern = (function () { - function ObjectPattern(properties) { - this.type = syntax_1.Syntax.ObjectPattern; - this.properties = properties; - } - return ObjectPattern; - }()); - exports.ObjectPattern = ObjectPattern; - var Property = (function () { - function Property(kind, key, computed, value, method, shorthand) { - this.type = syntax_1.Syntax.Property; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.method = method; - this.shorthand = shorthand; - } - return Property; - }()); - exports.Property = Property; - var RegexLiteral = (function () { - function RegexLiteral(value, raw, pattern, flags) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - this.regex = { pattern: pattern, flags: flags }; - } - return RegexLiteral; - }()); - exports.RegexLiteral = RegexLiteral; - var RestElement = (function () { - function RestElement(argument) { - this.type = syntax_1.Syntax.RestElement; - this.argument = argument; - } - return RestElement; - }()); - exports.RestElement = RestElement; - var ReturnStatement = (function () { - function ReturnStatement(argument) { - this.type = syntax_1.Syntax.ReturnStatement; - this.argument = argument; - } - return ReturnStatement; - }()); - exports.ReturnStatement = ReturnStatement; - var Script = (function () { - function Script(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'script'; - } - return Script; - }()); - exports.Script = Script; - var SequenceExpression = (function () { - function SequenceExpression(expressions) { - this.type = syntax_1.Syntax.SequenceExpression; - this.expressions = expressions; - } - return SequenceExpression; - }()); - exports.SequenceExpression = SequenceExpression; - var SpreadElement = (function () { - function SpreadElement(argument) { - this.type = syntax_1.Syntax.SpreadElement; - this.argument = argument; - } - return SpreadElement; - }()); - exports.SpreadElement = SpreadElement; - var StaticMemberExpression = (function () { - function StaticMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = false; - this.object = object; - this.property = property; - } - return StaticMemberExpression; - }()); - exports.StaticMemberExpression = StaticMemberExpression; - var Super = (function () { - function Super() { - this.type = syntax_1.Syntax.Super; - } - return Super; - }()); - exports.Super = Super; - var SwitchCase = (function () { - function SwitchCase(test, consequent) { - this.type = syntax_1.Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - } - return SwitchCase; - }()); - exports.SwitchCase = SwitchCase; - var SwitchStatement = (function () { - function SwitchStatement(discriminant, cases) { - this.type = syntax_1.Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - } - return SwitchStatement; - }()); - exports.SwitchStatement = SwitchStatement; - var TaggedTemplateExpression = (function () { - function TaggedTemplateExpression(tag, quasi) { - this.type = syntax_1.Syntax.TaggedTemplateExpression; - this.tag = tag; - this.quasi = quasi; - } - return TaggedTemplateExpression; - }()); - exports.TaggedTemplateExpression = TaggedTemplateExpression; - var TemplateElement = (function () { - function TemplateElement(value, tail) { - this.type = syntax_1.Syntax.TemplateElement; - this.value = value; - this.tail = tail; - } - return TemplateElement; - }()); - exports.TemplateElement = TemplateElement; - var TemplateLiteral = (function () { - function TemplateLiteral(quasis, expressions) { - this.type = syntax_1.Syntax.TemplateLiteral; - this.quasis = quasis; - this.expressions = expressions; - } - return TemplateLiteral; - }()); - exports.TemplateLiteral = TemplateLiteral; - var ThisExpression = (function () { - function ThisExpression() { - this.type = syntax_1.Syntax.ThisExpression; - } - return ThisExpression; - }()); - exports.ThisExpression = ThisExpression; - var ThrowStatement = (function () { - function ThrowStatement(argument) { - this.type = syntax_1.Syntax.ThrowStatement; - this.argument = argument; - } - return ThrowStatement; - }()); - exports.ThrowStatement = ThrowStatement; - var TryStatement = (function () { - function TryStatement(block, handler, finalizer) { - this.type = syntax_1.Syntax.TryStatement; - this.block = block; - this.handler = handler; - this.finalizer = finalizer; - } - return TryStatement; - }()); - exports.TryStatement = TryStatement; - var UnaryExpression = (function () { - function UnaryExpression(operator, argument) { - this.type = syntax_1.Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - } - return UnaryExpression; - }()); - exports.UnaryExpression = UnaryExpression; - var UpdateExpression = (function () { - function UpdateExpression(operator, argument, prefix) { - this.type = syntax_1.Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = prefix; - } - return UpdateExpression; - }()); - exports.UpdateExpression = UpdateExpression; - var VariableDeclaration = (function () { - function VariableDeclaration(declarations, kind) { - this.type = syntax_1.Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - } - return VariableDeclaration; - }()); - exports.VariableDeclaration = VariableDeclaration; - var VariableDeclarator = (function () { - function VariableDeclarator(id, init) { - this.type = syntax_1.Syntax.VariableDeclarator; - this.id = id; - this.init = init; - } - return VariableDeclarator; - }()); - exports.VariableDeclarator = VariableDeclarator; - var WhileStatement = (function () { - function WhileStatement(test, body) { - this.type = syntax_1.Syntax.WhileStatement; - this.test = test; - this.body = body; - } - return WhileStatement; - }()); - exports.WhileStatement = WhileStatement; - var WithStatement = (function () { - function WithStatement(object, body) { - this.type = syntax_1.Syntax.WithStatement; - this.object = object; - this.body = body; - } - return WithStatement; - }()); - exports.WithStatement = WithStatement; - var YieldExpression = (function () { - function YieldExpression(argument, delegate) { - this.type = syntax_1.Syntax.YieldExpression; - this.argument = argument; - this.delegate = delegate; - } - return YieldExpression; - }()); - exports.YieldExpression = YieldExpression; - - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var error_handler_1 = __webpack_require__(10); - var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); - var scanner_1 = __webpack_require__(12); - var syntax_1 = __webpack_require__(2); - var token_1 = __webpack_require__(13); - var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; - var Parser = (function () { - function Parser(code, options, delegate) { - if (options === void 0) { options = {}; } - this.config = { - range: (typeof options.range === 'boolean') && options.range, - loc: (typeof options.loc === 'boolean') && options.loc, - source: null, - tokens: (typeof options.tokens === 'boolean') && options.tokens, - comment: (typeof options.comment === 'boolean') && options.comment, - tolerant: (typeof options.tolerant === 'boolean') && options.tolerant - }; - if (this.config.loc && options.source && options.source !== null) { - this.config.source = String(options.source); - } - this.delegate = delegate; - this.errorHandler = new error_handler_1.ErrorHandler(); - this.errorHandler.tolerant = this.config.tolerant; - this.scanner = new scanner_1.Scanner(code, this.errorHandler); - this.scanner.trackComment = this.config.comment; - this.operatorPrecedence = { - ')': 0, - ';': 0, - ',': 0, - '=': 0, - ']': 0, - '||': 1, - '&&': 2, - '|': 3, - '^': 4, - '&': 5, - '==': 6, - '!=': 6, - '===': 6, - '!==': 6, - '<': 7, - '>': 7, - '<=': 7, - '>=': 7, - '<<': 8, - '>>': 8, - '>>>': 8, - '+': 9, - '-': 9, - '*': 11, - '/': 11, - '%': 11 - }; - this.lookahead = { - type: 2 /* EOF */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: 0, - start: 0, - end: 0 - }; - this.hasLineTerminator = false; - this.context = { - isModule: false, - await: false, - allowIn: true, - allowStrictDirective: true, - allowYield: true, - firstCoverInitializedNameError: null, - isAssignmentTarget: false, - isBindingElement: false, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - labelSet: {}, - strict: false - }; - this.tokens = []; - this.startMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.lastMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.nextToken(); - this.lastMarker = { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - } - Parser.prototype.throwError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - throw this.errorHandler.createError(index, line, column, msg); - }; - Parser.prototype.tolerateError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.scanner.lineNumber; - var column = this.lastMarker.column + 1; - this.errorHandler.tolerateError(index, line, column, msg); - }; - // Throw an exception because of the token. - Parser.prototype.unexpectedTokenError = function (token, message) { - var msg = message || messages_1.Messages.UnexpectedToken; - var value; - if (token) { - if (!message) { - msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : - (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : - (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : - (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : - (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : - messages_1.Messages.UnexpectedToken; - if (token.type === 4 /* Keyword */) { - if (this.scanner.isFutureReservedWord(token.value)) { - msg = messages_1.Messages.UnexpectedReserved; - } - else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { - msg = messages_1.Messages.StrictReservedWord; - } - } - } - value = token.value; - } - else { - value = 'ILLEGAL'; - } - msg = msg.replace('%0', value); - if (token && typeof token.lineNumber === 'number') { - var index = token.start; - var line = token.lineNumber; - var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; - var column = token.start - lastMarkerLineStart + 1; - return this.errorHandler.createError(index, line, column, msg); - } - else { - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - return this.errorHandler.createError(index, line, column, msg); - } - }; - Parser.prototype.throwUnexpectedToken = function (token, message) { - throw this.unexpectedTokenError(token, message); - }; - Parser.prototype.tolerateUnexpectedToken = function (token, message) { - this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); - }; - Parser.prototype.collectComments = function () { - if (!this.config.comment) { - this.scanner.scanComments(); - } - else { - var comments = this.scanner.scanComments(); - if (comments.length > 0 && this.delegate) { - for (var i = 0; i < comments.length; ++i) { - var e = comments[i]; - var node = void 0; - node = { - type: e.multiLine ? 'BlockComment' : 'LineComment', - value: this.scanner.source.slice(e.slice[0], e.slice[1]) - }; - if (this.config.range) { - node.range = e.range; - } - if (this.config.loc) { - node.loc = e.loc; - } - var metadata = { - start: { - line: e.loc.start.line, - column: e.loc.start.column, - offset: e.range[0] - }, - end: { - line: e.loc.end.line, - column: e.loc.end.column, - offset: e.range[1] - } - }; - this.delegate(node, metadata); - } - } - } - }; - // From internal representation to an external structure - Parser.prototype.getTokenRaw = function (token) { - return this.scanner.source.slice(token.start, token.end); - }; - Parser.prototype.convertToken = function (token) { - var t = { - type: token_1.TokenName[token.type], - value: this.getTokenRaw(token) - }; - if (this.config.range) { - t.range = [token.start, token.end]; - } - if (this.config.loc) { - t.loc = { - start: { - line: this.startMarker.line, - column: this.startMarker.column - }, - end: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - } - }; - } - if (token.type === 9 /* RegularExpression */) { - var pattern = token.pattern; - var flags = token.flags; - t.regex = { pattern: pattern, flags: flags }; - } - return t; - }; - Parser.prototype.nextToken = function () { - var token = this.lookahead; - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - this.collectComments(); - if (this.scanner.index !== this.startMarker.index) { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - } - var next = this.scanner.lex(); - this.hasLineTerminator = (token.lineNumber !== next.lineNumber); - if (next && this.context.strict && next.type === 3 /* Identifier */) { - if (this.scanner.isStrictModeReservedWord(next.value)) { - next.type = 4 /* Keyword */; - } - } - this.lookahead = next; - if (this.config.tokens && next.type !== 2 /* EOF */) { - this.tokens.push(this.convertToken(next)); - } - return token; - }; - Parser.prototype.nextRegexToken = function () { - this.collectComments(); - var token = this.scanner.scanRegExp(); - if (this.config.tokens) { - // Pop the previous token, '/' or '/=' - // This is added from the lookahead token. - this.tokens.pop(); - this.tokens.push(this.convertToken(token)); - } - // Prime the next lookahead. - this.lookahead = token; - this.nextToken(); - return token; - }; - Parser.prototype.createNode = function () { - return { - index: this.startMarker.index, - line: this.startMarker.line, - column: this.startMarker.column - }; - }; - Parser.prototype.startNode = function (token) { - return { - index: token.start, - line: token.lineNumber, - column: token.start - token.lineStart - }; - }; - Parser.prototype.finalize = function (marker, node) { - if (this.config.range) { - node.range = [marker.index, this.lastMarker.index]; - } - if (this.config.loc) { - node.loc = { - start: { - line: marker.line, - column: marker.column, - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column - } - }; - if (this.config.source) { - node.loc.source = this.config.source; - } - } - if (this.delegate) { - var metadata = { - start: { - line: marker.line, - column: marker.column, - offset: marker.index - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column, - offset: this.lastMarker.index - } - }; - this.delegate(node, metadata); - } - return node; - }; - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - Parser.prototype.expect = function (value) { - var token = this.nextToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). - Parser.prototype.expectCommaSeparator = function () { - if (this.config.tolerant) { - var token = this.lookahead; - if (token.type === 7 /* Punctuator */ && token.value === ',') { - this.nextToken(); - } - else if (token.type === 7 /* Punctuator */ && token.value === ';') { - this.nextToken(); - this.tolerateUnexpectedToken(token); - } - else { - this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); - } - } - else { - this.expect(','); - } - }; - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - Parser.prototype.expectKeyword = function (keyword) { - var token = this.nextToken(); - if (token.type !== 4 /* Keyword */ || token.value !== keyword) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next token matches the specified punctuator. - Parser.prototype.match = function (value) { - return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; - }; - // Return true if the next token matches the specified keyword - Parser.prototype.matchKeyword = function (keyword) { - return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; - }; - // Return true if the next token matches the specified contextual keyword - // (where an identifier is sometimes a keyword depending on the context) - Parser.prototype.matchContextualKeyword = function (keyword) { - return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; - }; - // Return true if the next token is an assignment operator - Parser.prototype.matchAssign = function () { - if (this.lookahead.type !== 7 /* Punctuator */) { - return false; - } - var op = this.lookahead.value; - return op === '=' || - op === '*=' || - op === '**=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - }; - // Cover grammar support. - // - // When an assignment expression position starts with an left parenthesis, the determination of the type - // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) - // or the first comma. This situation also defers the determination of all the expressions nested in the pair. - // - // There are three productions that can be parsed in a parentheses pair that needs to be determined - // after the outermost pair is closed. They are: - // - // 1. AssignmentExpression - // 2. BindingElements - // 3. AssignmentTargets - // - // In order to avoid exponential backtracking, we use two flags to denote if the production can be - // binding element or assignment target. - // - // The three productions have the relationship: - // - // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression - // - // with a single exception that CoverInitializedName when used directly in an Expression, generates - // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the - // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. - // - // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not - // effect the current flags. This means the production the parser parses is only used as an expression. Therefore - // the CoverInitializedName check is conducted. - // - // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates - // the flags outside of the parser. This means the production the parser parses is used as a part of a potential - // pattern. The CoverInitializedName check is deferred. - Parser.prototype.isolateCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - if (this.context.firstCoverInitializedNameError !== null) { - this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); - } - this.context.isBindingElement = previousIsBindingElement; - this.context.isAssignmentTarget = previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; - return result; - }; - Parser.prototype.inheritCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; - this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; - return result; - }; - Parser.prototype.consumeSemicolon = function () { - if (this.match(';')) { - this.nextToken(); - } - else if (!this.hasLineTerminator) { - if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { - this.throwUnexpectedToken(this.lookahead); - } - this.lastMarker.index = this.startMarker.index; - this.lastMarker.line = this.startMarker.line; - this.lastMarker.column = this.startMarker.column; - } - }; - // https://tc39.github.io/ecma262/#sec-primary-expression - Parser.prototype.parsePrimaryExpression = function () { - var node = this.createNode(); - var expr; - var token, raw; - switch (this.lookahead.type) { - case 3 /* Identifier */: - if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { - this.tolerateUnexpectedToken(this.lookahead); - } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); - break; - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - if (this.context.strict && this.lookahead.octal) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 1 /* BooleanLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); - break; - case 5 /* NullLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); - break; - case 10 /* Template */: - expr = this.parseTemplateLiteral(); - break; - case 7 /* Punctuator */: - switch (this.lookahead.value) { - case '(': - this.context.isBindingElement = false; - expr = this.inheritCoverGrammar(this.parseGroupExpression); - break; - case '[': - expr = this.inheritCoverGrammar(this.parseArrayInitializer); - break; - case '{': - expr = this.inheritCoverGrammar(this.parseObjectInitializer); - break; - case '/': - case '/=': - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.scanner.index = this.startMarker.index; - token = this.nextRegexToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - break; - case 4 /* Keyword */: - if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseIdentifierName(); - } - else if (!this.context.strict && this.matchKeyword('let')) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); - } - else { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - if (this.matchKeyword('function')) { - expr = this.parseFunctionExpression(); - } - else if (this.matchKeyword('this')) { - this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); - } - else if (this.matchKeyword('class')) { - expr = this.parseClassExpression(); - } - else { - expr = this.throwUnexpectedToken(this.nextToken()); - } - } - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-array-initializer - Parser.prototype.parseSpreadElement = function () { - var node = this.createNode(); - this.expect('...'); - var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); - }; - Parser.prototype.parseArrayInitializer = function () { - var node = this.createNode(); - var elements = []; - this.expect('['); - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else if (this.match('...')) { - var element = this.parseSpreadElement(); - if (!this.match(']')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.expect(','); - } - elements.push(element); - } - else { - elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayExpression(elements)); - }; - // https://tc39.github.io/ecma262/#sec-object-initializer - Parser.prototype.parsePropertyMethod = function (params) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = params.simple; - var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); - if (this.context.strict && params.firstRestricted) { - this.tolerateUnexpectedToken(params.firstRestricted, params.message); - } - if (this.context.strict && params.stricted) { - this.tolerateUnexpectedToken(params.stricted, params.message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - return body; - }; - Parser.prototype.parsePropertyMethodFunction = function () { - var isGenerator = false; - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - Parser.prototype.parsePropertyMethodAsyncFunction = function () { - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = false; - this.context.await = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); - }; - Parser.prototype.parseObjectPropertyKey = function () { - var node = this.createNode(); - var token = this.nextToken(); - var key; - switch (token.type) { - case 8 /* StringLiteral */: - case 6 /* NumericLiteral */: - if (this.context.strict && token.octal) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); - } - var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 3 /* Identifier */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 4 /* Keyword */: - key = this.finalize(node, new Node.Identifier(token.value)); - break; - case 7 /* Punctuator */: - if (token.value === '[') { - key = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.expect(']'); - } - else { - key = this.throwUnexpectedToken(token); - } - break; - default: - key = this.throwUnexpectedToken(token); - } - return key; - }; - Parser.prototype.isPropertyKey = function (key, value) { - return (key.type === syntax_1.Syntax.Identifier && key.name === value) || - (key.type === syntax_1.Syntax.Literal && key.value === value); - }; - Parser.prototype.parseObjectProperty = function (hasProto) { - var node = this.createNode(); - var token = this.lookahead; - var kind; - var key = null; - var value = null; - var computed = false; - var method = false; - var shorthand = false; - var isAsync = false; - if (token.type === 3 /* Identifier */) { - var id = token.value; - this.nextToken(); - computed = this.match('['); - isAsync = !this.hasLineTerminator && (id === 'async') && - !this.match(':') && !this.match('(') && !this.match('*'); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); - } - else if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - else { - if (!key) { - this.throwUnexpectedToken(this.lookahead); - } - kind = 'init'; - if (this.match(':') && !isAsync) { - if (!computed && this.isPropertyKey(key, '__proto__')) { - if (hasProto.value) { - this.tolerateError(messages_1.Messages.DuplicateProtoProperty); - } - hasProto.value = true; - } - this.nextToken(); - value = this.inheritCoverGrammar(this.parseAssignmentExpression); - } - else if (this.match('(')) { - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - else if (token.type === 3 /* Identifier */) { - var id = this.finalize(node, new Node.Identifier(token.value)); - if (this.match('=')) { - this.context.firstCoverInitializedNameError = this.lookahead; - this.nextToken(); - shorthand = true; - var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); - } - else { - shorthand = true; - value = id; - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectInitializer = function () { - var node = this.createNode(); - this.expect('{'); - var properties = []; - var hasProto = { value: false }; - while (!this.match('}')) { - properties.push(this.parseObjectProperty(hasProto)); - if (!this.match('}')) { - this.expectCommaSeparator(); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectExpression(properties)); - }; - // https://tc39.github.io/ecma262/#sec-template-literals - Parser.prototype.parseTemplateHead = function () { - assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateElement = function () { - if (this.lookahead.type !== 10 /* Template */) { - this.throwUnexpectedToken(); - } - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateLiteral = function () { - var node = this.createNode(); - var expressions = []; - var quasis = []; - var quasi = this.parseTemplateHead(); - quasis.push(quasi); - while (!quasi.tail) { - expressions.push(this.parseExpression()); - quasi = this.parseTemplateElement(); - quasis.push(quasi); - } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); - }; - // https://tc39.github.io/ecma262/#sec-grouping-operator - Parser.prototype.reinterpretExpressionAsPattern = function (expr) { - switch (expr.type) { - case syntax_1.Syntax.Identifier: - case syntax_1.Syntax.MemberExpression: - case syntax_1.Syntax.RestElement: - case syntax_1.Syntax.AssignmentPattern: - break; - case syntax_1.Syntax.SpreadElement: - expr.type = syntax_1.Syntax.RestElement; - this.reinterpretExpressionAsPattern(expr.argument); - break; - case syntax_1.Syntax.ArrayExpression: - expr.type = syntax_1.Syntax.ArrayPattern; - for (var i = 0; i < expr.elements.length; i++) { - if (expr.elements[i] !== null) { - this.reinterpretExpressionAsPattern(expr.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectExpression: - expr.type = syntax_1.Syntax.ObjectPattern; - for (var i = 0; i < expr.properties.length; i++) { - this.reinterpretExpressionAsPattern(expr.properties[i].value); - } - break; - case syntax_1.Syntax.AssignmentExpression: - expr.type = syntax_1.Syntax.AssignmentPattern; - delete expr.operator; - this.reinterpretExpressionAsPattern(expr.left); - break; - default: - // Allow other node type for tolerant parsing. - break; - } - }; - Parser.prototype.parseGroupExpression = function () { - var expr; - this.expect('('); - if (this.match(')')) { - this.nextToken(); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [], - async: false - }; - } - else { - var startToken = this.lookahead; - var params = []; - if (this.match('...')) { - expr = this.parseRestElement(params); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - else { - var arrow = false; - this.context.isBindingElement = true; - expr = this.inheritCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - this.context.isAssignmentTarget = false; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - if (this.match(')')) { - this.nextToken(); - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else if (this.match('...')) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - expressions.push(this.parseRestElement(params)); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - this.context.isBindingElement = false; - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else { - expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - } - if (arrow) { - break; - } - } - if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - } - if (!arrow) { - this.expect(')'); - if (this.match('=>')) { - if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - if (!arrow) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - if (expr.type === syntax_1.Syntax.SequenceExpression) { - for (var i = 0; i < expr.expressions.length; i++) { - this.reinterpretExpressionAsPattern(expr.expressions[i]); - } - } - else { - this.reinterpretExpressionAsPattern(expr); - } - var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); - expr = { - type: ArrowParameterPlaceHolder, - params: parameters, - async: false - }; - } - } - this.context.isBindingElement = false; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions - Parser.prototype.parseArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAssignmentExpression); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.isIdentifierName = function (token) { - return token.type === 3 /* Identifier */ || - token.type === 4 /* Keyword */ || - token.type === 1 /* BooleanLiteral */ || - token.type === 5 /* NullLiteral */; - }; - Parser.prototype.parseIdentifierName = function () { - var node = this.createNode(); - var token = this.nextToken(); - if (!this.isIdentifierName(token)) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseNewExpression = function () { - var node = this.createNode(); - var id = this.parseIdentifierName(); - assert_1.assert(id.name === 'new', 'New expression must start with `new`'); - var expr; - if (this.match('.')) { - this.nextToken(); - if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { - var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); - var args = this.match('(') ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return this.finalize(node, expr); - }; - Parser.prototype.parseAsyncArgument = function () { - var arg = this.parseAssignmentExpression(); - this.context.firstCoverInitializedNameError = null; - return arg; - }; - Parser.prototype.parseAsyncArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAsyncArgument); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { - var startToken = this.lookahead; - var maybeAsync = this.matchContextualKeyword('async'); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var expr; - if (this.matchKeyword('super') && this.context.inFunctionBody) { - expr = this.createNode(); - this.nextToken(); - expr = this.finalize(expr, new Node.Super()); - if (!this.match('(') && !this.match('.') && !this.match('[')) { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - } - while (true) { - if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); - } - else if (this.match('(')) { - var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); - this.context.isBindingElement = false; - this.context.isAssignmentTarget = false; - var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); - if (asyncArrow && this.match('=>')) { - for (var i = 0; i < args.length; ++i) { - this.reinterpretExpressionAsPattern(args[i]); - } - expr = { - type: ArrowParameterPlaceHolder, - params: args, - async: true - }; - } - } - else if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - this.context.allowIn = previousAllowIn; - return expr; - }; - Parser.prototype.parseSuper = function () { - var node = this.createNode(); - this.expectKeyword('super'); - if (!this.match('[') && !this.match('.')) { - this.throwUnexpectedToken(this.lookahead); - } - return this.finalize(node, new Node.Super()); - }; - Parser.prototype.parseLeftHandSideExpression = function () { - assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); - var node = this.startNode(this.lookahead); - var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : - this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - while (true) { - if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); - } - else if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-update-expressions - Parser.prototype.parseUpdateExpression = function () { - var expr; - var startToken = this.lookahead; - if (this.match('++') || this.match('--')) { - var node = this.startNode(startToken); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPrefix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { - if (this.match('++') || this.match('--')) { - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPostfix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var operator = this.nextToken().value; - var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-unary-operators - Parser.prototype.parseAwaitExpression = function () { - var node = this.createNode(); - this.nextToken(); - var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); - }; - Parser.prototype.parseUnaryExpression = function () { - var expr; - if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || - this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { - var node = this.startNode(this.lookahead); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); - if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { - this.tolerateError(messages_1.Messages.StrictDelete); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else if (this.context.await && this.matchContextualKeyword('await')) { - expr = this.parseAwaitExpression(); - } - else { - expr = this.parseUpdateExpression(); - } - return expr; - }; - Parser.prototype.parseExponentiationExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-exp-operator - // https://tc39.github.io/ecma262/#sec-multiplicative-operators - // https://tc39.github.io/ecma262/#sec-additive-operators - // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators - // https://tc39.github.io/ecma262/#sec-relational-operators - // https://tc39.github.io/ecma262/#sec-equality-operators - // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators - // https://tc39.github.io/ecma262/#sec-binary-logical-operators - Parser.prototype.binaryPrecedence = function (token) { - var op = token.value; - var precedence; - if (token.type === 7 /* Punctuator */) { - precedence = this.operatorPrecedence[op] || 0; - } - else if (token.type === 4 /* Keyword */) { - precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; - } - else { - precedence = 0; - } - return precedence; - }; - Parser.prototype.parseBinaryExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); - var token = this.lookahead; - var prec = this.binaryPrecedence(token); - if (prec > 0) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var markers = [startToken, this.lookahead]; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - var stack = [left, token.value, right]; - var precedences = [prec]; - while (true) { - prec = this.binaryPrecedence(this.lookahead); - if (prec <= 0) { - break; - } - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { - right = stack.pop(); - var operator = stack.pop(); - precedences.pop(); - left = stack.pop(); - markers.pop(); - var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); - } - // Shift. - stack.push(this.nextToken().value); - precedences.push(prec); - markers.push(this.lookahead); - stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); - } - // Final reduce to clean-up the stack. - var i = stack.length - 1; - expr = stack[i]; - markers.pop(); - while (i > 1) { - var node = this.startNode(markers.pop()); - var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); - i -= 2; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-conditional-operator - Parser.prototype.parseConditionalExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseBinaryExpression); - if (this.match('?')) { - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - this.expect(':'); - var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-assignment-operators - Parser.prototype.checkPatternParam = function (options, param) { - switch (param.type) { - case syntax_1.Syntax.Identifier: - this.validateParam(options, param, param.name); - break; - case syntax_1.Syntax.RestElement: - this.checkPatternParam(options, param.argument); - break; - case syntax_1.Syntax.AssignmentPattern: - this.checkPatternParam(options, param.left); - break; - case syntax_1.Syntax.ArrayPattern: - for (var i = 0; i < param.elements.length; i++) { - if (param.elements[i] !== null) { - this.checkPatternParam(options, param.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectPattern: - for (var i = 0; i < param.properties.length; i++) { - this.checkPatternParam(options, param.properties[i].value); - } - break; - default: - break; - } - options.simple = options.simple && (param instanceof Node.Identifier); - }; - Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { - var params = [expr]; - var options; - var asyncArrow = false; - switch (expr.type) { - case syntax_1.Syntax.Identifier: - break; - case ArrowParameterPlaceHolder: - params = expr.params; - asyncArrow = expr.async; - break; - default: - return null; - } - options = { - simple: true, - paramSet: {} - }; - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.AssignmentPattern) { - if (param.right.type === syntax_1.Syntax.YieldExpression) { - if (param.right.argument) { - this.throwUnexpectedToken(this.lookahead); - } - param.right.type = syntax_1.Syntax.Identifier; - param.right.name = 'yield'; - delete param.right.argument; - delete param.right.delegate; - } - } - else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { - this.throwUnexpectedToken(this.lookahead); - } - this.checkPatternParam(options, param); - params[i] = param; - } - if (this.context.strict || !this.context.allowYield) { - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.YieldExpression) { - this.throwUnexpectedToken(this.lookahead); - } - } - } - if (options.message === messages_1.Messages.StrictParamDupe) { - var token = this.context.strict ? options.stricted : options.firstRestricted; - this.throwUnexpectedToken(token, options.message); - } - return { - simple: options.simple, - params: params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.parseAssignmentExpression = function () { - var expr; - if (!this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseYieldExpression(); - } - else { - var startToken = this.lookahead; - var token = startToken; - expr = this.parseConditionalExpression(); - if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { - if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { - var arg = this.parsePrimaryExpression(); - this.reinterpretExpressionAsPattern(arg); - expr = { - type: ArrowParameterPlaceHolder, - params: [arg], - async: true - }; - } - } - if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { - // https://tc39.github.io/ecma262/#sec-arrow-function-definitions - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var isAsync = expr.async; - var list = this.reinterpretAsCoverFormalsList(expr); - if (list) { - if (this.hasLineTerminator) { - this.tolerateUnexpectedToken(this.lookahead); - } - this.context.firstCoverInitializedNameError = null; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = list.simple; - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = true; - this.context.await = isAsync; - var node = this.startNode(startToken); - this.expect('=>'); - var body = void 0; - if (this.match('{')) { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - body = this.parseFunctionSourceElements(); - this.context.allowIn = previousAllowIn; - } - else { - body = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - var expression = body.type !== syntax_1.Syntax.BlockStatement; - if (this.context.strict && list.firstRestricted) { - this.throwUnexpectedToken(list.firstRestricted, list.message); - } - if (this.context.strict && list.stricted) { - this.tolerateUnexpectedToken(list.stricted, list.message); - } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : - this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - } - } - else { - if (this.matchAssign()) { - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { - var id = expr; - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); - } - if (this.scanner.isStrictModeReservedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - } - if (!this.match('=')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - this.reinterpretExpressionAsPattern(expr); - } - token = this.nextToken(); - var operator = token.value; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); - this.context.firstCoverInitializedNameError = null; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-comma-operator - Parser.prototype.parseExpression = function () { - var startToken = this.lookahead; - var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-block - Parser.prototype.parseStatementListItem = function () { - var statement; - this.context.isAssignmentTarget = true; - this.context.isBindingElement = true; - if (this.lookahead.type === 4 /* Keyword */) { - switch (this.lookahead.value) { - case 'export': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); - } - statement = this.parseExportDeclaration(); - break; - case 'import': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); - } - statement = this.parseImportDeclaration(); - break; - case 'const': - statement = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'class': - statement = this.parseClassDeclaration(); - break; - case 'let': - statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); - break; - default: - statement = this.parseStatement(); - break; - } - } - else { - statement = this.parseStatement(); - } - return statement; - }; - Parser.prototype.parseBlock = function () { - var node = this.createNode(); - this.expect('{'); - var block = []; - while (true) { - if (this.match('}')) { - break; - } - block.push(this.parseStatementListItem()); - } - this.expect('}'); - return this.finalize(node, new Node.BlockStatement(block)); - }; - // https://tc39.github.io/ecma262/#sec-let-and-const-declarations - Parser.prototype.parseLexicalBinding = function (kind, options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, kind); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (kind === 'const') { - if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else { - this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); - } - } - } - else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { - this.expect('='); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseBindingList = function (kind, options) { - var list = [this.parseLexicalBinding(kind, options)]; - while (this.match(',')) { - this.nextToken(); - list.push(this.parseLexicalBinding(kind, options)); - } - return list; - }; - Parser.prototype.isLexicalDeclaration = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - return (next.type === 3 /* Identifier */) || - (next.type === 7 /* Punctuator */ && next.value === '[') || - (next.type === 7 /* Punctuator */ && next.value === '{') || - (next.type === 4 /* Keyword */ && next.value === 'let') || - (next.type === 4 /* Keyword */ && next.value === 'yield'); - }; - Parser.prototype.parseLexicalDeclaration = function (options) { - var node = this.createNode(); - var kind = this.nextToken().value; - assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); - var declarations = this.parseBindingList(kind, options); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); - }; - // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns - Parser.prototype.parseBindingRestElement = function (params, kind) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseArrayPattern = function (params, kind) { - var node = this.createNode(); - this.expect('['); - var elements = []; - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else { - if (this.match('...')) { - elements.push(this.parseBindingRestElement(params, kind)); - break; - } - else { - elements.push(this.parsePatternWithDefault(params, kind)); - } - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayPattern(elements)); - }; - Parser.prototype.parsePropertyPattern = function (params, kind) { - var node = this.createNode(); - var computed = false; - var shorthand = false; - var method = false; - var key; - var value; - if (this.lookahead.type === 3 /* Identifier */) { - var keyToken = this.lookahead; - key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); - if (this.match('=')) { - params.push(keyToken); - shorthand = true; - this.nextToken(); - var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); - } - else if (!this.match(':')) { - params.push(keyToken); - shorthand = true; - value = init; - } - else { - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectPattern = function (params, kind) { - var node = this.createNode(); - var properties = []; - this.expect('{'); - while (!this.match('}')) { - properties.push(this.parsePropertyPattern(params, kind)); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectPattern(properties)); - }; - Parser.prototype.parsePattern = function (params, kind) { - var pattern; - if (this.match('[')) { - pattern = this.parseArrayPattern(params, kind); - } - else if (this.match('{')) { - pattern = this.parseObjectPattern(params, kind); - } - else { - if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); - } - params.push(this.lookahead); - pattern = this.parseVariableIdentifier(kind); - } - return pattern; - }; - Parser.prototype.parsePatternWithDefault = function (params, kind) { - var startToken = this.lookahead; - var pattern = this.parsePattern(params, kind); - if (this.match('=')) { - this.nextToken(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); - } - return pattern; - }; - // https://tc39.github.io/ecma262/#sec-variable-statement - Parser.prototype.parseVariableIdentifier = function (kind) { - var node = this.createNode(); - var token = this.nextToken(); - if (token.type === 4 /* Keyword */ && token.value === 'yield') { - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else if (!this.context.allowYield) { - this.throwUnexpectedToken(token); - } - } - else if (token.type !== 3 /* Identifier */) { - if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else { - if (this.context.strict || token.value !== 'let' || kind !== 'var') { - this.throwUnexpectedToken(token); - } - } - } - else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { - this.tolerateUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseVariableDeclaration = function (options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, 'var'); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { - this.expect('='); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseVariableDeclarationList = function (options) { - var opt = { inFor: options.inFor }; - var list = []; - list.push(this.parseVariableDeclaration(opt)); - while (this.match(',')) { - this.nextToken(); - list.push(this.parseVariableDeclaration(opt)); - } - return list; - }; - Parser.prototype.parseVariableStatement = function () { - var node = this.createNode(); - this.expectKeyword('var'); - var declarations = this.parseVariableDeclarationList({ inFor: false }); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); - }; - // https://tc39.github.io/ecma262/#sec-empty-statement - Parser.prototype.parseEmptyStatement = function () { - var node = this.createNode(); - this.expect(';'); - return this.finalize(node, new Node.EmptyStatement()); - }; - // https://tc39.github.io/ecma262/#sec-expression-statement - Parser.prototype.parseExpressionStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); - }; - // https://tc39.github.io/ecma262/#sec-if-statement - Parser.prototype.parseIfClause = function () { - if (this.context.strict && this.matchKeyword('function')) { - this.tolerateError(messages_1.Messages.StrictFunction); - } - return this.parseStatement(); - }; - Parser.prototype.parseIfStatement = function () { - var node = this.createNode(); - var consequent; - var alternate = null; - this.expectKeyword('if'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - consequent = this.parseIfClause(); - if (this.matchKeyword('else')) { - this.nextToken(); - alternate = this.parseIfClause(); - } - } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); - }; - // https://tc39.github.io/ecma262/#sec-do-while-statement - Parser.prototype.parseDoWhileStatement = function () { - var node = this.createNode(); - this.expectKeyword('do'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - var body = this.parseStatement(); - this.context.inIteration = previousInIteration; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - } - else { - this.expect(')'); - if (this.match(';')) { - this.nextToken(); - } - } - return this.finalize(node, new Node.DoWhileStatement(body, test)); - }; - // https://tc39.github.io/ecma262/#sec-while-statement - Parser.prototype.parseWhileStatement = function () { - var node = this.createNode(); - var body; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.parseStatement(); - this.context.inIteration = previousInIteration; - } - return this.finalize(node, new Node.WhileStatement(test, body)); - }; - // https://tc39.github.io/ecma262/#sec-for-statement - // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements - Parser.prototype.parseForStatement = function () { - var init = null; - var test = null; - var update = null; - var forIn = true; - var left, right; - var node = this.createNode(); - this.expectKeyword('for'); - this.expect('('); - if (this.match(';')) { - this.nextToken(); - } - else { - if (this.matchKeyword('var')) { - init = this.createNode(); - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseVariableDeclarationList({ inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && this.matchKeyword('in')) { - var decl = declarations[0]; - if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { - this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); - } - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.expect(';'); - } - } - else if (this.matchKeyword('const') || this.matchKeyword('let')) { - init = this.createNode(); - var kind = this.nextToken().value; - if (!this.context.strict && this.lookahead.value === 'in') { - init = this.finalize(init, new Node.Identifier(kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseBindingList(kind, { inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - } - } - } - else { - var initStartToken = this.lookahead; - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - init = this.inheritCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - if (this.matchKeyword('in')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForIn); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseExpression(); - init = null; - } - else if (this.matchContextualKeyword('of')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - if (this.match(',')) { - var initSeq = [init]; - while (this.match(',')) { - this.nextToken(); - initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); - } - this.expect(';'); - } - } - } - if (typeof left === 'undefined') { - if (!this.match(';')) { - test = this.parseExpression(); - } - this.expect(';'); - if (!this.match(')')) { - update = this.parseExpression(); - } - } - var body; - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.isolateCoverGrammar(this.parseStatement); - this.context.inIteration = previousInIteration; - } - return (typeof left === 'undefined') ? - this.finalize(node, new Node.ForStatement(init, test, update, body)) : - forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : - this.finalize(node, new Node.ForOfStatement(left, right, body)); - }; - // https://tc39.github.io/ecma262/#sec-continue-statement - Parser.prototype.parseContinueStatement = function () { - var node = this.createNode(); - this.expectKeyword('continue'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - label = id; - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration) { - this.throwError(messages_1.Messages.IllegalContinue); - } - return this.finalize(node, new Node.ContinueStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-break-statement - Parser.prototype.parseBreakStatement = function () { - var node = this.createNode(); - this.expectKeyword('break'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - label = id; - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration && !this.context.inSwitch) { - this.throwError(messages_1.Messages.IllegalBreak); - } - return this.finalize(node, new Node.BreakStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-return-statement - Parser.prototype.parseReturnStatement = function () { - if (!this.context.inFunctionBody) { - this.tolerateError(messages_1.Messages.IllegalReturn); - } - var node = this.createNode(); - this.expectKeyword('return'); - var hasArgument = !this.match(';') && !this.match('}') && - !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */; - var argument = hasArgument ? this.parseExpression() : null; - this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-with-statement - Parser.prototype.parseWithStatement = function () { - if (this.context.strict) { - this.tolerateError(messages_1.Messages.StrictModeWith); - } - var node = this.createNode(); - var body; - this.expectKeyword('with'); - this.expect('('); - var object = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - body = this.parseStatement(); - } - return this.finalize(node, new Node.WithStatement(object, body)); - }; - // https://tc39.github.io/ecma262/#sec-switch-statement - Parser.prototype.parseSwitchCase = function () { - var node = this.createNode(); - var test; - if (this.matchKeyword('default')) { - this.nextToken(); - test = null; - } - else { - this.expectKeyword('case'); - test = this.parseExpression(); - } - this.expect(':'); - var consequent = []; - while (true) { - if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { - break; - } - consequent.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.SwitchCase(test, consequent)); - }; - Parser.prototype.parseSwitchStatement = function () { - var node = this.createNode(); - this.expectKeyword('switch'); - this.expect('('); - var discriminant = this.parseExpression(); - this.expect(')'); - var previousInSwitch = this.context.inSwitch; - this.context.inSwitch = true; - var cases = []; - var defaultFound = false; - this.expect('{'); - while (true) { - if (this.match('}')) { - break; - } - var clause = this.parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - this.expect('}'); - this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); - }; - // https://tc39.github.io/ecma262/#sec-labelled-statements - Parser.prototype.parseLabelledStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - var statement; - if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { - this.nextToken(); - var id = expr; - var key = '$' + id.name; - if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); - } - this.context.labelSet[key] = true; - var body = void 0; - if (this.matchKeyword('class')) { - this.tolerateUnexpectedToken(this.lookahead); - body = this.parseClassDeclaration(); - } - else if (this.matchKeyword('function')) { - var token = this.lookahead; - var declaration = this.parseFunctionDeclaration(); - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); - } - else if (declaration.generator) { - this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); - } - body = declaration; - } - else { - body = this.parseStatement(); - } - delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); - } - else { - this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); - } - return this.finalize(node, statement); - }; - // https://tc39.github.io/ecma262/#sec-throw-statement - Parser.prototype.parseThrowStatement = function () { - var node = this.createNode(); - this.expectKeyword('throw'); - if (this.hasLineTerminator) { - this.throwError(messages_1.Messages.NewlineAfterThrow); - } - var argument = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-try-statement - Parser.prototype.parseCatchClause = function () { - var node = this.createNode(); - this.expectKeyword('catch'); - this.expect('('); - if (this.match(')')) { - this.throwUnexpectedToken(this.lookahead); - } - var params = []; - var param = this.parsePattern(params); - var paramMap = {}; - for (var i = 0; i < params.length; i++) { - var key = '$' + params[i].value; - if (Object.prototype.hasOwnProperty.call(paramMap, key)) { - this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); - } - paramMap[key] = true; - } - if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(param.name)) { - this.tolerateError(messages_1.Messages.StrictCatchVariable); - } - } - this.expect(')'); - var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); - }; - Parser.prototype.parseFinallyClause = function () { - this.expectKeyword('finally'); - return this.parseBlock(); - }; - Parser.prototype.parseTryStatement = function () { - var node = this.createNode(); - this.expectKeyword('try'); - var block = this.parseBlock(); - var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; - var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; - if (!handler && !finalizer) { - this.throwError(messages_1.Messages.NoCatchOrFinally); - } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); - }; - // https://tc39.github.io/ecma262/#sec-debugger-statement - Parser.prototype.parseDebuggerStatement = function () { - var node = this.createNode(); - this.expectKeyword('debugger'); - this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); - }; - // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations - Parser.prototype.parseStatement = function () { - var statement; - switch (this.lookahead.type) { - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* Template */: - case 9 /* RegularExpression */: - statement = this.parseExpressionStatement(); - break; - case 7 /* Punctuator */: - var value = this.lookahead.value; - if (value === '{') { - statement = this.parseBlock(); - } - else if (value === '(') { - statement = this.parseExpressionStatement(); - } - else if (value === ';') { - statement = this.parseEmptyStatement(); - } - else { - statement = this.parseExpressionStatement(); - } - break; - case 3 /* Identifier */: - statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); - break; - case 4 /* Keyword */: - switch (this.lookahead.value) { - case 'break': - statement = this.parseBreakStatement(); - break; - case 'continue': - statement = this.parseContinueStatement(); - break; - case 'debugger': - statement = this.parseDebuggerStatement(); - break; - case 'do': - statement = this.parseDoWhileStatement(); - break; - case 'for': - statement = this.parseForStatement(); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'if': - statement = this.parseIfStatement(); - break; - case 'return': - statement = this.parseReturnStatement(); - break; - case 'switch': - statement = this.parseSwitchStatement(); - break; - case 'throw': - statement = this.parseThrowStatement(); - break; - case 'try': - statement = this.parseTryStatement(); - break; - case 'var': - statement = this.parseVariableStatement(); - break; - case 'while': - statement = this.parseWhileStatement(); - break; - case 'with': - statement = this.parseWithStatement(); - break; - default: - statement = this.parseExpressionStatement(); - break; - } - break; - default: - statement = this.throwUnexpectedToken(this.lookahead); - } - return statement; - }; - // https://tc39.github.io/ecma262/#sec-function-definitions - Parser.prototype.parseFunctionSourceElements = function () { - var node = this.createNode(); - this.expect('{'); - var body = this.parseDirectivePrologues(); - var previousLabelSet = this.context.labelSet; - var previousInIteration = this.context.inIteration; - var previousInSwitch = this.context.inSwitch; - var previousInFunctionBody = this.context.inFunctionBody; - this.context.labelSet = {}; - this.context.inIteration = false; - this.context.inSwitch = false; - this.context.inFunctionBody = true; - while (this.lookahead.type !== 2 /* EOF */) { - if (this.match('}')) { - break; - } - body.push(this.parseStatementListItem()); - } - this.expect('}'); - this.context.labelSet = previousLabelSet; - this.context.inIteration = previousInIteration; - this.context.inSwitch = previousInSwitch; - this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); - }; - Parser.prototype.validateParam = function (options, param, name) { - var key = '$' + name; - if (this.context.strict) { - if (this.scanner.isRestrictedWord(name)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - else if (!options.firstRestricted) { - if (this.scanner.isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictParamName; - } - else if (this.scanner.isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictReservedWord; - } - else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - /* istanbul ignore next */ - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); - } - else { - options.paramSet[key] = true; - } - }; - Parser.prototype.parseRestElement = function (params) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params); - if (this.match('=')) { - this.throwError(messages_1.Messages.DefaultRestParameter); - } - if (!this.match(')')) { - this.throwError(messages_1.Messages.ParameterAfterRestParameter); - } - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseFormalParameter = function (options) { - var params = []; - var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); - for (var i = 0; i < params.length; i++) { - this.validateParam(options, params[i], params[i].value); - } - options.simple = options.simple && (param instanceof Node.Identifier); - options.params.push(param); - }; - Parser.prototype.parseFormalParameters = function (firstRestricted) { - var options; - options = { - simple: true, - params: [], - firstRestricted: firstRestricted - }; - this.expect('('); - if (!this.match(')')) { - options.paramSet = {}; - while (this.lookahead.type !== 2 /* EOF */) { - this.parseFormalParameter(options); - if (this.match(')')) { - break; - } - this.expect(','); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return { - simple: options.simple, - params: options.params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.matchAsyncFunction = function () { - var match = this.matchContextualKeyword('async'); - if (match) { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); - } - return match; - }; - Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted = null; - if (!identifierIsOptional || !this.match('(')) { - var token = this.lookahead; - id = this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : - this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); - }; - Parser.prototype.parseFunctionExpression = function () { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted; - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - if (!this.match('(')) { - var token = this.lookahead; - id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : - this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive - Parser.prototype.parseDirective = function () { - var token = this.lookahead; - var node = this.createNode(); - var expr = this.parseExpression(); - var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; - this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); - }; - Parser.prototype.parseDirectivePrologues = function () { - var firstRestricted = null; - var body = []; - while (true) { - var token = this.lookahead; - if (token.type !== 8 /* StringLiteral */) { - break; - } - var statement = this.parseDirective(); - body.push(statement); - var directive = statement.directive; - if (typeof directive !== 'string') { - break; - } - if (directive === 'use strict') { - this.context.strict = true; - if (firstRestricted) { - this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); - } - if (!this.context.allowStrictDirective) { - this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); - } - } - else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - return body; - }; - // https://tc39.github.io/ecma262/#sec-method-definitions - Parser.prototype.qualifiedPropertyName = function (token) { - switch (token.type) { - case 3 /* Identifier */: - case 8 /* StringLiteral */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 4 /* Keyword */: - return true; - case 7 /* Punctuator */: - return token.value === '['; - default: - break; - } - return false; - }; - Parser.prototype.parseGetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length > 0) { - this.tolerateError(messages_1.Messages.BadGetterArity); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseSetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length !== 1) { - this.tolerateError(messages_1.Messages.BadSetterArity); - } - else if (formalParameters.params[0] instanceof Node.RestElement) { - this.tolerateError(messages_1.Messages.BadSetterRestParameter); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseGeneratorMethod = function () { - var node = this.createNode(); - var isGenerator = true; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - this.context.allowYield = false; - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-generator-function-definitions - Parser.prototype.isStartOfExpression = function () { - var start = true; - var value = this.lookahead.value; - switch (this.lookahead.type) { - case 7 /* Punctuator */: - start = (value === '[') || (value === '(') || (value === '{') || - (value === '+') || (value === '-') || - (value === '!') || (value === '~') || - (value === '++') || (value === '--') || - (value === '/') || (value === '/='); // regular expression literal - break; - case 4 /* Keyword */: - start = (value === 'class') || (value === 'delete') || - (value === 'function') || (value === 'let') || (value === 'new') || - (value === 'super') || (value === 'this') || (value === 'typeof') || - (value === 'void') || (value === 'yield'); - break; - default: - break; - } - return start; - }; - Parser.prototype.parseYieldExpression = function () { - var node = this.createNode(); - this.expectKeyword('yield'); - var argument = null; - var delegate = false; - if (!this.hasLineTerminator) { - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - delegate = this.match('*'); - if (delegate) { - this.nextToken(); - argument = this.parseAssignmentExpression(); - } - else if (this.isStartOfExpression()) { - argument = this.parseAssignmentExpression(); - } - this.context.allowYield = previousAllowYield; - } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); - }; - // https://tc39.github.io/ecma262/#sec-class-definitions - Parser.prototype.parseClassElement = function (hasConstructor) { - var token = this.lookahead; - var node = this.createNode(); - var kind = ''; - var key = null; - var value = null; - var computed = false; - var method = false; - var isStatic = false; - var isAsync = false; - if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - var id = key; - if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { - token = this.lookahead; - isStatic = true; - computed = this.match('['); - if (this.match('*')) { - this.nextToken(); - } - else { - key = this.parseObjectPropertyKey(); - } - } - if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { - var punctuator = this.lookahead.value; - if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { - isAsync = true; - token = this.lookahead; - key = this.parseObjectPropertyKey(); - if (token.type === 3 /* Identifier */) { - if (token.value === 'get' || token.value === 'set') { - this.tolerateUnexpectedToken(token); - } - else if (token.value === 'constructor') { - this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); - } - } - } - } - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */) { - if (token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - if (!kind && key && this.match('(')) { - kind = 'init'; - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - if (!kind) { - this.throwUnexpectedToken(this.lookahead); - } - if (kind === 'init') { - kind = 'method'; - } - if (!computed) { - if (isStatic && this.isPropertyKey(key, 'prototype')) { - this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); - } - if (!isStatic && this.isPropertyKey(key, 'constructor')) { - if (kind !== 'method' || !method || (value && value.generator)) { - this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); - } - if (hasConstructor.value) { - this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); - } - else { - hasConstructor.value = true; - } - kind = 'constructor'; - } - } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); - }; - Parser.prototype.parseClassElementList = function () { - var body = []; - var hasConstructor = { value: false }; - this.expect('{'); - while (!this.match('}')) { - if (this.match(';')) { - this.nextToken(); - } - else { - body.push(this.parseClassElement(hasConstructor)); - } - } - this.expect('}'); - return body; - }; - Parser.prototype.parseClassBody = function () { - var node = this.createNode(); - var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); - }; - Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); - }; - Parser.prototype.parseClassExpression = function () { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); - }; - // https://tc39.github.io/ecma262/#sec-scripts - // https://tc39.github.io/ecma262/#sec-modules - Parser.prototype.parseModule = function () { - this.context.strict = true; - this.context.isModule = true; - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Module(body)); - }; - Parser.prototype.parseScript = function () { - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Script(body)); - }; - // https://tc39.github.io/ecma262/#sec-imports - Parser.prototype.parseModuleSpecifier = function () { - var node = this.createNode(); - if (this.lookahead.type !== 8 /* StringLiteral */) { - this.throwError(messages_1.Messages.InvalidModuleSpecifier); - } - var token = this.nextToken(); - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - // import {} ...; - Parser.prototype.parseImportSpecifier = function () { - var node = this.createNode(); - var imported; - var local; - if (this.lookahead.type === 3 /* Identifier */) { - imported = this.parseVariableIdentifier(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - } - else { - imported = this.parseIdentifierName(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); - }; - // {foo, bar as bas} - Parser.prototype.parseNamedImports = function () { - this.expect('{'); - var specifiers = []; - while (!this.match('}')) { - specifiers.push(this.parseImportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return specifiers; - }; - // import ...; - Parser.prototype.parseImportDefaultSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); - }; - // import <* as foo> ...; - Parser.prototype.parseImportNamespaceSpecifier = function () { - var node = this.createNode(); - this.expect('*'); - if (!this.matchContextualKeyword('as')) { - this.throwError(messages_1.Messages.NoAsAfterImportNamespace); - } - this.nextToken(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); - }; - Parser.prototype.parseImportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalImportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('import'); - var src; - var specifiers = []; - if (this.lookahead.type === 8 /* StringLiteral */) { - // import 'foo'; - src = this.parseModuleSpecifier(); - } - else { - if (this.match('{')) { - // import {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else if (this.match('*')) { - // import * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { - // import foo - specifiers.push(this.parseImportDefaultSpecifier()); - if (this.match(',')) { - this.nextToken(); - if (this.match('*')) { - // import foo, * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.match('{')) { - // import foo, {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - src = this.parseModuleSpecifier(); - } - this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); - }; - // https://tc39.github.io/ecma262/#sec-exports - Parser.prototype.parseExportSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - var exported = local; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - exported = this.parseIdentifierName(); - } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); - }; - Parser.prototype.parseExportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalExportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('export'); - var exportDeclaration; - if (this.matchKeyword('default')) { - // export default ... - this.nextToken(); - if (this.matchKeyword('function')) { - // export default function foo () {} - // export default function () {} - var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchKeyword('class')) { - // export default class foo {} - var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchContextualKeyword('async')) { - // export default async function f () {} - // export default async function () {} - // export default async x => x - var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else { - if (this.matchContextualKeyword('from')) { - this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); - } - // export default {}; - // export default []; - // export default (1 + 2); - var declaration = this.match('{') ? this.parseObjectInitializer() : - this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - } - else if (this.match('*')) { - // export * from 'foo'; - this.nextToken(); - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - var src = this.parseModuleSpecifier(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); - } - else if (this.lookahead.type === 4 /* Keyword */) { - // export var f = 1; - var declaration = void 0; - switch (this.lookahead.value) { - case 'let': - case 'const': - declaration = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'var': - case 'class': - case 'function': - declaration = this.parseStatementListItem(); - break; - default: - this.throwUnexpectedToken(this.lookahead); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else if (this.matchAsyncFunction()) { - var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else { - var specifiers = []; - var source = null; - var isExportFromIdentifier = false; - this.expect('{'); - while (!this.match('}')) { - isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); - specifiers.push(this.parseExportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - if (this.matchContextualKeyword('from')) { - // export {default} from 'foo'; - // export {foo} from 'foo'; - this.nextToken(); - source = this.parseModuleSpecifier(); - this.consumeSemicolon(); - } - else if (isExportFromIdentifier) { - // export {default}; // missing fromClause - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - else { - // export {foo}; - this.consumeSemicolon(); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); - } - return exportDeclaration; - }; - return Parser; - }()); - exports.Parser = Parser; - - -/***/ }, -/* 9 */ -/***/ function(module, exports) { - - "use strict"; - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - Object.defineProperty(exports, "__esModule", { value: true }); - function assert(condition, message) { - /* istanbul ignore if */ - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - exports.assert = assert; - - -/***/ }, -/* 10 */ -/***/ function(module, exports) { - - "use strict"; - /* tslint:disable:max-classes-per-file */ - Object.defineProperty(exports, "__esModule", { value: true }); - var ErrorHandler = (function () { - function ErrorHandler() { - this.errors = []; - this.tolerant = false; - } - ErrorHandler.prototype.recordError = function (error) { - this.errors.push(error); - }; - ErrorHandler.prototype.tolerate = function (error) { - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - ErrorHandler.prototype.constructError = function (msg, column) { - var error = new Error(msg); - try { - throw error; - } - catch (base) { - /* istanbul ignore else */ - if (Object.create && Object.defineProperty) { - error = Object.create(base); - Object.defineProperty(error, 'column', { value: column }); - } - } - /* istanbul ignore next */ - return error; - }; - ErrorHandler.prototype.createError = function (index, line, col, description) { - var msg = 'Line ' + line + ': ' + description; - var error = this.constructError(msg, col); - error.index = index; - error.lineNumber = line; - error.description = description; - return error; - }; - ErrorHandler.prototype.throwError = function (index, line, col, description) { - throw this.createError(index, line, col, description); - }; - ErrorHandler.prototype.tolerateError = function (index, line, col, description) { - var error = this.createError(index, line, col, description); - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - return ErrorHandler; - }()); - exports.ErrorHandler = ErrorHandler; - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // Error messages should be identical to V8. - exports.Messages = { - BadGetterArity: 'Getter must not have any formal parameters', - BadSetterArity: 'Setter must have exactly one formal parameter', - BadSetterRestParameter: 'Setter function argument must not be a rest parameter', - ConstructorIsAsync: 'Class constructor may not be an async method', - ConstructorSpecialMethod: 'Class constructor may not be an accessor', - DeclarationMissingInitializer: 'Missing initializer in %0 declaration', - DefaultRestParameter: 'Unexpected token =', - DuplicateBinding: 'Duplicate binding %0', - DuplicateConstructor: 'A class may only have one constructor', - DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', - ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', - GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', - IllegalBreak: 'Illegal break statement', - IllegalContinue: 'Illegal continue statement', - IllegalExportDeclaration: 'Unexpected token', - IllegalImportDeclaration: 'Unexpected token', - IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', - IllegalReturn: 'Illegal return statement', - InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', - InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', - InvalidModuleSpecifier: 'Unexpected token', - InvalidRegExp: 'Invalid regular expression', - LetInLexicalBinding: 'let is disallowed as a lexically bound name', - MissingFromClause: 'Unexpected token', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NewlineAfterThrow: 'Illegal newline after throw', - NoAsAfterImportNamespace: 'Unexpected token', - NoCatchOrFinally: 'Missing catch or finally after try', - ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', - Redeclaration: '%0 \'%1\' has already been declared', - StaticPrototype: 'Classes may not have static property named prototype', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', - UnexpectedEOS: 'Unexpected end of input', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedNumber: 'Unexpected number', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedString: 'Unexpected string', - UnexpectedTemplate: 'Unexpected quasi %0', - UnexpectedToken: 'Unexpected token %0', - UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', - UnknownLabel: 'Undefined label \'%0\'', - UnterminatedRegExp: 'Invalid regular expression: missing /' - }; - - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var character_1 = __webpack_require__(4); - var messages_1 = __webpack_require__(11); - function hexValue(ch) { - return '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - function octalValue(ch) { - return '01234567'.indexOf(ch); - } - var Scanner = (function () { - function Scanner(code, handler) { - this.source = code; - this.errorHandler = handler; - this.trackComment = false; - this.length = code.length; - this.index = 0; - this.lineNumber = (code.length > 0) ? 1 : 0; - this.lineStart = 0; - this.curlyStack = []; - } - Scanner.prototype.saveState = function () { - return { - index: this.index, - lineNumber: this.lineNumber, - lineStart: this.lineStart - }; - }; - Scanner.prototype.restoreState = function (state) { - this.index = state.index; - this.lineNumber = state.lineNumber; - this.lineStart = state.lineStart; - }; - Scanner.prototype.eof = function () { - return this.index >= this.length; - }; - Scanner.prototype.throwUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - Scanner.prototype.tolerateUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - // https://tc39.github.io/ecma262/#sec-comments - Scanner.prototype.skipSingleLineComment = function (offset) { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - offset; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - offset - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - ++this.index; - if (character_1.Character.isLineTerminator(ch)) { - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - 1 - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index - 1], - range: [start, this.index - 1], - loc: loc - }; - comments.push(entry); - } - if (ch === 13 && this.source.charCodeAt(this.index) === 10) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - return comments; - } - } - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - }; - Scanner.prototype.skipMultiLineComment = function () { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - 2; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - 2 - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isLineTerminator(ch)) { - if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - ++this.index; - this.lineStart = this.index; - } - else if (ch === 0x2A) { - // Block comment ends with '*/'. - if (this.source.charCodeAt(this.index + 1) === 0x2F) { - this.index += 2; - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index - 2], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - } - ++this.index; - } - else { - ++this.index; - } - } - // Ran off the end of the file - the whole thing is a comment - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - this.tolerateUnexpectedToken(); - return comments; - }; - Scanner.prototype.scanComments = function () { - var comments; - if (this.trackComment) { - comments = []; - } - var start = (this.index === 0); - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isWhiteSpace(ch)) { - ++this.index; - } - else if (character_1.Character.isLineTerminator(ch)) { - ++this.index; - if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - start = true; - } - else if (ch === 0x2F) { - ch = this.source.charCodeAt(this.index + 1); - if (ch === 0x2F) { - this.index += 2; - var comment = this.skipSingleLineComment(2); - if (this.trackComment) { - comments = comments.concat(comment); - } - start = true; - } - else if (ch === 0x2A) { - this.index += 2; - var comment = this.skipMultiLineComment(); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (start && ch === 0x2D) { - // U+003E is '>' - if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { - // '-->' is a single-line comment - this.index += 3; - var comment = this.skipSingleLineComment(3); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (ch === 0x3C) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.index += 4; // ` - - - -``` - -Browser support was done mostly for the online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - -Notes: - -1. We have no resources to support browserified version. Don't expect it to be - well tested. Don't expect fast fixes if something goes wrong there. -2. `!!js/function` in browser bundle will not work by default. If you really need - it - load `esprima` parser first (via amd or directly). -3. `!!bin` in browser will return `Array`, because browsers do not support - node.js `Buffer` and adding Buffer shims is completely useless on practice. - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. - -``` javascript -yaml = require('js-yaml'); -fs = require('fs'); - -// Get document, or throw exception on error -try { - var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### safeLoad (string [ , options ]) - -**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript -object or throws `YAMLException` on error. By default, does not support regexps, -functions and undefined. This method is safe for untrusted data. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `onWarning` _(default: null)_ - function to call on warning messages. - Loader will throw on warnings if this function is not provided. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. - - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: - http://www.yaml.org/spec/1.2/spec.html#id2802346 - - `JSON_SCHEMA` - all JSON-supported types: - http://www.yaml.org/spec/1.2/spec.html#id2803231 - - `CORE_SCHEMA` - same as `JSON_SCHEMA`: - http://www.yaml.org/spec/1.2/spec.html#id2804923 - - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones - (`!!js/undefined`, `!!js/regexp` and `!!js/function`): - http://yaml.org/type/ - - `DEFAULT_FULL_SCHEMA` - all supported YAML types. -- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. - -NOTE: This function **does not** understand multi-document sources, it throws -exception on those. - -NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. -So, the JSON schema is not as strictly defined in the YAML specification. -It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. -The core schema also has no such restrictions. It allows binary notation for integers. - - -### load (string [ , options ]) - -**Use with care with untrusted sources**. The same as `safeLoad()` but uses -`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: -`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you -must additionally validate object structure to avoid injections: - -``` javascript -var untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; - -// I'm just converting that string, what could possibly go wrong? -require('js-yaml').load(untrusted_code) + '' -``` - - -### safeLoadAll (string [, iterator] [, options ]) - -Same as `safeLoad()`, but understands multi-document sources. Applies -`iterator` to each document if specified, or returns array of documents. - -``` javascript -var yaml = require('js-yaml'); - -yaml.safeLoadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### loadAll (string [, iterator] [ , options ]) - -Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. - - -### safeDump (object [ , options ]) - -Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will -throw an exception if you try to dump regexps or functions. However, you can -disable exceptions by setting the `skipInvalid` option to `true`. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function - in the safe schema) and skip pairs and single values with such types. -- `flowLevel` (default: -1) - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. -- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a - function, use the function to sort the keys. -- `lineWidth` _(default: `80`)_ - set max line width. -- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references -- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older - yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 -- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. - -The following table show availlable styles (e.g. "canonical", -"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml -output is shown on the right side after `=>` (default setting) or `->`: - -``` none -!!null - "canonical" -> "~" - "lowercase" => "null" - "uppercase" -> "NULL" - "camelcase" -> "Null" - -!!int - "binary" -> "0b1", "0b101010", "0b1110001111010" - "octal" -> "01", "052", "016172" - "decimal" => "1", "42", "7290" - "hexadecimal" -> "0x1", "0x2A", "0x1C7A" - -!!bool - "lowercase" => "true", "false" - "uppercase" -> "TRUE", "FALSE" - "camelcase" -> "True", "False" - -!!float - "lowercase" => ".nan", '.inf' - "uppercase" -> ".NAN", '.INF' - "camelcase" -> ".NaN", '.Inf' -``` - -Example: - -``` javascript -safeDump (object, { - 'styles': { - '!!null': 'canonical' // dump null as ~ - }, - 'sortKeys': true // sort object keys -}); -``` - -### dump (object [ , options ]) - -Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). - - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScipt types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` - -Caveats -------- - -Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects -or arrays as keys, and stringifies (by calling `toString()` method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - - -Breaking changes in 2.x.x -> 3.x.x ----------------------------------- - -If you have not used __custom__ tags or loader classes and not loaded yaml -files via `require()`, no changes are needed. Just upgrade the library. - -Otherwise, you should: - -1. Replace all occurrences of `require('xxxx.yml')` by `fs.readFileSync()` + - `yaml.safeLoad()`. -2. rewrite your custom tags constructors and custom loader - classes, to conform the new API. See - [examples](https://github.com/nodeca/js-yaml/tree/master/examples) and - [wiki](https://github.com/nodeca/js-yaml/wiki) for details. - - -License -------- - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/tools/doc/node_modules/js-yaml/bin/js-yaml.js b/tools/doc/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index e79186be6f56..000000000000 --- a/tools/doc/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env node - - -'use strict'; - -/*eslint-disable no-console*/ - - -// stdlib -var fs = require('fs'); - - -// 3rd-party -var argparse = require('argparse'); - - -// internal -var yaml = require('..'); - - -//////////////////////////////////////////////////////////////////////////////// - - -var cli = new argparse.ArgumentParser({ - prog: 'js-yaml', - version: require('../package.json').version, - addHelp: true -}); - - -cli.addArgument([ '-c', '--compact' ], { - help: 'Display errors in compact mode', - action: 'storeTrue' -}); - - -// deprecated (not needed after we removed output colors) -// option suppressed, but not completely removed for compatibility -cli.addArgument([ '-j', '--to-json' ], { - help: argparse.Const.SUPPRESS, - dest: 'json', - action: 'storeTrue' -}); - - -cli.addArgument([ '-t', '--trace' ], { - help: 'Show stack trace on error', - action: 'storeTrue' -}); - -cli.addArgument([ 'file' ], { - help: 'File to read, utf-8 encoded without BOM', - nargs: '?', - defaultValue: '-' -}); - - -//////////////////////////////////////////////////////////////////////////////// - - -var options = cli.parseArgs(); - - -//////////////////////////////////////////////////////////////////////////////// - -function readFile(filename, encoding, callback) { - if (options.file === '-') { - // read from stdin - - var chunks = []; - - process.stdin.on('data', function (chunk) { - chunks.push(chunk); - }); - - process.stdin.on('end', function () { - return callback(null, Buffer.concat(chunks).toString(encoding)); - }); - } else { - fs.readFile(filename, encoding, callback); - } -} - -readFile(options.file, 'utf8', function (error, input) { - var output, isYaml; - - if (error) { - if (error.code === 'ENOENT') { - console.error('File not found: ' + options.file); - process.exit(2); - } - - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - - try { - output = JSON.parse(input); - isYaml = false; - } catch (err) { - if (err instanceof SyntaxError) { - try { - output = []; - yaml.loadAll(input, function (doc) { output.push(doc); }, {}); - isYaml = true; - - if (output.length === 0) output = null; - else if (output.length === 1) output = output[0]; - - } catch (e) { - if (options.trace && err.stack) console.error(e.stack); - else console.error(e.toString(options.compact)); - - process.exit(1); - } - } else { - console.error( - options.trace && err.stack || - err.message || - String(err)); - - process.exit(1); - } - } - - if (isYaml) console.log(JSON.stringify(output, null, ' ')); - else console.log(yaml.dump(output)); -}); diff --git a/tools/doc/node_modules/js-yaml/dist/js-yaml.js b/tools/doc/node_modules/js-yaml/dist/js-yaml.js deleted file mode 100644 index df93be39d12a..000000000000 --- a/tools/doc/node_modules/js-yaml/dist/js-yaml.js +++ /dev/null @@ -1,3905 +0,0 @@ -/* js-yaml 3.11.0 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - - if (line.length && line !== '\n') result += ind; - - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} - -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} - -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - && c !== CHAR_COLON - && c !== CHAR_SHARP; -} - -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} - -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; - -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); - - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (string[0] === ' ' && indentPerLevel > 9) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} - -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } - - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = state.condenseFlow ? '"' : ''; - - if (index !== 0) pairBuffer += ', '; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; - -},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - -},{}],5:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - if (typeof iterator !== 'function') { - return documents; - } - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - if (typeof output === 'function') { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } else { - return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; - -},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - -},{"./common":2}],7:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - -},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); - -},{"../schema":7,"./json":12}],9:[function(require,module,exports){ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); - -},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); - -},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); - -},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); - -},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - -},{"./exception":4}],14:[function(require,module,exports){ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); - -},{"../type":13}],15:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],16:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - -},{"../common":2,"../type":13}],17:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); - -},{"../common":2,"../type":13}],18:[function(require,module,exports){ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - -},{"../../type":13}],19:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - -},{"../../type":13}],20:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - -},{"../../type":13}],21:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); - -},{"../type":13}],22:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - -},{"../type":13}],23:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],24:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); - -},{"../type":13}],25:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); - -},{"../type":13}],26:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); - -},{"../type":13}],27:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - -},{"../type":13}],28:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); - -},{"../type":13}],29:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - -},{"../type":13}],"/":[function(require,module,exports){ -'use strict'; - - -var yaml = require('./lib/js-yaml.js'); - - -module.exports = yaml; - -},{"./lib/js-yaml.js":1}]},{},[])("/") -}); \ No newline at end of file diff --git a/tools/doc/node_modules/js-yaml/dist/js-yaml.min.js b/tools/doc/node_modules/js-yaml/dist/js-yaml.min.js deleted file mode 100644 index 7ca018420d20..000000000000 --- a/tools/doc/node_modules/js-yaml/dist/js-yaml.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}}(function(){return function o(a,s,c){function u(n,e){if(!s[n]){if(!a[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(l)return l(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[n]={exports:{}};a[n][0].call(r.exports,function(e){var t=a[n][1][e];return u(t||e)},r,r.exports,o,a,s,c)}return s[n].exports}for(var l="function"==typeof require&&require,e=0;e=i.flowLevel;switch($(r,n,i.indent,t,function(e){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+G(r,i.indent)+V(L(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(s=e.indexOf("\n"),s=-1!==s?s:e.length,r.lastIndex=s,Z(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;i=r.exec(e);){var c=i[1],u=i[2];n=" "===u[0],o+=c+(a||n||""===u?"":"\n")+Z(u,t),a=n}return o}(r,t),e));case K:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function J(e,t,n,i,r,o){e.tag=null,e.dump=n,z(e,n,!1)||z(e,n,!0);var a=l.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return!0}function Q(e,t){var n,i,r=[],o=[];for(function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;ot)&&0!==i)_(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(B(e,t,b,!0,r)&&(m?d=e.result:h=e.result),m||(L(e,l,p,f,d,h,o,a),f=d=h=null),U(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)_(e,"bad indentation of a mapping entry");else if(e.lineIndentl&&(l=e.lineIndent),j(o))p++;else{if(e.lineIndent>10),56320+(c-65536&1023)),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else j(s)?(M(e,n,i,!0),Y(e,U(e,!1,t)),n=i=e.position):e.position===e.lineStart&&q(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!I(i)&&!E(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],U(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,s,c,u,l,p=e.kind,f=e.result;if(I(l=e.input.charCodeAt(e.position))||E(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(I(i=e.input.charCodeAt(e.position+1))||n&&E(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==l;){if(58===l){if(I(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===l){if(I(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&q(e)||n&&E(l))break;if(j(l)){if(s=e.line,c=e.lineStart,u=e.lineIndent,U(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(M(e,r,o,!1),Y(e,e.line-s),r=o=e.position,a=!1),S(l)||(o=e.position+1),l=e.input.charCodeAt(++e.position)}return M(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,p,x===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||_(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=s&&R(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):_(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function K(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(U(e,!0,-1),r=e.input.charCodeAt(e.position),!(0t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var i=e("./common"),r=e("./exception"),o=e("./type");function a(e,t,i){var r=[];return e.include.forEach(function(e){i=a(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0==(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),c?c.from?c.from(s):new c(s):s},predicate:function(e){return c&&c.isBuffer(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},{"../type":13}],15:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type"),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,i,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type");t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - - if (line.length && line !== '\n') result += ind; - - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} - -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} - -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - && c !== CHAR_COLON - && c !== CHAR_SHARP; -} - -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} - -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; - -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); - - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (string[0] === ' ' && indentPerLevel > 9) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} - -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } - - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = state.condenseFlow ? '"' : ''; - - if (index !== 0) pairBuffer += ', '; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/exception.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index b744a1ee4ef4..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,43 +0,0 @@ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/loader.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index fe2cb4d07ac4..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1598 +0,0 @@ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - if (typeof iterator !== 'function') { - return documents; - } - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - if (typeof output === 'function') { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } else { - return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); - } -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/mark.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index 47b265c20cea..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ca7cf47e7053..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/core.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/core.js deleted file mode 100644 index 206daab56c05..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/core.js +++ /dev/null @@ -1,18 +0,0 @@ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js deleted file mode 100644 index a55ef42accda..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +++ /dev/null @@ -1,25 +0,0 @@ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js deleted file mode 100644 index 11d89bbfbba4..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +++ /dev/null @@ -1,28 +0,0 @@ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js deleted file mode 100644 index b7a33eb7a1cc..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +++ /dev/null @@ -1,17 +0,0 @@ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/json.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/json.js deleted file mode 100644 index 5be3dbf805bc..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/schema/json.js +++ /dev/null @@ -1,25 +0,0 @@ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index 90b702ac06f1..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/binary.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 10b1875595be..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/bool.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index cb7745930a6e..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/float.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index 127671b21392..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/int.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index ba61c5f958e2..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index ba2dfd45b6f8..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 43fa47017619..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 95b5569fdfa5..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/map.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index f327beebd53b..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/merge.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index ae08a86444cf..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/null.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 6874daa6471e..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/omap.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index b2b5323bd1cd..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 74b52403fc12..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/seq.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index be8f77f2844b..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/set.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index f885a329c2ca..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/str.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 27acc106caaf..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); diff --git a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/tools/doc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 8fa9c5865697..000000000000 --- a/tools/doc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); diff --git a/tools/doc/node_modules/js-yaml/package.json b/tools/doc/node_modules/js-yaml/package.json deleted file mode 100644 index 0776bc5686b5..000000000000 --- a/tools/doc/node_modules/js-yaml/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "js-yaml@3.11.0", - "/Users/rubys/git/node/tools/doc" - ] - ], - "_development": true, - "_from": "js-yaml@3.11.0", - "_id": "js-yaml@3.11.0", - "_inBundle": false, - "_integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "_location": "/js-yaml", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "js-yaml@3.11.0", - "name": "js-yaml", - "escapedName": "js-yaml", - "rawSpec": "3.11.0", - "saveSpec": null, - "fetchSpec": "3.11.0" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "_spec": "3.11.0", - "_where": "/Users/rubys/git/node/tools/doc", - "author": { - "name": "Vladimir Zapparov", - "email": "dervus.grim@gmail.com" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - }, - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Vitaly Puzrin", - "email": "vitaly@rcdesign.ru", - "url": "https://github.com/puzrin" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "description": "YAML 1.2 parser and serializer", - "devDependencies": { - "ansi": "^0.3.1", - "benchmark": "^2.1.4", - "browserify": "^14.3.0", - "codemirror": "^5.13.4", - "eslint": "^4.1.1", - "istanbul": "^0.4.5", - "mocha": "^3.3.0", - "uglify-js": "^3.0.1" - }, - "files": [ - "index.js", - "lib/", - "bin/", - "dist/" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "license": "MIT", - "name": "js-yaml", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/js-yaml.git" - }, - "scripts": { - "test": "make test" - }, - "version": "3.11.0" -} diff --git a/tools/doc/node_modules/marked/LICENSE b/tools/doc/node_modules/marked/LICENSE deleted file mode 100644 index a7b812ed618f..000000000000 --- a/tools/doc/node_modules/marked/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) - -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. diff --git a/tools/doc/node_modules/marked/Makefile b/tools/doc/node_modules/marked/Makefile deleted file mode 100644 index d9349f07996d..000000000000 --- a/tools/doc/node_modules/marked/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all: - @cp lib/marked.js marked.js - @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js - -clean: - @rm marked.js - @rm marked.min.js - -bench: - @node test --bench - -.PHONY: clean all diff --git a/tools/doc/node_modules/marked/README.md b/tools/doc/node_modules/marked/README.md deleted file mode 100644 index efa71aaaabc8..000000000000 --- a/tools/doc/node_modules/marked/README.md +++ /dev/null @@ -1,406 +0,0 @@ -# marked - -> A full-featured markdown parser and compiler, written in JavaScript. Built -> for speed. - -[![NPM version](https://badge.fury.io/js/marked.png)][badge] - -## Install - -``` bash -npm install marked --save -``` - -## Usage - -Minimal usage: - -```js -var marked = require('marked'); -console.log(marked('I am using __markdown__.')); -// Outputs:

I am using markdown.

-``` - -Example setting options with default values: - -```js -var marked = require('marked'); -marked.setOptions({ - renderer: new marked.Renderer(), - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: true, - smartLists: true, - smartypants: false -}); - -console.log(marked('I am using __markdown__.')); -``` - -### Browser - -```html - - - - - Marked in the browser - - - -
- - - -``` - -## marked(markdownString [,options] [,callback]) - -### markdownString - -Type: `string` - -String of markdown source to be compiled. - -### options - -Type: `object` - -Hash of options. Can also be set using the `marked.setOptions` method as seen -above. - -### callback - -Type: `function` - -Function called when the `markdownString` has been fully parsed when using -async highlighting. If the `options` argument is omitted, this can be used as -the second argument. - -## Options - -### highlight - -Type: `function` - -A function to highlight code blocks. The first example below uses async highlighting with -[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using -[highlight.js][highlight]: - -```js -var marked = require('marked'); - -var markdownString = '```js\n console.log("hello"); \n```'; - -// Async highlighting with pygmentize-bundled -marked.setOptions({ - highlight: function (code, lang, callback) { - require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { - callback(err, result.toString()); - }); - } -}); - -// Using async version of marked -marked(markdownString, function (err, content) { - if (err) throw err; - console.log(content); -}); - -// Synchronous highlighting with highlight.js -marked.setOptions({ - highlight: function (code) { - return require('highlight.js').highlightAuto(code).value; - } -}); - -console.log(marked(markdownString)); -``` - -#### highlight arguments - -`code` - -Type: `string` - -The section of code to pass to the highlighter. - -`lang` - -Type: `string` - -The programming language specified in the code block. - -`callback` - -Type: `function` - -The callback function to call when using an async highlighter. - -### renderer - -Type: `object` -Default: `new Renderer()` - -An object containing functions to render tokens to HTML. - -#### Overriding renderer methods - -The renderer option allows you to render tokens in a custom manner. Here is an -example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: - -```javascript -var marked = require('marked'); -var renderer = new marked.Renderer(); - -renderer.heading = function (text, level) { - var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - - return '' + - text + ''; -}, - -console.log(marked('# heading+', { renderer: renderer })); -``` -This code will output the following HTML: -```html -

- - - - heading+ -

-``` - -#### Block level renderer methods - -- code(*string* code, *string* language) -- blockquote(*string* quote) -- html(*string* html) -- heading(*string* text, *number* level) -- hr() -- list(*string* body, *boolean* ordered) -- listitem(*string* text) -- paragraph(*string* text) -- table(*string* header, *string* body) -- tablerow(*string* content) -- tablecell(*string* content, *object* flags) - -`flags` has the following properties: - -```js -{ - header: true || false, - align: 'center' || 'left' || 'right' -} -``` - -#### Inline level renderer methods - -- strong(*string* text) -- em(*string* text) -- codespan(*string* code) -- br() -- del(*string* text) -- link(*string* href, *string* title, *string* text) -- image(*string* href, *string* title, *string* text) - -### gfm - -Type: `boolean` -Default: `true` - -Enable [GitHub flavored markdown][gfm]. - -### tables - -Type: `boolean` -Default: `true` - -Enable GFM [tables][tables]. -This option requires the `gfm` option to be true. - -### breaks - -Type: `boolean` -Default: `false` - -Enable GFM [line breaks][breaks]. -This option requires the `gfm` option to be true. - -### pedantic - -Type: `boolean` -Default: `false` - -Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of -the original markdown bugs or poor behavior. - -### sanitize - -Type: `boolean` -Default: `false` - -Sanitize the output. Ignore any HTML that has been input. - -### smartLists - -Type: `boolean` -Default: `true` - -Use smarter list behavior than the original markdown. May eventually be -default with the old behavior moved into `pedantic`. - -### smartypants - -Type: `boolean` -Default: `false` - -Use "smart" typograhic punctuation for things like quotes and dashes. - -## Access to lexer and parser - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -## CLI - -``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

hello world

-``` - -## Philosophy behind marked - -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecesarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks above. - -Along with implementing every markdown feature, marked also implements [GFM -features][gfmf]. - -## Benchmarks - -node v0.8.x - -``` bash -$ node test --bench -marked completed in 3411ms. -marked (gfm) completed in 3727ms. -marked (pedantic) completed in 3201ms. -robotskirt completed in 808ms. -showdown (reuse converter) completed in 11954ms. -showdown (new converter) completed in 17774ms. -markdown-js completed in 17191ms. -``` - -__Marked is now faster than Discount, which is written in C.__ - -For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. - -### Pro level - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -``` bash -$ node -> require('marked').lexer('> i am using marked.') -[ { type: 'blockquote_start' }, - { type: 'paragraph', - text: 'i am using marked.' }, - { type: 'blockquote_end' }, - links: {} ] -``` - -## Running Tests & Contributing - -If you want to submit a pull request, make sure your changes pass the test -suite. If you're adding a new feature, be sure to add your own test. - -The marked test suite is set up slightly strangely: `test/new` is for all tests -that are not part of the original markdown.pl test suite (this is where your -test should go if you make one). `test/original` is only for the original -markdown.pl tests. `test/tests` houses both types of tests after they have been -combined and moved/generated by running `node test --fix` or `marked --test ---fix`. - -In other words, if you have a test to add, add it to `test/new/` and then -regenerate the tests with `node test --fix`. Commit the result. If your test -uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you -can add `.nogfm` to the filename. So, `my-test.text` becomes -`my-test.nogfm.text`. You can do this with any marked option. Say you want -line breaks and smartypants enabled, your filename should be: -`my-test.breaks.smartypants.text`. - -To run the tests: - -``` bash -cd marked/ -node test -``` - -### Contribution and License Agreement - -If you contribute code to this project, you are implicitly allowing your code -to be distributed under the MIT license. You are also implicitly verifying that -all code is your original work. `` - -## License - -Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) - -See LICENSE for more info. - -[gfm]: https://help.github.com/articles/github-flavored-markdown -[gfmf]: http://github.github.com/github-flavored-markdown/ -[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled -[highlight]: https://github.com/isagalaev/highlight.js -[badge]: http://badge.fury.io/js/marked -[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables -[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/tools/doc/node_modules/marked/bin/marked b/tools/doc/node_modules/marked/bin/marked deleted file mode 100755 index 64254fc3eb2e..000000000000 --- a/tools/doc/node_modules/marked/bin/marked +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env node - -/** - * Marked CLI - * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) - */ - -var fs = require('fs') - , util = require('util') - , marked = require('../'); - -/** - * Man Page - */ - -function help() { - var spawn = require('child_process').spawn; - - var options = { - cwd: process.cwd(), - env: process.env, - setsid: false, - customFds: [0, 1, 2] - }; - - spawn('man', - [__dirname + '/../man/marked.1'], - options); -} - -/** - * Main - */ - -function main(argv, callback) { - var files = [] - , options = {} - , input - , output - , arg - , tokens - , opt; - - function getarg() { - var arg = argv.shift(); - - if (arg.indexOf('--') === 0) { - // e.g. --opt - arg = arg.split('='); - if (arg.length > 1) { - // e.g. --opt=val - argv.unshift(arg.slice(1).join('=')); - } - arg = arg[0]; - } else if (arg[0] === '-') { - if (arg.length > 2) { - // e.g. -abc - argv = arg.substring(1).split('').map(function(ch) { - return '-' + ch; - }).concat(argv); - arg = argv.shift(); - } else { - // e.g. -a - } - } else { - // e.g. foo - } - - return arg; - } - - while (argv.length) { - arg = getarg(); - switch (arg) { - case '--test': - return require('../test').main(process.argv.slice()); - case '-o': - case '--output': - output = argv.shift(); - break; - case '-i': - case '--input': - input = argv.shift(); - break; - case '-t': - case '--tokens': - tokens = true; - break; - case '-h': - case '--help': - return help(); - default: - if (arg.indexOf('--') === 0) { - opt = camelize(arg.replace(/^--(no-)?/, '')); - if (!marked.defaults.hasOwnProperty(opt)) { - continue; - } - if (arg.indexOf('--no-') === 0) { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? null - : false; - } else { - options[opt] = typeof marked.defaults[opt] !== 'boolean' - ? argv.shift() - : true; - } - } else { - files.push(arg); - } - break; - } - } - - function getData(callback) { - if (!input) { - if (files.length <= 2) { - return getStdin(callback); - } - input = files.pop(); - } - return fs.readFile(input, 'utf8', callback); - } - - return getData(function(err, data) { - if (err) return callback(err); - - data = tokens - ? JSON.stringify(marked.lexer(data, options), null, 2) - : marked(data, options); - - if (!output) { - process.stdout.write(data + '\n'); - return callback(); - } - - return fs.writeFile(output, data, callback); - }); -} - -/** - * Helpers - */ - -function getStdin(callback) { - var stdin = process.stdin - , buff = ''; - - stdin.setEncoding('utf8'); - - stdin.on('data', function(data) { - buff += data; - }); - - stdin.on('error', function(err) { - return callback(err); - }); - - stdin.on('end', function() { - return callback(null, buff); - }); - - try { - stdin.resume(); - } catch (e) { - callback(e); - } -} - -function camelize(text) { - return text.replace(/(\w)-(\w)/g, function(_, a, b) { - return a + b.toUpperCase(); - }); -} - -/** - * Expose / Entry Point - */ - -if (!module.parent) { - process.title = 'marked'; - main(process.argv.slice(), function(err, code) { - if (err) throw err; - return process.exit(code || 0); - }); -} else { - module.exports = main; -} diff --git a/tools/doc/node_modules/marked/index.js b/tools/doc/node_modules/marked/index.js deleted file mode 100644 index a12f90569faa..000000000000 --- a/tools/doc/node_modules/marked/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/marked'); diff --git a/tools/doc/node_modules/marked/lib/marked.js b/tools/doc/node_modules/marked/lib/marked.js deleted file mode 100644 index 32521d993497..000000000000 --- a/tools/doc/node_modules/marked/lib/marked.js +++ /dev/null @@ -1,1286 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ - -;(function() { - -/** - * Block-Level Grammar - */ - -var block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - nptable: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, - def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, - text: /^[^\n]+/ -}; - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); - -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') - ('def', '\\n+(?=' + block.def.source + ')') - (); - -block.blockquote = replace(block.blockquote) - ('def', block.def) - (); - -block._tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; - -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /])*?>/) - (/tag/g, block._tag) - (); - -block.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('blockquote', block.blockquote) - ('tag', '<' + block._tag) - ('def', block.def) - (); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, - paragraph: /^/, - heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ -}); - -block.gfm.paragraph = replace(block.paragraph) - ('(?!', '(?!' - + block.gfm.fences.source.replace('\\1', '\\2') + '|' - + block.list.source.replace('\\1', '\\3') + '|') - (); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ -}); - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = []; - this.tokens.links = {}; - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -Lexer.prototype.lex = function(src) { - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') - .replace(/\u2424/g, '\n'); - - return this.token(src, true); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , bull - , b - , item - , space - , i - , l; - - while (src) { - // newline - if (cap = this.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this.tokens.push({ - type: 'space' - }); - } - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - cap = cap[0].replace(/^ {4}/gm, ''); - this.tokens.push({ - type: 'code', - text: !this.options.pedantic - ? cap.replace(/\n+$/, '') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this.rules.fences.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] || '' - }); - continue; - } - - // heading - if (cap = this.rules.heading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // table no leading pipe (gfm) - if (top && (cap = this.rules.nptable.exec(src))) { - src = src.substring(cap[0].length); - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/\n$/, '').split('\n') - }; - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // lheading - if (cap = this.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // hr - if (cap = this.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top, true); - - this.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = this.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - - this.tokens.push({ - type: 'list_start', - ordered: bull.length > 1 - }); - - // Get each top-level item. - cap = cap[0].match(this.rules.item); - - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) loose = next; - } - - this.tokens.push({ - type: loose - ? 'loose_item_start' - : 'list_item_start' - }); - - // Recurse. - this.token(item, false, bq); - - this.tokens.push({ - type: 'list_item_end' - }); - } - - this.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - if (cap = this.rules.html.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: this.options.sanitize - ? 'paragraph' - : 'html', - pre: !this.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }); - continue; - } - - // def - if ((!bq && top) && (cap = this.rules.def.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.links[cap[1].toLowerCase()] = { - href: cap[2], - title: cap[3] - }; - continue; - } - - // table (gfm) - if (top && (cap = this.rules.table.exec(src))) { - src = src.substring(cap[0].length); - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') - }; - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // top-level paragraph - if (top && (cap = this.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[(inside)\]\(href\)/, - reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, - del: noop, - text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; - -inline.link = replace(inline.link) - ('inside', inline._inside) - ('href', inline._href) - (); - -inline.reflink = replace(inline.reflink) - ('inside', inline._inside) - (); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape)('])', '~|])')(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - (']|', '~]|') - ('|', '|https?://|') - () -}); - -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br)('{2,}', '*')(), - text: replace(inline.gfm.text)('{2,}', '*')() -}); - -/** - * Inline Lexer & Compiler - */ - -function InlineLexer(links, options) { - this.options = options || marked.defaults; - this.links = links; - this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer; - this.renderer.options = this.options; - - if (!this.links) { - throw new - Error('Tokens array requires a `links` property.'); - } - - if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } - } else if (this.options.pedantic) { - this.rules = inline.pedantic; - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var out = '' - , link - , text - , href - , cap; - - while (src) { - // escape - if (cap = this.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += cap[1]; - continue; - } - - // autolink - if (cap = this.rules.autolink.exec(src)) { - src = src.substring(cap[0].length); - if (cap[2] === '@') { - text = cap[1].charAt(6) === ':' - ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]); - href = this.mangle('mailto:') + text; - } else { - text = escape(cap[1]); - href = text; - } - out += this.renderer.link(href, null, text); - continue; - } - - // url (gfm) - if (!this.inLink && (cap = this.rules.url.exec(src))) { - src = src.substring(cap[0].length); - text = escape(cap[1]); - href = text; - out += this.renderer.link(href, null, text); - continue; - } - - // tag - if (cap = this.rules.tag.exec(src)) { - if (!this.inLink && /^/i.test(cap[0])) { - this.inLink = false; - } - src = src.substring(cap[0].length); - out += this.options.sanitize - ? this.options.sanitizer - ? this.options.sanitizer(cap[0]) - : escape(cap[0]) - : cap[0] - continue; - } - - // link - if (cap = this.rules.link.exec(src)) { - src = src.substring(cap[0].length); - this.inLink = true; - out += this.outputLink(cap, { - href: cap[2], - title: cap[3] - }); - this.inLink = false; - continue; - } - - // reflink, nolink - if ((cap = this.rules.reflink.exec(src)) - || (cap = this.rules.nolink.exec(src))) { - src = src.substring(cap[0].length); - link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = this.links[link.toLowerCase()]; - if (!link || !link.href) { - out += cap[0].charAt(0); - src = cap[0].substring(1) + src; - continue; - } - this.inLink = true; - out += this.outputLink(cap, link); - this.inLink = false; - continue; - } - - // strong - if (cap = this.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[2] || cap[1])); - continue; - } - - // em - if (cap = this.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); - continue; - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[2], true)); - continue; - } - - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.del(this.output(cap[1])); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.text(escape(this.smartypants(cap[0]))); - continue; - } - - if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return out; -}; - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = escape(link.href) - , title = link.title ? escape(link.title) : null; - - return cap[0].charAt(0) !== '!' - ? this.renderer.link(href, title, this.output(cap[1])) - : this.renderer.image(href, title, escape(cap[1])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text; - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) return text; - var out = '' - , l = text.length - , i = 0 - , ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || {}; -} - -Renderer.prototype.code = function(code, lang, escaped) { - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - if (!lang) { - return '
'
-      + (escaped ? code : escape(code, true))
-      + '\n
'; - } - - return '
'
-    + (escaped ? code : escape(code, true))
-    + '\n
\n'; -}; - -Renderer.prototype.blockquote = function(quote) { - return '
\n' + quote + '
\n'; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw) { - return '' - + text - + '\n'; -}; - -Renderer.prototype.hr = function() { - return this.options.xhtml ? '
\n' : '
\n'; -}; - -Renderer.prototype.list = function(body, ordered) { - var type = ordered ? 'ol' : 'ul'; - return '<' + type + '>\n' + body + '\n'; -}; - -Renderer.prototype.listitem = function(text) { - return '
  • ' + text + '
  • \n'; -}; - -Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    \n'; -}; - -Renderer.prototype.table = function(header, body) { - return '\n' - + '\n' - + header - + '\n' - + '\n' - + body - + '\n' - + '
    \n'; -}; - -Renderer.prototype.tablerow = function(content) { - return '\n' + content + '\n'; -}; - -Renderer.prototype.tablecell = function(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align - ? '<' + type + ' style="text-align:' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; -}; - -// span level renderer -Renderer.prototype.strong = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.em = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.codespan = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.br = function() { - return this.options.xhtml ? '
    ' : '
    '; -}; - -Renderer.prototype.del = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.link = function(href, title, text) { - if (this.options.sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return ''; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { - return ''; - } - } - var out = '
    '; - return out; -}; - -Renderer.prototype.image = function(href, title, text) { - var out = '' + text + '' : '>'; - return out; -}; - -Renderer.prototype.text = function(text) { - return text; -}; - -/** - * Parsing & Compiling - */ - -function Parser(options) { - this.tokens = []; - this.token = null; - this.options = options || marked.defaults; - this.options.renderer = this.options.renderer || new Renderer; - this.renderer = this.options.renderer; - this.renderer.options = this.options; -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options, renderer) { - var parser = new Parser(options, renderer); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -Parser.prototype.parse = function(src) { - this.inline = new InlineLexer(src.links, this.options, this.renderer); - this.tokens = src.reverse(); - - var out = ''; - while (this.next()) { - out += this.tok(); - } - - return out; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this.next().text; - } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -Parser.prototype.tok = function() { - switch (this.token.type) { - case 'space': { - return ''; - } - case 'hr': { - return this.renderer.hr(); - } - case 'heading': { - return this.renderer.heading( - this.inline.output(this.token.text), - this.token.depth, - this.token.text); - } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); - } - case 'table': { - var header = '' - , body = '' - , i - , row - , cell - , flags - , j; - - // header - cell = ''; - for (i = 0; i < this.token.header.length; i++) { - flags = { header: true, align: this.token.align[i] }; - cell += this.renderer.tablecell( - this.inline.output(this.token.header[i]), - { header: true, align: this.token.align[i] } - ); - } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this.renderer.tablecell( - this.inline.output(row[j]), - { header: false, align: this.token.align[j] } - ); - } - - body += this.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - var body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - var body = '' - , ordered = this.token.ordered; - - while (this.next().type !== 'list_end') { - body += this.tok(); - } - - return this.renderer.list(body, ordered); - } - case 'list_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.token.type === 'text' - ? this.parseText() - : this.tok(); - } - - return this.renderer.listitem(body); - } - case 'loose_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.tok(); - } - - return this.renderer.listitem(body); - } - case 'html': { - var html = !this.token.pre && !this.options.pedantic - ? this.inline.output(this.token.text) - : this.token.text; - return this.renderer.html(html); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); - } - case 'text': { - return this.renderer.paragraph(this.parseText()); - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -function replace(regex, opt) { - regex = regex.source; - opt = opt || ''; - return function self(name, val) { - if (!name) return new RegExp(regex, opt); - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return self; - }; -} - -function noop() {} -noop.exec = noop; - -function merge(obj) { - var i = 1 - , target - , key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - - -/** - * Marked - */ - -function marked(src, opt, callback) { - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight - , tokens - , pending - , i = 0; - - try { - tokens = Lexer.lex(src, opt) - } catch (e) { - return callback(e); - } - - pending = tokens.length; - - var done = function(err) { - if (err) { - opt.highlight = highlight; - return callback(err); - } - - var out; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) return done(); - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); - } - return highlight(token.text, token.lang, function(err, code) { - if (err) return done(err); - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; - } - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occured:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.defaults = { - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - sanitizer: null, - mangle: true, - smartLists: false, - silent: false, - highlight: null, - langPrefix: 'lang-', - smartypants: false, - headerPrefix: '', - renderer: new Renderer, - xhtml: false -}; - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Renderer = Renderer; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -if (typeof module !== 'undefined' && typeof exports === 'object') { - module.exports = marked; -} else if (typeof define === 'function' && define.amd) { - define(function() { return marked; }); -} else { - this.marked = marked; -} - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); diff --git a/tools/doc/node_modules/marked/man/marked.1 b/tools/doc/node_modules/marked/man/marked.1 deleted file mode 100644 index b9bdc8c2123e..000000000000 --- a/tools/doc/node_modules/marked/man/marked.1 +++ /dev/null @@ -1,91 +0,0 @@ -.ds q \N'34' -.TH marked 1 "2014-01-31" "v0.3.1" "marked.js" - -.SH NAME -marked \- a javascript markdown parser - -.SH SYNOPSIS -.B marked -[\-o \fI\fP] [\-i \fI\fP] [\-\-help] -[\-\-tokens] [\-\-pedantic] [\-\-gfm] -[\-\-breaks] [\-\-tables] [\-\-sanitize] -[\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] -[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] - -.SH DESCRIPTION -.B marked -is a full-featured javascript markdown parser, built for speed. It also includes -multiple GFM features. - -.SH EXAMPLES -.TP -cat in.md | marked > out.html -.TP -echo "hello *world*" | marked -.TP -marked \-o out.html in.md \-\-gfm -.TP -marked \-\-output="hello world.html" \-i in.md \-\-no-breaks - -.SH OPTIONS -.TP -.BI \-o,\ \-\-output\ [\fIoutput\fP] -Specify file output. If none is specified, write to stdout. -.TP -.BI \-i,\ \-\-input\ [\fIinput\fP] -Specify file input, otherwise use last argument as input file. If no input file -is specified, read from stdin. -.TP -.BI \-t,\ \-\-tokens -Output a token stream instead of html. -.TP -.BI \-\-pedantic -Conform to obscure parts of markdown.pl as much as possible. Don't fix original -markdown bugs. -.TP -.BI \-\-gfm -Enable github flavored markdown. -.TP -.BI \-\-breaks -Enable GFM line breaks. Only works with the gfm option. -.TP -.BI \-\-tables -Enable GFM tables. Only works with the gfm option. -.TP -.BI \-\-sanitize -Sanitize output. Ignore any HTML input. -.TP -.BI \-\-smart\-lists -Use smarter list behavior than the original markdown. -.TP -.BI \-\-lang\-prefix\ [\fIprefix\fP] -Set the prefix for code block classes. -.TP -.BI \-\-mangle -Mangle email addresses. -.TP -.BI \-\-no\-sanitize,\ \-no-etc... -The inverse of any of the marked options above. -.TP -.BI \-\-silent -Silence error output. -.TP -.BI \-h,\ \-\-help -Display help information. - -.SH CONFIGURATION -For configuring and running programmatically. - -.B Example - - require('marked')('*foo*', { gfm: true }); - -.SH BUGS -Please report any bugs to https://github.com/chjj/marked. - -.SH LICENSE -Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). - -.SH "SEE ALSO" -.BR markdown(1), -.BR node.js(1) diff --git a/tools/doc/node_modules/marked/marked.min.js b/tools/doc/node_modules/marked/marked.min.js deleted file mode 100644 index 555c1dc1d9da..000000000000 --- a/tools/doc/node_modules/marked/marked.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ -(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^
    /i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/tools/doc/node_modules/marked/package.json b/tools/doc/node_modules/marked/package.json deleted file mode 100644 index 81ab0639d2b1..000000000000 --- a/tools/doc/node_modules/marked/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "marked@^0.3.5", - "_id": "marked@0.3.6", - "_inBundle": false, - "_integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=", - "_location": "/marked", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "marked@^0.3.5", - "name": "marked", - "escapedName": "marked", - "rawSpec": "^0.3.5", - "saveSpec": null, - "fetchSpec": "^0.3.5" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", - "_shasum": "b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7", - "_spec": "marked@^0.3.5", - "_where": "/mnt/d/code/node-github-desktop/tools/doc", - "author": { - "name": "Christopher Jeffrey" - }, - "bin": { - "marked": "./bin/marked" - }, - "bugs": { - "url": "http://github.com/chjj/marked/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A markdown parser built for speed", - "devDependencies": { - "gulp": "^3.8.11", - "gulp-concat": "^2.5.2", - "gulp-uglify": "^1.1.0", - "markdown": "*", - "showdown": "*" - }, - "homepage": "https://github.com/chjj/marked", - "keywords": [ - "markdown", - "markup", - "html" - ], - "license": "MIT", - "main": "./lib/marked.js", - "man": [ - "./man/marked.1" - ], - "name": "marked", - "preferGlobal": true, - "repository": { - "type": "git", - "url": "git://github.com/chjj/marked.git" - }, - "scripts": { - "bench": "node test --bench", - "test": "node test" - }, - "tags": [ - "markdown", - "markup", - "html" - ], - "version": "0.3.6" -} diff --git a/tools/doc/node_modules/sprintf-js/LICENSE b/tools/doc/node_modules/sprintf-js/LICENSE deleted file mode 100644 index 663ac52e4d8c..000000000000 --- a/tools/doc/node_modules/sprintf-js/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2007-2014, Alexandru Marasteanu -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of this software nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/doc/node_modules/sprintf-js/README.md b/tools/doc/node_modules/sprintf-js/README.md deleted file mode 100644 index 83863561b291..000000000000 --- a/tools/doc/node_modules/sprintf-js/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# sprintf.js -**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. - -Its prototype is simple: - - string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) - -The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: - -* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. -* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. -* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. -* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. -* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. -* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. -* A type specifier that can be any of: - * `%` — yields a literal `%` character - * `b` — yields an integer as a binary number - * `c` — yields an integer as the character with that ASCII value - * `d` or `i` — yields an integer as a signed decimal number - * `e` — yields a float using scientific notation - * `u` — yields an integer as an unsigned decimal number - * `f` — yields a float as is; see notes on precision above - * `g` — yields a float as is; see notes on precision above - * `o` — yields an integer as an octal number - * `s` — yields a string as is - * `x` — yields an integer as a hexadecimal number (lower-case) - * `X` — yields an integer as a hexadecimal number (upper-case) - * `j` — yields a JavaScript object or array as a JSON encoded string - -## JavaScript `vsprintf` -`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: - - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -## Argument swapping -You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") -And, of course, you can repeat the placeholders without having to increase the number of arguments. - -## Named arguments -Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: - - var user = { - name: "Dolly" - } - sprintf("Hello %(name)s", user) // Hello Dolly -Keywords in replacement fields can be optionally followed by any number of keywords or indexes: - - var users = [ - {name: "Dolly"}, - {name: "Molly"}, - {name: "Polly"} - ] - sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly -Note: mixing positional and named placeholders is not (yet) supported - -## Computed values -You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. - - sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 - sprintf("Current date and time: %s", function() { return new Date().toString() }) - -# AngularJS -You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. - -# Installation - -## Via Bower - - bower install sprintf - -## Or as a node.js module - - npm install sprintf-js - -### Usage - - var sprintf = require("sprintf-js").sprintf, - vsprintf = require("sprintf-js").vsprintf - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -# License - -**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js b/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js deleted file mode 100644 index dbaf744d83c2..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); -//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js.map deleted file mode 100644 index 055964c624c1..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.map b/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.map deleted file mode 100644 index 055964c624c1..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/angular-sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js b/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js deleted file mode 100644 index dc61e51add29..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js.map b/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js.map deleted file mode 100644 index 369dbafab157..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIyB,UAAU,EAAGtB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAI+C,cAG3BvC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWgD,QAAQxC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGyB,OAAO,GAAK,IACzEtB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASyD,GAErB,IADA,GAAIC,GAAOD,EAAK1B,KAAYL,KAAiBiC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC3B,EAAQhB,EAAGK,KAAKwC,KAAKF,IACtBhC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOuC,KAAKF,IAC7BhC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYsC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI9B,EAAM,GAAI,CACV4B,GAAa,CACb,IAAIG,MAAiBC,EAAoBhC,EAAM,GAAIiC,IACnD,IAAuD,QAAlDA,EAAcjD,EAAGnB,IAAIgE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.map b/tools/doc/node_modules/sprintf-js/dist/sprintf.min.map deleted file mode 100644 index ee011aaa5aa5..000000000000 --- a/tools/doc/node_modules/sprintf-js/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKyB,YAAYtB,EAAM,IAAMoB,WAAWvB,EACxE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAI0B,UAAU,EAAGvB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAIgD,cAG3BxC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWiD,QAAQzC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG0B,OAAO,GAAK,IACzEvB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAAS0D,GAErB,IADA,GAAIC,GAAOD,EAAK3B,KAAYL,KAAiBkC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC5B,EAAQhB,EAAGK,KAAKyC,KAAKF,IACtBjC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOwC,KAAKF,IAC7BjC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYuC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI/B,EAAM,GAAI,CACV6B,GAAa,CACb,IAAIG,MAAiBC,EAAoBjC,EAAM,GAAIkC,IACnD,IAAuD,QAAlDA,EAAclD,EAAGnB,IAAIiE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAW1B,QAAU4B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG5B,UACnE,GAA8D,QAAzD4B,EAAclD,EAAGQ,WAAWsC,KAAKG,IAClCD,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/tools/doc/node_modules/sprintf-js/package.json b/tools/doc/node_modules/sprintf-js/package.json deleted file mode 100644 index 3ec22029daac..000000000000 --- a/tools/doc/node_modules/sprintf-js/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_args": [ - [ - "sprintf-js@1.0.3", - "/Users/rubys/git/node/tools/doc" - ] - ], - "_development": true, - "_from": "sprintf-js@1.0.3", - "_id": "sprintf-js@1.0.3", - "_inBundle": false, - "_integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "_location": "/sprintf-js", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "sprintf-js@1.0.3", - "name": "sprintf-js", - "escapedName": "sprintf-js", - "rawSpec": "1.0.3", - "saveSpec": null, - "fetchSpec": "1.0.3" - }, - "_requiredBy": [ - "/argparse" - ], - "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "_spec": "1.0.3", - "_where": "/Users/rubys/git/node/tools/doc", - "author": { - "name": "Alexandru Marasteanu", - "email": "hello@alexei.ro", - "url": "http://alexei.ro/" - }, - "bugs": { - "url": "https://github.com/alexei/sprintf.js/issues" - }, - "description": "JavaScript sprintf implementation", - "devDependencies": { - "grunt": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-watch": "*", - "mocha": "*" - }, - "homepage": "https://github.com/alexei/sprintf.js#readme", - "license": "BSD-3-Clause", - "main": "src/sprintf.js", - "name": "sprintf-js", - "repository": { - "type": "git", - "url": "git+https://github.com/alexei/sprintf.js.git" - }, - "scripts": { - "test": "mocha test/test.js" - }, - "version": "1.0.3" -} diff --git a/tools/doc/node_modules/sprintf-js/src/angular-sprintf.js b/tools/doc/node_modules/sprintf-js/src/angular-sprintf.js deleted file mode 100644 index 9c69123bea29..000000000000 --- a/tools/doc/node_modules/sprintf-js/src/angular-sprintf.js +++ /dev/null @@ -1,18 +0,0 @@ -angular. - module("sprintf", []). - filter("sprintf", function() { - return function() { - return sprintf.apply(null, arguments) - } - }). - filter("fmt", ["$filter", function($filter) { - return $filter("sprintf") - }]). - filter("vsprintf", function() { - return function(format, argv) { - return vsprintf(format, argv) - } - }). - filter("vfmt", ["$filter", function($filter) { - return $filter("vsprintf") - }]) diff --git a/tools/doc/node_modules/sprintf-js/src/sprintf.js b/tools/doc/node_modules/sprintf-js/src/sprintf.js deleted file mode 100644 index c0fc7c08b2e6..000000000000 --- a/tools/doc/node_modules/sprintf-js/src/sprintf.js +++ /dev/null @@ -1,208 +0,0 @@ -(function(window) { - var re = { - not_string: /[^s]/, - number: /[diefg]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[\+\-]/ - } - - function sprintf() { - var key = arguments[0], cache = sprintf.cache - if (!(cache[key] && cache.hasOwnProperty(key))) { - cache[key] = sprintf.parse(key) - } - return sprintf.format.call(null, cache[key], arguments) - } - - sprintf.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]) - if (node_type === "string") { - output[output.length] = parse_tree[i] - } - else if (node_type === "array") { - match = parse_tree[i] // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor] - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) - } - arg = arg[match[2][k]] - } - } - else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - - if (get_type(arg) == "function") { - arg = arg() - } - - if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { - throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) - } - - if (re.number.test(match[8])) { - is_positive = arg >= 0 - } - - switch (match[8]) { - case "b": - arg = arg.toString(2) - break - case "c": - arg = String.fromCharCode(arg) - break - case "d": - case "i": - arg = parseInt(arg, 10) - break - case "j": - arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) - break - case "e": - arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() - break - case "f": - arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) - break - case "g": - arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) - break - case "o": - arg = arg.toString(8) - break - case "s": - arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) - break - case "u": - arg = arg >>> 0 - break - case "x": - arg = arg.toString(16) - break - case "X": - arg = arg.toString(16).toUpperCase() - break - } - if (re.json.test(match[8])) { - output[output.length] = arg - } - else { - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") - } - else { - sign = "" - } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) - } - } - } - return output.join("") - } - - sprintf.cache = {} - - sprintf.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = match[0] - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = "%" - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - } - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") - } - parse_tree[parse_tree.length] = match - } - else { - throw new SyntaxError("[sprintf] unexpected placeholder") - } - _fmt = _fmt.substring(match[0].length) - } - return parse_tree - } - - var vsprintf = function(fmt, argv, _argv) { - _argv = (argv || []).slice(0) - _argv.splice(0, 0, fmt) - return sprintf.apply(null, _argv) - } - - /** - * helpers - */ - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() - } - - function str_repeat(input, multiplier) { - return Array(multiplier + 1).join(input) - } - - /** - * export to either browser or node.js - */ - if (typeof exports !== "undefined") { - exports.sprintf = sprintf - exports.vsprintf = vsprintf - } - else { - window.sprintf = sprintf - window.vsprintf = vsprintf - - if (typeof define === "function" && define.amd) { - define(function() { - return { - sprintf: sprintf, - vsprintf: vsprintf - } - }) - } - } -})(typeof window === "undefined" ? this : window); diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json index c89617c7200b..c688e60c1577 100644 --- a/tools/doc/package-lock.json +++ b/tools/doc/package-lock.json @@ -9,35 +9,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.5.tgz", "integrity": "sha512-6lRwZN0Y3TuglwaaZN2XPocobmzLlhxcqDjKFjNYSsXG/TFAGYkCqkzZh4+ms8iTHHQE6gJXLHPV7TziVGeWhg==" }, - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=" - }, - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==" - }, - "acorn-globals": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", - "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", - "requires": { - "acorn": "^5.0.0" - } - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -47,70 +18,21 @@ "sprintf-js": "~1.0.2" } }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" - }, "bail": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.3.tgz", "integrity": "sha512-1X8CnjFVQ+a+KW36uBNMTU5s8+v5FzeqrP7hTG5aTb4aPreSbZJlhwPon9VKMuEVgV++JM+SQrALY3kr7eswdg==" }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "browser-process-hrtime": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", - "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=" + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "ccount": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz", @@ -136,24 +58,11 @@ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz", "integrity": "sha512-7I/xceXfKyUJmSAn/jw8ve/9DyOP7XxufNYLI9Px7CmsKgEUaZLUTax6nZxGQtaoiZCjpu6cHPj20xC/vqRReQ==" }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, "collapse-white-space": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz", "integrity": "sha512-YfQ1tAUZm561vpYD+5eyWN8+UsceQbSrqqlc/6zDY2gtAE+uZLSdkkovhnGpmCThsvKBFakq4EdY/FF93E8XIw==" }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "comma-separated-tokens": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.5.tgz", @@ -162,47 +71,19 @@ "trim": "0.0.1" } }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cssom": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", - "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=" - }, - "cssstyle": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.3.1.tgz", - "integrity": "sha512-tNvaxM5blOnxanyxI6panOsnfiyLRj3HV4qjqqS45WPNS1usdYWRUQjqTEEELK73lpeP/1KoIGYUwrBn/VcECA==", - "requires": { - "cssom": "0.3.x" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } + "css-selector-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-1.3.0.tgz", + "integrity": "sha1-XxrUPi2O77/cME/NOaUhZklD4+s=" }, - "data-urls": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.0.tgz", - "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { - "abab": "^1.0.4", - "whatwg-mimetype": "^2.0.0", - "whatwg-url": "^6.4.0" + "ms": "2.0.0" } }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, "define-properties": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", @@ -212,11 +93,6 @@ "object-keys": "^1.0.8" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, "detab": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/detab/-/detab-2.0.1.tgz", @@ -225,130 +101,27 @@ "repeat-string": "^1.5.4" } }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, - "requires": { - "jsbn": "~0.1.0" - } - }, - "escodegen": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz", - "integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==", - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" - } - } - }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" - }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "requires": { - "ajv": "^5.1.0", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -406,6 +179,14 @@ "zwitch": "^1.0.0" } }, + "hast-util-sanitize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-1.2.0.tgz", + "integrity": "sha512-VwCTqjt6fbMGacxGB1FKV5sBJaVVkyCGVMDwb4nnqvCW2lkqscA2GEpOyBx4ZWRXty1eAZF58MHBrllEoQEoBg==", + "requires": { + "xtend": "^4.0.1" + } + }, "hast-util-to-html": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-3.1.0.tgz", @@ -453,34 +234,11 @@ "space-separated-tokens": "^1.0.0" } }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, "html-void-elements": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.3.tgz", "integrity": "sha512-SaGhCDPXJVNrQyKMtKy24q6IMdXg5FCPN3z+xizxw9l+oXQw5fOoaj/ERU5KqWhSYhXtW5bWthlDbTDLBhJQrA==" }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" - }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", @@ -528,11 +286,6 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, "is-whitespace-character": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz", @@ -543,11 +296,6 @@ "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.2.tgz", "integrity": "sha512-T3FlsX8rCHAH8e7RE7PfOPZVFQlcV3XRF9eOOBQ1uf70OxO7CjjSOjeImMPCADBdYWcStAbVbYvJ1m2D3tb+EA==" }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "js-yaml": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", @@ -558,112 +306,16 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "jsdom": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.11.0.tgz", - "integrity": "sha512-ou1VyfjwsSuWkudGxb03FotDajxAto6USAlmMZjE2lc0jCznt7sBWkhfRBRaWwbnmDqdMSTKTLT5d9sBFkkM7A==", - "requires": { - "abab": "^1.0.4", - "acorn": "^5.3.0", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": ">= 0.3.1 < 0.4.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.0", - "escodegen": "^1.9.0", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.2.0", - "nwsapi": "^2.0.0", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.83.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.3", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^4.0.0", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" - } - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "kebab-case": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/kebab-case/-/kebab-case-1.0.0.tgz", "integrity": "sha1-P55JkK3K0MaGwOcB92RYaPdfkes=" }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" - }, "lodash.iteratee": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.iteratee/-/lodash.iteratee-4.7.0.tgz", "integrity": "sha1-vkF32yiajMw8CZDx2ya1si/BVUw=" }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" - }, "longest-streak": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-1.0.0.tgz", @@ -687,11 +339,6 @@ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-0.4.0.tgz", "integrity": "sha1-iQwsGzv+g/sA5BKbjkz+ZFJw+dE=" }, - "marked": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", - "integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=" - }, "mdast-util-definitions": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-1.2.2.tgz", @@ -723,29 +370,19 @@ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, - "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", "requires": { - "mime-db": "~1.33.0" + "boolbase": "~1.0.0" } }, - "nwsapi": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.4.tgz", - "integrity": "sha512-Zt6HRR6RcJkuj5/N9zeE7FN6YitRW//hK2wTOwX274IBphbY3Zf5+yn5mZ9v/SzAOTMjQNxZf9KkmPLWn0cV4g==" - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -764,19 +401,6 @@ "wrappy": "1" } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, "parse-entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.2.tgz", @@ -798,41 +422,11 @@ "@types/node": "*" } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" - }, "property-information": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-3.2.0.tgz", "integrity": "sha1-/RSDyPusYYCPX+NZ52k6H0ilgzE=" }, - "psl": { - "version": "1.1.28", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.28.tgz", - "integrity": "sha512-+AqO1Ae+N/4r7Rvchrdm432afjT9hqJRyBN3DQv9At0tPz4hIFSGKbq64fN9dVoCow4oggIIax5/iONx0r9hZw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, "rehype-raw": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-2.0.0.tgz", @@ -896,6 +490,17 @@ } } }, + "remark-html": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/remark-html/-/remark-html-7.0.0.tgz", + "integrity": "sha512-jqRzkZXCkM12gIY2ibMLTW41m7rfanliMTVQCFTezHJFsbH00YaTox/BX4gU+f/zCdzfhFJONtebFByvpMv37w==", + "requires": { + "hast-util-sanitize": "^1.0.0", + "hast-util-to-html": "^3.0.0", + "mdast-util-to-hast": "^3.0.0", + "xtend": "^4.0.1" + } + }, "remark-parse": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz", @@ -951,87 +556,6 @@ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" }, - "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "requires": { - "punycode": "^1.4.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true - }, "space-separated-tokens": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.2.tgz", @@ -1046,32 +570,11 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "state-toggle": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.1.tgz", "integrity": "sha512-Qe8QntFrrpWTnHwvwj2FZTgv+PKIsp0B9VxLzLLbSpPXWOgRgc5LVj/aTiSfK1RqIeF9jeC1UeOH8Q8y60A7og==" }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, "stringify-entities": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.2.tgz", @@ -1083,33 +586,13 @@ "is-hexadecimal": "^1.0.0" } }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=" - }, - "tough-cookie": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.2.tgz", - "integrity": "sha512-vahm+X8lSV/KjXziec8x5Vp0OTC9mq8EVCOApIsRAooeuMPSO8aT7PFACYkaL0yZ/3hVqw+8DzhCJwl8H2Ad6w==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "to-vfile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-5.0.0.tgz", + "integrity": "sha512-sUeBtb4i09pNIzPtl/PMW20Xfe/NK82oV0IehtmoX/+PhIdvc6JHMRnmC4fjCIcy0LOwcNqB8iRMtTBzXHVbng==", "requires": { - "punycode": "^2.1.0" + "is-buffer": "^2.0.0", + "vfile": "^3.0.0" } }, "trim": { @@ -1132,28 +615,6 @@ "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.2.tgz", "integrity": "sha512-FHkoUZvG6Egrv9XZAyYGKEyb1JMsFphgPjoczkZC2y6W93U1jswcVURB8MUvtsahEPEVACyxD47JAL63vF4JsQ==" }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "requires": { - "prelude-ls": "~1.1.2" - } - }, "unherit": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.1.tgz", @@ -1217,6 +678,16 @@ "unist-util-visit": "^1.1.0" } }, + "unist-util-select": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-1.5.0.tgz", + "integrity": "sha1-qTwr6MD2U4J4A7gTMa3sKqJM2TM=", + "requires": { + "css-selector-parser": "^1.1.0", + "debug": "^2.2.0", + "nth-check": "^1.0.1" + } + }, "unist-util-stringify-position": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", @@ -1230,21 +701,6 @@ "unist-util-is": "^2.1.1" } }, - "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vfile": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.0.tgz", @@ -1269,66 +725,16 @@ "unist-util-stringify-position": "^1.1.1" } }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, "web-namespaces": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.2.tgz", "integrity": "sha512-II+n2ms4mPxK+RnIxRPOw3zwF2jRscdJIUE9BfkKHm4FYEg9+biIoTMnaZF5MpemE3T+VhMLrhbyD4ilkPCSbg==" }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" - }, - "whatwg-encoding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", - "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", - "requires": { - "iconv-lite": "0.4.19" - } - }, - "whatwg-mimetype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", - "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==" - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0" - } - }, "x-is-array": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/x-is-array/-/x-is-array-0.1.0.tgz", @@ -1339,11 +745,6 @@ "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=" }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==" - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", diff --git a/tools/doc/package.json b/tools/doc/package.json index 7a8e60f443b3..41ae87889d36 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -7,13 +7,15 @@ "node": ">=6" }, "dependencies": { - "marked": "^0.3.5", "rehype-raw": "^2.0.0", "rehype-stringify": "^3.0.0", + "remark-html": "^7.0.0", "remark-parse": "^5.0.0", "remark-rehype": "^3.0.0", + "to-vfile": "^5.0.0", "unified": "^7.0.0", "unist-util-find": "^1.0.1", + "unist-util-select": "^1.5.0", "unist-util-visit": "^1.3.1" }, "devDependencies": { diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 151235c7277e..42cc27f19c52 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -118,7 +118,9 @@ const customTypesMap = { 'URL': 'url.html#url_the_whatwg_url_api', 'URLSearchParams': 'url.html#url_class_urlsearchparams', - 'MessagePort': 'worker_threads.html#worker_threads_class_messageport' + 'MessagePort': 'worker_threads.html#worker_threads_class_messageport', + + 'zlib options': 'zlib.html#zlib_class_options', }; const arrayPart = /(?:\[])+$/; diff --git a/tools/inspector_protocol/CheckProtocolCompatibility.py b/tools/inspector_protocol/CheckProtocolCompatibility.py new file mode 100755 index 000000000000..c70162a2a44e --- /dev/null +++ b/tools/inspector_protocol/CheckProtocolCompatibility.py @@ -0,0 +1,479 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Inspector protocol validator. +# +# Tests that subsequent protocol changes are not breaking backwards compatibility. +# Following violations are reported: +# +# - Domain has been removed +# - Command has been removed +# - Required command parameter was added or changed from optional +# - Required response parameter was removed or changed to optional +# - Event has been removed +# - Required event parameter was removed or changed to optional +# - Parameter type has changed. +# +# For the parameters with composite types the above checks are also applied +# recursively to every property of the type. +# +# Adding --show_changes to the command line prints out a list of valid public API changes. + +import copy +import os.path +import optparse +import sys + +try: + import json +except ImportError: + import simplejson as json + + +def list_to_map(items, key): + result = {} + for item in items: + if "experimental" not in item and "hidden" not in item: + result[item[key]] = item + return result + + +def named_list_to_map(container, name, key): + if name in container: + return list_to_map(container[name], key) + return {} + + +def removed(reverse): + if reverse: + return "added" + return "removed" + + +def required(reverse): + if reverse: + return "optional" + return "required" + + +def compare_schemas(d_1, d_2, reverse): + errors = [] + domains_1 = copy.deepcopy(d_1) + domains_2 = copy.deepcopy(d_2) + types_1 = normalize_types_in_schema(domains_1) + types_2 = normalize_types_in_schema(domains_2) + + domains_by_name_1 = list_to_map(domains_1, "domain") + domains_by_name_2 = list_to_map(domains_2, "domain") + + for name in domains_by_name_1: + domain_1 = domains_by_name_1[name] + if name not in domains_by_name_2: + errors.append("%s: domain has been %s" % (name, removed(reverse))) + continue + compare_domains(domain_1, domains_by_name_2[name], types_1, types_2, errors, reverse) + return errors + + +def compare_domains(domain_1, domain_2, types_map_1, types_map_2, errors, reverse): + domain_name = domain_1["domain"] + commands_1 = named_list_to_map(domain_1, "commands", "name") + commands_2 = named_list_to_map(domain_2, "commands", "name") + for name in commands_1: + command_1 = commands_1[name] + if name not in commands_2: + errors.append("%s.%s: command has been %s" % (domain_1["domain"], name, removed(reverse))) + continue + compare_commands(domain_name, command_1, commands_2[name], types_map_1, types_map_2, errors, reverse) + + events_1 = named_list_to_map(domain_1, "events", "name") + events_2 = named_list_to_map(domain_2, "events", "name") + for name in events_1: + event_1 = events_1[name] + if name not in events_2: + errors.append("%s.%s: event has been %s" % (domain_1["domain"], name, removed(reverse))) + continue + compare_events(domain_name, event_1, events_2[name], types_map_1, types_map_2, errors, reverse) + + +def compare_commands(domain_name, command_1, command_2, types_map_1, types_map_2, errors, reverse): + context = domain_name + "." + command_1["name"] + + params_1 = named_list_to_map(command_1, "parameters", "name") + params_2 = named_list_to_map(command_2, "parameters", "name") + # Note the reversed order: we allow removing but forbid adding parameters. + compare_params_list(context, "parameter", params_2, params_1, types_map_2, types_map_1, 0, errors, not reverse) + + returns_1 = named_list_to_map(command_1, "returns", "name") + returns_2 = named_list_to_map(command_2, "returns", "name") + compare_params_list(context, "response parameter", returns_1, returns_2, types_map_1, types_map_2, 0, errors, reverse) + + +def compare_events(domain_name, event_1, event_2, types_map_1, types_map_2, errors, reverse): + context = domain_name + "." + event_1["name"] + params_1 = named_list_to_map(event_1, "parameters", "name") + params_2 = named_list_to_map(event_2, "parameters", "name") + compare_params_list(context, "parameter", params_1, params_2, types_map_1, types_map_2, 0, errors, reverse) + + +def compare_params_list(context, kind, params_1, params_2, types_map_1, types_map_2, depth, errors, reverse): + for name in params_1: + param_1 = params_1[name] + if name not in params_2: + if "optional" not in param_1: + errors.append("%s.%s: required %s has been %s" % (context, name, kind, removed(reverse))) + continue + + param_2 = params_2[name] + if param_2 and "optional" in param_2 and "optional" not in param_1: + errors.append("%s.%s: %s %s is now %s" % (context, name, required(reverse), kind, required(not reverse))) + continue + type_1 = extract_type(param_1, types_map_1, errors) + type_2 = extract_type(param_2, types_map_2, errors) + compare_types(context + "." + name, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse) + + +def compare_types(context, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse): + if depth > 5: + return + + base_type_1 = type_1["type"] + base_type_2 = type_2["type"] + + if base_type_1 != base_type_2: + errors.append("%s: %s base type mismatch, '%s' vs '%s'" % (context, kind, base_type_1, base_type_2)) + elif base_type_1 == "object": + params_1 = named_list_to_map(type_1, "properties", "name") + params_2 = named_list_to_map(type_2, "properties", "name") + # If both parameters have the same named type use it in the context. + if "id" in type_1 and "id" in type_2 and type_1["id"] == type_2["id"]: + type_name = type_1["id"] + else: + type_name = "" + context += " %s->%s" % (kind, type_name) + compare_params_list(context, "property", params_1, params_2, types_map_1, types_map_2, depth + 1, errors, reverse) + elif base_type_1 == "array": + item_type_1 = extract_type(type_1["items"], types_map_1, errors) + item_type_2 = extract_type(type_2["items"], types_map_2, errors) + compare_types(context, kind, item_type_1, item_type_2, types_map_1, types_map_2, depth + 1, errors, reverse) + + +def extract_type(typed_object, types_map, errors): + if "type" in typed_object: + result = {"id": "", "type": typed_object["type"]} + if typed_object["type"] == "object": + result["properties"] = [] + elif typed_object["type"] == "array": + result["items"] = typed_object["items"] + return result + elif "$ref" in typed_object: + ref = typed_object["$ref"] + if ref not in types_map: + errors.append("Can not resolve type: %s" % ref) + types_map[ref] = {"id": "", "type": "object"} + return types_map[ref] + + +def normalize_types_in_schema(domains): + types = {} + for domain in domains: + domain_name = domain["domain"] + normalize_types(domain, domain_name, types) + return types + + +def normalize_types(obj, domain_name, types): + if isinstance(obj, list): + for item in obj: + normalize_types(item, domain_name, types) + elif isinstance(obj, dict): + for key, value in obj.items(): + if key == "$ref" and value.find(".") == -1: + obj[key] = "%s.%s" % (domain_name, value) + elif key == "id": + obj[key] = "%s.%s" % (domain_name, value) + types[obj[key]] = obj + else: + normalize_types(value, domain_name, types) + + +def load_schema(file_name, domains): + # pylint: disable=W0613 + if not os.path.isfile(file_name): + return + input_file = open(file_name, "r") + json_string = input_file.read() + parsed_json = json.loads(json_string) + domains += parsed_json["domains"] + return parsed_json["version"] + + +def self_test(): + def create_test_schema_1(): + return [ + { + "domain": "Network", + "types": [ + { + "id": "LoaderId", + "type": "string" + }, + { + "id": "Headers", + "type": "object" + }, + { + "id": "Request", + "type": "object", + "properties": [ + {"name": "url", "type": "string"}, + {"name": "method", "type": "string"}, + {"name": "headers", "$ref": "Headers"}, + {"name": "becameOptionalField", "type": "string"}, + {"name": "removedField", "type": "string"}, + ] + } + ], + "commands": [ + { + "name": "removedCommand", + }, + { + "name": "setExtraHTTPHeaders", + "parameters": [ + {"name": "headers", "$ref": "Headers"}, + {"name": "mismatched", "type": "string"}, + {"name": "becameOptional", "$ref": "Headers"}, + {"name": "removedRequired", "$ref": "Headers"}, + {"name": "becameRequired", "$ref": "Headers", "optional": True}, + {"name": "removedOptional", "$ref": "Headers", "optional": True}, + ], + "returns": [ + {"name": "mimeType", "type": "string"}, + {"name": "becameOptional", "type": "string"}, + {"name": "removedRequired", "type": "string"}, + {"name": "becameRequired", "type": "string", "optional": True}, + {"name": "removedOptional", "type": "string", "optional": True}, + ] + } + ], + "events": [ + { + "name": "requestWillBeSent", + "parameters": [ + {"name": "frameId", "type": "string", "experimental": True}, + {"name": "request", "$ref": "Request"}, + {"name": "becameOptional", "type": "string"}, + {"name": "removedRequired", "type": "string"}, + {"name": "becameRequired", "type": "string", "optional": True}, + {"name": "removedOptional", "type": "string", "optional": True}, + ] + }, + { + "name": "removedEvent", + "parameters": [ + {"name": "errorText", "type": "string"}, + {"name": "canceled", "type": "boolean", "optional": True} + ] + } + ] + }, + { + "domain": "removedDomain" + } + ] + + def create_test_schema_2(): + return [ + { + "domain": "Network", + "types": [ + { + "id": "LoaderId", + "type": "string" + }, + { + "id": "Request", + "type": "object", + "properties": [ + {"name": "url", "type": "string"}, + {"name": "method", "type": "string"}, + {"name": "headers", "type": "object"}, + {"name": "becameOptionalField", "type": "string", "optional": True}, + ] + } + ], + "commands": [ + { + "name": "addedCommand", + }, + { + "name": "setExtraHTTPHeaders", + "parameters": [ + {"name": "headers", "type": "object"}, + {"name": "mismatched", "type": "object"}, + {"name": "becameOptional", "type": "object", "optional": True}, + {"name": "addedRequired", "type": "object"}, + {"name": "becameRequired", "type": "object"}, + {"name": "addedOptional", "type": "object", "optional": True}, + ], + "returns": [ + {"name": "mimeType", "type": "string"}, + {"name": "becameOptional", "type": "string", "optional": True}, + {"name": "addedRequired", "type": "string"}, + {"name": "becameRequired", "type": "string"}, + {"name": "addedOptional", "type": "string", "optional": True}, + ] + } + ], + "events": [ + { + "name": "requestWillBeSent", + "parameters": [ + {"name": "request", "$ref": "Request"}, + {"name": "becameOptional", "type": "string", "optional": True}, + {"name": "addedRequired", "type": "string"}, + {"name": "becameRequired", "type": "string"}, + {"name": "addedOptional", "type": "string", "optional": True}, + ] + }, + { + "name": "addedEvent" + } + ] + }, + { + "domain": "addedDomain" + } + ] + + expected_errors = [ + "removedDomain: domain has been removed", + "Network.removedCommand: command has been removed", + "Network.removedEvent: event has been removed", + "Network.setExtraHTTPHeaders.mismatched: parameter base type mismatch, 'object' vs 'string'", + "Network.setExtraHTTPHeaders.addedRequired: required parameter has been added", + "Network.setExtraHTTPHeaders.becameRequired: optional parameter is now required", + "Network.setExtraHTTPHeaders.removedRequired: required response parameter has been removed", + "Network.setExtraHTTPHeaders.becameOptional: required response parameter is now optional", + "Network.requestWillBeSent.removedRequired: required parameter has been removed", + "Network.requestWillBeSent.becameOptional: required parameter is now optional", + "Network.requestWillBeSent.request parameter->Network.Request.removedField: required property has been removed", + "Network.requestWillBeSent.request parameter->Network.Request.becameOptionalField: required property is now optional", + ] + + expected_errors_reverse = [ + "addedDomain: domain has been added", + "Network.addedEvent: event has been added", + "Network.addedCommand: command has been added", + "Network.setExtraHTTPHeaders.mismatched: parameter base type mismatch, 'string' vs 'object'", + "Network.setExtraHTTPHeaders.removedRequired: required parameter has been removed", + "Network.setExtraHTTPHeaders.becameOptional: required parameter is now optional", + "Network.setExtraHTTPHeaders.addedRequired: required response parameter has been added", + "Network.setExtraHTTPHeaders.becameRequired: optional response parameter is now required", + "Network.requestWillBeSent.becameRequired: optional parameter is now required", + "Network.requestWillBeSent.addedRequired: required parameter has been added", + ] + + def is_subset(subset, superset, message): + for i in range(len(subset)): + if subset[i] not in superset: + sys.stderr.write("%s error: %s\n" % (message, subset[i])) + return False + return True + + def errors_match(expected, actual): + return (is_subset(actual, expected, "Unexpected") and + is_subset(expected, actual, "Missing")) + + return (errors_match(expected_errors, + compare_schemas(create_test_schema_1(), create_test_schema_2(), False)) and + errors_match(expected_errors_reverse, + compare_schemas(create_test_schema_2(), create_test_schema_1(), True))) + + +def load_domains_and_baselines(file_name, domains, baseline_domains): + version = load_schema(os.path.normpath(file_name), domains) + suffix = "-%s.%s.json" % (version["major"], version["minor"]) + baseline_file = file_name.replace(".json", suffix) + load_schema(os.path.normpath(baseline_file), baseline_domains) + return version + + +def main(): + if not self_test(): + sys.stderr.write("Self-test failed") + return 1 + + cmdline_parser = optparse.OptionParser() + cmdline_parser.add_option("--show_changes") + cmdline_parser.add_option("--expected_errors") + cmdline_parser.add_option("--stamp") + arg_options, arg_values = cmdline_parser.parse_args() + + if len(arg_values) < 1: + sys.stderr.write("Usage: %s [--show_changes] [, ...]\n" % sys.argv[0]) + return 1 + + domains = [] + baseline_domains = [] + version = load_domains_and_baselines(arg_values[0], domains, baseline_domains) + for dependency in arg_values[1:]: + load_domains_and_baselines(dependency, domains, baseline_domains) + + expected_errors = [] + if arg_options.expected_errors: + expected_errors_file = open(arg_options.expected_errors, "r") + expected_errors = json.loads(expected_errors_file.read())["errors"] + expected_errors_file.close() + + errors = compare_schemas(baseline_domains, domains, False) + unexpected_errors = [] + for i in range(len(errors)): + if errors[i] not in expected_errors: + unexpected_errors.append(errors[i]) + if len(unexpected_errors) > 0: + sys.stderr.write(" Compatibility checks FAILED\n") + for error in unexpected_errors: + sys.stderr.write(" %s\n" % error) + return 1 + + if arg_options.show_changes: + changes = compare_schemas(domains, baseline_domains, True) + if len(changes) > 0: + print " Public changes since %s:" % version + for change in changes: + print " %s" % change + + if arg_options.stamp: + with open(arg_options.stamp, 'a') as _: + pass + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/inspector_protocol/CodeGenerator.py b/tools/inspector_protocol/CodeGenerator.py new file mode 100644 index 000000000000..e630b0298571 --- /dev/null +++ b/tools/inspector_protocol/CodeGenerator.py @@ -0,0 +1,654 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os.path +import sys +import optparse +import collections +import functools +import re +import copy +try: + import json +except ImportError: + import simplejson as json + +# Path handling for libraries and templates +# Paths have to be normalized because Jinja uses the exact template path to +# determine the hash used in the cache filename, and we need a pre-caching step +# to be concurrency-safe. Use absolute path because __file__ is absolute if +# module is imported, and relative if executed directly. +# If paths differ between pre-caching and individual file compilation, the cache +# is regenerated, which causes a race condition and breaks concurrent build, +# since some compile processes will try to read the partially written cache. +module_path, module_filename = os.path.split(os.path.realpath(__file__)) + +def read_config(): + # pylint: disable=W0703 + def json_to_object(data, output_base, config_base): + def json_object_hook(object_dict): + items = [(k, os.path.join(config_base, v) if k == "path" else v) for (k, v) in object_dict.items()] + items = [(k, os.path.join(output_base, v) if k == "output" else v) for (k, v) in items] + keys, values = zip(*items) + return collections.namedtuple('X', keys)(*values) + return json.loads(data, object_hook=json_object_hook) + + def init_defaults(config_tuple, path, defaults): + keys = list(config_tuple._fields) # pylint: disable=E1101 + values = [getattr(config_tuple, k) for k in keys] + for i in xrange(len(keys)): + if hasattr(values[i], "_fields"): + values[i] = init_defaults(values[i], path + "." + keys[i], defaults) + for optional in defaults: + if optional.find(path + ".") != 0: + continue + optional_key = optional[len(path) + 1:] + if optional_key.find(".") == -1 and optional_key not in keys: + keys.append(optional_key) + values.append(defaults[optional]) + return collections.namedtuple('X', keys)(*values) + + try: + cmdline_parser = optparse.OptionParser() + cmdline_parser.add_option("--output_base") + cmdline_parser.add_option("--jinja_dir") + cmdline_parser.add_option("--config") + cmdline_parser.add_option("--config_value", action="append", type="string") + arg_options, _ = cmdline_parser.parse_args() + jinja_dir = arg_options.jinja_dir + if not jinja_dir: + raise Exception("jinja directory must be specified") + jinja_dir = jinja_dir.decode('utf8') + output_base = arg_options.output_base + if not output_base: + raise Exception("Base output directory must be specified") + output_base = output_base.decode('utf8') + config_file = arg_options.config + if not config_file: + raise Exception("Config file name must be specified") + config_file = config_file.decode('utf8') + config_base = os.path.dirname(config_file) + config_values = arg_options.config_value + if not config_values: + config_values = [] + except Exception: + # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html + exc = sys.exc_info()[1] + sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc) + exit(1) + + try: + config_json_file = open(config_file, "r") + config_json_string = config_json_file.read() + config_partial = json_to_object(config_json_string, output_base, config_base) + config_json_file.close() + defaults = { + ".use_snake_file_names": False, + ".use_title_case_methods": False, + ".imported": False, + ".imported.export_macro": "", + ".imported.export_header": False, + ".imported.header": False, + ".imported.package": False, + ".imported.options": False, + ".protocol.export_macro": "", + ".protocol.export_header": False, + ".protocol.options": False, + ".exported": False, + ".exported.export_macro": "", + ".exported.export_header": False, + ".lib": False, + ".lib.export_macro": "", + ".lib.export_header": False, + } + for key_value in config_values: + parts = key_value.split("=") + if len(parts) == 2: + defaults["." + parts[0]] = parts[1] + return (jinja_dir, config_file, init_defaults(config_partial, "", defaults)) + except Exception: + # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html + exc = sys.exc_info()[1] + sys.stderr.write("Failed to parse config file: %s\n\n" % exc) + exit(1) + + +# ---- Begin of utilities exposed to generator ---- + + +def to_title_case(name): + return name[:1].upper() + name[1:] + + +def dash_to_camelcase(word): + prefix = "" + if word[0] == "-": + prefix = "Negative" + word = word[1:] + return prefix + "".join(to_title_case(x) or "-" for x in word.split("-")) + + +def to_snake_case(name): + return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", name, sys.maxint).lower() + + +def to_method_case(config, name): + if config.use_title_case_methods: + return to_title_case(name) + return name + + +def join_arrays(dict, keys): + result = [] + for key in keys: + if key in dict: + result += dict[key] + return result + + +def format_include(config, header, file_name=None): + if file_name is not None: + header = header + "/" + file_name + ".h" + header = "\"" + header + "\"" if header[0] not in "<\"" else header + if config.use_snake_file_names: + header = to_snake_case(header) + return header + + +def to_file_name(config, file_name): + if config.use_snake_file_names: + return to_snake_case(file_name).replace(".cpp", ".cc") + return file_name + + +# ---- End of utilities exposed to generator ---- + + +def initialize_jinja_env(jinja_dir, cache_dir, config): + # pylint: disable=F0401 + sys.path.insert(1, os.path.abspath(jinja_dir)) + import jinja2 + + jinja_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(module_path), + # Bytecode cache is not concurrency-safe unless pre-cached: + # if pre-cached this is read-only, but writing creates a race condition. + bytecode_cache=jinja2.FileSystemBytecodeCache(cache_dir), + keep_trailing_newline=True, # newline-terminate generated files + lstrip_blocks=True, # so can indent control flow tags + trim_blocks=True) + jinja_env.filters.update({"to_title_case": to_title_case, "dash_to_camelcase": dash_to_camelcase, "to_method_case": functools.partial(to_method_case, config)}) + jinja_env.add_extension("jinja2.ext.loopcontrols") + return jinja_env + + +def create_imported_type_definition(domain_name, type, imported_namespace): + # pylint: disable=W0622 + return { + "return_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]), + "pass_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]), + "to_raw_type": "%s.get()", + "to_pass_type": "std::move(%s)", + "to_rvalue": "std::move(%s)", + "type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]), + "raw_type": "%s::%s::API::%s" % (imported_namespace, domain_name, type["id"]), + "raw_pass_type": "%s::%s::API::%s*" % (imported_namespace, domain_name, type["id"]), + "raw_return_type": "%s::%s::API::%s*" % (imported_namespace, domain_name, type["id"]), + } + + +def create_user_type_definition(domain_name, type): + # pylint: disable=W0622 + return { + "return_type": "std::unique_ptr" % (domain_name, type["id"]), + "pass_type": "std::unique_ptr" % (domain_name, type["id"]), + "to_raw_type": "%s.get()", + "to_pass_type": "std::move(%s)", + "to_rvalue": "std::move(%s)", + "type": "std::unique_ptr" % (domain_name, type["id"]), + "raw_type": "protocol::%s::%s" % (domain_name, type["id"]), + "raw_pass_type": "protocol::%s::%s*" % (domain_name, type["id"]), + "raw_return_type": "protocol::%s::%s*" % (domain_name, type["id"]), + } + + +def create_object_type_definition(): + # pylint: disable=W0622 + return { + "return_type": "std::unique_ptr", + "pass_type": "std::unique_ptr", + "to_raw_type": "%s.get()", + "to_pass_type": "std::move(%s)", + "to_rvalue": "std::move(%s)", + "type": "std::unique_ptr", + "raw_type": "protocol::DictionaryValue", + "raw_pass_type": "protocol::DictionaryValue*", + "raw_return_type": "protocol::DictionaryValue*", + } + + +def create_any_type_definition(): + # pylint: disable=W0622 + return { + "return_type": "std::unique_ptr", + "pass_type": "std::unique_ptr", + "to_raw_type": "%s.get()", + "to_pass_type": "std::move(%s)", + "to_rvalue": "std::move(%s)", + "type": "std::unique_ptr", + "raw_type": "protocol::Value", + "raw_pass_type": "protocol::Value*", + "raw_return_type": "protocol::Value*", + } + + +def create_string_type_definition(): + # pylint: disable=W0622 + return { + "return_type": "String", + "pass_type": "const String&", + "to_pass_type": "%s", + "to_raw_type": "%s", + "to_rvalue": "%s", + "type": "String", + "raw_type": "String", + "raw_pass_type": "const String&", + "raw_return_type": "String", + } + + +def create_primitive_type_definition(type): + # pylint: disable=W0622 + typedefs = { + "number": "double", + "integer": "int", + "boolean": "bool" + } + defaults = { + "number": "0", + "integer": "0", + "boolean": "false" + } + jsontypes = { + "number": "TypeDouble", + "integer": "TypeInteger", + "boolean": "TypeBoolean", + } + return { + "return_type": typedefs[type], + "pass_type": typedefs[type], + "to_pass_type": "%s", + "to_raw_type": "%s", + "to_rvalue": "%s", + "type": typedefs[type], + "raw_type": typedefs[type], + "raw_pass_type": typedefs[type], + "raw_return_type": typedefs[type], + "default_value": defaults[type] + } + + +def wrap_array_definition(type): + # pylint: disable=W0622 + return { + "return_type": "std::unique_ptr>" % type["raw_type"], + "pass_type": "std::unique_ptr>" % type["raw_type"], + "to_raw_type": "%s.get()", + "to_pass_type": "std::move(%s)", + "to_rvalue": "std::move(%s)", + "type": "std::unique_ptr>" % type["raw_type"], + "raw_type": "protocol::Array<%s>" % type["raw_type"], + "raw_pass_type": "protocol::Array<%s>*" % type["raw_type"], + "raw_return_type": "protocol::Array<%s>*" % type["raw_type"], + "out_type": "protocol::Array<%s>&" % type["raw_type"], + } + + +class Protocol(object): + def __init__(self, config): + self.config = config + self.json_api = {"domains": []} + self.imported_domains = [] + self.exported_domains = [] + self.generate_domains = self.read_protocol_file(config.protocol.path) + + if config.protocol.options: + self.generate_domains = [rule.domain for rule in config.protocol.options] + self.exported_domains = [rule.domain for rule in config.protocol.options if hasattr(rule, "exported")] + + if config.imported: + self.imported_domains = self.read_protocol_file(config.imported.path) + if config.imported.options: + self.imported_domains = [rule.domain for rule in config.imported.options] + + self.patch_full_qualified_refs() + self.create_notification_types() + self.create_type_definitions() + self.generate_used_types() + + + def read_protocol_file(self, file_name): + input_file = open(file_name, "r") + json_string = input_file.read() + input_file.close() + parsed_json = json.loads(json_string) + version = parsed_json["version"]["major"] + "." + parsed_json["version"]["minor"] + domains = [] + for domain in parsed_json["domains"]: + domains.append(domain["domain"]) + domain["version"] = version + self.json_api["domains"] += parsed_json["domains"] + return domains + + + def patch_full_qualified_refs(self): + def patch_full_qualified_refs_in_domain(json, domain_name): + if isinstance(json, list): + for item in json: + patch_full_qualified_refs_in_domain(item, domain_name) + if not isinstance(json, dict): + return + for key in json: + if key == "type" and json[key] == "string": + json[key] = domain_name + ".string" + if key != "$ref": + patch_full_qualified_refs_in_domain(json[key], domain_name) + continue + if json["$ref"].find(".") == -1: + json["$ref"] = domain_name + "." + json["$ref"] + return + + for domain in self.json_api["domains"]: + patch_full_qualified_refs_in_domain(domain, domain["domain"]) + + + def all_references(self, json): + refs = set() + if isinstance(json, list): + for item in json: + refs |= self.all_references(item) + if not isinstance(json, dict): + return refs + for key in json: + if key != "$ref": + refs |= self.all_references(json[key]) + else: + refs.add(json["$ref"]) + return refs + + def generate_used_types(self): + all_refs = set() + for domain in self.json_api["domains"]: + domain_name = domain["domain"] + if "commands" in domain: + for command in domain["commands"]: + if self.generate_command(domain_name, command["name"]): + all_refs |= self.all_references(command) + if "events" in domain: + for event in domain["events"]: + if self.generate_event(domain_name, event["name"]): + all_refs |= self.all_references(event) + all_refs.add(domain_name + "." + to_title_case(event["name"]) + "Notification") + + dependencies = self.generate_type_dependencies() + queue = set(all_refs) + while len(queue): + ref = queue.pop() + if ref in dependencies: + queue |= dependencies[ref] - all_refs + all_refs |= dependencies[ref] + self.used_types = all_refs + + + def generate_type_dependencies(self): + dependencies = dict() + domains_with_types = (x for x in self.json_api["domains"] if "types" in x) + for domain in domains_with_types: + domain_name = domain["domain"] + for type in domain["types"]: + related_types = self.all_references(type) + if len(related_types): + dependencies[domain_name + "." + type["id"]] = related_types + return dependencies + + + def create_notification_types(self): + for domain in self.json_api["domains"]: + if "events" in domain: + for event in domain["events"]: + event_type = dict() + event_type["description"] = "Wrapper for notification params" + event_type["type"] = "object" + event_type["id"] = to_title_case(event["name"]) + "Notification" + if "parameters" in event: + event_type["properties"] = copy.deepcopy(event["parameters"]) + if "types" not in domain: + domain["types"] = list() + domain["types"].append(event_type) + + + def create_type_definitions(self): + imported_namespace = "::".join(self.config.imported.namespace) if self.config.imported else "" + self.type_definitions = {} + self.type_definitions["number"] = create_primitive_type_definition("number") + self.type_definitions["integer"] = create_primitive_type_definition("integer") + self.type_definitions["boolean"] = create_primitive_type_definition("boolean") + self.type_definitions["object"] = create_object_type_definition() + self.type_definitions["any"] = create_any_type_definition() + for domain in self.json_api["domains"]: + self.type_definitions[domain["domain"] + ".string"] = create_string_type_definition() + if not ("types" in domain): + continue + for type in domain["types"]: + type_name = domain["domain"] + "." + type["id"] + if type["type"] == "object" and domain["domain"] in self.imported_domains: + self.type_definitions[type_name] = create_imported_type_definition(domain["domain"], type, imported_namespace) + elif type["type"] == "object": + self.type_definitions[type_name] = create_user_type_definition(domain["domain"], type) + elif type["type"] == "array": + items_type = type["items"]["type"] + self.type_definitions[type_name] = wrap_array_definition(self.type_definitions[items_type]) + elif type["type"] == domain["domain"] + ".string": + self.type_definitions[type_name] = create_string_type_definition() + else: + self.type_definitions[type_name] = create_primitive_type_definition(type["type"]) + + + def check_options(self, options, domain, name, include_attr, exclude_attr, default): + for rule in options: + if rule.domain != domain: + continue + if include_attr and hasattr(rule, include_attr): + return name in getattr(rule, include_attr) + if exclude_attr and hasattr(rule, exclude_attr): + return name not in getattr(rule, exclude_attr) + return default + return False + + + # ---- Begin of methods exposed to generator + + + def type_definition(self, name): + return self.type_definitions[name] + + + def resolve_type(self, prop): + if "$ref" in prop: + return self.type_definitions[prop["$ref"]] + if prop["type"] == "array": + return wrap_array_definition(self.resolve_type(prop["items"])) + return self.type_definitions[prop["type"]] + + + def generate_command(self, domain, command): + if not self.config.protocol.options: + return domain in self.generate_domains + return self.check_options(self.config.protocol.options, domain, command, "include", "exclude", True) + + + def generate_event(self, domain, event): + if not self.config.protocol.options: + return domain in self.generate_domains + return self.check_options(self.config.protocol.options, domain, event, "include_events", "exclude_events", True) + + + def generate_type(self, domain, typename): + return domain + "." + typename in self.used_types + + + def is_async_command(self, domain, command): + if not self.config.protocol.options: + return False + return self.check_options(self.config.protocol.options, domain, command, "async", None, False) + + + def is_exported(self, domain, name): + if not self.config.protocol.options: + return False + return self.check_options(self.config.protocol.options, domain, name, "exported", None, False) + + + def is_imported(self, domain, name): + if not self.config.imported: + return False + if not self.config.imported.options: + return domain in self.imported_domains + return self.check_options(self.config.imported.options, domain, name, "imported", None, False) + + + def is_exported_domain(self, domain): + return domain in self.exported_domains + + + def generate_disable(self, domain): + if "commands" not in domain: + return True + for command in domain["commands"]: + if command["name"] == "disable" and self.generate_command(domain["domain"], "disable"): + return False + return True + + + def is_imported_dependency(self, domain): + return domain in self.generate_domains or domain in self.imported_domains + + +def main(): + jinja_dir, config_file, config = read_config() + + protocol = Protocol(config) + + if not config.exported and len(protocol.exported_domains): + sys.stderr.write("Domains [%s] are exported, but config is missing export entry\n\n" % ", ".join(protocol.exported_domains)) + exit(1) + + if not os.path.exists(config.protocol.output): + os.mkdir(config.protocol.output) + if len(protocol.exported_domains) and not os.path.exists(config.exported.output): + os.mkdir(config.exported.output) + jinja_env = initialize_jinja_env(jinja_dir, config.protocol.output, config) + + inputs = [] + inputs.append(__file__) + inputs.append(config_file) + inputs.append(config.protocol.path) + if config.imported: + inputs.append(config.imported.path) + templates_dir = os.path.join(module_path, "templates") + inputs.append(os.path.join(templates_dir, "TypeBuilder_h.template")) + inputs.append(os.path.join(templates_dir, "TypeBuilder_cpp.template")) + inputs.append(os.path.join(templates_dir, "Exported_h.template")) + inputs.append(os.path.join(templates_dir, "Imported_h.template")) + + h_template = jinja_env.get_template("templates/TypeBuilder_h.template") + cpp_template = jinja_env.get_template("templates/TypeBuilder_cpp.template") + exported_template = jinja_env.get_template("templates/Exported_h.template") + imported_template = jinja_env.get_template("templates/Imported_h.template") + + outputs = dict() + + for domain in protocol.json_api["domains"]: + class_name = domain["domain"] + template_context = { + "protocol": protocol, + "config": config, + "domain": domain, + "join_arrays": join_arrays, + "format_include": functools.partial(format_include, config), + } + + if domain["domain"] in protocol.generate_domains: + outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".h"))] = h_template.render(template_context) + outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".cpp"))] = cpp_template.render(template_context) + if domain["domain"] in protocol.exported_domains: + outputs[os.path.join(config.exported.output, to_file_name(config, class_name + ".h"))] = exported_template.render(template_context) + if domain["domain"] in protocol.imported_domains: + outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".h"))] = imported_template.render(template_context) + + if config.lib: + template_context = { + "config": config, + "format_include": functools.partial(format_include, config), + } + + lib_templates_dir = os.path.join(module_path, "lib") + # Note these should be sorted in the right order. + # TODO(dgozman): sort them programmatically based on commented includes. + lib_h_templates = [ + "Collections_h.template", + "ErrorSupport_h.template", + "Values_h.template", + "Object_h.template", + "ValueConversions_h.template", + "Maybe_h.template", + "Array_h.template", + "DispatcherBase_h.template", + "Parser_h.template", + ] + + lib_cpp_templates = [ + "Protocol_cpp.template", + "ErrorSupport_cpp.template", + "Values_cpp.template", + "Object_cpp.template", + "DispatcherBase_cpp.template", + "Parser_cpp.template", + ] + + forward_h_templates = [ + "Forward_h.template", + "Allocator_h.template", + "FrontendChannel_h.template", + ] + + def generate_lib_file(file_name, template_files): + parts = [] + for template_file in template_files: + inputs.append(os.path.join(lib_templates_dir, template_file)) + template = jinja_env.get_template("lib/" + template_file) + parts.append(template.render(template_context)) + outputs[file_name] = "\n\n".join(parts) + + generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Forward.h")), forward_h_templates) + generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Protocol.h")), lib_h_templates) + generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Protocol.cpp")), lib_cpp_templates) + + # Make gyp / make generatos happy, otherwise make rebuilds world. + inputs_ts = max(map(os.path.getmtime, inputs)) + up_to_date = True + for output_file in outputs.iterkeys(): + if not os.path.exists(output_file) or os.path.getmtime(output_file) < inputs_ts: + up_to_date = False + break + if up_to_date: + sys.exit() + + for file_name, content in outputs.iteritems(): + out_file = open(file_name, "w") + out_file.write(content) + out_file.close() + + +main() diff --git a/tools/inspector_protocol/ConcatenateProtocols.py b/tools/inspector_protocol/ConcatenateProtocols.py new file mode 100755 index 000000000000..a7cbc992c76e --- /dev/null +++ b/tools/inspector_protocol/ConcatenateProtocols.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os.path +import sys + +try: + import json +except ImportError: + import simplejson as json + + +def main(argv): + if len(argv) < 1: + sys.stderr.write("Usage: %s [ [, ...]] \n" % sys.argv[0]) + return 1 + + domains = [] + version = None + for protocol in argv[:-1]: + file_name = os.path.normpath(protocol) + if not os.path.isfile(file_name): + sys.stderr.write("Cannot find %s\n" % file_name) + return 1 + input_file = open(file_name, "r") + json_string = input_file.read() + parsed_json = json.loads(json_string) + domains += parsed_json["domains"] + version = parsed_json["version"] + + output_file = open(argv[-1], "w") + json.dump({"version": version, "domains": domains}, output_file, indent=4, sort_keys=False, separators=(',', ': ')) + output_file.close() + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/tools/inspector_protocol/ConvertProtocolToJSON.py b/tools/inspector_protocol/ConvertProtocolToJSON.py new file mode 100644 index 000000000000..56fc09d78cb1 --- /dev/null +++ b/tools/inspector_protocol/ConvertProtocolToJSON.py @@ -0,0 +1,183 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import collections +import json +import os.path +import re +import sys + +file_name = None +description = '' + +primitiveTypes = ['integer', 'number', 'boolean', 'string', 'object', 'any', 'array'] + + +def assignType(item, type, isArray=False): + if isArray: + item['type'] = 'array' + item['items'] = collections.OrderedDict() + assignType(item['items'], type) + return + + if type == 'enum': + type = 'string' + if type in primitiveTypes: + item['type'] = type + else: + item['$ref'] = type + + +def createItem(d, experimental, deprecated, name=None): + result = collections.OrderedDict(d) + if name: + result['name'] = name + global description + if description: + result['description'] = description.strip() + if experimental: + result['experimental'] = True + if deprecated: + result['deprecated'] = True + return result + + +def parse(data): + protocol = collections.OrderedDict() + protocol['version'] = collections.OrderedDict() + protocol['domains'] = [] + domain = None + item = None + subitems = None + nukeDescription = False + global description + lines = data.split('\n') + for i in range(0, len(lines)): + if nukeDescription: + description = '' + nukeDescription = False + line = lines[i] + trimLine = line.strip() + + if trimLine.startswith('#'): + if len(description): + description += '\n' + description += trimLine[2:] + continue + else: + nukeDescription = True + + if len(trimLine) == 0: + continue + + match = re.compile('^(experimental )?(deprecated )?domain (.*)').match(line) + if match: + domain = createItem({'domain' : match.group(3)}, match.group(1), match.group(2)) + protocol['domains'].append(domain) + continue + + match = re.compile('^ depends on ([^\s]+)').match(line) + if match: + if 'dependencies' not in domain: + domain['dependencies'] = [] + domain['dependencies'].append(match.group(1)) + continue + + match = re.compile('^ (experimental )?(deprecated )?type (.*) extends (array of )?([^\s]+)').match(line) + if match: + if 'types' not in domain: + domain['types'] = [] + item = createItem({'id': match.group(3)}, match.group(1), match.group(2)) + assignType(item, match.group(5), match.group(4)) + domain['types'].append(item) + continue + + match = re.compile('^ (experimental )?(deprecated )?(command|event) (.*)').match(line) + if match: + list = [] + if match.group(3) == 'command': + if 'commands' in domain: + list = domain['commands'] + else: + list = domain['commands'] = [] + else: + if 'events' in domain: + list = domain['events'] + else: + list = domain['events'] = [] + + item = createItem({}, match.group(1), match.group(2), match.group(4)) + list.append(item) + continue + + match = re.compile('^ (experimental )?(deprecated )?(optional )?(array of )?([^\s]+) ([^\s]+)').match(line) + if match: + param = createItem({}, match.group(1), match.group(2), match.group(6)) + if match.group(3): + param['optional'] = True + assignType(param, match.group(5), match.group(4)) + if match.group(5) == 'enum': + enumliterals = param['enum'] = [] + subitems.append(param) + continue + + match = re.compile('^ (parameters|returns|properties)').match(line) + if match: + subitems = item[match.group(1)] = [] + continue + + match = re.compile('^ enum').match(line) + if match: + enumliterals = item['enum'] = [] + continue + + match = re.compile('^version').match(line) + if match: + continue + + match = re.compile('^ major (\d+)').match(line) + if match: + protocol['version']['major'] = match.group(1) + continue + + match = re.compile('^ minor (\d+)').match(line) + if match: + protocol['version']['minor'] = match.group(1) + continue + + match = re.compile('^ redirect ([^\s]+)').match(line) + if match: + item['redirect'] = match.group(1) + continue + + match = re.compile('^ ( )?[^\s]+$').match(line) + if match: + # enum literal + enumliterals.append(trimLine) + continue + + print 'Error in %s:%s, illegal token: \t%s' % (file_name, i, line) + sys.exit(1) + return protocol + +def main(argv): + if len(argv) < 2: + sys.stderr.write("Usage: %s \n" % sys.argv[0]) + return 1 + global file_name + file_name = os.path.normpath(argv[0]) + input_file = open(file_name, "r") + pdl_string = input_file.read() + protocol = parse(pdl_string) + output_file = open(argv[0].replace('.pdl', '.json'), 'wb') + json.dump(protocol, output_file, indent=4, separators=(',', ': ')) + output_file.close() + + output_file = open(os.path.normpath(argv[1]), 'wb') + json.dump(protocol, output_file, indent=4, separators=(',', ': ')) + output_file.close() + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/tools/inspector_protocol/LICENSE b/tools/inspector_protocol/LICENSE new file mode 100644 index 000000000000..800468e57634 --- /dev/null +++ b/tools/inspector_protocol/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/inspector_protocol/OWNERS b/tools/inspector_protocol/OWNERS new file mode 100644 index 000000000000..8d0b6d90cb23 --- /dev/null +++ b/tools/inspector_protocol/OWNERS @@ -0,0 +1,8 @@ +set noparent + +alph@chromium.org +caseq@chromium.org +dgozman@chromium.org +kozyatinskiy@chromium.org +pfeldman@chromium.org +yangguo@chromium.org diff --git a/tools/inspector_protocol/README.v8 b/tools/inspector_protocol/README.v8 new file mode 100644 index 000000000000..8a82f2a9c9d6 --- /dev/null +++ b/tools/inspector_protocol/README.v8 @@ -0,0 +1,16 @@ +Name: inspector protocol +Short Name: inspector_protocol +URL: https://chromium.googlesource.com/deps/inspector_protocol/ +Version: 0 +Revision: 752d4abd13119010cf30e454e8ef9b5fb7ef43a3 +License: BSD +License File: LICENSE +Security Critical: no + +Description: +src/inspector uses these scripts to generate handlers from protocol +description. + +Local modifications: +- This only includes the lib/ and templates/ directories, scripts, build + and the LICENSE files. diff --git a/tools/inspector_protocol/inspector_protocol.gni b/tools/inspector_protocol/inspector_protocol.gni new file mode 100644 index 000000000000..5dcc1f522d86 --- /dev/null +++ b/tools/inspector_protocol/inspector_protocol.gni @@ -0,0 +1,89 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This template will generate inspector protocol source code. The code will +# not be compiled, use get_target_outputs() to compile them. +# +# Inputs +# +# config_file (required) +# Path to json file specifying inspector protocol configuration. +# +# out_dir (required) +# Path to put the generated files in. It must be inside output or +# generated file directory. +# +# outputs (required) +# Files generated. Relative to out_dir. +# +# inputs (optional) +# Extra inputs specified by the config file. +template("inspector_protocol_generate") { + assert(defined(invoker.config_file)) + assert(defined(invoker.out_dir)) + assert(defined(invoker.outputs)) + assert(defined(invoker.inspector_protocol_dir)) + inspector_protocol_dir = invoker.inspector_protocol_dir + + action(target_name) { + script = "$inspector_protocol_dir/CodeGenerator.py" + + inputs = [ + invoker.config_file, + "$inspector_protocol_dir/lib/Allocator_h.template", + "$inspector_protocol_dir/lib/Array_h.template", + "$inspector_protocol_dir/lib/Collections_h.template", + "$inspector_protocol_dir/lib/DispatcherBase_cpp.template", + "$inspector_protocol_dir/lib/DispatcherBase_h.template", + "$inspector_protocol_dir/lib/ErrorSupport_cpp.template", + "$inspector_protocol_dir/lib/ErrorSupport_h.template", + "$inspector_protocol_dir/lib/Forward_h.template", + "$inspector_protocol_dir/lib/FrontendChannel_h.template", + "$inspector_protocol_dir/lib/Maybe_h.template", + "$inspector_protocol_dir/lib/Object_cpp.template", + "$inspector_protocol_dir/lib/Object_h.template", + "$inspector_protocol_dir/lib/Parser_cpp.template", + "$inspector_protocol_dir/lib/Parser_h.template", + "$inspector_protocol_dir/lib/Protocol_cpp.template", + "$inspector_protocol_dir/lib/ValueConversions_h.template", + "$inspector_protocol_dir/lib/Values_cpp.template", + "$inspector_protocol_dir/lib/Values_h.template", + "$inspector_protocol_dir/templates/Exported_h.template", + "$inspector_protocol_dir/templates/Imported_h.template", + "$inspector_protocol_dir/templates/TypeBuilder_cpp.template", + "$inspector_protocol_dir/templates/TypeBuilder_h.template", + ] + if (defined(invoker.inputs)) { + inputs += invoker.inputs + } + + args = [ + "--jinja_dir", + rebase_path("//third_party/", root_build_dir), # jinja is in chromium's third_party + "--output_base", + rebase_path(invoker.out_dir, root_build_dir), + "--config", + rebase_path(invoker.config_file, root_build_dir), + ] + + if (defined(invoker.config_values)) { + foreach(value, invoker.config_values) { + args += [ + "--config_value", + value, + ] + } + } + + outputs = get_path_info(rebase_path(invoker.outputs, ".", invoker.out_dir), + "abspath") + + forward_variables_from(invoker, + [ + "visibility", + "deps", + "public_deps", + ]) + } +} diff --git a/tools/inspector_protocol/inspector_protocol.gypi b/tools/inspector_protocol/inspector_protocol.gypi new file mode 100644 index 000000000000..1fb7119b5fa5 --- /dev/null +++ b/tools/inspector_protocol/inspector_protocol.gypi @@ -0,0 +1,33 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'inspector_protocol_files': [ + 'lib/Allocator_h.template', + 'lib/Array_h.template', + 'lib/Collections_h.template', + 'lib/DispatcherBase_cpp.template', + 'lib/DispatcherBase_h.template', + 'lib/ErrorSupport_cpp.template', + 'lib/ErrorSupport_h.template', + 'lib/Forward_h.template', + 'lib/FrontendChannel_h.template', + 'lib/Maybe_h.template', + 'lib/Object_cpp.template', + 'lib/Object_h.template', + 'lib/Parser_cpp.template', + 'lib/Parser_h.template', + 'lib/Protocol_cpp.template', + 'lib/ValueConversions_h.template', + 'lib/Values_cpp.template', + 'lib/Values_h.template', + 'templates/Exported_h.template', + 'templates/Imported_h.template', + 'templates/TypeBuilder_cpp.template', + 'templates/TypeBuilder_h.template', + 'CodeGenerator.py', + ] + } +} diff --git a/tools/inspector_protocol/lib/Allocator_h.template b/tools/inspector_protocol/lib/Allocator_h.template new file mode 100644 index 000000000000..8f8109d695c5 --- /dev/null +++ b/tools/inspector_protocol/lib/Allocator_h.template @@ -0,0 +1,30 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Allocator_h +#define {{"_".join(config.protocol.namespace)}}_Allocator_h + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +enum NotNullTagEnum { NotNullLiteral }; + +#define PROTOCOL_DISALLOW_NEW() \ + private: \ + void* operator new(size_t) = delete; \ + void* operator new(size_t, NotNullTagEnum, void*) = delete; \ + void* operator new(size_t, void*) = delete; \ + public: + +#define PROTOCOL_DISALLOW_COPY(ClassName) \ + private: \ + ClassName(const ClassName&) = delete; \ + ClassName& operator=(const ClassName&) = delete + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Allocator_h) diff --git a/tools/inspector_protocol/lib/Array_h.template b/tools/inspector_protocol/lib/Array_h.template new file mode 100644 index 000000000000..3854f6e5cd10 --- /dev/null +++ b/tools/inspector_protocol/lib/Array_h.template @@ -0,0 +1,136 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Array_h +#define {{"_".join(config.protocol.namespace)}}_Array_h + +//#include "ErrorSupport.h" +//#include "Forward.h" +//#include "ValueConversions.h" +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template +class Array { +public: + static std::unique_ptr> create() + { + return std::unique_ptr>(new Array()); + } + + static std::unique_ptr> fromValue(protocol::Value* value, ErrorSupport* errors) + { + protocol::ListValue* array = ListValue::cast(value); + if (!array) { + errors->addError("array expected"); + return nullptr; + } + std::unique_ptr> result(new Array()); + errors->push(); + for (size_t i = 0; i < array->size(); ++i) { + errors->setName(StringUtil::fromInteger(i)); + std::unique_ptr item = ValueConversions::fromValue(array->at(i), errors); + result->m_vector.push_back(std::move(item)); + } + errors->pop(); + if (errors->hasErrors()) + return nullptr; + return result; + } + + void addItem(std::unique_ptr value) + { + m_vector.push_back(std::move(value)); + } + + size_t length() + { + return m_vector.size(); + } + + T* get(size_t index) + { + return m_vector[index].get(); + } + + std::unique_ptr toValue() + { + std::unique_ptr result = ListValue::create(); + for (auto& item : m_vector) + result->pushValue(ValueConversions::toValue(item)); + return result; + } + +private: + std::vector> m_vector; +}; + +template +class ArrayBase { +public: + static std::unique_ptr> create() + { + return std::unique_ptr>(new Array()); + } + + static std::unique_ptr> fromValue(protocol::Value* value, ErrorSupport* errors) + { + protocol::ListValue* array = ListValue::cast(value); + if (!array) { + errors->addError("array expected"); + return nullptr; + } + errors->push(); + std::unique_ptr> result(new Array()); + for (size_t i = 0; i < array->size(); ++i) { + errors->setName(StringUtil::fromInteger(i)); + T item = ValueConversions::fromValue(array->at(i), errors); + result->m_vector.push_back(item); + } + errors->pop(); + if (errors->hasErrors()) + return nullptr; + return result; + } + + void addItem(const T& value) + { + m_vector.push_back(value); + } + + size_t length() + { + return m_vector.size(); + } + + T get(size_t index) + { + return m_vector[index]; + } + + std::unique_ptr toValue() + { + std::unique_ptr result = ListValue::create(); + for (auto& item : m_vector) + result->pushValue(ValueConversions::toValue(item)); + return result; + } + +private: + std::vector m_vector; +}; + +template<> class Array : public ArrayBase {}; +template<> class Array : public ArrayBase {}; +template<> class Array : public ArrayBase {}; +template<> class Array : public ArrayBase {}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Array_h) diff --git a/tools/inspector_protocol/lib/Collections_h.template b/tools/inspector_protocol/lib/Collections_h.template new file mode 100644 index 000000000000..7505a17bfa6e --- /dev/null +++ b/tools/inspector_protocol/lib/Collections_h.template @@ -0,0 +1,43 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Collections_h +#define {{"_".join(config.protocol.namespace)}}_Collections_h + +#include {{format_include(config.protocol.package, "Forward")}} +#include + +#if defined(__APPLE__) && !defined(_LIBCPP_VERSION) +#include +#include + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template using HashMap = std::map; +template using HashSet = std::set; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#else +#include +#include + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template using HashMap = std::unordered_map; +template using HashSet = std::unordered_set; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // defined(__APPLE__) && !defined(_LIBCPP_VERSION) + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Collections_h) diff --git a/tools/inspector_protocol/lib/DispatcherBase_cpp.template b/tools/inspector_protocol/lib/DispatcherBase_cpp.template new file mode 100644 index 000000000000..cecef743bffc --- /dev/null +++ b/tools/inspector_protocol/lib/DispatcherBase_cpp.template @@ -0,0 +1,354 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//#include "DispatcherBase.h" +//#include "Parser.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +// static +DispatchResponse DispatchResponse::OK() +{ + DispatchResponse result; + result.m_status = kSuccess; + result.m_errorCode = kParseError; + return result; +} + +// static +DispatchResponse DispatchResponse::Error(const String& error) +{ + DispatchResponse result; + result.m_status = kError; + result.m_errorCode = kServerError; + result.m_errorMessage = error; + return result; +} + +// static +DispatchResponse DispatchResponse::InternalError() +{ + DispatchResponse result; + result.m_status = kError; + result.m_errorCode = kInternalError; + result.m_errorMessage = "Internal error"; + return result; +} + +// static +DispatchResponse DispatchResponse::InvalidParams(const String& error) +{ + DispatchResponse result; + result.m_status = kError; + result.m_errorCode = kInvalidParams; + result.m_errorMessage = error; + return result; +} + +// static +DispatchResponse DispatchResponse::FallThrough() +{ + DispatchResponse result; + result.m_status = kFallThrough; + result.m_errorCode = kParseError; + return result; +} + +// static +const char DispatcherBase::kInvalidParamsString[] = "Invalid parameters"; + +DispatcherBase::WeakPtr::WeakPtr(DispatcherBase* dispatcher) : m_dispatcher(dispatcher) { } + +DispatcherBase::WeakPtr::~WeakPtr() +{ + if (m_dispatcher) + m_dispatcher->m_weakPtrs.erase(this); +} + +DispatcherBase::Callback::Callback(std::unique_ptr backendImpl, int callId, int callbackId) + : m_backendImpl(std::move(backendImpl)) + , m_callId(callId) + , m_callbackId(callbackId) { } + +DispatcherBase::Callback::~Callback() = default; + +void DispatcherBase::Callback::dispose() +{ + m_backendImpl = nullptr; +} + +void DispatcherBase::Callback::sendIfActive(std::unique_ptr partialMessage, const DispatchResponse& response) +{ + if (!m_backendImpl || !m_backendImpl->get()) + return; + m_backendImpl->get()->sendResponse(m_callId, response, std::move(partialMessage)); + m_backendImpl = nullptr; +} + +void DispatcherBase::Callback::fallThroughIfActive() +{ + if (!m_backendImpl || !m_backendImpl->get()) + return; + m_backendImpl->get()->markFallThrough(m_callbackId); + m_backendImpl = nullptr; +} + +DispatcherBase::DispatcherBase(FrontendChannel* frontendChannel) + : m_frontendChannel(frontendChannel) + , m_lastCallbackId(0) + , m_lastCallbackFallThrough(false) { } + +DispatcherBase::~DispatcherBase() +{ + clearFrontend(); +} + +int DispatcherBase::nextCallbackId() +{ + m_lastCallbackFallThrough = false; + return ++m_lastCallbackId; +} + +void DispatcherBase::markFallThrough(int callbackId) +{ + DCHECK(callbackId == m_lastCallbackId); + m_lastCallbackFallThrough = true; +} + +void DispatcherBase::sendResponse(int callId, const DispatchResponse& response, std::unique_ptr result) +{ + if (!m_frontendChannel) + return; + if (response.status() == DispatchResponse::kError) { + reportProtocolError(callId, response.errorCode(), response.errorMessage(), nullptr); + return; + } + m_frontendChannel->sendProtocolResponse(callId, InternalResponse::createResponse(callId, std::move(result))); +} + +void DispatcherBase::sendResponse(int callId, const DispatchResponse& response) +{ + sendResponse(callId, response, DictionaryValue::create()); +} + +namespace { + +class ProtocolError : public Serializable { +public: + static std::unique_ptr createErrorResponse(int callId, DispatchResponse::ErrorCode code, const String& errorMessage, ErrorSupport* errors) + { + std::unique_ptr protocolError(new ProtocolError(code, errorMessage)); + protocolError->m_callId = callId; + protocolError->m_hasCallId = true; + if (errors && errors->hasErrors()) + protocolError->m_data = errors->errors(); + return protocolError; + } + + static std::unique_ptr createErrorNotification(DispatchResponse::ErrorCode code, const String& errorMessage) + { + return std::unique_ptr(new ProtocolError(code, errorMessage)); + } + + String serialize() override + { + std::unique_ptr error = DictionaryValue::create(); + error->setInteger("code", m_code); + error->setString("message", m_errorMessage); + if (m_data.length()) + error->setString("data", m_data); + std::unique_ptr message = DictionaryValue::create(); + message->setObject("error", std::move(error)); + if (m_hasCallId) + message->setInteger("id", m_callId); + return message->serialize(); + } + + ~ProtocolError() override {} + +private: + ProtocolError(DispatchResponse::ErrorCode code, const String& errorMessage) + : m_code(code) + , m_errorMessage(errorMessage) + { + } + + DispatchResponse::ErrorCode m_code; + String m_errorMessage; + String m_data; + int m_callId = 0; + bool m_hasCallId = false; +}; + +} // namespace + +static void reportProtocolErrorTo(FrontendChannel* frontendChannel, int callId, DispatchResponse::ErrorCode code, const String& errorMessage, ErrorSupport* errors) +{ + if (frontendChannel) + frontendChannel->sendProtocolResponse(callId, ProtocolError::createErrorResponse(callId, code, errorMessage, errors)); +} + +static void reportProtocolErrorTo(FrontendChannel* frontendChannel, DispatchResponse::ErrorCode code, const String& errorMessage) +{ + if (frontendChannel) + frontendChannel->sendProtocolNotification(ProtocolError::createErrorNotification(code, errorMessage)); +} + +void DispatcherBase::reportProtocolError(int callId, DispatchResponse::ErrorCode code, const String& errorMessage, ErrorSupport* errors) +{ + reportProtocolErrorTo(m_frontendChannel, callId, code, errorMessage, errors); +} + +void DispatcherBase::clearFrontend() +{ + m_frontendChannel = nullptr; + for (auto& weak : m_weakPtrs) + weak->dispose(); + m_weakPtrs.clear(); +} + +std::unique_ptr DispatcherBase::weakPtr() +{ + std::unique_ptr weak(new DispatcherBase::WeakPtr(this)); + m_weakPtrs.insert(weak.get()); + return weak; +} + +UberDispatcher::UberDispatcher(FrontendChannel* frontendChannel) + : m_frontendChannel(frontendChannel) + , m_fallThroughForNotFound(false) { } + +void UberDispatcher::setFallThroughForNotFound(bool fallThroughForNotFound) +{ + m_fallThroughForNotFound = fallThroughForNotFound; +} + +void UberDispatcher::registerBackend(const String& name, std::unique_ptr dispatcher) +{ + m_dispatchers[name] = std::move(dispatcher); +} + +void UberDispatcher::setupRedirects(const HashMap& redirects) +{ + for (const auto& pair : redirects) + m_redirects[pair.first] = pair.second; +} + +DispatchResponse::Status UberDispatcher::dispatch(std::unique_ptr parsedMessage, int* outCallId, String* outMethod) +{ + if (!parsedMessage) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kParseError, "Message must be a valid JSON"); + return DispatchResponse::kError; + } + std::unique_ptr messageObject = DictionaryValue::cast(std::move(parsedMessage)); + if (!messageObject) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kInvalidRequest, "Message must be an object"); + return DispatchResponse::kError; + } + + int callId = 0; + protocol::Value* callIdValue = messageObject->get("id"); + bool success = callIdValue && callIdValue->asInteger(&callId); + if (outCallId) + *outCallId = callId; + if (!success) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kInvalidRequest, "Message must have integer 'id' property"); + return DispatchResponse::kError; + } + + protocol::Value* methodValue = messageObject->get("method"); + String method; + success = methodValue && methodValue->asString(&method); + if (outMethod) + *outMethod = method; + if (!success) { + reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kInvalidRequest, "Message must have string 'method' property", nullptr); + return DispatchResponse::kError; + } + + HashMap::iterator redirectIt = m_redirects.find(method); + if (redirectIt != m_redirects.end()) + method = redirectIt->second; + + size_t dotIndex = StringUtil::find(method, "."); + if (dotIndex == StringUtil::kNotFound) { + if (m_fallThroughForNotFound) + return DispatchResponse::kFallThrough; + reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kMethodNotFound, "'" + method + "' wasn't found", nullptr); + return DispatchResponse::kError; + } + String domain = StringUtil::substring(method, 0, dotIndex); + auto it = m_dispatchers.find(domain); + if (it == m_dispatchers.end()) { + if (m_fallThroughForNotFound) + return DispatchResponse::kFallThrough; + reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kMethodNotFound, "'" + method + "' wasn't found", nullptr); + return DispatchResponse::kError; + } + return it->second->dispatch(callId, method, std::move(messageObject)); +} + +bool UberDispatcher::getCommandName(const String& message, String* method, std::unique_ptr* parsedMessage) +{ + std::unique_ptr value = StringUtil::parseJSON(message); + if (!value) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kParseError, "Message must be a valid JSON"); + return false; + } + + protocol::DictionaryValue* object = DictionaryValue::cast(value.get()); + if (!object) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kInvalidRequest, "Message must be an object"); + return false; + } + + if (!object->getString("method", method)) { + reportProtocolErrorTo(m_frontendChannel, DispatchResponse::kInvalidRequest, "Message must have string 'method' property"); + return false; + } + + parsedMessage->reset(DictionaryValue::cast(value.release())); + return true; +} + +UberDispatcher::~UberDispatcher() = default; + +// static +std::unique_ptr InternalResponse::createResponse(int callId, std::unique_ptr params) +{ + return std::unique_ptr(new InternalResponse(callId, String(), std::move(params))); +} + +// static +std::unique_ptr InternalResponse::createNotification(const String& notification, std::unique_ptr params) +{ + return std::unique_ptr(new InternalResponse(0, notification, std::move(params))); +} + +String InternalResponse::serialize() +{ + std::unique_ptr result = DictionaryValue::create(); + std::unique_ptr params(m_params ? std::move(m_params) : DictionaryValue::create()); + if (m_notification.length()) { + result->setString("method", m_notification); + result->setValue("params", SerializedValue::create(params->serialize())); + } else { + result->setInteger("id", m_callId); + result->setValue("result", SerializedValue::create(params->serialize())); + } + return result->serialize(); +} + +InternalResponse::InternalResponse(int callId, const String& notification, std::unique_ptr params) + : m_callId(callId) + , m_notification(notification) + , m_params(params ? std::move(params) : nullptr) +{ +} + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/lib/DispatcherBase_h.template b/tools/inspector_protocol/lib/DispatcherBase_h.template new file mode 100644 index 000000000000..d70a4afe71de --- /dev/null +++ b/tools/inspector_protocol/lib/DispatcherBase_h.template @@ -0,0 +1,173 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_DispatcherBase_h +#define {{"_".join(config.protocol.namespace)}}_DispatcherBase_h + +//#include "Collections.h" +//#include "ErrorSupport.h" +//#include "Forward.h" +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +class WeakPtr; + +class {{config.lib.export_macro}} DispatchResponse { +public: + enum Status { + kSuccess = 0, + kError = 1, + kFallThrough = 2, + kAsync = 3 + }; + + enum ErrorCode { + kParseError = -32700, + kInvalidRequest = -32600, + kMethodNotFound = -32601, + kInvalidParams = -32602, + kInternalError = -32603, + kServerError = -32000, + }; + + Status status() const { return m_status; } + const String& errorMessage() const { return m_errorMessage; } + ErrorCode errorCode() const { return m_errorCode; } + bool isSuccess() const { return m_status == kSuccess; } + + static DispatchResponse OK(); + static DispatchResponse Error(const String&); + static DispatchResponse InternalError(); + static DispatchResponse InvalidParams(const String&); + static DispatchResponse FallThrough(); + +private: + Status m_status; + String m_errorMessage; + ErrorCode m_errorCode; +}; + +class {{config.lib.export_macro}} DispatcherBase { + PROTOCOL_DISALLOW_COPY(DispatcherBase); +public: + static const char kInvalidParamsString[]; + class {{config.lib.export_macro}} WeakPtr { + public: + explicit WeakPtr(DispatcherBase*); + ~WeakPtr(); + DispatcherBase* get() { return m_dispatcher; } + void dispose() { m_dispatcher = nullptr; } + + private: + DispatcherBase* m_dispatcher; + }; + + class {{config.lib.export_macro}} Callback { + public: + Callback(std::unique_ptr backendImpl, int callId, int callbackId); + virtual ~Callback(); + void dispose(); + + protected: + void sendIfActive(std::unique_ptr partialMessage, const DispatchResponse& response); + void fallThroughIfActive(); + + private: + std::unique_ptr m_backendImpl; + int m_callId; + int m_callbackId; + }; + + explicit DispatcherBase(FrontendChannel*); + virtual ~DispatcherBase(); + + virtual DispatchResponse::Status dispatch(int callId, const String& method, std::unique_ptr messageObject) = 0; + + void sendResponse(int callId, const DispatchResponse&, std::unique_ptr result); + void sendResponse(int callId, const DispatchResponse&); + + void reportProtocolError(int callId, DispatchResponse::ErrorCode, const String& errorMessage, ErrorSupport* errors); + void clearFrontend(); + + std::unique_ptr weakPtr(); + + int nextCallbackId(); + void markFallThrough(int callbackId); + bool lastCallbackFallThrough() { return m_lastCallbackFallThrough; } + +private: + FrontendChannel* m_frontendChannel; + protocol::HashSet m_weakPtrs; + int m_lastCallbackId; + bool m_lastCallbackFallThrough; +}; + +class {{config.lib.export_macro}} UberDispatcher { + PROTOCOL_DISALLOW_COPY(UberDispatcher); +public: + explicit UberDispatcher(FrontendChannel*); + void registerBackend(const String& name, std::unique_ptr); + void setupRedirects(const HashMap&); + DispatchResponse::Status dispatch(std::unique_ptr message, int* callId = nullptr, String* method = nullptr); + FrontendChannel* channel() { return m_frontendChannel; } + bool fallThroughForNotFound() { return m_fallThroughForNotFound; } + void setFallThroughForNotFound(bool); + bool getCommandName(const String& message, String* method, std::unique_ptr* parsedMessage); + virtual ~UberDispatcher(); + +private: + FrontendChannel* m_frontendChannel; + bool m_fallThroughForNotFound; + HashMap m_redirects; + protocol::HashMap> m_dispatchers; +}; + +class InternalResponse : public Serializable { + PROTOCOL_DISALLOW_COPY(InternalResponse); +public: + static std::unique_ptr createResponse(int callId, std::unique_ptr params); + static std::unique_ptr createNotification(const String& notification, std::unique_ptr params = nullptr); + + String serialize() override; + + ~InternalResponse() override {} + +private: + InternalResponse(int callId, const String& notification, std::unique_ptr params); + + int m_callId; + String m_notification; + std::unique_ptr m_params; +}; + +class InternalRawNotification : public Serializable { +public: + static std::unique_ptr create(const String& notification) + { + return std::unique_ptr(new InternalRawNotification(notification)); + } + ~InternalRawNotification() override {} + + String serialize() override + { + return m_notification; + } + +private: + explicit InternalRawNotification(const String& notification) + : m_notification(notification) + { + } + + String m_notification; +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_DispatcherBase_h) diff --git a/tools/inspector_protocol/lib/ErrorSupport_cpp.template b/tools/inspector_protocol/lib/ErrorSupport_cpp.template new file mode 100644 index 000000000000..7b858b8dc48f --- /dev/null +++ b/tools/inspector_protocol/lib/ErrorSupport_cpp.template @@ -0,0 +1,71 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//#include "ErrorSupport.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +ErrorSupport::ErrorSupport() { } +ErrorSupport::~ErrorSupport() { } + +void ErrorSupport::setName(const char* name) +{ + setName(String(name)); +} + +void ErrorSupport::setName(const String& name) +{ + DCHECK(m_path.size()); + m_path[m_path.size() - 1] = name; +} + +void ErrorSupport::push() +{ + m_path.push_back(String()); +} + +void ErrorSupport::pop() +{ + m_path.pop_back(); +} + +void ErrorSupport::addError(const char* error) +{ + addError(String(error)); +} + +void ErrorSupport::addError(const String& error) +{ + StringBuilder builder; + for (size_t i = 0; i < m_path.size(); ++i) { + if (i) + StringUtil::builderAppend(builder, '.'); + StringUtil::builderAppend(builder, m_path[i]); + } + StringUtil::builderAppend(builder, ": "); + StringUtil::builderAppend(builder, error); + m_errors.push_back(StringUtil::builderToString(builder)); +} + +bool ErrorSupport::hasErrors() +{ + return !!m_errors.size(); +} + +String ErrorSupport::errors() +{ + StringBuilder builder; + for (size_t i = 0; i < m_errors.size(); ++i) { + if (i) + StringUtil::builderAppend(builder, "; "); + StringUtil::builderAppend(builder, m_errors[i]); + } + return StringUtil::builderToString(builder); +} + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/lib/ErrorSupport_h.template b/tools/inspector_protocol/lib/ErrorSupport_h.template new file mode 100644 index 000000000000..083f2a5eb0d4 --- /dev/null +++ b/tools/inspector_protocol/lib/ErrorSupport_h.template @@ -0,0 +1,37 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_ErrorSupport_h +#define {{"_".join(config.protocol.namespace)}}_ErrorSupport_h + +//#include "Forward.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +class {{config.lib.export_macro}} ErrorSupport { +public: + ErrorSupport(); + ~ErrorSupport(); + + void push(); + void setName(const char*); + void setName(const String&); + void pop(); + void addError(const char*); + void addError(const String&); + bool hasErrors(); + String errors(); + +private: + std::vector m_path; + std::vector m_errors; +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_ErrorSupport_h) diff --git a/tools/inspector_protocol/lib/Forward_h.template b/tools/inspector_protocol/lib/Forward_h.template new file mode 100644 index 000000000000..34d1c0d3e946 --- /dev/null +++ b/tools/inspector_protocol/lib/Forward_h.template @@ -0,0 +1,37 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Forward_h +#define {{"_".join(config.protocol.namespace)}}_Forward_h + +{% if config.lib.export_header %} +#include {{format_include(config.lib.export_header)}} +{% endif %} +#include {{format_include(config.lib.string_header)}} + +#include + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template class Array; +class DictionaryValue; +class DispatchResponse; +class ErrorSupport; +class FundamentalValue; +class ListValue; +template class Maybe; +class Object; +using Response = DispatchResponse; +class SerializedValue; +class StringValue; +class UberDispatcher; +class Value; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Forward_h) diff --git a/tools/inspector_protocol/lib/FrontendChannel_h.template b/tools/inspector_protocol/lib/FrontendChannel_h.template new file mode 100644 index 000000000000..0454978b0c8e --- /dev/null +++ b/tools/inspector_protocol/lib/FrontendChannel_h.template @@ -0,0 +1,30 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_FrontendChannel_h +#define {{"_".join(config.protocol.namespace)}}_FrontendChannel_h + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +class {{config.lib.export_macro}} Serializable { +public: + virtual String serialize() = 0; + virtual ~Serializable() = default; +}; + +class {{config.lib.export_macro}} FrontendChannel { +public: + virtual ~FrontendChannel() { } + virtual void sendProtocolResponse(int callId, std::unique_ptr message) = 0; + virtual void sendProtocolNotification(std::unique_ptr message) = 0; + virtual void flushProtocolNotifications() = 0; +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_FrontendChannel_h) diff --git a/tools/inspector_protocol/lib/Maybe_h.template b/tools/inspector_protocol/lib/Maybe_h.template new file mode 100644 index 000000000000..71593acd0e55 --- /dev/null +++ b/tools/inspector_protocol/lib/Maybe_h.template @@ -0,0 +1,86 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Maybe_h +#define {{"_".join(config.protocol.namespace)}}_Maybe_h + +//#include "Forward.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template +class Maybe { +public: + Maybe() : m_value() { } + Maybe(std::unique_ptr value) : m_value(std::move(value)) { } + Maybe(Maybe&& other) : m_value(std::move(other.m_value)) { } + void operator=(std::unique_ptr value) { m_value = std::move(value); } + T* fromJust() const { DCHECK(m_value); return m_value.get(); } + T* fromMaybe(T* defaultValue) const { return m_value ? m_value.get() : defaultValue; } + bool isJust() const { return !!m_value; } + std::unique_ptr takeJust() { DCHECK(m_value); return std::move(m_value); } +private: + std::unique_ptr m_value; +}; + +template +class MaybeBase { +public: + MaybeBase() : m_isJust(false) { } + MaybeBase(T value) : m_isJust(true), m_value(value) { } + MaybeBase(MaybeBase&& other) : m_isJust(other.m_isJust), m_value(std::move(other.m_value)) { } + void operator=(T value) { m_value = value; m_isJust = true; } + T fromJust() const { DCHECK(m_isJust); return m_value; } + T fromMaybe(const T& defaultValue) const { return m_isJust ? m_value : defaultValue; } + bool isJust() const { return m_isJust; } + T takeJust() { DCHECK(m_isJust); return m_value; } + +protected: + bool m_isJust; + T m_value; +}; + +template<> +class Maybe : public MaybeBase { +public: + Maybe() { } + Maybe(bool value) : MaybeBase(value) { } + Maybe(Maybe&& other) : MaybeBase(std::move(other)) { } + using MaybeBase::operator=; +}; + +template<> +class Maybe : public MaybeBase { +public: + Maybe() { } + Maybe(int value) : MaybeBase(value) { } + Maybe(Maybe&& other) : MaybeBase(std::move(other)) { } + using MaybeBase::operator=; +}; + +template<> +class Maybe : public MaybeBase { +public: + Maybe() { } + Maybe(double value) : MaybeBase(value) { } + Maybe(Maybe&& other) : MaybeBase(std::move(other)) { } + using MaybeBase::operator=; +}; + +template<> +class Maybe : public MaybeBase { +public: + Maybe() { } + Maybe(const String& value) : MaybeBase(value) { } + Maybe(Maybe&& other) : MaybeBase(std::move(other)) { } + using MaybeBase::operator=; +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Maybe_h) diff --git a/tools/inspector_protocol/lib/Object_cpp.template b/tools/inspector_protocol/lib/Object_cpp.template new file mode 100644 index 000000000000..91723a71e29c --- /dev/null +++ b/tools/inspector_protocol/lib/Object_cpp.template @@ -0,0 +1,38 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//#include "Object.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +std::unique_ptr Object::fromValue(protocol::Value* value, ErrorSupport* errors) +{ + protocol::DictionaryValue* dictionary = DictionaryValue::cast(value); + if (!dictionary) { + errors->addError("object expected"); + return nullptr; + } + dictionary = static_cast(dictionary->clone().release()); + return std::unique_ptr(new Object(std::unique_ptr(dictionary))); +} + +std::unique_ptr Object::toValue() const +{ + return DictionaryValue::cast(m_object->clone()); +} + +std::unique_ptr Object::clone() const +{ + return std::unique_ptr(new Object(DictionaryValue::cast(m_object->clone()))); +} + +Object::Object(std::unique_ptr object) : m_object(std::move(object)) { } + +Object::~Object() { } + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/lib/Object_h.template b/tools/inspector_protocol/lib/Object_h.template new file mode 100644 index 000000000000..f6ffc57659e1 --- /dev/null +++ b/tools/inspector_protocol/lib/Object_h.template @@ -0,0 +1,32 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Object_h +#define {{"_".join(config.protocol.namespace)}}_Object_h + +//#include "ErrorSupport.h" +//#include "Forward.h" +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +class {{config.lib.export_macro}} Object { +public: + static std::unique_ptr fromValue(protocol::Value*, ErrorSupport*); + ~Object(); + + std::unique_ptr toValue() const; + std::unique_ptr clone() const; +private: + explicit Object(std::unique_ptr); + std::unique_ptr m_object; +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Object_h) diff --git a/tools/inspector_protocol/lib/Parser_cpp.template b/tools/inspector_protocol/lib/Parser_cpp.template new file mode 100644 index 000000000000..f3dde5ac218e --- /dev/null +++ b/tools/inspector_protocol/lib/Parser_cpp.template @@ -0,0 +1,547 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +namespace { + +const int stackLimit = 1000; + +enum Token { + ObjectBegin, + ObjectEnd, + ArrayBegin, + ArrayEnd, + StringLiteral, + Number, + BoolTrue, + BoolFalse, + NullToken, + ListSeparator, + ObjectPairSeparator, + InvalidToken, +}; + +const char* const nullString = "null"; +const char* const trueString = "true"; +const char* const falseString = "false"; + +bool isASCII(uint16_t c) +{ + return !(c & ~0x7F); +} + +bool isSpaceOrNewLine(uint16_t c) +{ + return isASCII(c) && c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); +} + +double charactersToDouble(const uint16_t* characters, size_t length, bool* ok) +{ + std::vector buffer; + buffer.reserve(length + 1); + for (size_t i = 0; i < length; ++i) { + if (!isASCII(characters[i])) { + *ok = false; + return 0; + } + buffer.push_back(static_cast(characters[i])); + } + buffer.push_back('\0'); + return StringUtil::toDouble(buffer.data(), length, ok); +} + +double charactersToDouble(const uint8_t* characters, size_t length, bool* ok) +{ + std::string buffer(reinterpret_cast(characters), length); + return StringUtil::toDouble(buffer.data(), length, ok); +} + +template +bool parseConstToken(const Char* start, const Char* end, const Char** tokenEnd, const char* token) +{ + while (start < end && *token != '\0' && *start++ == *token++) { } + if (*token != '\0') + return false; + *tokenEnd = start; + return true; +} + +template +bool readInt(const Char* start, const Char* end, const Char** tokenEnd, bool canHaveLeadingZeros) +{ + if (start == end) + return false; + bool haveLeadingZero = '0' == *start; + int length = 0; + while (start < end && '0' <= *start && *start <= '9') { + ++start; + ++length; + } + if (!length) + return false; + if (!canHaveLeadingZeros && length > 1 && haveLeadingZero) + return false; + *tokenEnd = start; + return true; +} + +template +bool parseNumberToken(const Char* start, const Char* end, const Char** tokenEnd) +{ + // We just grab the number here. We validate the size in DecodeNumber. + // According to RFC4627, a valid number is: [minus] int [frac] [exp] + if (start == end) + return false; + Char c = *start; + if ('-' == c) + ++start; + + if (!readInt(start, end, &start, false)) + return false; + if (start == end) { + *tokenEnd = start; + return true; + } + + // Optional fraction part + c = *start; + if ('.' == c) { + ++start; + if (!readInt(start, end, &start, true)) + return false; + if (start == end) { + *tokenEnd = start; + return true; + } + c = *start; + } + + // Optional exponent part + if ('e' == c || 'E' == c) { + ++start; + if (start == end) + return false; + c = *start; + if ('-' == c || '+' == c) { + ++start; + if (start == end) + return false; + } + if (!readInt(start, end, &start, true)) + return false; + } + + *tokenEnd = start; + return true; +} + +template +bool readHexDigits(const Char* start, const Char* end, const Char** tokenEnd, int digits) +{ + if (end - start < digits) + return false; + for (int i = 0; i < digits; ++i) { + Char c = *start++; + if (!(('0' <= c && c <= '9') || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'))) + return false; + } + *tokenEnd = start; + return true; +} + +template +bool parseStringToken(const Char* start, const Char* end, const Char** tokenEnd) +{ + while (start < end) { + Char c = *start++; + if ('\\' == c) { + if (start == end) + return false; + c = *start++; + // Make sure the escaped char is valid. + switch (c) { + case 'x': + if (!readHexDigits(start, end, &start, 2)) + return false; + break; + case 'u': + if (!readHexDigits(start, end, &start, 4)) + return false; + break; + case '\\': + case '/': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + case 'v': + case '"': + break; + default: + return false; + } + } else if ('"' == c) { + *tokenEnd = start; + return true; + } + } + return false; +} + +template +bool skipComment(const Char* start, const Char* end, const Char** commentEnd) +{ + if (start == end) + return false; + + if (*start != '/' || start + 1 >= end) + return false; + ++start; + + if (*start == '/') { + // Single line comment, read to newline. + for (++start; start < end; ++start) { + if (*start == '\n' || *start == '\r') { + *commentEnd = start + 1; + return true; + } + } + *commentEnd = end; + // Comment reaches end-of-input, which is fine. + return true; + } + + if (*start == '*') { + Char previous = '\0'; + // Block comment, read until end marker. + for (++start; start < end; previous = *start++) { + if (previous == '*' && *start == '/') { + *commentEnd = start + 1; + return true; + } + } + // Block comment must close before end-of-input. + return false; + } + + return false; +} + +template +void skipWhitespaceAndComments(const Char* start, const Char* end, const Char** whitespaceEnd) +{ + while (start < end) { + if (isSpaceOrNewLine(*start)) { + ++start; + } else if (*start == '/') { + const Char* commentEnd; + if (!skipComment(start, end, &commentEnd)) + break; + start = commentEnd; + } else { + break; + } + } + *whitespaceEnd = start; +} + +template +Token parseToken(const Char* start, const Char* end, const Char** tokenStart, const Char** tokenEnd) +{ + skipWhitespaceAndComments(start, end, tokenStart); + start = *tokenStart; + + if (start == end) + return InvalidToken; + + switch (*start) { + case 'n': + if (parseConstToken(start, end, tokenEnd, nullString)) + return NullToken; + break; + case 't': + if (parseConstToken(start, end, tokenEnd, trueString)) + return BoolTrue; + break; + case 'f': + if (parseConstToken(start, end, tokenEnd, falseString)) + return BoolFalse; + break; + case '[': + *tokenEnd = start + 1; + return ArrayBegin; + case ']': + *tokenEnd = start + 1; + return ArrayEnd; + case ',': + *tokenEnd = start + 1; + return ListSeparator; + case '{': + *tokenEnd = start + 1; + return ObjectBegin; + case '}': + *tokenEnd = start + 1; + return ObjectEnd; + case ':': + *tokenEnd = start + 1; + return ObjectPairSeparator; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + if (parseNumberToken(start, end, tokenEnd)) + return Number; + break; + case '"': + if (parseStringToken(start + 1, end, tokenEnd)) + return StringLiteral; + break; + } + return InvalidToken; +} + +template +int hexToInt(Char c) +{ + if ('0' <= c && c <= '9') + return c - '0'; + if ('A' <= c && c <= 'F') + return c - 'A' + 10; + if ('a' <= c && c <= 'f') + return c - 'a' + 10; + DCHECK(false); + return 0; +} + +template +bool decodeString(const Char* start, const Char* end, StringBuilder* output) +{ + while (start < end) { + uint16_t c = *start++; + if ('\\' != c) { + StringUtil::builderAppend(*output, c); + continue; + } + if (start == end) + return false; + c = *start++; + + if (c == 'x') { + // \x is not supported. + return false; + } + + switch (c) { + case '"': + case '/': + case '\\': + break; + case 'b': + c = '\b'; + break; + case 'f': + c = '\f'; + break; + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + case 'v': + c = '\v'; + break; + case 'u': + c = (hexToInt(*start) << 12) + + (hexToInt(*(start + 1)) << 8) + + (hexToInt(*(start + 2)) << 4) + + hexToInt(*(start + 3)); + start += 4; + break; + default: + return false; + } + StringUtil::builderAppend(*output, c); + } + return true; +} + +template +bool decodeString(const Char* start, const Char* end, String* output) +{ + if (start == end) { + *output = ""; + return true; + } + if (start > end) + return false; + StringBuilder buffer; + StringUtil::builderReserve(buffer, end - start); + if (!decodeString(start, end, &buffer)) + return false; + *output = StringUtil::builderToString(buffer); + return true; +} + +template +std::unique_ptr buildValue(const Char* start, const Char* end, const Char** valueTokenEnd, int depth) +{ + if (depth > stackLimit) + return nullptr; + + std::unique_ptr result; + const Char* tokenStart; + const Char* tokenEnd; + Token token = parseToken(start, end, &tokenStart, &tokenEnd); + switch (token) { + case InvalidToken: + return nullptr; + case NullToken: + result = Value::null(); + break; + case BoolTrue: + result = FundamentalValue::create(true); + break; + case BoolFalse: + result = FundamentalValue::create(false); + break; + case Number: { + bool ok; + double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok); + if (!ok) + return nullptr; + int number = static_cast(value); + if (number == value) + result = FundamentalValue::create(number); + else + result = FundamentalValue::create(value); + break; + } + case StringLiteral: { + String value; + bool ok = decodeString(tokenStart + 1, tokenEnd - 1, &value); + if (!ok) + return nullptr; + result = StringValue::create(value); + break; + } + case ArrayBegin: { + std::unique_ptr array = ListValue::create(); + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + while (token != ArrayEnd) { + std::unique_ptr arrayNode = buildValue(start, end, &tokenEnd, depth + 1); + if (!arrayNode) + return nullptr; + array->pushValue(std::move(arrayNode)); + + // After a list value, we expect a comma or the end of the list. + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == ListSeparator) { + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == ArrayEnd) + return nullptr; + } else if (token != ArrayEnd) { + // Unexpected value after list value. Bail out. + return nullptr; + } + } + if (token != ArrayEnd) + return nullptr; + result = std::move(array); + break; + } + case ObjectBegin: { + std::unique_ptr object = DictionaryValue::create(); + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + while (token != ObjectEnd) { + if (token != StringLiteral) + return nullptr; + String key; + if (!decodeString(tokenStart + 1, tokenEnd - 1, &key)) + return nullptr; + start = tokenEnd; + + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token != ObjectPairSeparator) + return nullptr; + start = tokenEnd; + + std::unique_ptr value = buildValue(start, end, &tokenEnd, depth + 1); + if (!value) + return nullptr; + object->setValue(key, std::move(value)); + start = tokenEnd; + + // After a key/value pair, we expect a comma or the end of the + // object. + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == ListSeparator) { + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == ObjectEnd) + return nullptr; + } else if (token != ObjectEnd) { + // Unexpected value after last object value. Bail out. + return nullptr; + } + } + if (token != ObjectEnd) + return nullptr; + result = std::move(object); + break; + } + + default: + // We got a token that's not a value. + return nullptr; + } + + skipWhitespaceAndComments(tokenEnd, end, valueTokenEnd); + return result; +} + +template +std::unique_ptr parseJSONInternal(const Char* start, unsigned length) +{ + const Char* end = start + length; + const Char *tokenEnd; + std::unique_ptr value = buildValue(start, end, &tokenEnd, 0); + if (!value || tokenEnd != end) + return nullptr; + return value; +} + +} // anonymous namespace + +std::unique_ptr parseJSONCharacters(const uint16_t* characters, unsigned length) +{ + return parseJSONInternal(characters, length); +} + +std::unique_ptr parseJSONCharacters(const uint8_t* characters, unsigned length) +{ + return parseJSONInternal(characters, length); +} + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/lib/Parser_h.template b/tools/inspector_protocol/lib/Parser_h.template new file mode 100644 index 000000000000..8397d3f5d691 --- /dev/null +++ b/tools/inspector_protocol/lib/Parser_h.template @@ -0,0 +1,22 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Parser_h +#define {{"_".join(config.protocol.namespace)}}_Parser_h + +//#include "Forward.h" +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +{{config.lib.export_macro}} std::unique_ptr parseJSONCharacters(const uint8_t*, unsigned); +{{config.lib.export_macro}} std::unique_ptr parseJSONCharacters(const uint16_t*, unsigned); + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_Parser_h) diff --git a/tools/inspector_protocol/lib/Protocol_cpp.template b/tools/inspector_protocol/lib/Protocol_cpp.template new file mode 100644 index 000000000000..901656373a4f --- /dev/null +++ b/tools/inspector_protocol/lib/Protocol_cpp.template @@ -0,0 +1,12 @@ +// This file is generated. + +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include {{format_include(config.protocol.package, "Protocol")}} + +#include +#include + +#include diff --git a/tools/inspector_protocol/lib/ValueConversions_h.template b/tools/inspector_protocol/lib/ValueConversions_h.template new file mode 100644 index 000000000000..4d64ec9091a6 --- /dev/null +++ b/tools/inspector_protocol/lib/ValueConversions_h.template @@ -0,0 +1,171 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_ValueConversions_h +#define {{"_".join(config.protocol.namespace)}}_ValueConversions_h + +//#include "ErrorSupport.h" +//#include "Forward.h" +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +template +struct ValueConversions { + static std::unique_ptr fromValue(protocol::Value* value, ErrorSupport* errors) + { + return T::fromValue(value, errors); + } + + static std::unique_ptr toValue(T* value) + { + return value->toValue(); + } + + static std::unique_ptr toValue(const std::unique_ptr& value) + { + return value->toValue(); + } +}; + +template<> +struct ValueConversions { + static bool fromValue(protocol::Value* value, ErrorSupport* errors) + { + bool result = false; + bool success = value ? value->asBoolean(&result) : false; + if (!success) + errors->addError("boolean value expected"); + return result; + } + + static std::unique_ptr toValue(bool value) + { + return FundamentalValue::create(value); + } +}; + +template<> +struct ValueConversions { + static int fromValue(protocol::Value* value, ErrorSupport* errors) + { + int result = 0; + bool success = value ? value->asInteger(&result) : false; + if (!success) + errors->addError("integer value expected"); + return result; + } + + static std::unique_ptr toValue(int value) + { + return FundamentalValue::create(value); + } +}; + +template<> +struct ValueConversions { + static double fromValue(protocol::Value* value, ErrorSupport* errors) + { + double result = 0; + bool success = value ? value->asDouble(&result) : false; + if (!success) + errors->addError("double value expected"); + return result; + } + + static std::unique_ptr toValue(double value) + { + return FundamentalValue::create(value); + } +}; + +template<> +struct ValueConversions { + static String fromValue(protocol::Value* value, ErrorSupport* errors) + { + String result; + bool success = value ? value->asString(&result) : false; + if (!success) + errors->addError("string value expected"); + return result; + } + + static std::unique_ptr toValue(const String& value) + { + return StringValue::create(value); + } +}; + +template<> +struct ValueConversions { + static std::unique_ptr fromValue(protocol::Value* value, ErrorSupport* errors) + { + bool success = !!value; + if (!success) { + errors->addError("value expected"); + return nullptr; + } + return value->clone(); + } + + static std::unique_ptr toValue(Value* value) + { + return value->clone(); + } + + static std::unique_ptr toValue(const std::unique_ptr& value) + { + return value->clone(); + } +}; + +template<> +struct ValueConversions { + static std::unique_ptr fromValue(protocol::Value* value, ErrorSupport* errors) + { + bool success = value && value->type() == protocol::Value::TypeObject; + if (!success) + errors->addError("object expected"); + return DictionaryValue::cast(value->clone()); + } + + static std::unique_ptr toValue(DictionaryValue* value) + { + return value->clone(); + } + + static std::unique_ptr toValue(const std::unique_ptr& value) + { + return value->clone(); + } +}; + +template<> +struct ValueConversions { + static std::unique_ptr fromValue(protocol::Value* value, ErrorSupport* errors) + { + bool success = value && value->type() == protocol::Value::TypeArray; + if (!success) + errors->addError("list expected"); + return ListValue::cast(value->clone()); + } + + static std::unique_ptr toValue(ListValue* value) + { + return value->clone(); + } + + static std::unique_ptr toValue(const std::unique_ptr& value) + { + return value->clone(); + } +}; + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_ValueConversions_h) diff --git a/tools/inspector_protocol/lib/Values_cpp.template b/tools/inspector_protocol/lib/Values_cpp.template new file mode 100644 index 000000000000..b9f061346bf6 --- /dev/null +++ b/tools/inspector_protocol/lib/Values_cpp.template @@ -0,0 +1,409 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//#include "Values.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +namespace { + +const char* const nullValueString = "null"; +const char* const trueValueString = "true"; +const char* const falseValueString = "false"; + +inline bool escapeChar(uint16_t c, StringBuilder* dst) +{ + switch (c) { + case '\b': StringUtil::builderAppend(*dst, "\\b"); break; + case '\f': StringUtil::builderAppend(*dst, "\\f"); break; + case '\n': StringUtil::builderAppend(*dst, "\\n"); break; + case '\r': StringUtil::builderAppend(*dst, "\\r"); break; + case '\t': StringUtil::builderAppend(*dst, "\\t"); break; + case '\\': StringUtil::builderAppend(*dst, "\\\\"); break; + case '"': StringUtil::builderAppend(*dst, "\\\""); break; + default: + return false; + } + return true; +} + +const char hexDigits[17] = "0123456789ABCDEF"; + +void appendUnsignedAsHex(uint16_t number, StringBuilder* dst) +{ + StringUtil::builderAppend(*dst, "\\u"); + for (size_t i = 0; i < 4; ++i) { + uint16_t c = hexDigits[(number & 0xF000) >> 12]; + StringUtil::builderAppend(*dst, c); + number <<= 4; + } +} + +template +void escapeStringForJSONInternal(const Char* str, unsigned len, + StringBuilder* dst) +{ + for (unsigned i = 0; i < len; ++i) { + Char c = str[i]; + if (escapeChar(c, dst)) + continue; + if (c < 32 || c > 126) { + appendUnsignedAsHex(c, dst); + } else { + StringUtil::builderAppend(*dst, c); + } + } +} + +} // anonymous namespace + +bool Value::asBoolean(bool*) const +{ + return false; +} + +bool Value::asDouble(double*) const +{ + return false; +} + +bool Value::asInteger(int*) const +{ + return false; +} + +bool Value::asString(String*) const +{ + return false; +} + +bool Value::asSerialized(String*) const +{ + return false; +} + +void Value::writeJSON(StringBuilder* output) const +{ + DCHECK(m_type == TypeNull); + StringUtil::builderAppend(*output, nullValueString, 4); +} + +std::unique_ptr Value::clone() const +{ + return Value::null(); +} + +String Value::serialize() +{ + StringBuilder result; + StringUtil::builderReserve(result, 512); + writeJSON(&result); + return StringUtil::builderToString(result); +} + +bool FundamentalValue::asBoolean(bool* output) const +{ + if (type() != TypeBoolean) + return false; + *output = m_boolValue; + return true; +} + +bool FundamentalValue::asDouble(double* output) const +{ + if (type() == TypeDouble) { + *output = m_doubleValue; + return true; + } + if (type() == TypeInteger) { + *output = m_integerValue; + return true; + } + return false; +} + +bool FundamentalValue::asInteger(int* output) const +{ + if (type() != TypeInteger) + return false; + *output = m_integerValue; + return true; +} + +void FundamentalValue::writeJSON(StringBuilder* output) const +{ + DCHECK(type() == TypeBoolean || type() == TypeInteger || type() == TypeDouble); + if (type() == TypeBoolean) { + if (m_boolValue) + StringUtil::builderAppend(*output, trueValueString, 4); + else + StringUtil::builderAppend(*output, falseValueString, 5); + } else if (type() == TypeDouble) { + if (!std::isfinite(m_doubleValue)) { + StringUtil::builderAppend(*output, nullValueString, 4); + return; + } + StringUtil::builderAppend(*output, StringUtil::fromDouble(m_doubleValue)); + } else if (type() == TypeInteger) { + StringUtil::builderAppend(*output, StringUtil::fromInteger(m_integerValue)); + } +} + +std::unique_ptr FundamentalValue::clone() const +{ + switch (type()) { + case TypeDouble: return FundamentalValue::create(m_doubleValue); + case TypeInteger: return FundamentalValue::create(m_integerValue); + case TypeBoolean: return FundamentalValue::create(m_boolValue); + default: + DCHECK(false); + } + return nullptr; +} + +bool StringValue::asString(String* output) const +{ + *output = m_stringValue; + return true; +} + +void StringValue::writeJSON(StringBuilder* output) const +{ + DCHECK(type() == TypeString); + StringUtil::builderAppendQuotedString(*output, m_stringValue); +} + +std::unique_ptr StringValue::clone() const +{ + return StringValue::create(m_stringValue); +} + +bool SerializedValue::asSerialized(String* output) const +{ + *output = m_serializedValue; + return true; +} + +void SerializedValue::writeJSON(StringBuilder* output) const +{ + DCHECK(type() == TypeSerialized); + StringUtil::builderAppend(*output, m_serializedValue); +} + +std::unique_ptr SerializedValue::clone() const +{ + return SerializedValue::create(m_serializedValue); +} + +DictionaryValue::~DictionaryValue() +{ +} + +void DictionaryValue::setBoolean(const String& name, bool value) +{ + setValue(name, FundamentalValue::create(value)); +} + +void DictionaryValue::setInteger(const String& name, int value) +{ + setValue(name, FundamentalValue::create(value)); +} + +void DictionaryValue::setDouble(const String& name, double value) +{ + setValue(name, FundamentalValue::create(value)); +} + +void DictionaryValue::setString(const String& name, const String& value) +{ + setValue(name, StringValue::create(value)); +} + +void DictionaryValue::setValue(const String& name, std::unique_ptr value) +{ + set(name, value); +} + +void DictionaryValue::setObject(const String& name, std::unique_ptr value) +{ + set(name, value); +} + +void DictionaryValue::setArray(const String& name, std::unique_ptr value) +{ + set(name, value); +} + +bool DictionaryValue::getBoolean(const String& name, bool* output) const +{ + protocol::Value* value = get(name); + if (!value) + return false; + return value->asBoolean(output); +} + +bool DictionaryValue::getInteger(const String& name, int* output) const +{ + Value* value = get(name); + if (!value) + return false; + return value->asInteger(output); +} + +bool DictionaryValue::getDouble(const String& name, double* output) const +{ + Value* value = get(name); + if (!value) + return false; + return value->asDouble(output); +} + +bool DictionaryValue::getString(const String& name, String* output) const +{ + protocol::Value* value = get(name); + if (!value) + return false; + return value->asString(output); +} + +DictionaryValue* DictionaryValue::getObject(const String& name) const +{ + return DictionaryValue::cast(get(name)); +} + +protocol::ListValue* DictionaryValue::getArray(const String& name) const +{ + return ListValue::cast(get(name)); +} + +protocol::Value* DictionaryValue::get(const String& name) const +{ + Dictionary::const_iterator it = m_data.find(name); + if (it == m_data.end()) + return nullptr; + return it->second.get(); +} + +DictionaryValue::Entry DictionaryValue::at(size_t index) const +{ + const String key = m_order[index]; + return std::make_pair(key, m_data.find(key)->second.get()); +} + +bool DictionaryValue::booleanProperty(const String& name, bool defaultValue) const +{ + bool result = defaultValue; + getBoolean(name, &result); + return result; +} + +int DictionaryValue::integerProperty(const String& name, int defaultValue) const +{ + int result = defaultValue; + getInteger(name, &result); + return result; +} + +double DictionaryValue::doubleProperty(const String& name, double defaultValue) const +{ + double result = defaultValue; + getDouble(name, &result); + return result; +} + +void DictionaryValue::remove(const String& name) +{ + m_data.erase(name); + m_order.erase(std::remove(m_order.begin(), m_order.end(), name), m_order.end()); +} + +void DictionaryValue::writeJSON(StringBuilder* output) const +{ + StringUtil::builderAppend(*output, '{'); + for (size_t i = 0; i < m_order.size(); ++i) { + Dictionary::const_iterator it = m_data.find(m_order[i]); + CHECK(it != m_data.end()); + if (i) + StringUtil::builderAppend(*output, ','); + StringUtil::builderAppendQuotedString(*output, it->first); + StringUtil::builderAppend(*output, ':'); + it->second->writeJSON(output); + } + StringUtil::builderAppend(*output, '}'); +} + +std::unique_ptr DictionaryValue::clone() const +{ + std::unique_ptr result = DictionaryValue::create(); + for (size_t i = 0; i < m_order.size(); ++i) { + String key = m_order[i]; + Dictionary::const_iterator value = m_data.find(key); + DCHECK(value != m_data.cend() && value->second); + result->setValue(key, value->second->clone()); + } + return std::move(result); +} + +DictionaryValue::DictionaryValue() + : Value(TypeObject) +{ +} + +ListValue::~ListValue() +{ +} + +void ListValue::writeJSON(StringBuilder* output) const +{ + StringUtil::builderAppend(*output, '['); + bool first = true; + for (const std::unique_ptr& value : m_data) { + if (!first) + StringUtil::builderAppend(*output, ','); + value->writeJSON(output); + first = false; + } + StringUtil::builderAppend(*output, ']'); +} + +std::unique_ptr ListValue::clone() const +{ + std::unique_ptr result = ListValue::create(); + for (const std::unique_ptr& value : m_data) + result->pushValue(value->clone()); + return std::move(result); +} + +ListValue::ListValue() + : Value(TypeArray) +{ +} + +void ListValue::pushValue(std::unique_ptr value) +{ + DCHECK(value); + m_data.push_back(std::move(value)); +} + +protocol::Value* ListValue::at(size_t index) +{ + DCHECK_LT(index, m_data.size()); + return m_data[index].get(); +} + +void escapeLatinStringForJSON(const uint8_t* str, unsigned len, StringBuilder* dst) +{ + escapeStringForJSONInternal(str, len, dst); +} + +void escapeWideStringForJSON(const uint16_t* str, unsigned len, StringBuilder* dst) +{ + escapeStringForJSONInternal(str, len, dst); +} + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/lib/Values_h.template b/tools/inspector_protocol/lib/Values_h.template new file mode 100644 index 000000000000..3638b34b4e77 --- /dev/null +++ b/tools/inspector_protocol/lib/Values_h.template @@ -0,0 +1,249 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_Values_h +#define {{"_".join(config.protocol.namespace)}}_Values_h + +//#include "Allocator.h" +//#include "Collections.h" +//#include "Forward.h" + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + +class ListValue; +class DictionaryValue; +class Value; + +class {{config.lib.export_macro}} Value : public Serializable { + PROTOCOL_DISALLOW_COPY(Value); +public: + virtual ~Value() override { } + + static std::unique_ptr null() + { + return std::unique_ptr(new Value()); + } + + enum ValueType { + TypeNull = 0, + TypeBoolean, + TypeInteger, + TypeDouble, + TypeString, + TypeObject, + TypeArray, + TypeSerialized + }; + + ValueType type() const { return m_type; } + + bool isNull() const { return m_type == TypeNull; } + + virtual bool asBoolean(bool* output) const; + virtual bool asDouble(double* output) const; + virtual bool asInteger(int* output) const; + virtual bool asString(String* output) const; + virtual bool asSerialized(String* output) const; + + virtual void writeJSON(StringBuilder* output) const; + virtual std::unique_ptr clone() const; + String serialize() override; + +protected: + Value() : m_type(TypeNull) { } + explicit Value(ValueType type) : m_type(type) { } + +private: + friend class DictionaryValue; + friend class ListValue; + + ValueType m_type; +}; + +class {{config.lib.export_macro}} FundamentalValue : public Value { +public: + static std::unique_ptr create(bool value) + { + return std::unique_ptr(new FundamentalValue(value)); + } + + static std::unique_ptr create(int value) + { + return std::unique_ptr(new FundamentalValue(value)); + } + + static std::unique_ptr create(double value) + { + return std::unique_ptr(new FundamentalValue(value)); + } + + bool asBoolean(bool* output) const override; + bool asDouble(double* output) const override; + bool asInteger(int* output) const override; + void writeJSON(StringBuilder* output) const override; + std::unique_ptr clone() const override; + +private: + explicit FundamentalValue(bool value) : Value(TypeBoolean), m_boolValue(value) { } + explicit FundamentalValue(int value) : Value(TypeInteger), m_integerValue(value) { } + explicit FundamentalValue(double value) : Value(TypeDouble), m_doubleValue(value) { } + + union { + bool m_boolValue; + double m_doubleValue; + int m_integerValue; + }; +}; + +class {{config.lib.export_macro}} StringValue : public Value { +public: + static std::unique_ptr create(const String& value) + { + return std::unique_ptr(new StringValue(value)); + } + + static std::unique_ptr create(const char* value) + { + return std::unique_ptr(new StringValue(value)); + } + + bool asString(String* output) const override; + void writeJSON(StringBuilder* output) const override; + std::unique_ptr clone() const override; + +private: + explicit StringValue(const String& value) : Value(TypeString), m_stringValue(value) { } + explicit StringValue(const char* value) : Value(TypeString), m_stringValue(value) { } + + String m_stringValue; +}; + +class {{config.lib.export_macro}} SerializedValue : public Value { +public: + static std::unique_ptr create(const String& value) + { + return std::unique_ptr(new SerializedValue(value)); + } + + bool asSerialized(String* output) const override; + void writeJSON(StringBuilder* output) const override; + std::unique_ptr clone() const override; + +private: + explicit SerializedValue(const String& value) : Value(TypeSerialized), m_serializedValue(value) { } + + String m_serializedValue; +}; + +class {{config.lib.export_macro}} DictionaryValue : public Value { +public: + using Entry = std::pair; + static std::unique_ptr create() + { + return std::unique_ptr(new DictionaryValue()); + } + + static DictionaryValue* cast(Value* value) + { + if (!value || value->type() != TypeObject) + return nullptr; + return static_cast(value); + } + + static std::unique_ptr cast(std::unique_ptr value) + { + return std::unique_ptr(DictionaryValue::cast(value.release())); + } + + void writeJSON(StringBuilder* output) const override; + std::unique_ptr clone() const override; + + size_t size() const { return m_data.size(); } + + void setBoolean(const String& name, bool); + void setInteger(const String& name, int); + void setDouble(const String& name, double); + void setString(const String& name, const String&); + void setValue(const String& name, std::unique_ptr); + void setObject(const String& name, std::unique_ptr); + void setArray(const String& name, std::unique_ptr); + + bool getBoolean(const String& name, bool* output) const; + bool getInteger(const String& name, int* output) const; + bool getDouble(const String& name, double* output) const; + bool getString(const String& name, String* output) const; + + DictionaryValue* getObject(const String& name) const; + ListValue* getArray(const String& name) const; + Value* get(const String& name) const; + Entry at(size_t index) const; + + bool booleanProperty(const String& name, bool defaultValue) const; + int integerProperty(const String& name, int defaultValue) const; + double doubleProperty(const String& name, double defaultValue) const; + void remove(const String& name); + + ~DictionaryValue() override; + +private: + DictionaryValue(); + template + void set(const String& key, std::unique_ptr& value) + { + DCHECK(value); + bool isNew = m_data.find(key) == m_data.end(); + m_data[key] = std::move(value); + if (isNew) + m_order.push_back(key); + } + + using Dictionary = protocol::HashMap>; + Dictionary m_data; + std::vector m_order; +}; + +class {{config.lib.export_macro}} ListValue : public Value { +public: + static std::unique_ptr create() + { + return std::unique_ptr(new ListValue()); + } + + static ListValue* cast(Value* value) + { + if (!value || value->type() != TypeArray) + return nullptr; + return static_cast(value); + } + + static std::unique_ptr cast(std::unique_ptr value) + { + return std::unique_ptr(ListValue::cast(value.release())); + } + + ~ListValue() override; + + void writeJSON(StringBuilder* output) const override; + std::unique_ptr clone() const override; + + void pushValue(std::unique_ptr); + + Value* at(size_t index); + size_t size() const { return m_data.size(); } + +private: + ListValue(); + std::vector> m_data; +}; + +void escapeLatinStringForJSON(const uint8_t* str, unsigned len, StringBuilder* dst); +void escapeWideStringForJSON(const uint16_t* str, unsigned len, StringBuilder* dst); + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // {{"_".join(config.protocol.namespace)}}_Values_h diff --git a/tools/inspector_protocol/templates/Exported_h.template b/tools/inspector_protocol/templates/Exported_h.template new file mode 100644 index 000000000000..3d36ecffae3c --- /dev/null +++ b/tools/inspector_protocol/templates/Exported_h.template @@ -0,0 +1,65 @@ +// This file is generated + +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h +#define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h + +{% if config.exported.export_header %} +#include {{format_include(config.exported.export_header)}} +{% endif %} +#include {{format_include(config.exported.string_header)}} + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} +namespace {{domain.domain}} { +namespace API { + +// ------------- Enums. + {% for type in domain.types %} + {% if ("enum" in type) and protocol.is_exported(domain.domain, type.id) %} + +namespace {{type.id}}Enum { + {% for literal in type.enum %} +{{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelcase}}; + {% endfor %} +} // {{type.id}}Enum + {% endif %} + {% endfor %} + {% for command in join_arrays(domain, ["commands", "events"]) %} + {% for param in join_arrays(command, ["parameters", "returns"]) %} + {% if ("enum" in param) and protocol.is_exported(domain.domain, command.name + "." + param.name) %} + +namespace {{command.name | to_title_case}} { +namespace {{param.name | to_title_case}}Enum { + {% for literal in param.enum %} +{{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelcase}}; + {% endfor %} +} // {{param.name | to_title_case}}Enum +} // {{command.name | to_title_case }} + {% endif %} + {% endfor %} + {% endfor %} + +// ------------- Types. + {% for type in domain.types %} + {% if not (type.type == "object") or not ("properties" in type) or not protocol.is_exported(domain.domain, type.id) %}{% continue %}{% endif %} + +class {{config.exported.export_macro}} {{type.id}} { +public: + virtual {{config.exported.string_out}} toJSONString() const = 0; + virtual ~{{type.id}}() { } + static std::unique_ptr fromJSONString(const {{config.exported.string_in}}& json); +}; + {% endfor %} + +} // namespace API +} // namespace {{domain.domain}} +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h) diff --git a/tools/inspector_protocol/templates/Imported_h.template b/tools/inspector_protocol/templates/Imported_h.template new file mode 100644 index 000000000000..4c9d24bd5fcc --- /dev/null +++ b/tools/inspector_protocol/templates/Imported_h.template @@ -0,0 +1,55 @@ +// This file is generated + +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h +#define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h + +#include {{format_include(config.protocol.package, "Protocol")}} +{% if config.imported.header %} +#include {{format_include(config.imported.header)}} +{% else %} +#include {{format_include(config.imported.package, domain.domain)}} +{% endif %} + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} + {% for type in domain.types %} + {% if not (type.type == "object") or not ("properties" in type) or not protocol.is_imported(domain.domain, type.id) %}{% continue %}{% endif %} + +template<> +struct ValueConversions<{{"::".join(config.imported.namespace)}}::{{domain.domain}}::API::{{type.id}}> { + static std::unique_ptr<{{"::".join(config.imported.namespace)}}::{{domain.domain}}::API::{{type.id}}> fromValue(protocol::Value* value, ErrorSupport* errors) + { + if (!value) { + errors->addError("value expected"); + return nullptr; + } + String json = value->serialize(); + auto result = {{"::".join(config.imported.namespace)}}::{{domain.domain}}::API::{{type.id}}::fromJSONString({{config.imported.to_imported_string % "json"}}); + if (!result) + errors->addError("cannot parse"); + return result; + } + + static std::unique_ptr toValue(const {{"::".join(config.imported.namespace)}}::{{domain.domain}}::API::{{type.id}}* value) + { + auto json = value->toJSONString(); + return SerializedValue::create({{config.imported.from_imported_string % "std::move(json)"}}); + } + + static std::unique_ptr toValue(const std::unique_ptr<{{"::".join(config.imported.namespace)}}::{{domain.domain}}::API::{{type.id}}>& value) + { + return toValue(value.get()); + } +}; + {% endfor %} + +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h) diff --git a/tools/inspector_protocol/templates/TypeBuilder_cpp.template b/tools/inspector_protocol/templates/TypeBuilder_cpp.template new file mode 100644 index 000000000000..026c1cdb8da9 --- /dev/null +++ b/tools/inspector_protocol/templates/TypeBuilder_cpp.template @@ -0,0 +1,397 @@ +// This file is generated + +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include {{format_include(config.protocol.package, domain.domain)}} + +#include {{format_include(config.protocol.package, "Protocol")}} + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} +namespace {{domain.domain}} { + +// ------------- Enum values from types. + +const char Metainfo::domainName[] = "{{domain.domain}}"; +const char Metainfo::commandPrefix[] = "{{domain.domain}}."; +const char Metainfo::version[] = "{{domain.version}}"; + {% for type in domain.types %} + {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %} {% endif %} + {% if "enum" in type %} + +namespace {{type.id}}Enum { + {% for literal in type.enum %} +const char* {{ literal | dash_to_camelcase}} = "{{literal}}"; + {% endfor %} +} // namespace {{type.id}}Enum + {% if protocol.is_exported(domain.domain, type.id) %} + +namespace API { +namespace {{type.id}}Enum { + {% for literal in type.enum %} +const char* {{ literal | dash_to_camelcase}} = "{{literal}}"; + {% endfor %} +} // namespace {{type.id}}Enum +} // namespace API + {% endif %} + {% endif %} + {% for property in type.properties %} + {% if "enum" in property %} + + {% for literal in property.enum %} +const char* {{type.id}}::{{property.name | to_title_case}}Enum::{{literal | dash_to_camelcase}} = "{{literal}}"; + {% endfor %} + {% endif %} + {% endfor %} + {% if not (type.type == "object") or not ("properties" in type) %}{% continue %}{% endif %} + +std::unique_ptr<{{type.id}}> {{type.id}}::fromValue(protocol::Value* value, ErrorSupport* errors) +{ + if (!value || value->type() != protocol::Value::TypeObject) { + errors->addError("object expected"); + return nullptr; + } + + std::unique_ptr<{{type.id}}> result(new {{type.id}}()); + protocol::DictionaryValue* object = DictionaryValue::cast(value); + errors->push(); + {% for property in type.properties %} + protocol::Value* {{property.name}}Value = object->get("{{property.name}}"); + {% if property.optional %} + if ({{property.name}}Value) { + errors->setName("{{property.name}}"); + result->m_{{property.name}} = ValueConversions<{{protocol.resolve_type(property).raw_type}}>::fromValue({{property.name}}Value, errors); + } + {% else %} + errors->setName("{{property.name}}"); + result->m_{{property.name}} = ValueConversions<{{protocol.resolve_type(property).raw_type}}>::fromValue({{property.name}}Value, errors); + {% endif %} + {% endfor %} + errors->pop(); + if (errors->hasErrors()) + return nullptr; + return result; +} + +std::unique_ptr {{type.id}}::toValue() const +{ + std::unique_ptr result = DictionaryValue::create(); + {% for property in type.properties %} + {% set property_type = protocol.resolve_type(property) %} + {% set property_field = "m_" + property.name %} + {% if property.optional %} + if ({{property_field}}.isJust()) + result->setValue("{{property.name}}", ValueConversions<{{property_type.raw_type}}>::toValue({{property_field}}.fromJust())); + {% else %} + result->setValue("{{property.name}}", ValueConversions<{{property_type.raw_type}}>::toValue({{property_type.to_raw_type % property_field}})); + {% endif %} + {% endfor %} + return result; +} + +std::unique_ptr<{{type.id}}> {{type.id}}::clone() const +{ + ErrorSupport errors; + return fromValue(toValue().get(), &errors); +} + {% if protocol.is_exported(domain.domain, type.id) %} + +{{config.exported.string_out}} {{type.id}}::toJSONString() const +{ + String json = toValue()->serialize(); + return {{config.exported.to_string_out % "json"}}; +} + +// static +std::unique_ptr API::{{type.id}}::fromJSONString(const {{config.exported.string_in}}& json) +{ + ErrorSupport errors; + std::unique_ptr value = StringUtil::parseJSON(json); + if (!value) + return nullptr; + return protocol::{{domain.domain}}::{{type.id}}::fromValue(value.get(), &errors); +} + {% endif %} + {% endfor %} + +// ------------- Enum values from params. + + {% for command in join_arrays(domain, ["commands", "events"]) %} + {% for param in join_arrays(command, ["parameters", "returns"]) %} + {% if "enum" in param %} + +namespace {{command.name | to_title_case}} { +namespace {{param.name | to_title_case}}Enum { + {% for literal in param.enum %} +const char* {{ literal | to_title_case}} = "{{literal}}"; + {% endfor %} +} // namespace {{param.name | to_title_case}}Enum +} // namespace {{command.name | to_title_case }} + {% if protocol.is_exported(domain.domain, command.name + "." + param.name) %} + +namespace API { +namespace {{command.name | to_title_case}} { +namespace {{param.name | to_title_case}}Enum { + {% for literal in param.enum %} +const char* {{ literal | to_title_case}} = "{{literal}}"; + {% endfor %} +} // namespace {{param.name | to_title_case}}Enum +} // namespace {{command.name | to_title_case }} +} // namespace API + {% endif %} + {% endif %} + {% endfor %} + {% endfor %} + +// ------------- Frontend notifications. + {% for event in domain.events %} + {% if not protocol.generate_event(domain.domain, event.name) %}{% continue %}{% endif %} + +void Frontend::{{event.name | to_method_case}}( + {%- for parameter in event.parameters %} + {% if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> + {%- else -%} + {{protocol.resolve_type(parameter).pass_type}} + {%- endif %} {{parameter.name}}{%- if not loop.last -%}, {% endif -%} + {% endfor -%}) +{ + if (!m_frontendChannel) + return; + {% if event.parameters %} + std::unique_ptr<{{event.name | to_title_case}}Notification> messageData = {{event.name | to_title_case}}Notification::{{"create" | to_method_case}}() + {% for parameter in event.parameters %} + {% if not "optional" in parameter %} + .{{"set" | to_method_case}}{{parameter.name | to_title_case}}({{protocol.resolve_type(parameter).to_pass_type % parameter.name}}) + {% endif %} + {% endfor %} + .{{ "build" | to_method_case }}(); + {% for parameter in event.parameters %} + {% if "optional" in parameter %} + if ({{parameter.name}}.isJust()) + messageData->{{"set" | to_method_case}}{{parameter.name | to_title_case}}(std::move({{parameter.name}}).takeJust()); + {% endif %} + {% endfor %} + m_frontendChannel->sendProtocolNotification(InternalResponse::createNotification("{{domain.domain}}.{{event.name}}", std::move(messageData))); + {% else %} + m_frontendChannel->sendProtocolNotification(InternalResponse::createNotification("{{domain.domain}}.{{event.name}}")); + {% endif %} +} + {% endfor %} + +void Frontend::flush() +{ + m_frontendChannel->flushProtocolNotifications(); +} + +void Frontend::sendRawNotification(const String& notification) +{ + m_frontendChannel->sendProtocolNotification(InternalRawNotification::create(notification)); +} + +// --------------------- Dispatcher. + +class DispatcherImpl : public protocol::DispatcherBase { +public: + DispatcherImpl(FrontendChannel* frontendChannel, Backend* backend, bool fallThroughForNotFound) + : DispatcherBase(frontendChannel) + , m_backend(backend) + , m_fallThroughForNotFound(fallThroughForNotFound) { + {% for command in domain.commands %} + {% if "redirect" in command %} + m_redirects["{{domain.domain}}.{{command.name}}"] = "{{command.redirect}}.{{command.name}}"; + {% continue %} + {% endif %} + {% if not protocol.generate_command(domain.domain, command.name) %}{% continue %}{% endif %} + m_dispatchMap["{{domain.domain}}.{{command.name}}"] = &DispatcherImpl::{{command.name}}; + {% endfor %} + } + ~DispatcherImpl() override { } + DispatchResponse::Status dispatch(int callId, const String& method, std::unique_ptr messageObject) override; + HashMap& redirects() { return m_redirects; } + +protected: + using CallHandler = DispatchResponse::Status (DispatcherImpl::*)(int callId, std::unique_ptr messageObject, ErrorSupport* errors); + using DispatchMap = protocol::HashMap; + DispatchMap m_dispatchMap; + HashMap m_redirects; + + {% for command in domain.commands %} + {% if "redirect" in command %}{% continue %}{% endif %} + {% if not protocol.generate_command(domain.domain, command.name) %}{% continue %}{% endif %} + DispatchResponse::Status {{command.name}}(int callId, std::unique_ptr requestMessageObject, ErrorSupport*); + {% endfor %} + + Backend* m_backend; + bool m_fallThroughForNotFound; +}; + +DispatchResponse::Status DispatcherImpl::dispatch(int callId, const String& method, std::unique_ptr messageObject) +{ + protocol::HashMap::iterator it = m_dispatchMap.find(method); + if (it == m_dispatchMap.end()) { + if (m_fallThroughForNotFound) + return DispatchResponse::kFallThrough; + reportProtocolError(callId, DispatchResponse::kMethodNotFound, "'" + method + "' wasn't found", nullptr); + return DispatchResponse::kError; + } + + protocol::ErrorSupport errors; + return (this->*(it->second))(callId, std::move(messageObject), &errors); +} + + {% for command in domain.commands %} + {% set command_name_title = command.name | to_title_case %} + {% if "redirect" in command %}{% continue %}{% endif %} + {% if not protocol.generate_command(domain.domain, command.name) %}{% continue %}{% endif %} + {% if protocol.is_async_command(domain.domain, command.name) %} + +class {{command_name_title}}CallbackImpl : public Backend::{{command_name_title}}Callback, public DispatcherBase::Callback { +public: + {{command_name_title}}CallbackImpl(std::unique_ptr backendImpl, int callId, int callbackId) + : DispatcherBase::Callback(std::move(backendImpl), callId, callbackId) { } + + void sendSuccess( + {%- for parameter in command.returns -%} + {%- if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> {{parameter.name}} + {%- else -%} + {{protocol.resolve_type(parameter).pass_type}} {{parameter.name}} + {%- endif -%} + {%- if not loop.last -%}, {% endif -%} + {%- endfor -%}) override + { + std::unique_ptr resultObject = DictionaryValue::create(); + {% for parameter in command.returns %} + {% if "optional" in parameter %} + if ({{parameter.name}}.isJust()) + resultObject->setValue("{{parameter.name}}", ValueConversions<{{protocol.resolve_type(parameter).raw_type}}>::toValue({{parameter.name}}.fromJust())); + {% else %} + resultObject->setValue("{{parameter.name}}", ValueConversions<{{protocol.resolve_type(parameter).raw_type}}>::toValue({{protocol.resolve_type(parameter).to_raw_type % parameter.name}})); + {% endif %} + {% endfor %} + sendIfActive(std::move(resultObject), DispatchResponse::OK()); + } + + void fallThrough() override + { + fallThroughIfActive(); + } + + void sendFailure(const DispatchResponse& response) override + { + DCHECK(response.status() == DispatchResponse::kError); + sendIfActive(nullptr, response); + } +}; + {% endif %} + +DispatchResponse::Status DispatcherImpl::{{command.name}}(int callId, std::unique_ptr requestMessageObject, ErrorSupport* errors) +{ + {% if "parameters" in command %} + // Prepare input parameters. + protocol::DictionaryValue* object = DictionaryValue::cast(requestMessageObject->get("params")); + errors->push(); + {% for parameter in command.parameters %} + {% set parameter_type = protocol.resolve_type(parameter) %} + protocol::Value* {{parameter.name}}Value = object ? object->get("{{parameter.name}}") : nullptr; + {% if parameter.optional %} + Maybe<{{parameter_type.raw_type}}> in_{{parameter.name}}; + if ({{parameter.name}}Value) { + errors->setName("{{parameter.name}}"); + in_{{parameter.name}} = ValueConversions<{{parameter_type.raw_type}}>::fromValue({{parameter.name}}Value, errors); + } + {% else %} + errors->setName("{{parameter.name}}"); + {{parameter_type.type}} in_{{parameter.name}} = ValueConversions<{{parameter_type.raw_type}}>::fromValue({{parameter.name}}Value, errors); + {% endif %} + {% endfor %} + errors->pop(); + if (errors->hasErrors()) { + reportProtocolError(callId, DispatchResponse::kInvalidParams, kInvalidParamsString, errors); + return DispatchResponse::kError; + } + {% endif %} + {% if "returns" in command and not protocol.is_async_command(domain.domain, command.name) %} + // Declare output parameters. + {% for parameter in command.returns %} + {% if "optional" in parameter %} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> out_{{parameter.name}}; + {% else %} + {{protocol.resolve_type(parameter).type}} out_{{parameter.name}}; + {% endif %} + {% endfor %} + {% endif %} + + {% if not protocol.is_async_command(domain.domain, command.name) %} + std::unique_ptr weak = weakPtr(); + DispatchResponse response = m_backend->{{command.name | to_method_case}}( + {%- for parameter in command.parameters -%} + {%- if not loop.first -%}, {% endif -%} + {%- if "optional" in parameter -%} + std::move(in_{{parameter.name}}) + {%- else -%} + {{protocol.resolve_type(parameter).to_pass_type % ("in_" + parameter.name)}} + {%- endif -%} + {%- endfor %} + {%- if "returns" in command %} + {%- for parameter in command.returns -%} + {%- if not loop.first or command.parameters -%}, {% endif -%} + &out_{{parameter.name}} + {%- endfor %} + {% endif %}); + if (response.status() == DispatchResponse::kFallThrough) + return response.status(); + {% if "returns" in command %} + std::unique_ptr result = DictionaryValue::create(); + if (response.status() == DispatchResponse::kSuccess) { + {% for parameter in command.returns %} + {% if "optional" in parameter %} + if (out_{{parameter.name}}.isJust()) + result->setValue("{{parameter.name}}", ValueConversions<{{protocol.resolve_type(parameter).raw_type}}>::toValue(out_{{parameter.name}}.fromJust())); + {% else %} + result->setValue("{{parameter.name}}", ValueConversions<{{protocol.resolve_type(parameter).raw_type}}>::toValue({{protocol.resolve_type(parameter).to_raw_type % ("out_" + parameter.name)}})); + {% endif %} + {% endfor %} + } + if (weak->get()) + weak->get()->sendResponse(callId, response, std::move(result)); + {% else %} + if (weak->get()) + weak->get()->sendResponse(callId, response); + {% endif %} + return response.status(); + {% else %} + std::unique_ptr weak = weakPtr(); + std::unique_ptr<{{command_name_title}}CallbackImpl> callback(new {{command.name | to_title_case}}CallbackImpl(weakPtr(), callId, nextCallbackId())); + m_backend->{{command.name | to_method_case}}( + {%- for property in command.parameters -%} + {%- if not loop.first -%}, {% endif -%} + {%- if "optional" in property -%} + std::move(in_{{property.name}}) + {%- else -%} + {{protocol.resolve_type(property).to_pass_type % ("in_" + property.name)}} + {%- endif -%} + {%- endfor -%} + {%- if command.parameters -%}, {% endif -%} + std::move(callback)); + return (weak->get() && weak->get()->lastCallbackFallThrough()) ? DispatchResponse::kFallThrough : DispatchResponse::kAsync; + {% endif %} +} + {% endfor %} + +// static +void Dispatcher::wire(UberDispatcher* uber, Backend* backend) +{ + std::unique_ptr dispatcher(new DispatcherImpl(uber->channel(), backend, uber->fallThroughForNotFound())); + uber->setupRedirects(dispatcher->redirects()); + uber->registerBackend("{{domain.domain}}", std::move(dispatcher)); +} + +} // {{domain.domain}} +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} diff --git a/tools/inspector_protocol/templates/TypeBuilder_h.template b/tools/inspector_protocol/templates/TypeBuilder_h.template new file mode 100644 index 000000000000..744d496026a2 --- /dev/null +++ b/tools/inspector_protocol/templates/TypeBuilder_h.template @@ -0,0 +1,301 @@ +// This file is generated + +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_h +#define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_h + +{% if config.protocol.export_header %} +#include {{format_include(config.protocol.export_header)}} +{% endif %} +#include {{format_include(config.protocol.package, "Protocol")}} +// For each imported domain we generate a ValueConversions struct instead of a full domain definition +// and include Domain::API version from there. +{% for name in domain.dependencies %} + {% if protocol.is_imported_dependency(name) %} +#include {{format_include(config.protocol.package, name)}} + {% endif %} +{% endfor %} +{% if protocol.is_exported_domain(domain.domain) %} +#include {{format_include(config.exported.package, domain.domain)}} +{% endif %} + +{% for namespace in config.protocol.namespace %} +namespace {{namespace}} { +{% endfor %} +namespace {{domain.domain}} { + +// ------------- Forward and enum declarations. + {% for type in domain.types %} + {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %} + {% if type.type == "object" %} + {% if "properties" in type %} +class {{type.id}}; + {% else %} +using {{type.id}} = Object; + {% endif %} + {% elif type.type != "array" %} +using {{type.id}} = {{protocol.resolve_type(type).type}}; + {% endif %} + {% endfor %} + {% for type in domain.types %} + {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %} + {% if "enum" in type %} + +namespace {{type.id}}Enum { + {% for literal in type.enum %} +{{config.protocol.export_macro}} extern const char* {{ literal | dash_to_camelcase}}; + {% endfor %} +} // namespace {{type.id}}Enum + {% endif %} + {% endfor %} + {% for command in join_arrays(domain, ["commands", "events"]) %} + {% for param in join_arrays(command, ["parameters", "returns"]) %} + {% if "enum" in param %} + +namespace {{command.name | to_title_case}} { +namespace {{param.name | to_title_case}}Enum { + {% for literal in param.enum %} +{{config.protocol.export_macro}} extern const char* {{literal | dash_to_camelcase}}; + {% endfor %} +} // {{param.name | to_title_case}}Enum +} // {{command.name | to_title_case }} + {% endif %} + {% endfor %} + {% endfor %} + +// ------------- Type and builder declarations. + {% for type in domain.types %} + {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %} + {% if not (type.type == "object") or not ("properties" in type) %}{% continue %}{% endif %} + +class {{config.protocol.export_macro}} {{type.id}} : public Serializable{% if protocol.is_exported(domain.domain, type.id) %}, public API::{{type.id}}{% endif %}{ + PROTOCOL_DISALLOW_COPY({{type.id}}); +public: + static std::unique_ptr<{{type.id}}> fromValue(protocol::Value* value, ErrorSupport* errors); + + ~{{type.id}}() override { } + {% for property in type.properties %} + {% set property_type = protocol.resolve_type(property) %} + {% set property_name = property.name | to_title_case %} + {% set property_field = "m_" + property.name %} + {% if "enum" in property %} + + struct {{config.protocol.export_macro}} {{property_name}}Enum { + {% for literal in property.enum %} + static const char* {{literal | dash_to_camelcase}}; + {% endfor %} + }; // {{property_name}}Enum + {% endif %} + + {% if property.optional %} + bool {{"has" | to_method_case}}{{property_name}}() { return {{property_field}}.isJust(); } + {{property_type.raw_return_type}} {{"get" | to_method_case}}{{property_name}}({{property_type.raw_pass_type}} defaultValue) { return {{property_field}}.isJust() ? {{property_field}}.fromJust() : defaultValue; } + {% else %} + {{property_type.raw_return_type}} {{"get" | to_method_case}}{{property_name}}() { return {{property_type.to_raw_type % property_field}}; } + {% endif %} + void {{"set" | to_method_case}}{{property_name}}({{property_type.pass_type}} value) { {{property_field}} = {{property_type.to_rvalue % "value"}}; } + {% endfor %} + + std::unique_ptr toValue() const; + String serialize() override { return toValue()->serialize(); } + std::unique_ptr<{{type.id}}> clone() const; + {% if protocol.is_exported(domain.domain, type.id) %} + {{config.exported.string_out}} toJSONString() const override; + {% endif %} + + template + class {{type.id}}Builder { + public: + enum { + NoFieldsSet = 0, + {% for property in type.properties|rejectattr("optional") %} + {{property.name | to_title_case}}Set = 1 << {{loop.index}}, + {% endfor %} + AllFieldsSet = ( + {%- for property in type.properties %} + {% if not(property.optional) %}{{property.name | to_title_case}}Set | {%endif %} + {% endfor %}0)}; + + {% for property in type.properties %} + {% set property_type = protocol.resolve_type(property) %} + {% set property_name = property.name | to_title_case %} + + {% if property.optional %} + {{type.id}}Builder& {{"set" | to_method_case}}{{property_name}}({{property_type.pass_type}} value) + { + m_result->{{"set" | to_method_case}}{{property_name}}({{property_type.to_rvalue % "value"}}); + return *this; + } + {% else %} + {{type.id}}Builder& {{"set" | to_method_case}}{{property_name}}({{property_type.pass_type}} value) + { + static_assert(!(STATE & {{property_name}}Set), "property {{property.name}} should not be set yet"); + m_result->{{"set" | to_method_case}}{{property_name}}({{property_type.to_rvalue % "value"}}); + return castState<{{property_name}}Set>(); + } + {% endif %} + {% endfor %} + + std::unique_ptr<{{type.id}}> {{"build" | to_method_case}}() + { + static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet"); + return std::move(m_result); + } + + private: + friend class {{type.id}}; + {{type.id}}Builder() : m_result(new {{type.id}}()) { } + + template {{type.id}}Builder& castState() + { + return *reinterpret_cast<{{type.id}}Builder*>(this); + } + + {{protocol.type_definition(domain.domain + "." + type.id).type}} m_result; + }; + + static {{type.id}}Builder<0> {{"create" | to_method_case}}() + { + return {{type.id}}Builder<0>(); + } + +private: + {{type.id}}() + { + {% for property in type.properties %} + {% if not(property.optional) and "default_value" in protocol.resolve_type(property) %} + m_{{property.name}} = {{protocol.resolve_type(property).default_value}}; + {%endif %} + {% endfor %} + } + + {% for property in type.properties %} + {% if property.optional %} + Maybe<{{protocol.resolve_type(property).raw_type}}> m_{{property.name}}; + {% else %} + {{protocol.resolve_type(property).type}} m_{{property.name}}; + {% endif %} + {% endfor %} +}; + + {% endfor %} + +// ------------- Backend interface. + +class {{config.protocol.export_macro}} Backend { +public: + virtual ~Backend() { } + + {% for command in domain.commands %} + {% if "redirect" in command %}{% continue %}{% endif %} + {% if not protocol.generate_command(domain.domain, command.name) %}{% continue %}{% endif %} + {% if protocol.is_async_command(domain.domain, command.name) %} + class {{config.protocol.export_macro}} {{command.name | to_title_case}}Callback { + public: + virtual void sendSuccess( + {%- for parameter in command.returns -%} + {%- if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> {{parameter.name}} + {%- else -%} + {{protocol.resolve_type(parameter).pass_type}} {{parameter.name}} + {%- endif -%} + {%- if not loop.last -%}, {% endif -%} + {%- endfor -%} + ) = 0; + virtual void sendFailure(const DispatchResponse&) = 0; + virtual void fallThrough() = 0; + virtual ~{{command.name | to_title_case}}Callback() { } + }; + {% endif %} + {%- if not protocol.is_async_command(domain.domain, command.name) %} + virtual DispatchResponse {{command.name | to_method_case}}( + {%- else %} + virtual void {{command.name | to_method_case}}( + {%- endif %} + {%- for parameter in command.parameters -%} + {%- if not loop.first -%}, {% endif -%} + {%- if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> in_{{parameter.name}} + {%- else -%} + {{protocol.resolve_type(parameter).pass_type}} in_{{parameter.name}} + {%- endif -%} + {%- endfor -%} + {%- if protocol.is_async_command(domain.domain, command.name) -%} + {%- if command.parameters -%}, {% endif -%} + std::unique_ptr<{{command.name | to_title_case}}Callback> callback + {%- else -%} + {%- for parameter in command.returns -%} + {%- if (not loop.first) or command.parameters -%}, {% endif -%} + {%- if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}>* out_{{parameter.name}} + {%- else -%} + {{protocol.resolve_type(parameter).type}}* out_{{parameter.name}} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + ) = 0; + {% endfor %} + + {% if protocol.generate_disable(domain) %} + virtual DispatchResponse {{"disable" | to_method_case}}() + { + return DispatchResponse::OK(); + } + {% endif %} +}; + +// ------------- Frontend interface. + +class {{config.protocol.export_macro}} Frontend { +public: + explicit Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { } + {% for event in domain.events %} + {% if not protocol.generate_event(domain.domain, event.name) %}{% continue %}{% endif %} + void {{event.name | to_method_case}}( + {%- for parameter in event.parameters -%} + {%- if "optional" in parameter -%} + Maybe<{{protocol.resolve_type(parameter).raw_type}}> {{parameter.name}} = Maybe<{{protocol.resolve_type(parameter).raw_type}}>() + {%- else -%} + {{protocol.resolve_type(parameter).pass_type}} {{parameter.name}} + {%- endif -%}{%- if not loop.last -%}, {% endif -%} + {%- endfor -%} + ); + {% endfor %} + + void flush(); + void sendRawNotification(const String&); +private: + FrontendChannel* m_frontendChannel; +}; + +// ------------- Dispatcher. + +class {{config.protocol.export_macro}} Dispatcher { +public: + static void wire(UberDispatcher*, Backend*); + +private: + Dispatcher() { } +}; + +// ------------- Metainfo. + +class {{config.protocol.export_macro}} Metainfo { +public: + using BackendClass = Backend; + using FrontendClass = Frontend; + using DispatcherClass = Dispatcher; + static const char domainName[]; + static const char commandPrefix[]; + static const char version[]; +}; + +} // namespace {{domain.domain}} +{% for namespace in config.protocol.namespace %} +} // namespace {{namespace}} +{% endfor %} + +#endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_h) diff --git a/tools/jinja2/AUTHORS b/tools/jinja2/AUTHORS new file mode 100644 index 000000000000..fd6dbfcbfd8f --- /dev/null +++ b/tools/jinja2/AUTHORS @@ -0,0 +1,34 @@ +Jinja is written and maintained by the Jinja Team and various +contributors: + +Lead Developer: + +- Armin Ronacher + +Developers: + +- Christoph Hack +- Georg Brandl + +Contributors: + +- Bryan McLemore +- Mickaël Guérin +- Cameron Knight +- Lawrence Journal-World. +- David Cramer +- Adrian Mönnich (ThiefMaster) + +Patches and suggestions: + +- Ronny Pfannschmidt +- Axel Böhm +- Alexey Melchakov +- Bryan McLemore +- Clovis Fabricio (nosklo) +- Cameron Knight +- Peter van Dijk (Habbie) +- Stefan Ebner +- Rene Leonhardt +- Thomas Waldmann +- Cory Benfield (Lukasa) diff --git a/tools/jinja2/Jinja2-2.10.tar.gz.md5 b/tools/jinja2/Jinja2-2.10.tar.gz.md5 new file mode 100644 index 000000000000..9137ee129a0a --- /dev/null +++ b/tools/jinja2/Jinja2-2.10.tar.gz.md5 @@ -0,0 +1 @@ +61ef1117f945486472850819b8d1eb3d Jinja2-2.10.tar.gz diff --git a/tools/jinja2/Jinja2-2.10.tar.gz.sha512 b/tools/jinja2/Jinja2-2.10.tar.gz.sha512 new file mode 100644 index 000000000000..087d24c18eb8 --- /dev/null +++ b/tools/jinja2/Jinja2-2.10.tar.gz.sha512 @@ -0,0 +1 @@ +0ea7371be67ffcf19e46dfd06523a45a0806e678a407d54f5f2f3e573982f0959cf82ec5d07b203670309928a62ef71109701ab16547a9bba2ebcdc178cb67f2 Jinja2-2.10.tar.gz diff --git a/tools/jinja2/LICENSE b/tools/jinja2/LICENSE new file mode 100644 index 000000000000..31bf900e58e3 --- /dev/null +++ b/tools/jinja2/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/jinja2/OWNERS b/tools/jinja2/OWNERS new file mode 100644 index 000000000000..ee2bec9ba3a3 --- /dev/null +++ b/tools/jinja2/OWNERS @@ -0,0 +1,6 @@ +timloh@chromium.org +haraken@chromium.org +nbarth@chromium.org + +# TEAM: platform-architecture-dev@chromium.org +# COMPONENT: Blink>Internals diff --git a/tools/jinja2/README.chromium b/tools/jinja2/README.chromium new file mode 100644 index 000000000000..5246c2f84b60 --- /dev/null +++ b/tools/jinja2/README.chromium @@ -0,0 +1,26 @@ +Name: Jinja2 Python Template Engine +Short Name: jinja2 +URL: http://jinja.pocoo.org/ +Version: 2.10 +License: BSD 3-Clause +License File: LICENSE +Security Critical: no + +Description: +Template engine for code generation in Blink. + +Source: https://pypi.python.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz +MD5: 61ef1117f945486472850819b8d1eb3d +SHA-1: 34b69e5caab12ee37b9df69df9018776c008b7b8 + +Local Modifications: +This only includes the jinja2 directory from the tarball and the LICENSE and +AUTHORS files. Unit tests (testsuite directory) have been removed. +Additional chromium-specific files are: +* README.chromium (this file) +* OWNERS +* get_jinja2.sh (install script) +* jinja2.gni (generated by get_jinja2.sh) +* files of hashes (MD5 is also posted on website, SHA-512 computed locally). +Script checks hash then unpacks archive and installs desired files. +Retrieve or update by executing jinja2/get_jinja2.sh from third_party. diff --git a/tools/jinja2/__init__.py b/tools/jinja2/__init__.py new file mode 100644 index 000000000000..42aa763d571e --- /dev/null +++ b/tools/jinja2/__init__.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" + jinja2 + ~~~~~~ + + Jinja2 is a template engine written in pure Python. It provides a + Django inspired non-XML syntax but supports inline expressions and + an optional sandboxed environment. + + Nutshell + -------- + + Here a small example of a Jinja2 template:: + + {% extends 'base.html' %} + {% block title %}Memberlist{% endblock %} + {% block content %} + + {% endblock %} + + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +__docformat__ = 'restructuredtext en' +__version__ = '2.10' + +# high level interface +from jinja2.environment import Environment, Template + +# loaders +from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \ + DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \ + ModuleLoader + +# bytecode caches +from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \ + MemcachedBytecodeCache + +# undefined types +from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined, \ + make_logging_undefined + +# exceptions +from jinja2.exceptions import TemplateError, UndefinedError, \ + TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \ + TemplateAssertionError, TemplateRuntimeError + +# decorators and public utilities +from jinja2.filters import environmentfilter, contextfilter, \ + evalcontextfilter +from jinja2.utils import Markup, escape, clear_caches, \ + environmentfunction, evalcontextfunction, contextfunction, \ + is_undefined, select_autoescape + +__all__ = [ + 'Environment', 'Template', 'BaseLoader', 'FileSystemLoader', + 'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader', + 'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache', + 'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined', + 'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound', + 'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError', + 'TemplateRuntimeError', + 'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape', + 'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined', + 'evalcontextfilter', 'evalcontextfunction', 'make_logging_undefined', + 'select_autoescape', +] + + +def _patch_async(): + from jinja2.utils import have_async_gen + if have_async_gen: + from jinja2.asyncsupport import patch_all + patch_all() + + +_patch_async() +del _patch_async diff --git a/tools/jinja2/_compat.py b/tools/jinja2/_compat.py new file mode 100644 index 000000000000..61d85301a4a9 --- /dev/null +++ b/tools/jinja2/_compat.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +""" + jinja2._compat + ~~~~~~~~~~~~~~ + + Some py2/py3 compatibility support based on a stripped down + version of six so we don't have to depend on a specific version + of it. + + :copyright: Copyright 2013 by the Jinja team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +import sys + +PY2 = sys.version_info[0] == 2 +PYPY = hasattr(sys, 'pypy_translation_info') +_identity = lambda x: x + + +if not PY2: + unichr = chr + range_type = range + text_type = str + string_types = (str,) + integer_types = (int,) + + iterkeys = lambda d: iter(d.keys()) + itervalues = lambda d: iter(d.values()) + iteritems = lambda d: iter(d.items()) + + import pickle + from io import BytesIO, StringIO + NativeStringIO = StringIO + + def reraise(tp, value, tb=None): + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + + ifilter = filter + imap = map + izip = zip + intern = sys.intern + + implements_iterator = _identity + implements_to_string = _identity + encode_filename = _identity + +else: + unichr = unichr + text_type = unicode + range_type = xrange + string_types = (str, unicode) + integer_types = (int, long) + + iterkeys = lambda d: d.iterkeys() + itervalues = lambda d: d.itervalues() + iteritems = lambda d: d.iteritems() + + import cPickle as pickle + from cStringIO import StringIO as BytesIO, StringIO + NativeStringIO = BytesIO + + exec('def reraise(tp, value, tb=None):\n raise tp, value, tb') + + from itertools import imap, izip, ifilter + intern = intern + + def implements_iterator(cls): + cls.next = cls.__next__ + del cls.__next__ + return cls + + def implements_to_string(cls): + cls.__unicode__ = cls.__str__ + cls.__str__ = lambda x: x.__unicode__().encode('utf-8') + return cls + + def encode_filename(filename): + if isinstance(filename, unicode): + return filename.encode('utf-8') + return filename + + +def with_metaclass(meta, *bases): + """Create a base class with a metaclass.""" + # This requires a bit of explanation: the basic idea is to make a + # dummy metaclass for one level of class instantiation that replaces + # itself with the actual metaclass. + class metaclass(type): + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + return type.__new__(metaclass, 'temporary_class', (), {}) + + +try: + from urllib.parse import quote_from_bytes as url_quote +except ImportError: + from urllib import quote as url_quote diff --git a/tools/jinja2/_identifier.py b/tools/jinja2/_identifier.py new file mode 100644 index 000000000000..2eac35d5c355 --- /dev/null +++ b/tools/jinja2/_identifier.py @@ -0,0 +1,2 @@ +# generated by scripts/generate_identifier_pattern.py +pattern = '·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఃా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪽ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰℘℮⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯︳︴﹍-﹏_𐇽𐋠𐍶-𐍺𐨁-𐨃𐨅𐨆𐨌-𐨏𐨸-𐨿𐨺𐫦𐫥𑀀-𑀂𑀸-𑁆𑁿-𑂂𑂰-𑂺𑄀-𑄂𑄧-𑅳𑄴𑆀-𑆂𑆳-𑇊𑇀-𑇌𑈬-𑈷𑈾𑋟-𑋪𑌀-𑌃𑌼𑌾-𑍄𑍇𑍈𑍋-𑍍𑍗𑍢𑍣𑍦-𑍬𑍰-𑍴𑐵-𑑆𑒰-𑓃𑖯-𑖵𑖸-𑗀𑗜𑗝𑘰-𑙀𑚫-𑚷𑜝-𑜫𑰯-𑰶𑰸-𑰿𑲒-𑲧𑲩-𑲶𖫰-𖫴𖬰-𖬶𖽑-𖽾𖾏-𖾒𛲝𛲞𝅥-𝅩𝅭-𝅲𝅻-𝆂𝆅-𝆋𝆪-𝆭𝉂-𝉄𝨀-𝨶𝨻-𝩬𝩵𝪄𝪛-𝪟𝪡-𝪯𞀀-𞀆𞀈-𞀘𞀛-𞀡𞀣𞀤𞀦-𞣐𞀪-𞣖𞥄-𞥊󠄀-󠇯' diff --git a/tools/jinja2/asyncfilters.py b/tools/jinja2/asyncfilters.py new file mode 100644 index 000000000000..5c1f46d7fa7d --- /dev/null +++ b/tools/jinja2/asyncfilters.py @@ -0,0 +1,146 @@ +from functools import wraps + +from jinja2.asyncsupport import auto_aiter +from jinja2 import filters + + +async def auto_to_seq(value): + seq = [] + if hasattr(value, '__aiter__'): + async for item in value: + seq.append(item) + else: + for item in value: + seq.append(item) + return seq + + +async def async_select_or_reject(args, kwargs, modfunc, lookup_attr): + seq, func = filters.prepare_select_or_reject( + args, kwargs, modfunc, lookup_attr) + if seq: + async for item in auto_aiter(seq): + if func(item): + yield item + + +def dualfilter(normal_filter, async_filter): + wrap_evalctx = False + if getattr(normal_filter, 'environmentfilter', False): + is_async = lambda args: args[0].is_async + wrap_evalctx = False + else: + if not getattr(normal_filter, 'evalcontextfilter', False) and \ + not getattr(normal_filter, 'contextfilter', False): + wrap_evalctx = True + is_async = lambda args: args[0].environment.is_async + + @wraps(normal_filter) + def wrapper(*args, **kwargs): + b = is_async(args) + if wrap_evalctx: + args = args[1:] + if b: + return async_filter(*args, **kwargs) + return normal_filter(*args, **kwargs) + + if wrap_evalctx: + wrapper.evalcontextfilter = True + + wrapper.asyncfiltervariant = True + + return wrapper + + +def asyncfiltervariant(original): + def decorator(f): + return dualfilter(original, f) + return decorator + + +@asyncfiltervariant(filters.do_first) +async def do_first(environment, seq): + try: + return await auto_aiter(seq).__anext__() + except StopAsyncIteration: + return environment.undefined('No first item, sequence was empty.') + + +@asyncfiltervariant(filters.do_groupby) +async def do_groupby(environment, value, attribute): + expr = filters.make_attrgetter(environment, attribute) + return [filters._GroupTuple(key, await auto_to_seq(values)) + for key, values in filters.groupby(sorted( + await auto_to_seq(value), key=expr), expr)] + + +@asyncfiltervariant(filters.do_join) +async def do_join(eval_ctx, value, d=u'', attribute=None): + return filters.do_join(eval_ctx, await auto_to_seq(value), d, attribute) + + +@asyncfiltervariant(filters.do_list) +async def do_list(value): + return await auto_to_seq(value) + + +@asyncfiltervariant(filters.do_reject) +async def do_reject(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: not x, False) + + +@asyncfiltervariant(filters.do_rejectattr) +async def do_rejectattr(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: not x, True) + + +@asyncfiltervariant(filters.do_select) +async def do_select(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: x, False) + + +@asyncfiltervariant(filters.do_selectattr) +async def do_selectattr(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: x, True) + + +@asyncfiltervariant(filters.do_map) +async def do_map(*args, **kwargs): + seq, func = filters.prepare_map(args, kwargs) + if seq: + async for item in auto_aiter(seq): + yield func(item) + + +@asyncfiltervariant(filters.do_sum) +async def do_sum(environment, iterable, attribute=None, start=0): + rv = start + if attribute is not None: + func = filters.make_attrgetter(environment, attribute) + else: + func = lambda x: x + async for item in auto_aiter(iterable): + rv += func(item) + return rv + + +@asyncfiltervariant(filters.do_slice) +async def do_slice(value, slices, fill_with=None): + return filters.do_slice(await auto_to_seq(value), slices, fill_with) + + +ASYNC_FILTERS = { + 'first': do_first, + 'groupby': do_groupby, + 'join': do_join, + 'list': do_list, + # we intentionally do not support do_last because that would be + # ridiculous + 'reject': do_reject, + 'rejectattr': do_rejectattr, + 'map': do_map, + 'select': do_select, + 'selectattr': do_selectattr, + 'sum': do_sum, + 'slice': do_slice, +} diff --git a/tools/jinja2/asyncsupport.py b/tools/jinja2/asyncsupport.py new file mode 100644 index 000000000000..b1e7b5ce9a27 --- /dev/null +++ b/tools/jinja2/asyncsupport.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +""" + jinja2.asyncsupport + ~~~~~~~~~~~~~~~~~~~ + + Has all the code for async support which is implemented as a patch + for supported Python versions. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +import sys +import asyncio +import inspect +from functools import update_wrapper + +from jinja2.utils import concat, internalcode, Markup +from jinja2.environment import TemplateModule +from jinja2.runtime import LoopContextBase, _last_iteration + + +async def concat_async(async_gen): + rv = [] + async def collect(): + async for event in async_gen: + rv.append(event) + await collect() + return concat(rv) + + +async def generate_async(self, *args, **kwargs): + vars = dict(*args, **kwargs) + try: + async for event in self.root_render_func(self.new_context(vars)): + yield event + except Exception: + exc_info = sys.exc_info() + else: + return + yield self.environment.handle_exception(exc_info, True) + + +def wrap_generate_func(original_generate): + def _convert_generator(self, loop, args, kwargs): + async_gen = self.generate_async(*args, **kwargs) + try: + while 1: + yield loop.run_until_complete(async_gen.__anext__()) + except StopAsyncIteration: + pass + def generate(self, *args, **kwargs): + if not self.environment.is_async: + return original_generate(self, *args, **kwargs) + return _convert_generator(self, asyncio.get_event_loop(), args, kwargs) + return update_wrapper(generate, original_generate) + + +async def render_async(self, *args, **kwargs): + if not self.environment.is_async: + raise RuntimeError('The environment was not created with async mode ' + 'enabled.') + + vars = dict(*args, **kwargs) + ctx = self.new_context(vars) + + try: + return await concat_async(self.root_render_func(ctx)) + except Exception: + exc_info = sys.exc_info() + return self.environment.handle_exception(exc_info, True) + + +def wrap_render_func(original_render): + def render(self, *args, **kwargs): + if not self.environment.is_async: + return original_render(self, *args, **kwargs) + loop = asyncio.get_event_loop() + return loop.run_until_complete(self.render_async(*args, **kwargs)) + return update_wrapper(render, original_render) + + +def wrap_block_reference_call(original_call): + @internalcode + async def async_call(self): + rv = await concat_async(self._stack[self._depth](self._context)) + if self._context.eval_ctx.autoescape: + rv = Markup(rv) + return rv + + @internalcode + def __call__(self): + if not self._context.environment.is_async: + return original_call(self) + return async_call(self) + + return update_wrapper(__call__, original_call) + + +def wrap_macro_invoke(original_invoke): + @internalcode + async def async_invoke(self, arguments, autoescape): + rv = await self._func(*arguments) + if autoescape: + rv = Markup(rv) + return rv + + @internalcode + def _invoke(self, arguments, autoescape): + if not self._environment.is_async: + return original_invoke(self, arguments, autoescape) + return async_invoke(self, arguments, autoescape) + return update_wrapper(_invoke, original_invoke) + + +@internalcode +async def get_default_module_async(self): + if self._module is not None: + return self._module + self._module = rv = await self.make_module_async() + return rv + + +def wrap_default_module(original_default_module): + @internalcode + def _get_default_module(self): + if self.environment.is_async: + raise RuntimeError('Template module attribute is unavailable ' + 'in async mode') + return original_default_module(self) + return _get_default_module + + +async def make_module_async(self, vars=None, shared=False, locals=None): + context = self.new_context(vars, shared, locals) + body_stream = [] + async for item in self.root_render_func(context): + body_stream.append(item) + return TemplateModule(self, context, body_stream) + + +def patch_template(): + from jinja2 import Template + Template.generate = wrap_generate_func(Template.generate) + Template.generate_async = update_wrapper( + generate_async, Template.generate_async) + Template.render_async = update_wrapper( + render_async, Template.render_async) + Template.render = wrap_render_func(Template.render) + Template._get_default_module = wrap_default_module( + Template._get_default_module) + Template._get_default_module_async = get_default_module_async + Template.make_module_async = update_wrapper( + make_module_async, Template.make_module_async) + + +def patch_runtime(): + from jinja2.runtime import BlockReference, Macro + BlockReference.__call__ = wrap_block_reference_call( + BlockReference.__call__) + Macro._invoke = wrap_macro_invoke(Macro._invoke) + + +def patch_filters(): + from jinja2.filters import FILTERS + from jinja2.asyncfilters import ASYNC_FILTERS + FILTERS.update(ASYNC_FILTERS) + + +def patch_all(): + patch_template() + patch_runtime() + patch_filters() + + +async def auto_await(value): + if inspect.isawaitable(value): + return await value + return value + + +async def auto_aiter(iterable): + if hasattr(iterable, '__aiter__'): + async for item in iterable: + yield item + return + for item in iterable: + yield item + + +class AsyncLoopContext(LoopContextBase): + + def __init__(self, async_iterator, undefined, after, length, recurse=None, + depth0=0): + LoopContextBase.__init__(self, undefined, recurse, depth0) + self._async_iterator = async_iterator + self._after = after + self._length = length + + @property + def length(self): + if self._length is None: + raise TypeError('Loop length for some iterators cannot be ' + 'lazily calculated in async mode') + return self._length + + def __aiter__(self): + return AsyncLoopContextIterator(self) + + +class AsyncLoopContextIterator(object): + __slots__ = ('context',) + + def __init__(self, context): + self.context = context + + def __aiter__(self): + return self + + async def __anext__(self): + ctx = self.context + ctx.index0 += 1 + if ctx._after is _last_iteration: + raise StopAsyncIteration() + ctx._before = ctx._current + ctx._current = ctx._after + try: + ctx._after = await ctx._async_iterator.__anext__() + except StopAsyncIteration: + ctx._after = _last_iteration + return ctx._current, ctx + + +async def make_async_loop_context(iterable, undefined, recurse=None, depth0=0): + # Length is more complicated and less efficient in async mode. The + # reason for this is that we cannot know if length will be used + # upfront but because length is a property we cannot lazily execute it + # later. This means that we need to buffer it up and measure :( + # + # We however only do this for actual iterators, not for async + # iterators as blocking here does not seem like the best idea in the + # world. + try: + length = len(iterable) + except (TypeError, AttributeError): + if not hasattr(iterable, '__aiter__'): + iterable = tuple(iterable) + length = len(iterable) + else: + length = None + async_iterator = auto_aiter(iterable) + try: + after = await async_iterator.__anext__() + except StopAsyncIteration: + after = _last_iteration + return AsyncLoopContext(async_iterator, undefined, after, length, recurse, + depth0) diff --git a/tools/jinja2/bccache.py b/tools/jinja2/bccache.py new file mode 100644 index 000000000000..080e527cabf3 --- /dev/null +++ b/tools/jinja2/bccache.py @@ -0,0 +1,362 @@ +# -*- coding: utf-8 -*- +""" + jinja2.bccache + ~~~~~~~~~~~~~~ + + This module implements the bytecode cache system Jinja is optionally + using. This is useful if you have very complex template situations and + the compiliation of all those templates slow down your application too + much. + + Situations where this is useful are often forking web applications that + are initialized on the first request. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD. +""" +from os import path, listdir +import os +import sys +import stat +import errno +import marshal +import tempfile +import fnmatch +from hashlib import sha1 +from jinja2.utils import open_if_exists +from jinja2._compat import BytesIO, pickle, PY2, text_type + + +# marshal works better on 3.x, one hack less required +if not PY2: + marshal_dump = marshal.dump + marshal_load = marshal.load +else: + + def marshal_dump(code, f): + if isinstance(f, file): + marshal.dump(code, f) + else: + f.write(marshal.dumps(code)) + + def marshal_load(f): + if isinstance(f, file): + return marshal.load(f) + return marshal.loads(f.read()) + + +bc_version = 3 + +# magic version used to only change with new jinja versions. With 2.6 +# we change this to also take Python version changes into account. The +# reason for this is that Python tends to segfault if fed earlier bytecode +# versions because someone thought it would be a good idea to reuse opcodes +# or make Python incompatible with earlier versions. +bc_magic = 'j2'.encode('ascii') + \ + pickle.dumps(bc_version, 2) + \ + pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1]) + + +class Bucket(object): + """Buckets are used to store the bytecode for one template. It's created + and initialized by the bytecode cache and passed to the loading functions. + + The buckets get an internal checksum from the cache assigned and use this + to automatically reject outdated cache material. Individual bytecode + cache subclasses don't have to care about cache invalidation. + """ + + def __init__(self, environment, key, checksum): + self.environment = environment + self.key = key + self.checksum = checksum + self.reset() + + def reset(self): + """Resets the bucket (unloads the bytecode).""" + self.code = None + + def load_bytecode(self, f): + """Loads bytecode from a file or file like object.""" + # make sure the magic header is correct + magic = f.read(len(bc_magic)) + if magic != bc_magic: + self.reset() + return + # the source code of the file changed, we need to reload + checksum = pickle.load(f) + if self.checksum != checksum: + self.reset() + return + # if marshal_load fails then we need to reload + try: + self.code = marshal_load(f) + except (EOFError, ValueError, TypeError): + self.reset() + return + + def write_bytecode(self, f): + """Dump the bytecode into the file or file like object passed.""" + if self.code is None: + raise TypeError('can\'t write empty bucket') + f.write(bc_magic) + pickle.dump(self.checksum, f, 2) + marshal_dump(self.code, f) + + def bytecode_from_string(self, string): + """Load bytecode from a string.""" + self.load_bytecode(BytesIO(string)) + + def bytecode_to_string(self): + """Return the bytecode as string.""" + out = BytesIO() + self.write_bytecode(out) + return out.getvalue() + + +class BytecodeCache(object): + """To implement your own bytecode cache you have to subclass this class + and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of + these methods are passed a :class:`~jinja2.bccache.Bucket`. + + A very basic bytecode cache that saves the bytecode on the file system:: + + from os import path + + class MyCache(BytecodeCache): + + def __init__(self, directory): + self.directory = directory + + def load_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + if path.exists(filename): + with open(filename, 'rb') as f: + bucket.load_bytecode(f) + + def dump_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + with open(filename, 'wb') as f: + bucket.write_bytecode(f) + + A more advanced version of a filesystem based bytecode cache is part of + Jinja2. + """ + + def load_bytecode(self, bucket): + """Subclasses have to override this method to load bytecode into a + bucket. If they are not able to find code in the cache for the + bucket, it must not do anything. + """ + raise NotImplementedError() + + def dump_bytecode(self, bucket): + """Subclasses have to override this method to write the bytecode + from a bucket back to the cache. If it unable to do so it must not + fail silently but raise an exception. + """ + raise NotImplementedError() + + def clear(self): + """Clears the cache. This method is not used by Jinja2 but should be + implemented to allow applications to clear the bytecode cache used + by a particular environment. + """ + + def get_cache_key(self, name, filename=None): + """Returns the unique hash key for this template name.""" + hash = sha1(name.encode('utf-8')) + if filename is not None: + filename = '|' + filename + if isinstance(filename, text_type): + filename = filename.encode('utf-8') + hash.update(filename) + return hash.hexdigest() + + def get_source_checksum(self, source): + """Returns a checksum for the source.""" + return sha1(source.encode('utf-8')).hexdigest() + + def get_bucket(self, environment, name, filename, source): + """Return a cache bucket for the given template. All arguments are + mandatory but filename may be `None`. + """ + key = self.get_cache_key(name, filename) + checksum = self.get_source_checksum(source) + bucket = Bucket(environment, key, checksum) + self.load_bytecode(bucket) + return bucket + + def set_bucket(self, bucket): + """Put the bucket into the cache.""" + self.dump_bytecode(bucket) + + +class FileSystemBytecodeCache(BytecodeCache): + """A bytecode cache that stores bytecode on the filesystem. It accepts + two arguments: The directory where the cache items are stored and a + pattern string that is used to build the filename. + + If no directory is specified a default cache directory is selected. On + Windows the user's temp directory is used, on UNIX systems a directory + is created for the user in the system temp directory. + + The pattern can be used to have multiple separate caches operate on the + same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s`` + is replaced with the cache key. + + >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache') + + This bytecode cache supports clearing of the cache using the clear method. + """ + + def __init__(self, directory=None, pattern='__jinja2_%s.cache'): + if directory is None: + directory = self._get_default_cache_dir() + self.directory = directory + self.pattern = pattern + + def _get_default_cache_dir(self): + def _unsafe_dir(): + raise RuntimeError('Cannot determine safe temp directory. You ' + 'need to explicitly provide one.') + + tmpdir = tempfile.gettempdir() + + # On windows the temporary directory is used specific unless + # explicitly forced otherwise. We can just use that. + if os.name == 'nt': + return tmpdir + if not hasattr(os, 'getuid'): + _unsafe_dir() + + dirname = '_jinja2-cache-%d' % os.getuid() + actual_dir = os.path.join(tmpdir, dirname) + + try: + os.mkdir(actual_dir, stat.S_IRWXU) + except OSError as e: + if e.errno != errno.EEXIST: + raise + try: + os.chmod(actual_dir, stat.S_IRWXU) + actual_dir_stat = os.lstat(actual_dir) + if actual_dir_stat.st_uid != os.getuid() \ + or not stat.S_ISDIR(actual_dir_stat.st_mode) \ + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU: + _unsafe_dir() + except OSError as e: + if e.errno != errno.EEXIST: + raise + + actual_dir_stat = os.lstat(actual_dir) + if actual_dir_stat.st_uid != os.getuid() \ + or not stat.S_ISDIR(actual_dir_stat.st_mode) \ + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU: + _unsafe_dir() + + return actual_dir + + def _get_cache_filename(self, bucket): + return path.join(self.directory, self.pattern % bucket.key) + + def load_bytecode(self, bucket): + f = open_if_exists(self._get_cache_filename(bucket), 'rb') + if f is not None: + try: + bucket.load_bytecode(f) + finally: + f.close() + + def dump_bytecode(self, bucket): + f = open(self._get_cache_filename(bucket), 'wb') + try: + bucket.write_bytecode(f) + finally: + f.close() + + def clear(self): + # imported lazily here because google app-engine doesn't support + # write access on the file system and the function does not exist + # normally. + from os import remove + files = fnmatch.filter(listdir(self.directory), self.pattern % '*') + for filename in files: + try: + remove(path.join(self.directory, filename)) + except OSError: + pass + + +class MemcachedBytecodeCache(BytecodeCache): + """This class implements a bytecode cache that uses a memcache cache for + storing the information. It does not enforce a specific memcache library + (tummy's memcache or cmemcache) but will accept any class that provides + the minimal interface required. + + Libraries compatible with this class: + + - `werkzeug `_.contrib.cache + - `python-memcached `_ + - `cmemcache `_ + + (Unfortunately the django cache interface is not compatible because it + does not support storing binary data, only unicode. You can however pass + the underlying cache client to the bytecode cache which is available + as `django.core.cache.cache._client`.) + + The minimal interface for the client passed to the constructor is this: + + .. class:: MinimalClientInterface + + .. method:: set(key, value[, timeout]) + + Stores the bytecode in the cache. `value` is a string and + `timeout` the timeout of the key. If timeout is not provided + a default timeout or no timeout should be assumed, if it's + provided it's an integer with the number of seconds the cache + item should exist. + + .. method:: get(key) + + Returns the value for the cache key. If the item does not + exist in the cache the return value must be `None`. + + The other arguments to the constructor are the prefix for all keys that + is added before the actual cache key and the timeout for the bytecode in + the cache system. We recommend a high (or no) timeout. + + This bytecode cache does not support clearing of used items in the cache. + The clear method is a no-operation function. + + .. versionadded:: 2.7 + Added support for ignoring memcache errors through the + `ignore_memcache_errors` parameter. + """ + + def __init__(self, client, prefix='jinja2/bytecode/', timeout=None, + ignore_memcache_errors=True): + self.client = client + self.prefix = prefix + self.timeout = timeout + self.ignore_memcache_errors = ignore_memcache_errors + + def load_bytecode(self, bucket): + try: + code = self.client.get(self.prefix + bucket.key) + except Exception: + if not self.ignore_memcache_errors: + raise + code = None + if code is not None: + bucket.bytecode_from_string(code) + + def dump_bytecode(self, bucket): + args = (self.prefix + bucket.key, bucket.bytecode_to_string()) + if self.timeout is not None: + args += (self.timeout,) + try: + self.client.set(*args) + except Exception: + if not self.ignore_memcache_errors: + raise diff --git a/tools/jinja2/compiler.py b/tools/jinja2/compiler.py new file mode 100644 index 000000000000..d534a827391a --- /dev/null +++ b/tools/jinja2/compiler.py @@ -0,0 +1,1721 @@ +# -*- coding: utf-8 -*- +""" + jinja2.compiler + ~~~~~~~~~~~~~~~ + + Compiles nodes into python code. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +from itertools import chain +from copy import deepcopy +from keyword import iskeyword as is_python_keyword +from functools import update_wrapper +from jinja2 import nodes +from jinja2.nodes import EvalContext +from jinja2.visitor import NodeVisitor +from jinja2.optimizer import Optimizer +from jinja2.exceptions import TemplateAssertionError +from jinja2.utils import Markup, concat, escape +from jinja2._compat import range_type, text_type, string_types, \ + iteritems, NativeStringIO, imap, izip +from jinja2.idtracking import Symbols, VAR_LOAD_PARAMETER, \ + VAR_LOAD_RESOLVE, VAR_LOAD_ALIAS, VAR_LOAD_UNDEFINED + + +operators = { + 'eq': '==', + 'ne': '!=', + 'gt': '>', + 'gteq': '>=', + 'lt': '<', + 'lteq': '<=', + 'in': 'in', + 'notin': 'not in' +} + +# what method to iterate over items do we want to use for dict iteration +# in generated code? on 2.x let's go with iteritems, on 3.x with items +if hasattr(dict, 'iteritems'): + dict_item_iter = 'iteritems' +else: + dict_item_iter = 'items' + +code_features = ['division'] + +# does this python version support generator stops? (PEP 0479) +try: + exec('from __future__ import generator_stop') + code_features.append('generator_stop') +except SyntaxError: + pass + +# does this python version support yield from? +try: + exec('def f(): yield from x()') +except SyntaxError: + supports_yield_from = False +else: + supports_yield_from = True + + +def optimizeconst(f): + def new_func(self, node, frame, **kwargs): + # Only optimize if the frame is not volatile + if self.optimized and not frame.eval_ctx.volatile: + new_node = self.optimizer.visit(node, frame.eval_ctx) + if new_node != node: + return self.visit(new_node, frame) + return f(self, node, frame, **kwargs) + return update_wrapper(new_func, f) + + +def generate(node, environment, name, filename, stream=None, + defer_init=False, optimized=True): + """Generate the python source for a node tree.""" + if not isinstance(node, nodes.Template): + raise TypeError('Can\'t compile non template nodes') + generator = environment.code_generator_class(environment, name, filename, + stream, defer_init, + optimized) + generator.visit(node) + if stream is None: + return generator.stream.getvalue() + + +def has_safe_repr(value): + """Does the node have a safe representation?""" + if value is None or value is NotImplemented or value is Ellipsis: + return True + if type(value) in (bool, int, float, complex, range_type, Markup) + string_types: + return True + if type(value) in (tuple, list, set, frozenset): + for item in value: + if not has_safe_repr(item): + return False + return True + elif type(value) is dict: + for key, value in iteritems(value): + if not has_safe_repr(key): + return False + if not has_safe_repr(value): + return False + return True + return False + + +def find_undeclared(nodes, names): + """Check if the names passed are accessed undeclared. The return value + is a set of all the undeclared names from the sequence of names found. + """ + visitor = UndeclaredNameVisitor(names) + try: + for node in nodes: + visitor.visit(node) + except VisitorExit: + pass + return visitor.undeclared + + +class MacroRef(object): + + def __init__(self, node): + self.node = node + self.accesses_caller = False + self.accesses_kwargs = False + self.accesses_varargs = False + + +class Frame(object): + """Holds compile time information for us.""" + + def __init__(self, eval_ctx, parent=None, level=None): + self.eval_ctx = eval_ctx + self.symbols = Symbols(parent and parent.symbols or None, + level=level) + + # a toplevel frame is the root + soft frames such as if conditions. + self.toplevel = False + + # the root frame is basically just the outermost frame, so no if + # conditions. This information is used to optimize inheritance + # situations. + self.rootlevel = False + + # in some dynamic inheritance situations the compiler needs to add + # write tests around output statements. + self.require_output_check = parent and parent.require_output_check + + # inside some tags we are using a buffer rather than yield statements. + # this for example affects {% filter %} or {% macro %}. If a frame + # is buffered this variable points to the name of the list used as + # buffer. + self.buffer = None + + # the name of the block we're in, otherwise None. + self.block = parent and parent.block or None + + # the parent of this frame + self.parent = parent + + if parent is not None: + self.buffer = parent.buffer + + def copy(self): + """Create a copy of the current one.""" + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.symbols = self.symbols.copy() + return rv + + def inner(self, isolated=False): + """Return an inner frame.""" + if isolated: + return Frame(self.eval_ctx, level=self.symbols.level + 1) + return Frame(self.eval_ctx, self) + + def soft(self): + """Return a soft frame. A soft frame may not be modified as + standalone thing as it shares the resources with the frame it + was created of, but it's not a rootlevel frame any longer. + + This is only used to implement if-statements. + """ + rv = self.copy() + rv.rootlevel = False + return rv + + __copy__ = copy + + +class VisitorExit(RuntimeError): + """Exception used by the `UndeclaredNameVisitor` to signal a stop.""" + + +class DependencyFinderVisitor(NodeVisitor): + """A visitor that collects filter and test calls.""" + + def __init__(self): + self.filters = set() + self.tests = set() + + def visit_Filter(self, node): + self.generic_visit(node) + self.filters.add(node.name) + + def visit_Test(self, node): + self.generic_visit(node) + self.tests.add(node.name) + + def visit_Block(self, node): + """Stop visiting at blocks.""" + + +class UndeclaredNameVisitor(NodeVisitor): + """A visitor that checks if a name is accessed without being + declared. This is different from the frame visitor as it will + not stop at closure frames. + """ + + def __init__(self, names): + self.names = set(names) + self.undeclared = set() + + def visit_Name(self, node): + if node.ctx == 'load' and node.name in self.names: + self.undeclared.add(node.name) + if self.undeclared == self.names: + raise VisitorExit() + else: + self.names.discard(node.name) + + def visit_Block(self, node): + """Stop visiting a blocks.""" + + +class CompilerExit(Exception): + """Raised if the compiler encountered a situation where it just + doesn't make sense to further process the code. Any block that + raises such an exception is not further processed. + """ + + +class CodeGenerator(NodeVisitor): + + def __init__(self, environment, name, filename, stream=None, + defer_init=False, optimized=True): + if stream is None: + stream = NativeStringIO() + self.environment = environment + self.name = name + self.filename = filename + self.stream = stream + self.created_block_context = False + self.defer_init = defer_init + self.optimized = optimized + if optimized: + self.optimizer = Optimizer(environment) + + # aliases for imports + self.import_aliases = {} + + # a registry for all blocks. Because blocks are moved out + # into the global python scope they are registered here + self.blocks = {} + + # the number of extends statements so far + self.extends_so_far = 0 + + # some templates have a rootlevel extends. In this case we + # can safely assume that we're a child template and do some + # more optimizations. + self.has_known_extends = False + + # the current line number + self.code_lineno = 1 + + # registry of all filters and tests (global, not block local) + self.tests = {} + self.filters = {} + + # the debug information + self.debug_info = [] + self._write_debug_info = None + + # the number of new lines before the next write() + self._new_lines = 0 + + # the line number of the last written statement + self._last_line = 0 + + # true if nothing was written so far. + self._first_write = True + + # used by the `temporary_identifier` method to get new + # unique, temporary identifier + self._last_identifier = 0 + + # the current indentation + self._indentation = 0 + + # Tracks toplevel assignments + self._assign_stack = [] + + # Tracks parameter definition blocks + self._param_def_block = [] + + # Tracks the current context. + self._context_reference_stack = ['context'] + + # -- Various compilation helpers + + def fail(self, msg, lineno): + """Fail with a :exc:`TemplateAssertionError`.""" + raise TemplateAssertionError(msg, lineno, self.name, self.filename) + + def temporary_identifier(self): + """Get a new unique identifier.""" + self._last_identifier += 1 + return 't_%d' % self._last_identifier + + def buffer(self, frame): + """Enable buffering for the frame from that point onwards.""" + frame.buffer = self.temporary_identifier() + self.writeline('%s = []' % frame.buffer) + + def return_buffer_contents(self, frame, force_unescaped=False): + """Return the buffer contents of the frame.""" + if not force_unescaped: + if frame.eval_ctx.volatile: + self.writeline('if context.eval_ctx.autoescape:') + self.indent() + self.writeline('return Markup(concat(%s))' % frame.buffer) + self.outdent() + self.writeline('else:') + self.indent() + self.writeline('return concat(%s)' % frame.buffer) + self.outdent() + return + elif frame.eval_ctx.autoescape: + self.writeline('return Markup(concat(%s))' % frame.buffer) + return + self.writeline('return concat(%s)' % frame.buffer) + + def indent(self): + """Indent by one.""" + self._indentation += 1 + + def outdent(self, step=1): + """Outdent by step.""" + self._indentation -= step + + def start_write(self, frame, node=None): + """Yield or write into the frame buffer.""" + if frame.buffer is None: + self.writeline('yield ', node) + else: + self.writeline('%s.append(' % frame.buffer, node) + + def end_write(self, frame): + """End the writing process started by `start_write`.""" + if frame.buffer is not None: + self.write(')') + + def simple_write(self, s, frame, node=None): + """Simple shortcut for start_write + write + end_write.""" + self.start_write(frame, node) + self.write(s) + self.end_write(frame) + + def blockvisit(self, nodes, frame): + """Visit a list of nodes as block in a frame. If the current frame + is no buffer a dummy ``if 0: yield None`` is written automatically. + """ + try: + self.writeline('pass') + for node in nodes: + self.visit(node, frame) + except CompilerExit: + pass + + def write(self, x): + """Write a string into the output stream.""" + if self._new_lines: + if not self._first_write: + self.stream.write('\n' * self._new_lines) + self.code_lineno += self._new_lines + if self._write_debug_info is not None: + self.debug_info.append((self._write_debug_info, + self.code_lineno)) + self._write_debug_info = None + self._first_write = False + self.stream.write(' ' * self._indentation) + self._new_lines = 0 + self.stream.write(x) + + def writeline(self, x, node=None, extra=0): + """Combination of newline and write.""" + self.newline(node, extra) + self.write(x) + + def newline(self, node=None, extra=0): + """Add one or more newlines before the next write.""" + self._new_lines = max(self._new_lines, 1 + extra) + if node is not None and node.lineno != self._last_line: + self._write_debug_info = node.lineno + self._last_line = node.lineno + + def signature(self, node, frame, extra_kwargs=None): + """Writes a function call to the stream for the current node. + A leading comma is added automatically. The extra keyword + arguments may not include python keywords otherwise a syntax + error could occour. The extra keyword arguments should be given + as python dict. + """ + # if any of the given keyword arguments is a python keyword + # we have to make sure that no invalid call is created. + kwarg_workaround = False + for kwarg in chain((x.key for x in node.kwargs), extra_kwargs or ()): + if is_python_keyword(kwarg): + kwarg_workaround = True + break + + for arg in node.args: + self.write(', ') + self.visit(arg, frame) + + if not kwarg_workaround: + for kwarg in node.kwargs: + self.write(', ') + self.visit(kwarg, frame) + if extra_kwargs is not None: + for key, value in iteritems(extra_kwargs): + self.write(', %s=%s' % (key, value)) + if node.dyn_args: + self.write(', *') + self.visit(node.dyn_args, frame) + + if kwarg_workaround: + if node.dyn_kwargs is not None: + self.write(', **dict({') + else: + self.write(', **{') + for kwarg in node.kwargs: + self.write('%r: ' % kwarg.key) + self.visit(kwarg.value, frame) + self.write(', ') + if extra_kwargs is not None: + for key, value in iteritems(extra_kwargs): + self.write('%r: %s, ' % (key, value)) + if node.dyn_kwargs is not None: + self.write('}, **') + self.visit(node.dyn_kwargs, frame) + self.write(')') + else: + self.write('}') + + elif node.dyn_kwargs is not None: + self.write(', **') + self.visit(node.dyn_kwargs, frame) + + def pull_dependencies(self, nodes): + """Pull all the dependencies.""" + visitor = DependencyFinderVisitor() + for node in nodes: + visitor.visit(node) + for dependency in 'filters', 'tests': + mapping = getattr(self, dependency) + for name in getattr(visitor, dependency): + if name not in mapping: + mapping[name] = self.temporary_identifier() + self.writeline('%s = environment.%s[%r]' % + (mapping[name], dependency, name)) + + def enter_frame(self, frame): + undefs = [] + for target, (action, param) in iteritems(frame.symbols.loads): + if action == VAR_LOAD_PARAMETER: + pass + elif action == VAR_LOAD_RESOLVE: + self.writeline('%s = %s(%r)' % + (target, self.get_resolve_func(), param)) + elif action == VAR_LOAD_ALIAS: + self.writeline('%s = %s' % (target, param)) + elif action == VAR_LOAD_UNDEFINED: + undefs.append(target) + else: + raise NotImplementedError('unknown load instruction') + if undefs: + self.writeline('%s = missing' % ' = '.join(undefs)) + + def leave_frame(self, frame, with_python_scope=False): + if not with_python_scope: + undefs = [] + for target, _ in iteritems(frame.symbols.loads): + undefs.append(target) + if undefs: + self.writeline('%s = missing' % ' = '.join(undefs)) + + def func(self, name): + if self.environment.is_async: + return 'async def %s' % name + return 'def %s' % name + + def macro_body(self, node, frame): + """Dump the function def of a macro or call block.""" + frame = frame.inner() + frame.symbols.analyze_node(node) + macro_ref = MacroRef(node) + + explicit_caller = None + skip_special_params = set() + args = [] + for idx, arg in enumerate(node.args): + if arg.name == 'caller': + explicit_caller = idx + if arg.name in ('kwargs', 'varargs'): + skip_special_params.add(arg.name) + args.append(frame.symbols.ref(arg.name)) + + undeclared = find_undeclared(node.body, ('caller', 'kwargs', 'varargs')) + + if 'caller' in undeclared: + # In older Jinja2 versions there was a bug that allowed caller + # to retain the special behavior even if it was mentioned in + # the argument list. However thankfully this was only really + # working if it was the last argument. So we are explicitly + # checking this now and error out if it is anywhere else in + # the argument list. + if explicit_caller is not None: + try: + node.defaults[explicit_caller - len(node.args)] + except IndexError: + self.fail('When defining macros or call blocks the ' + 'special "caller" argument must be omitted ' + 'or be given a default.', node.lineno) + else: + args.append(frame.symbols.declare_parameter('caller')) + macro_ref.accesses_caller = True + if 'kwargs' in undeclared and not 'kwargs' in skip_special_params: + args.append(frame.symbols.declare_parameter('kwargs')) + macro_ref.accesses_kwargs = True + if 'varargs' in undeclared and not 'varargs' in skip_special_params: + args.append(frame.symbols.declare_parameter('varargs')) + macro_ref.accesses_varargs = True + + # macros are delayed, they never require output checks + frame.require_output_check = False + frame.symbols.analyze_node(node) + self.writeline('%s(%s):' % (self.func('macro'), ', '.join(args)), node) + self.indent() + + self.buffer(frame) + self.enter_frame(frame) + + self.push_parameter_definitions(frame) + for idx, arg in enumerate(node.args): + ref = frame.symbols.ref(arg.name) + self.writeline('if %s is missing:' % ref) + self.indent() + try: + default = node.defaults[idx - len(node.args)] + except IndexError: + self.writeline('%s = undefined(%r, name=%r)' % ( + ref, + 'parameter %r was not provided' % arg.name, + arg.name)) + else: + self.writeline('%s = ' % ref) + self.visit(default, frame) + self.mark_parameter_stored(ref) + self.outdent() + self.pop_parameter_definitions() + + self.blockvisit(node.body, frame) + self.return_buffer_contents(frame, force_unescaped=True) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + return frame, macro_ref + + def macro_def(self, macro_ref, frame): + """Dump the macro definition for the def created by macro_body.""" + arg_tuple = ', '.join(repr(x.name) for x in macro_ref.node.args) + name = getattr(macro_ref.node, 'name', None) + if len(macro_ref.node.args) == 1: + arg_tuple += ',' + self.write('Macro(environment, macro, %r, (%s), %r, %r, %r, ' + 'context.eval_ctx.autoescape)' % + (name, arg_tuple, macro_ref.accesses_kwargs, + macro_ref.accesses_varargs, macro_ref.accesses_caller)) + + def position(self, node): + """Return a human readable position for the node.""" + rv = 'line %d' % node.lineno + if self.name is not None: + rv += ' in ' + repr(self.name) + return rv + + def dump_local_context(self, frame): + return '{%s}' % ', '.join( + '%r: %s' % (name, target) for name, target + in iteritems(frame.symbols.dump_stores())) + + def write_commons(self): + """Writes a common preamble that is used by root and block functions. + Primarily this sets up common local helpers and enforces a generator + through a dead branch. + """ + self.writeline('resolve = context.resolve_or_missing') + self.writeline('undefined = environment.undefined') + self.writeline('if 0: yield None') + + def push_parameter_definitions(self, frame): + """Pushes all parameter targets from the given frame into a local + stack that permits tracking of yet to be assigned parameters. In + particular this enables the optimization from `visit_Name` to skip + undefined expressions for parameters in macros as macros can reference + otherwise unbound parameters. + """ + self._param_def_block.append(frame.symbols.dump_param_targets()) + + def pop_parameter_definitions(self): + """Pops the current parameter definitions set.""" + self._param_def_block.pop() + + def mark_parameter_stored(self, target): + """Marks a parameter in the current parameter definitions as stored. + This will skip the enforced undefined checks. + """ + if self._param_def_block: + self._param_def_block[-1].discard(target) + + def push_context_reference(self, target): + self._context_reference_stack.append(target) + + def pop_context_reference(self): + self._context_reference_stack.pop() + + def get_context_ref(self): + return self._context_reference_stack[-1] + + def get_resolve_func(self): + target = self._context_reference_stack[-1] + if target == 'context': + return 'resolve' + return '%s.resolve' % target + + def derive_context(self, frame): + return '%s.derived(%s)' % ( + self.get_context_ref(), + self.dump_local_context(frame), + ) + + def parameter_is_undeclared(self, target): + """Checks if a given target is an undeclared parameter.""" + if not self._param_def_block: + return False + return target in self._param_def_block[-1] + + def push_assign_tracking(self): + """Pushes a new layer for assignment tracking.""" + self._assign_stack.append(set()) + + def pop_assign_tracking(self, frame): + """Pops the topmost level for assignment tracking and updates the + context variables if necessary. + """ + vars = self._assign_stack.pop() + if not frame.toplevel or not vars: + return + public_names = [x for x in vars if x[:1] != '_'] + if len(vars) == 1: + name = next(iter(vars)) + ref = frame.symbols.ref(name) + self.writeline('context.vars[%r] = %s' % (name, ref)) + else: + self.writeline('context.vars.update({') + for idx, name in enumerate(vars): + if idx: + self.write(', ') + ref = frame.symbols.ref(name) + self.write('%r: %s' % (name, ref)) + self.write('})') + if public_names: + if len(public_names) == 1: + self.writeline('context.exported_vars.add(%r)' % + public_names[0]) + else: + self.writeline('context.exported_vars.update((%s))' % + ', '.join(imap(repr, public_names))) + + # -- Statement Visitors + + def visit_Template(self, node, frame=None): + assert frame is None, 'no root frame allowed' + eval_ctx = EvalContext(self.environment, self.name) + + from jinja2.runtime import __all__ as exported + self.writeline('from __future__ import %s' % ', '.join(code_features)) + self.writeline('from jinja2.runtime import ' + ', '.join(exported)) + + if self.environment.is_async: + self.writeline('from jinja2.asyncsupport import auto_await, ' + 'auto_aiter, make_async_loop_context') + + # if we want a deferred initialization we cannot move the + # environment into a local name + envenv = not self.defer_init and ', environment=environment' or '' + + # do we have an extends tag at all? If not, we can save some + # overhead by just not processing any inheritance code. + have_extends = node.find(nodes.Extends) is not None + + # find all blocks + for block in node.find_all(nodes.Block): + if block.name in self.blocks: + self.fail('block %r defined twice' % block.name, block.lineno) + self.blocks[block.name] = block + + # find all imports and import them + for import_ in node.find_all(nodes.ImportedName): + if import_.importname not in self.import_aliases: + imp = import_.importname + self.import_aliases[imp] = alias = self.temporary_identifier() + if '.' in imp: + module, obj = imp.rsplit('.', 1) + self.writeline('from %s import %s as %s' % + (module, obj, alias)) + else: + self.writeline('import %s as %s' % (imp, alias)) + + # add the load name + self.writeline('name = %r' % self.name) + + # generate the root render function. + self.writeline('%s(context, missing=missing%s):' % + (self.func('root'), envenv), extra=1) + self.indent() + self.write_commons() + + # process the root + frame = Frame(eval_ctx) + if 'self' in find_undeclared(node.body, ('self',)): + ref = frame.symbols.declare_parameter('self') + self.writeline('%s = TemplateReference(context)' % ref) + frame.symbols.analyze_node(node) + frame.toplevel = frame.rootlevel = True + frame.require_output_check = have_extends and not self.has_known_extends + if have_extends: + self.writeline('parent_template = None') + self.enter_frame(frame) + self.pull_dependencies(node.body) + self.blockvisit(node.body, frame) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + # make sure that the parent root is called. + if have_extends: + if not self.has_known_extends: + self.indent() + self.writeline('if parent_template is not None:') + self.indent() + if supports_yield_from and not self.environment.is_async: + self.writeline('yield from parent_template.' + 'root_render_func(context)') + else: + self.writeline('%sfor event in parent_template.' + 'root_render_func(context):' % + (self.environment.is_async and 'async ' or '')) + self.indent() + self.writeline('yield event') + self.outdent() + self.outdent(1 + (not self.has_known_extends)) + + # at this point we now have the blocks collected and can visit them too. + for name, block in iteritems(self.blocks): + self.writeline('%s(context, missing=missing%s):' % + (self.func('block_' + name), envenv), + block, 1) + self.indent() + self.write_commons() + # It's important that we do not make this frame a child of the + # toplevel template. This would cause a variety of + # interesting issues with identifier tracking. + block_frame = Frame(eval_ctx) + undeclared = find_undeclared(block.body, ('self', 'super')) + if 'self' in undeclared: + ref = block_frame.symbols.declare_parameter('self') + self.writeline('%s = TemplateReference(context)' % ref) + if 'super' in undeclared: + ref = block_frame.symbols.declare_parameter('super') + self.writeline('%s = context.super(%r, ' + 'block_%s)' % (ref, name, name)) + block_frame.symbols.analyze_node(block) + block_frame.block = name + self.enter_frame(block_frame) + self.pull_dependencies(block.body) + self.blockvisit(block.body, block_frame) + self.leave_frame(block_frame, with_python_scope=True) + self.outdent() + + self.writeline('blocks = {%s}' % ', '.join('%r: block_%s' % (x, x) + for x in self.blocks), + extra=1) + + # add a function that returns the debug info + self.writeline('debug_info = %r' % '&'.join('%s=%s' % x for x + in self.debug_info)) + + def visit_Block(self, node, frame): + """Call a block and register it for the template.""" + level = 0 + if frame.toplevel: + # if we know that we are a child template, there is no need to + # check if we are one + if self.has_known_extends: + return + if self.extends_so_far > 0: + self.writeline('if parent_template is None:') + self.indent() + level += 1 + + if node.scoped: + context = self.derive_context(frame) + else: + context = self.get_context_ref() + + if supports_yield_from and not self.environment.is_async and \ + frame.buffer is None: + self.writeline('yield from context.blocks[%r][0](%s)' % ( + node.name, context), node) + else: + loop = self.environment.is_async and 'async for' or 'for' + self.writeline('%s event in context.blocks[%r][0](%s):' % ( + loop, node.name, context), node) + self.indent() + self.simple_write('event', frame) + self.outdent() + + self.outdent(level) + + def visit_Extends(self, node, frame): + """Calls the extender.""" + if not frame.toplevel: + self.fail('cannot use extend from a non top-level scope', + node.lineno) + + # if the number of extends statements in general is zero so + # far, we don't have to add a check if something extended + # the template before this one. + if self.extends_so_far > 0: + + # if we have a known extends we just add a template runtime + # error into the generated code. We could catch that at compile + # time too, but i welcome it not to confuse users by throwing the + # same error at different times just "because we can". + if not self.has_known_extends: + self.writeline('if parent_template is not None:') + self.indent() + self.writeline('raise TemplateRuntimeError(%r)' % + 'extended multiple times') + + # if we have a known extends already we don't need that code here + # as we know that the template execution will end here. + if self.has_known_extends: + raise CompilerExit() + else: + self.outdent() + + self.writeline('parent_template = environment.get_template(', node) + self.visit(node.template, frame) + self.write(', %r)' % self.name) + self.writeline('for name, parent_block in parent_template.' + 'blocks.%s():' % dict_item_iter) + self.indent() + self.writeline('context.blocks.setdefault(name, []).' + 'append(parent_block)') + self.outdent() + + # if this extends statement was in the root level we can take + # advantage of that information and simplify the generated code + # in the top level from this point onwards + if frame.rootlevel: + self.has_known_extends = True + + # and now we have one more + self.extends_so_far += 1 + + def visit_Include(self, node, frame): + """Handles includes.""" + if node.ignore_missing: + self.writeline('try:') + self.indent() + + func_name = 'get_or_select_template' + if isinstance(node.template, nodes.Const): + if isinstance(node.template.value, string_types): + func_name = 'get_template' + elif isinstance(node.template.value, (tuple, list)): + func_name = 'select_template' + elif isinstance(node.template, (nodes.Tuple, nodes.List)): + func_name = 'select_template' + + self.writeline('template = environment.%s(' % func_name, node) + self.visit(node.template, frame) + self.write(', %r)' % self.name) + if node.ignore_missing: + self.outdent() + self.writeline('except TemplateNotFound:') + self.indent() + self.writeline('pass') + self.outdent() + self.writeline('else:') + self.indent() + + skip_event_yield = False + if node.with_context: + loop = self.environment.is_async and 'async for' or 'for' + self.writeline('%s event in template.root_render_func(' + 'template.new_context(context.get_all(), True, ' + '%s)):' % (loop, self.dump_local_context(frame))) + elif self.environment.is_async: + self.writeline('for event in (await ' + 'template._get_default_module_async())' + '._body_stream:') + else: + if supports_yield_from: + self.writeline('yield from template._get_default_module()' + '._body_stream') + skip_event_yield = True + else: + self.writeline('for event in template._get_default_module()' + '._body_stream:') + + if not skip_event_yield: + self.indent() + self.simple_write('event', frame) + self.outdent() + + if node.ignore_missing: + self.outdent() + + def visit_Import(self, node, frame): + """Visit regular imports.""" + self.writeline('%s = ' % frame.symbols.ref(node.target), node) + if frame.toplevel: + self.write('context.vars[%r] = ' % node.target) + if self.environment.is_async: + self.write('await ') + self.write('environment.get_template(') + self.visit(node.template, frame) + self.write(', %r).' % self.name) + if node.with_context: + self.write('make_module%s(context.get_all(), True, %s)' + % (self.environment.is_async and '_async' or '', + self.dump_local_context(frame))) + elif self.environment.is_async: + self.write('_get_default_module_async()') + else: + self.write('_get_default_module()') + if frame.toplevel and not node.target.startswith('_'): + self.writeline('context.exported_vars.discard(%r)' % node.target) + + def visit_FromImport(self, node, frame): + """Visit named imports.""" + self.newline(node) + self.write('included_template = %senvironment.get_template(' + % (self.environment.is_async and 'await ' or '')) + self.visit(node.template, frame) + self.write(', %r).' % self.name) + if node.with_context: + self.write('make_module%s(context.get_all(), True, %s)' + % (self.environment.is_async and '_async' or '', + self.dump_local_context(frame))) + elif self.environment.is_async: + self.write('_get_default_module_async()') + else: + self.write('_get_default_module()') + + var_names = [] + discarded_names = [] + for name in node.names: + if isinstance(name, tuple): + name, alias = name + else: + alias = name + self.writeline('%s = getattr(included_template, ' + '%r, missing)' % (frame.symbols.ref(alias), name)) + self.writeline('if %s is missing:' % frame.symbols.ref(alias)) + self.indent() + self.writeline('%s = undefined(%r %% ' + 'included_template.__name__, ' + 'name=%r)' % + (frame.symbols.ref(alias), + 'the template %%r (imported on %s) does ' + 'not export the requested name %s' % ( + self.position(node), + repr(name) + ), name)) + self.outdent() + if frame.toplevel: + var_names.append(alias) + if not alias.startswith('_'): + discarded_names.append(alias) + + if var_names: + if len(var_names) == 1: + name = var_names[0] + self.writeline('context.vars[%r] = %s' % + (name, frame.symbols.ref(name))) + else: + self.writeline('context.vars.update({%s})' % ', '.join( + '%r: %s' % (name, frame.symbols.ref(name)) for name in var_names + )) + if discarded_names: + if len(discarded_names) == 1: + self.writeline('context.exported_vars.discard(%r)' % + discarded_names[0]) + else: + self.writeline('context.exported_vars.difference_' + 'update((%s))' % ', '.join(imap(repr, discarded_names))) + + def visit_For(self, node, frame): + loop_frame = frame.inner() + test_frame = frame.inner() + else_frame = frame.inner() + + # try to figure out if we have an extended loop. An extended loop + # is necessary if the loop is in recursive mode if the special loop + # variable is accessed in the body. + extended_loop = node.recursive or 'loop' in \ + find_undeclared(node.iter_child_nodes( + only=('body',)), ('loop',)) + + loop_ref = None + if extended_loop: + loop_ref = loop_frame.symbols.declare_parameter('loop') + + loop_frame.symbols.analyze_node(node, for_branch='body') + if node.else_: + else_frame.symbols.analyze_node(node, for_branch='else') + + if node.test: + loop_filter_func = self.temporary_identifier() + test_frame.symbols.analyze_node(node, for_branch='test') + self.writeline('%s(fiter):' % self.func(loop_filter_func), node.test) + self.indent() + self.enter_frame(test_frame) + self.writeline(self.environment.is_async and 'async for ' or 'for ') + self.visit(node.target, loop_frame) + self.write(' in ') + self.write(self.environment.is_async and 'auto_aiter(fiter)' or 'fiter') + self.write(':') + self.indent() + self.writeline('if ', node.test) + self.visit(node.test, test_frame) + self.write(':') + self.indent() + self.writeline('yield ') + self.visit(node.target, loop_frame) + self.outdent(3) + self.leave_frame(test_frame, with_python_scope=True) + + # if we don't have an recursive loop we have to find the shadowed + # variables at that point. Because loops can be nested but the loop + # variable is a special one we have to enforce aliasing for it. + if node.recursive: + self.writeline('%s(reciter, loop_render_func, depth=0):' % + self.func('loop'), node) + self.indent() + self.buffer(loop_frame) + + # Use the same buffer for the else frame + else_frame.buffer = loop_frame.buffer + + # make sure the loop variable is a special one and raise a template + # assertion error if a loop tries to write to loop + if extended_loop: + self.writeline('%s = missing' % loop_ref) + + for name in node.find_all(nodes.Name): + if name.ctx == 'store' and name.name == 'loop': + self.fail('Can\'t assign to special loop variable ' + 'in for-loop target', name.lineno) + + if node.else_: + iteration_indicator = self.temporary_identifier() + self.writeline('%s = 1' % iteration_indicator) + + self.writeline(self.environment.is_async and 'async for ' or 'for ', node) + self.visit(node.target, loop_frame) + if extended_loop: + if self.environment.is_async: + self.write(', %s in await make_async_loop_context(' % loop_ref) + else: + self.write(', %s in LoopContext(' % loop_ref) + else: + self.write(' in ') + + if node.test: + self.write('%s(' % loop_filter_func) + if node.recursive: + self.write('reciter') + else: + if self.environment.is_async and not extended_loop: + self.write('auto_aiter(') + self.visit(node.iter, frame) + if self.environment.is_async and not extended_loop: + self.write(')') + if node.test: + self.write(')') + + if node.recursive: + self.write(', undefined, loop_render_func, depth):') + else: + self.write(extended_loop and ', undefined):' or ':') + + self.indent() + self.enter_frame(loop_frame) + + self.blockvisit(node.body, loop_frame) + if node.else_: + self.writeline('%s = 0' % iteration_indicator) + self.outdent() + self.leave_frame(loop_frame, with_python_scope=node.recursive + and not node.else_) + + if node.else_: + self.writeline('if %s:' % iteration_indicator) + self.indent() + self.enter_frame(else_frame) + self.blockvisit(node.else_, else_frame) + self.leave_frame(else_frame) + self.outdent() + + # if the node was recursive we have to return the buffer contents + # and start the iteration code + if node.recursive: + self.return_buffer_contents(loop_frame) + self.outdent() + self.start_write(frame, node) + if self.environment.is_async: + self.write('await ') + self.write('loop(') + if self.environment.is_async: + self.write('auto_aiter(') + self.visit(node.iter, frame) + if self.environment.is_async: + self.write(')') + self.write(', loop)') + self.end_write(frame) + + def visit_If(self, node, frame): + if_frame = frame.soft() + self.writeline('if ', node) + self.visit(node.test, if_frame) + self.write(':') + self.indent() + self.blockvisit(node.body, if_frame) + self.outdent() + for elif_ in node.elif_: + self.writeline('elif ', elif_) + self.visit(elif_.test, if_frame) + self.write(':') + self.indent() + self.blockvisit(elif_.body, if_frame) + self.outdent() + if node.else_: + self.writeline('else:') + self.indent() + self.blockvisit(node.else_, if_frame) + self.outdent() + + def visit_Macro(self, node, frame): + macro_frame, macro_ref = self.macro_body(node, frame) + self.newline() + if frame.toplevel: + if not node.name.startswith('_'): + self.write('context.exported_vars.add(%r)' % node.name) + ref = frame.symbols.ref(node.name) + self.writeline('context.vars[%r] = ' % node.name) + self.write('%s = ' % frame.symbols.ref(node.name)) + self.macro_def(macro_ref, macro_frame) + + def visit_CallBlock(self, node, frame): + call_frame, macro_ref = self.macro_body(node, frame) + self.writeline('caller = ') + self.macro_def(macro_ref, call_frame) + self.start_write(frame, node) + self.visit_Call(node.call, frame, forward_caller=True) + self.end_write(frame) + + def visit_FilterBlock(self, node, frame): + filter_frame = frame.inner() + filter_frame.symbols.analyze_node(node) + self.enter_frame(filter_frame) + self.buffer(filter_frame) + self.blockvisit(node.body, filter_frame) + self.start_write(frame, node) + self.visit_Filter(node.filter, filter_frame) + self.end_write(frame) + self.leave_frame(filter_frame) + + def visit_With(self, node, frame): + with_frame = frame.inner() + with_frame.symbols.analyze_node(node) + self.enter_frame(with_frame) + for idx, (target, expr) in enumerate(izip(node.targets, node.values)): + self.newline() + self.visit(target, with_frame) + self.write(' = ') + self.visit(expr, frame) + self.blockvisit(node.body, with_frame) + self.leave_frame(with_frame) + + def visit_ExprStmt(self, node, frame): + self.newline(node) + self.visit(node.node, frame) + + def visit_Output(self, node, frame): + # if we have a known extends statement, we don't output anything + # if we are in a require_output_check section + if self.has_known_extends and frame.require_output_check: + return + + allow_constant_finalize = True + if self.environment.finalize: + func = self.environment.finalize + if getattr(func, 'contextfunction', False) or \ + getattr(func, 'evalcontextfunction', False): + allow_constant_finalize = False + elif getattr(func, 'environmentfunction', False): + finalize = lambda x: text_type( + self.environment.finalize(self.environment, x)) + else: + finalize = lambda x: text_type(self.environment.finalize(x)) + else: + finalize = text_type + + # if we are inside a frame that requires output checking, we do so + outdent_later = False + if frame.require_output_check: + self.writeline('if parent_template is None:') + self.indent() + outdent_later = True + + # try to evaluate as many chunks as possible into a static + # string at compile time. + body = [] + for child in node.nodes: + try: + if not allow_constant_finalize: + raise nodes.Impossible() + const = child.as_const(frame.eval_ctx) + except nodes.Impossible: + body.append(child) + continue + # the frame can't be volatile here, becaus otherwise the + # as_const() function would raise an Impossible exception + # at that point. + try: + if frame.eval_ctx.autoescape: + if hasattr(const, '__html__'): + const = const.__html__() + else: + const = escape(const) + const = finalize(const) + except Exception: + # if something goes wrong here we evaluate the node + # at runtime for easier debugging + body.append(child) + continue + if body and isinstance(body[-1], list): + body[-1].append(const) + else: + body.append([const]) + + # if we have less than 3 nodes or a buffer we yield or extend/append + if len(body) < 3 or frame.buffer is not None: + if frame.buffer is not None: + # for one item we append, for more we extend + if len(body) == 1: + self.writeline('%s.append(' % frame.buffer) + else: + self.writeline('%s.extend((' % frame.buffer) + self.indent() + for item in body: + if isinstance(item, list): + val = repr(concat(item)) + if frame.buffer is None: + self.writeline('yield ' + val) + else: + self.writeline(val + ',') + else: + if frame.buffer is None: + self.writeline('yield ', item) + else: + self.newline(item) + close = 1 + if frame.eval_ctx.volatile: + self.write('(escape if context.eval_ctx.autoescape' + ' else to_string)(') + elif frame.eval_ctx.autoescape: + self.write('escape(') + else: + self.write('to_string(') + if self.environment.finalize is not None: + self.write('environment.finalize(') + if getattr(self.environment.finalize, + "contextfunction", False): + self.write('context, ') + close += 1 + self.visit(item, frame) + self.write(')' * close) + if frame.buffer is not None: + self.write(',') + if frame.buffer is not None: + # close the open parentheses + self.outdent() + self.writeline(len(body) == 1 and ')' or '))') + + # otherwise we create a format string as this is faster in that case + else: + format = [] + arguments = [] + for item in body: + if isinstance(item, list): + format.append(concat(item).replace('%', '%%')) + else: + format.append('%s') + arguments.append(item) + self.writeline('yield ') + self.write(repr(concat(format)) + ' % (') + self.indent() + for argument in arguments: + self.newline(argument) + close = 0 + if frame.eval_ctx.volatile: + self.write('(escape if context.eval_ctx.autoescape else' + ' to_string)(') + close += 1 + elif frame.eval_ctx.autoescape: + self.write('escape(') + close += 1 + if self.environment.finalize is not None: + self.write('environment.finalize(') + if getattr(self.environment.finalize, + 'contextfunction', False): + self.write('context, ') + elif getattr(self.environment.finalize, + 'evalcontextfunction', False): + self.write('context.eval_ctx, ') + elif getattr(self.environment.finalize, + 'environmentfunction', False): + self.write('environment, ') + close += 1 + self.visit(argument, frame) + self.write(')' * close + ', ') + self.outdent() + self.writeline(')') + + if outdent_later: + self.outdent() + + def visit_Assign(self, node, frame): + self.push_assign_tracking() + self.newline(node) + self.visit(node.target, frame) + self.write(' = ') + self.visit(node.node, frame) + self.pop_assign_tracking(frame) + + def visit_AssignBlock(self, node, frame): + self.push_assign_tracking() + block_frame = frame.inner() + # This is a special case. Since a set block always captures we + # will disable output checks. This way one can use set blocks + # toplevel even in extended templates. + block_frame.require_output_check = False + block_frame.symbols.analyze_node(node) + self.enter_frame(block_frame) + self.buffer(block_frame) + self.blockvisit(node.body, block_frame) + self.newline(node) + self.visit(node.target, frame) + self.write(' = (Markup if context.eval_ctx.autoescape ' + 'else identity)(') + if node.filter is not None: + self.visit_Filter(node.filter, block_frame) + else: + self.write('concat(%s)' % block_frame.buffer) + self.write(')') + self.pop_assign_tracking(frame) + self.leave_frame(block_frame) + + # -- Expression Visitors + + def visit_Name(self, node, frame): + if node.ctx == 'store' and frame.toplevel: + if self._assign_stack: + self._assign_stack[-1].add(node.name) + ref = frame.symbols.ref(node.name) + + # If we are looking up a variable we might have to deal with the + # case where it's undefined. We can skip that case if the load + # instruction indicates a parameter which are always defined. + if node.ctx == 'load': + load = frame.symbols.find_load(ref) + if not (load is not None and load[0] == VAR_LOAD_PARAMETER and \ + not self.parameter_is_undeclared(ref)): + self.write('(undefined(name=%r) if %s is missing else %s)' % + (node.name, ref, ref)) + return + + self.write(ref) + + def visit_NSRef(self, node, frame): + # NSRefs can only be used to store values; since they use the normal + # `foo.bar` notation they will be parsed as a normal attribute access + # when used anywhere but in a `set` context + ref = frame.symbols.ref(node.name) + self.writeline('if not isinstance(%s, Namespace):' % ref) + self.indent() + self.writeline('raise TemplateRuntimeError(%r)' % + 'cannot assign attribute on non-namespace object') + self.outdent() + self.writeline('%s[%r]' % (ref, node.attr)) + + def visit_Const(self, node, frame): + val = node.as_const(frame.eval_ctx) + if isinstance(val, float): + self.write(str(val)) + else: + self.write(repr(val)) + + def visit_TemplateData(self, node, frame): + try: + self.write(repr(node.as_const(frame.eval_ctx))) + except nodes.Impossible: + self.write('(Markup if context.eval_ctx.autoescape else identity)(%r)' + % node.data) + + def visit_Tuple(self, node, frame): + self.write('(') + idx = -1 + for idx, item in enumerate(node.items): + if idx: + self.write(', ') + self.visit(item, frame) + self.write(idx == 0 and ',)' or ')') + + def visit_List(self, node, frame): + self.write('[') + for idx, item in enumerate(node.items): + if idx: + self.write(', ') + self.visit(item, frame) + self.write(']') + + def visit_Dict(self, node, frame): + self.write('{') + for idx, item in enumerate(node.items): + if idx: + self.write(', ') + self.visit(item.key, frame) + self.write(': ') + self.visit(item.value, frame) + self.write('}') + + def binop(operator, interceptable=True): + @optimizeconst + def visitor(self, node, frame): + if self.environment.sandboxed and \ + operator in self.environment.intercepted_binops: + self.write('environment.call_binop(context, %r, ' % operator) + self.visit(node.left, frame) + self.write(', ') + self.visit(node.right, frame) + else: + self.write('(') + self.visit(node.left, frame) + self.write(' %s ' % operator) + self.visit(node.right, frame) + self.write(')') + return visitor + + def uaop(operator, interceptable=True): + @optimizeconst + def visitor(self, node, frame): + if self.environment.sandboxed and \ + operator in self.environment.intercepted_unops: + self.write('environment.call_unop(context, %r, ' % operator) + self.visit(node.node, frame) + else: + self.write('(' + operator) + self.visit(node.node, frame) + self.write(')') + return visitor + + visit_Add = binop('+') + visit_Sub = binop('-') + visit_Mul = binop('*') + visit_Div = binop('/') + visit_FloorDiv = binop('//') + visit_Pow = binop('**') + visit_Mod = binop('%') + visit_And = binop('and', interceptable=False) + visit_Or = binop('or', interceptable=False) + visit_Pos = uaop('+') + visit_Neg = uaop('-') + visit_Not = uaop('not ', interceptable=False) + del binop, uaop + + @optimizeconst + def visit_Concat(self, node, frame): + if frame.eval_ctx.volatile: + func_name = '(context.eval_ctx.volatile and' \ + ' markup_join or unicode_join)' + elif frame.eval_ctx.autoescape: + func_name = 'markup_join' + else: + func_name = 'unicode_join' + self.write('%s((' % func_name) + for arg in node.nodes: + self.visit(arg, frame) + self.write(', ') + self.write('))') + + @optimizeconst + def visit_Compare(self, node, frame): + self.visit(node.expr, frame) + for op in node.ops: + self.visit(op, frame) + + def visit_Operand(self, node, frame): + self.write(' %s ' % operators[node.op]) + self.visit(node.expr, frame) + + @optimizeconst + def visit_Getattr(self, node, frame): + self.write('environment.getattr(') + self.visit(node.node, frame) + self.write(', %r)' % node.attr) + + @optimizeconst + def visit_Getitem(self, node, frame): + # slices bypass the environment getitem method. + if isinstance(node.arg, nodes.Slice): + self.visit(node.node, frame) + self.write('[') + self.visit(node.arg, frame) + self.write(']') + else: + self.write('environment.getitem(') + self.visit(node.node, frame) + self.write(', ') + self.visit(node.arg, frame) + self.write(')') + + def visit_Slice(self, node, frame): + if node.start is not None: + self.visit(node.start, frame) + self.write(':') + if node.stop is not None: + self.visit(node.stop, frame) + if node.step is not None: + self.write(':') + self.visit(node.step, frame) + + @optimizeconst + def visit_Filter(self, node, frame): + if self.environment.is_async: + self.write('await auto_await(') + self.write(self.filters[node.name] + '(') + func = self.environment.filters.get(node.name) + if func is None: + self.fail('no filter named %r' % node.name, node.lineno) + if getattr(func, 'contextfilter', False): + self.write('context, ') + elif getattr(func, 'evalcontextfilter', False): + self.write('context.eval_ctx, ') + elif getattr(func, 'environmentfilter', False): + self.write('environment, ') + + # if the filter node is None we are inside a filter block + # and want to write to the current buffer + if node.node is not None: + self.visit(node.node, frame) + elif frame.eval_ctx.volatile: + self.write('(context.eval_ctx.autoescape and' + ' Markup(concat(%s)) or concat(%s))' % + (frame.buffer, frame.buffer)) + elif frame.eval_ctx.autoescape: + self.write('Markup(concat(%s))' % frame.buffer) + else: + self.write('concat(%s)' % frame.buffer) + self.signature(node, frame) + self.write(')') + if self.environment.is_async: + self.write(')') + + @optimizeconst + def visit_Test(self, node, frame): + self.write(self.tests[node.name] + '(') + if node.name not in self.environment.tests: + self.fail('no test named %r' % node.name, node.lineno) + self.visit(node.node, frame) + self.signature(node, frame) + self.write(')') + + @optimizeconst + def visit_CondExpr(self, node, frame): + def write_expr2(): + if node.expr2 is not None: + return self.visit(node.expr2, frame) + self.write('undefined(%r)' % ('the inline if-' + 'expression on %s evaluated to false and ' + 'no else section was defined.' % self.position(node))) + + self.write('(') + self.visit(node.expr1, frame) + self.write(' if ') + self.visit(node.test, frame) + self.write(' else ') + write_expr2() + self.write(')') + + @optimizeconst + def visit_Call(self, node, frame, forward_caller=False): + if self.environment.is_async: + self.write('await auto_await(') + if self.environment.sandboxed: + self.write('environment.call(context, ') + else: + self.write('context.call(') + self.visit(node.node, frame) + extra_kwargs = forward_caller and {'caller': 'caller'} or None + self.signature(node, frame, extra_kwargs) + self.write(')') + if self.environment.is_async: + self.write(')') + + def visit_Keyword(self, node, frame): + self.write(node.key + '=') + self.visit(node.value, frame) + + # -- Unused nodes for extensions + + def visit_MarkSafe(self, node, frame): + self.write('Markup(') + self.visit(node.expr, frame) + self.write(')') + + def visit_MarkSafeIfAutoescape(self, node, frame): + self.write('(context.eval_ctx.autoescape and Markup or identity)(') + self.visit(node.expr, frame) + self.write(')') + + def visit_EnvironmentAttribute(self, node, frame): + self.write('environment.' + node.name) + + def visit_ExtensionAttribute(self, node, frame): + self.write('environment.extensions[%r].%s' % (node.identifier, node.name)) + + def visit_ImportedName(self, node, frame): + self.write(self.import_aliases[node.importname]) + + def visit_InternalName(self, node, frame): + self.write(node.name) + + def visit_ContextReference(self, node, frame): + self.write('context') + + def visit_Continue(self, node, frame): + self.writeline('continue', node) + + def visit_Break(self, node, frame): + self.writeline('break', node) + + def visit_Scope(self, node, frame): + scope_frame = frame.inner() + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + + def visit_OverlayScope(self, node, frame): + ctx = self.temporary_identifier() + self.writeline('%s = %s' % (ctx, self.derive_context(frame))) + self.writeline('%s.vars = ' % ctx) + self.visit(node.context, frame) + self.push_context_reference(ctx) + + scope_frame = frame.inner(isolated=True) + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + self.pop_context_reference() + + def visit_EvalContextModifier(self, node, frame): + for keyword in node.options: + self.writeline('context.eval_ctx.%s = ' % keyword.key) + self.visit(keyword.value, frame) + try: + val = keyword.value.as_const(frame.eval_ctx) + except nodes.Impossible: + frame.eval_ctx.volatile = True + else: + setattr(frame.eval_ctx, keyword.key, val) + + def visit_ScopedEvalContextModifier(self, node, frame): + old_ctx_name = self.temporary_identifier() + saved_ctx = frame.eval_ctx.save() + self.writeline('%s = context.eval_ctx.save()' % old_ctx_name) + self.visit_EvalContextModifier(node, frame) + for child in node.body: + self.visit(child, frame) + frame.eval_ctx.revert(saved_ctx) + self.writeline('context.eval_ctx.revert(%s)' % old_ctx_name) diff --git a/tools/jinja2/constants.py b/tools/jinja2/constants.py new file mode 100644 index 000000000000..11efd1ed1583 --- /dev/null +++ b/tools/jinja2/constants.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +""" + jinja.constants + ~~~~~~~~~~~~~~~ + + Various constants. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" + + +#: list of lorem ipsum words used by the lipsum() helper function +LOREM_IPSUM_WORDS = u'''\ +a ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at +auctor augue bibendum blandit class commodo condimentum congue consectetuer +consequat conubia convallis cras cubilia cum curabitur curae cursus dapibus +diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend +elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames +faucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac +hendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum +justo lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem +luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie +mollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non +nonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque +penatibus per pharetra phasellus placerat platea porta porttitor posuere +potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus +ridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit +sociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor +tempus tincidunt torquent tortor tristique turpis ullamcorper ultrices +ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus +viverra volutpat vulputate''' diff --git a/tools/jinja2/debug.py b/tools/jinja2/debug.py new file mode 100644 index 000000000000..b61139f0cde1 --- /dev/null +++ b/tools/jinja2/debug.py @@ -0,0 +1,372 @@ +# -*- coding: utf-8 -*- +""" + jinja2.debug + ~~~~~~~~~~~~ + + Implements the debug interface for Jinja. This module does some pretty + ugly stuff with the Python traceback system in order to achieve tracebacks + with correct line numbers, locals and contents. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +import sys +import traceback +from types import TracebackType, CodeType +from jinja2.utils import missing, internal_code +from jinja2.exceptions import TemplateSyntaxError +from jinja2._compat import iteritems, reraise, PY2 + +# on pypy we can take advantage of transparent proxies +try: + from __pypy__ import tproxy +except ImportError: + tproxy = None + + +# how does the raise helper look like? +try: + exec("raise TypeError, 'foo'") +except SyntaxError: + raise_helper = 'raise __jinja_exception__[1]' +except TypeError: + raise_helper = 'raise __jinja_exception__[0], __jinja_exception__[1]' + + +class TracebackFrameProxy(object): + """Proxies a traceback frame.""" + + def __init__(self, tb): + self.tb = tb + self._tb_next = None + + @property + def tb_next(self): + return self._tb_next + + def set_next(self, next): + if tb_set_next is not None: + try: + tb_set_next(self.tb, next and next.tb or None) + except Exception: + # this function can fail due to all the hackery it does + # on various python implementations. We just catch errors + # down and ignore them if necessary. + pass + self._tb_next = next + + @property + def is_jinja_frame(self): + return '__jinja_template__' in self.tb.tb_frame.f_globals + + def __getattr__(self, name): + return getattr(self.tb, name) + + +def make_frame_proxy(frame): + proxy = TracebackFrameProxy(frame) + if tproxy is None: + return proxy + def operation_handler(operation, *args, **kwargs): + if operation in ('__getattribute__', '__getattr__'): + return getattr(proxy, args[0]) + elif operation == '__setattr__': + proxy.__setattr__(*args, **kwargs) + else: + return getattr(proxy, operation)(*args, **kwargs) + return tproxy(TracebackType, operation_handler) + + +class ProcessedTraceback(object): + """Holds a Jinja preprocessed traceback for printing or reraising.""" + + def __init__(self, exc_type, exc_value, frames): + assert frames, 'no frames for this traceback?' + self.exc_type = exc_type + self.exc_value = exc_value + self.frames = frames + + # newly concatenate the frames (which are proxies) + prev_tb = None + for tb in self.frames: + if prev_tb is not None: + prev_tb.set_next(tb) + prev_tb = tb + prev_tb.set_next(None) + + def render_as_text(self, limit=None): + """Return a string with the traceback.""" + lines = traceback.format_exception(self.exc_type, self.exc_value, + self.frames[0], limit=limit) + return ''.join(lines).rstrip() + + def render_as_html(self, full=False): + """Return a unicode string with the traceback as rendered HTML.""" + from jinja2.debugrenderer import render_traceback + return u'%s\n\n' % ( + render_traceback(self, full=full), + self.render_as_text().decode('utf-8', 'replace') + ) + + @property + def is_template_syntax_error(self): + """`True` if this is a template syntax error.""" + return isinstance(self.exc_value, TemplateSyntaxError) + + @property + def exc_info(self): + """Exception info tuple with a proxy around the frame objects.""" + return self.exc_type, self.exc_value, self.frames[0] + + @property + def standard_exc_info(self): + """Standard python exc_info for re-raising""" + tb = self.frames[0] + # the frame will be an actual traceback (or transparent proxy) if + # we are on pypy or a python implementation with support for tproxy + if type(tb) is not TracebackType: + tb = tb.tb + return self.exc_type, self.exc_value, tb + + +def make_traceback(exc_info, source_hint=None): + """Creates a processed traceback object from the exc_info.""" + exc_type, exc_value, tb = exc_info + if isinstance(exc_value, TemplateSyntaxError): + exc_info = translate_syntax_error(exc_value, source_hint) + initial_skip = 0 + else: + initial_skip = 1 + return translate_exception(exc_info, initial_skip) + + +def translate_syntax_error(error, source=None): + """Rewrites a syntax error to please traceback systems.""" + error.source = source + error.translated = True + exc_info = (error.__class__, error, None) + filename = error.filename + if filename is None: + filename = '' + return fake_exc_info(exc_info, filename, error.lineno) + + +def translate_exception(exc_info, initial_skip=0): + """If passed an exc_info it will automatically rewrite the exceptions + all the way down to the correct line numbers and frames. + """ + tb = exc_info[2] + frames = [] + + # skip some internal frames if wanted + for x in range(initial_skip): + if tb is not None: + tb = tb.tb_next + initial_tb = tb + + while tb is not None: + # skip frames decorated with @internalcode. These are internal + # calls we can't avoid and that are useless in template debugging + # output. + if tb.tb_frame.f_code in internal_code: + tb = tb.tb_next + continue + + # save a reference to the next frame if we override the current + # one with a faked one. + next = tb.tb_next + + # fake template exceptions + template = tb.tb_frame.f_globals.get('__jinja_template__') + if template is not None: + lineno = template.get_corresponding_lineno(tb.tb_lineno) + tb = fake_exc_info(exc_info[:2] + (tb,), template.filename, + lineno)[2] + + frames.append(make_frame_proxy(tb)) + tb = next + + # if we don't have any exceptions in the frames left, we have to + # reraise it unchanged. + # XXX: can we backup here? when could this happen? + if not frames: + reraise(exc_info[0], exc_info[1], exc_info[2]) + + return ProcessedTraceback(exc_info[0], exc_info[1], frames) + + +def get_jinja_locals(real_locals): + ctx = real_locals.get('context') + if ctx: + locals = ctx.get_all().copy() + else: + locals = {} + + local_overrides = {} + + for name, value in iteritems(real_locals): + if not name.startswith('l_') or value is missing: + continue + try: + _, depth, name = name.split('_', 2) + depth = int(depth) + except ValueError: + continue + cur_depth = local_overrides.get(name, (-1,))[0] + if cur_depth < depth: + local_overrides[name] = (depth, value) + + for name, (_, value) in iteritems(local_overrides): + if value is missing: + locals.pop(name, None) + else: + locals[name] = value + + return locals + + +def fake_exc_info(exc_info, filename, lineno): + """Helper for `translate_exception`.""" + exc_type, exc_value, tb = exc_info + + # figure the real context out + if tb is not None: + locals = get_jinja_locals(tb.tb_frame.f_locals) + + # if there is a local called __jinja_exception__, we get + # rid of it to not break the debug functionality. + locals.pop('__jinja_exception__', None) + else: + locals = {} + + # assamble fake globals we need + globals = { + '__name__': filename, + '__file__': filename, + '__jinja_exception__': exc_info[:2], + + # we don't want to keep the reference to the template around + # to not cause circular dependencies, but we mark it as Jinja + # frame for the ProcessedTraceback + '__jinja_template__': None + } + + # and fake the exception + code = compile('\n' * (lineno - 1) + raise_helper, filename, 'exec') + + # if it's possible, change the name of the code. This won't work + # on some python environments such as google appengine + try: + if tb is None: + location = 'template' + else: + function = tb.tb_frame.f_code.co_name + if function == 'root': + location = 'top-level template code' + elif function.startswith('block_'): + location = 'block "%s"' % function[6:] + else: + location = 'template' + + if PY2: + code = CodeType(0, code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, code.co_consts, + code.co_names, code.co_varnames, filename, + location, code.co_firstlineno, + code.co_lnotab, (), ()) + else: + code = CodeType(0, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, + code.co_flags, code.co_code, code.co_consts, + code.co_names, code.co_varnames, filename, + location, code.co_firstlineno, + code.co_lnotab, (), ()) + except Exception as e: + pass + + # execute the code and catch the new traceback + try: + exec(code, globals, locals) + except: + exc_info = sys.exc_info() + new_tb = exc_info[2].tb_next + + # return without this frame + return exc_info[:2] + (new_tb,) + + +def _init_ugly_crap(): + """This function implements a few ugly things so that we can patch the + traceback objects. The function returned allows resetting `tb_next` on + any python traceback object. Do not attempt to use this on non cpython + interpreters + """ + import ctypes + from types import TracebackType + + if PY2: + # figure out size of _Py_ssize_t for Python 2: + if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): + _Py_ssize_t = ctypes.c_int64 + else: + _Py_ssize_t = ctypes.c_int + else: + # platform ssize_t on Python 3 + _Py_ssize_t = ctypes.c_ssize_t + + # regular python + class _PyObject(ctypes.Structure): + pass + _PyObject._fields_ = [ + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + # python with trace + if hasattr(sys, 'getobjects'): + class _PyObject(ctypes.Structure): + pass + _PyObject._fields_ = [ + ('_ob_next', ctypes.POINTER(_PyObject)), + ('_ob_prev', ctypes.POINTER(_PyObject)), + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + class _Traceback(_PyObject): + pass + _Traceback._fields_ = [ + ('tb_next', ctypes.POINTER(_Traceback)), + ('tb_frame', ctypes.POINTER(_PyObject)), + ('tb_lasti', ctypes.c_int), + ('tb_lineno', ctypes.c_int) + ] + + def tb_set_next(tb, next): + """Set the tb_next attribute of a traceback object.""" + if not (isinstance(tb, TracebackType) and + (next is None or isinstance(next, TracebackType))): + raise TypeError('tb_set_next arguments must be traceback objects') + obj = _Traceback.from_address(id(tb)) + if tb.tb_next is not None: + old = _Traceback.from_address(id(tb.tb_next)) + old.ob_refcnt -= 1 + if next is None: + obj.tb_next = ctypes.POINTER(_Traceback)() + else: + next = _Traceback.from_address(id(next)) + next.ob_refcnt += 1 + obj.tb_next = ctypes.pointer(next) + + return tb_set_next + + +# try to get a tb_set_next implementation if we don't have transparent +# proxies. +tb_set_next = None +if tproxy is None: + try: + tb_set_next = _init_ugly_crap() + except: + pass + del _init_ugly_crap diff --git a/tools/jinja2/defaults.py b/tools/jinja2/defaults.py new file mode 100644 index 000000000000..7c93dec0aeb2 --- /dev/null +++ b/tools/jinja2/defaults.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +""" + jinja2.defaults + ~~~~~~~~~~~~~~~ + + Jinja default filters and tags. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +from jinja2._compat import range_type +from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner, Namespace + + +# defaults for the parser / lexer +BLOCK_START_STRING = '{%' +BLOCK_END_STRING = '%}' +VARIABLE_START_STRING = '{{' +VARIABLE_END_STRING = '}}' +COMMENT_START_STRING = '{#' +COMMENT_END_STRING = '#}' +LINE_STATEMENT_PREFIX = None +LINE_COMMENT_PREFIX = None +TRIM_BLOCKS = False +LSTRIP_BLOCKS = False +NEWLINE_SEQUENCE = '\n' +KEEP_TRAILING_NEWLINE = False + + +# default filters, tests and namespace +from jinja2.filters import FILTERS as DEFAULT_FILTERS +from jinja2.tests import TESTS as DEFAULT_TESTS +DEFAULT_NAMESPACE = { + 'range': range_type, + 'dict': dict, + 'lipsum': generate_lorem_ipsum, + 'cycler': Cycler, + 'joiner': Joiner, + 'namespace': Namespace +} + + +# default policies +DEFAULT_POLICIES = { + 'compiler.ascii_str': True, + 'urlize.rel': 'noopener', + 'urlize.target': None, + 'truncate.leeway': 5, + 'json.dumps_function': None, + 'json.dumps_kwargs': {'sort_keys': True}, + 'ext.i18n.trimmed': False, +} + + +# export all constants +__all__ = tuple(x for x in locals().keys() if x.isupper()) diff --git a/tools/jinja2/environment.py b/tools/jinja2/environment.py new file mode 100644 index 000000000000..549d9afab456 --- /dev/null +++ b/tools/jinja2/environment.py @@ -0,0 +1,1276 @@ +# -*- coding: utf-8 -*- +""" + jinja2.environment + ~~~~~~~~~~~~~~~~~~ + + Provides a class that holds runtime and parsing time options. + + :copyright: (c) 2017 by the Jinja Team. + :license: BSD, see LICENSE for more details. +""" +import os +import sys +import weakref +from functools import reduce, partial +from jinja2 import nodes +from jinja2.defaults import BLOCK_START_STRING, \ + BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \ + COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \ + LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \ + DEFAULT_FILTERS, DEFAULT_TESTS, DEFAULT_NAMESPACE, \ + DEFAULT_POLICIES, KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS +from jinja2.lexer import get_lexer, TokenStream +from jinja2.parser import Parser +from jinja2.nodes import EvalContext +from jinja2.compiler import generate, CodeGenerator +from jinja2.runtime import Undefined, new_context, Context +from jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \ + TemplatesNotFound, TemplateRuntimeError +from jinja2.utils import import_string, LRUCache, Markup, missing, \ + concat, consume, internalcode, have_async_gen +from jinja2._compat import imap, ifilter, string_types, iteritems, \ + text_type, reraise, implements_iterator, implements_to_string, \ + encode_filename, PY2, PYPY + + +# for direct template usage we have up to ten living environments +_spontaneous_environments = LRUCache(10) + +# the function to create jinja traceback objects. This is dynamically +# imported on the first exception in the exception handler. +_make_traceback = None + + +def get_spontaneous_environment(*args): + """Return a new spontaneous environment. A spontaneous environment is an + unnamed and unaccessible (in theory) environment that is used for + templates generated from a string and not from the file system. + """ + try: + env = _spontaneous_environments.get(args) + except TypeError: + return Environment(*args) + if env is not None: + return env + _spontaneous_environments[args] = env = Environment(*args) + env.shared = True + return env + + +def create_cache(size): + """Return the cache class for the given size.""" + if size == 0: + return None + if size < 0: + return {} + return LRUCache(size) + + +def copy_cache(cache): + """Create an empty copy of the given cache.""" + if cache is None: + return None + elif type(cache) is dict: + return {} + return LRUCache(cache.capacity) + + +def load_extensions(environment, extensions): + """Load the extensions from the list and bind it to the environment. + Returns a dict of instantiated environments. + """ + result = {} + for extension in extensions: + if isinstance(extension, string_types): + extension = import_string(extension) + result[extension.identifier] = extension(environment) + return result + + +def fail_for_missing_callable(string, name): + msg = string % name + if isinstance(name, Undefined): + try: + name._fail_with_undefined_error() + except Exception as e: + msg = '%s (%s; did you forget to quote the callable name?)' % (msg, e) + raise TemplateRuntimeError(msg) + + +def _environment_sanity_check(environment): + """Perform a sanity check on the environment.""" + assert issubclass(environment.undefined, Undefined), 'undefined must ' \ + 'be a subclass of undefined because filters depend on it.' + assert environment.block_start_string != \ + environment.variable_start_string != \ + environment.comment_start_string, 'block, variable and comment ' \ + 'start strings must be different' + assert environment.newline_sequence in ('\r', '\r\n', '\n'), \ + 'newline_sequence set to unknown line ending string.' + return environment + + +class Environment(object): + r"""The core component of Jinja is the `Environment`. It contains + important shared variables like configuration, filters, tests, + globals and others. Instances of this class may be modified if + they are not shared and if no template was loaded so far. + Modifications on environments after the first template was loaded + will lead to surprising effects and undefined behavior. + + Here are the possible initialization parameters: + + `block_start_string` + The string marking the beginning of a block. Defaults to ``'{%'``. + + `block_end_string` + The string marking the end of a block. Defaults to ``'%}'``. + + `variable_start_string` + The string marking the beginning of a print statement. + Defaults to ``'{{'``. + + `variable_end_string` + The string marking the end of a print statement. Defaults to + ``'}}'``. + + `comment_start_string` + The string marking the beginning of a comment. Defaults to ``'{#'``. + + `comment_end_string` + The string marking the end of a comment. Defaults to ``'#}'``. + + `line_statement_prefix` + If given and a string, this will be used as prefix for line based + statements. See also :ref:`line-statements`. + + `line_comment_prefix` + If given and a string, this will be used as prefix for line based + comments. See also :ref:`line-statements`. + + .. versionadded:: 2.2 + + `trim_blocks` + If this is set to ``True`` the first newline after a block is + removed (block, not variable tag!). Defaults to `False`. + + `lstrip_blocks` + If this is set to ``True`` leading spaces and tabs are stripped + from the start of a line to a block. Defaults to `False`. + + `newline_sequence` + The sequence that starts a newline. Must be one of ``'\r'``, + ``'\n'`` or ``'\r\n'``. The default is ``'\n'`` which is a + useful default for Linux and OS X systems as well as web + applications. + + `keep_trailing_newline` + Preserve the trailing newline when rendering templates. + The default is ``False``, which causes a single newline, + if present, to be stripped from the end of the template. + + .. versionadded:: 2.7 + + `extensions` + List of Jinja extensions to use. This can either be import paths + as strings or extension classes. For more information have a + look at :ref:`the extensions documentation `. + + `optimized` + should the optimizer be enabled? Default is ``True``. + + `undefined` + :class:`Undefined` or a subclass of it that is used to represent + undefined values in the template. + + `finalize` + A callable that can be used to process the result of a variable + expression before it is output. For example one can convert + ``None`` implicitly into an empty string here. + + `autoescape` + If set to ``True`` the XML/HTML autoescaping feature is enabled by + default. For more details about autoescaping see + :class:`~jinja2.utils.Markup`. As of Jinja 2.4 this can also + be a callable that is passed the template name and has to + return ``True`` or ``False`` depending on autoescape should be + enabled by default. + + .. versionchanged:: 2.4 + `autoescape` can now be a function + + `loader` + The template loader for this environment. + + `cache_size` + The size of the cache. Per default this is ``400`` which means + that if more than 400 templates are loaded the loader will clean + out the least recently used template. If the cache size is set to + ``0`` templates are recompiled all the time, if the cache size is + ``-1`` the cache will not be cleaned. + + .. versionchanged:: 2.8 + The cache size was increased to 400 from a low 50. + + `auto_reload` + Some loaders load templates from locations where the template + sources may change (ie: file system or database). If + ``auto_reload`` is set to ``True`` (default) every time a template is + requested the loader checks if the source changed and if yes, it + will reload the template. For higher performance it's possible to + disable that. + + `bytecode_cache` + If set to a bytecode cache object, this object will provide a + cache for the internal Jinja bytecode so that templates don't + have to be parsed if they were not changed. + + See :ref:`bytecode-cache` for more information. + + `enable_async` + If set to true this enables async template execution which allows + you to take advantage of newer Python features. This requires + Python 3.6 or later. + """ + + #: if this environment is sandboxed. Modifying this variable won't make + #: the environment sandboxed though. For a real sandboxed environment + #: have a look at jinja2.sandbox. This flag alone controls the code + #: generation by the compiler. + sandboxed = False + + #: True if the environment is just an overlay + overlayed = False + + #: the environment this environment is linked to if it is an overlay + linked_to = None + + #: shared environments have this set to `True`. A shared environment + #: must not be modified + shared = False + + #: these are currently EXPERIMENTAL undocumented features. + exception_handler = None + exception_formatter = None + + #: the class that is used for code generation. See + #: :class:`~jinja2.compiler.CodeGenerator` for more information. + code_generator_class = CodeGenerator + + #: the context class thatis used for templates. See + #: :class:`~jinja2.runtime.Context` for more information. + context_class = Context + + def __init__(self, + block_start_string=BLOCK_START_STRING, + block_end_string=BLOCK_END_STRING, + variable_start_string=VARIABLE_START_STRING, + variable_end_string=VARIABLE_END_STRING, + comment_start_string=COMMENT_START_STRING, + comment_end_string=COMMENT_END_STRING, + line_statement_prefix=LINE_STATEMENT_PREFIX, + line_comment_prefix=LINE_COMMENT_PREFIX, + trim_blocks=TRIM_BLOCKS, + lstrip_blocks=LSTRIP_BLOCKS, + newline_sequence=NEWLINE_SEQUENCE, + keep_trailing_newline=KEEP_TRAILING_NEWLINE, + extensions=(), + optimized=True, + undefined=Undefined, + finalize=None, + autoescape=False, + loader=None, + cache_size=400, + auto_reload=True, + bytecode_cache=None, + enable_async=False): + # !!Important notice!! + # The constructor accepts quite a few arguments that should be + # passed by keyword rather than position. However it's important to + # not change the order of arguments because it's used at least + # internally in those cases: + # - spontaneous environments (i18n extension and Template) + # - unittests + # If parameter changes are required only add parameters at the end + # and don't change the arguments (or the defaults!) of the arguments + # existing already. + + # lexer / parser information + self.block_start_string = block_start_string + self.block_end_string = block_end_string + self.variable_start_string = variable_start_string + self.variable_end_string = variable_end_string + self.comment_start_string = comment_start_string + self.comment_end_string = comment_end_string + self.line_statement_prefix = line_statement_prefix + self.line_comment_prefix = line_comment_prefix + self.trim_blocks = trim_blocks + self.lstrip_blocks = lstrip_blocks + self.newline_sequence = newline_sequence + self.keep_trailing_newline = keep_trailing_newline + + # runtime information + self.undefined = undefined + self.optimized = optimized + self.finalize = finalize + self.autoescape = autoescape + + # defaults + self.filters = DEFAULT_FILTERS.copy() + self.tests = DEFAULT_TESTS.copy() + self.globals = DEFAULT_NAMESPACE.copy() + + # set the loader provided + self.loader = loader + self.cache = create_cache(cache_size) + self.bytecode_cache = bytecode_cache + self.auto_reload = auto_reload + + # configurable policies + self.policies = DEFAULT_POLICIES.copy() + + # load extensions + self.extensions = load_extensions(self, extensions) + + self.enable_async = enable_async + self.is_async = self.enable_async and have_async_gen + + _environment_sanity_check(self) + + def add_extension(self, extension): + """Adds an extension after the environment was created. + + .. versionadded:: 2.5 + """ + self.extensions.update(load_extensions(self, [extension])) + + def extend(self, **attributes): + """Add the items to the instance of the environment if they do not exist + yet. This is used by :ref:`extensions ` to register + callbacks and configuration values without breaking inheritance. + """ + for key, value in iteritems(attributes): + if not hasattr(self, key): + setattr(self, key, value) + + def overlay(self, block_start_string=missing, block_end_string=missing, + variable_start_string=missing, variable_end_string=missing, + comment_start_string=missing, comment_end_string=missing, + line_statement_prefix=missing, line_comment_prefix=missing, + trim_blocks=missing, lstrip_blocks=missing, + extensions=missing, optimized=missing, + undefined=missing, finalize=missing, autoescape=missing, + loader=missing, cache_size=missing, auto_reload=missing, + bytecode_cache=missing): + """Create a new overlay environment that shares all the data with the + current environment except for cache and the overridden attributes. + Extensions cannot be removed for an overlayed environment. An overlayed + environment automatically gets all the extensions of the environment it + is linked to plus optional extra extensions. + + Creating overlays should happen after the initial environment was set + up completely. Not all attributes are truly linked, some are just + copied over so modifications on the original environment may not shine + through. + """ + args = dict(locals()) + del args['self'], args['cache_size'], args['extensions'] + + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.overlayed = True + rv.linked_to = self + + for key, value in iteritems(args): + if value is not missing: + setattr(rv, key, value) + + if cache_size is not missing: + rv.cache = create_cache(cache_size) + else: + rv.cache = copy_cache(self.cache) + + rv.extensions = {} + for key, value in iteritems(self.extensions): + rv.extensions[key] = value.bind(rv) + if extensions is not missing: + rv.extensions.update(load_extensions(rv, extensions)) + + return _environment_sanity_check(rv) + + lexer = property(get_lexer, doc="The lexer for this environment.") + + def iter_extensions(self): + """Iterates over the extensions by priority.""" + return iter(sorted(self.extensions.values(), + key=lambda x: x.priority)) + + def getitem(self, obj, argument): + """Get an item or attribute of an object but prefer the item.""" + try: + return obj[argument] + except (AttributeError, TypeError, LookupError): + if isinstance(argument, string_types): + try: + attr = str(argument) + except Exception: + pass + else: + try: + return getattr(obj, attr) + except AttributeError: + pass + return self.undefined(obj=obj, name=argument) + + def getattr(self, obj, attribute): + """Get an item or attribute of an object but prefer the attribute. + Unlike :meth:`getitem` the attribute *must* be a bytestring. + """ + try: + return getattr(obj, attribute) + except AttributeError: + pass + try: + return obj[attribute] + except (TypeError, LookupError, AttributeError): + return self.undefined(obj=obj, name=attribute) + + def call_filter(self, name, value, args=None, kwargs=None, + context=None, eval_ctx=None): + """Invokes a filter on a value the same way the compiler does it. + + Note that on Python 3 this might return a coroutine in case the + filter is running from an environment in async mode and the filter + supports async execution. It's your responsibility to await this + if needed. + + .. versionadded:: 2.7 + """ + func = self.filters.get(name) + if func is None: + fail_for_missing_callable('no filter named %r', name) + args = [value] + list(args or ()) + if getattr(func, 'contextfilter', False): + if context is None: + raise TemplateRuntimeError('Attempted to invoke context ' + 'filter without context') + args.insert(0, context) + elif getattr(func, 'evalcontextfilter', False): + if eval_ctx is None: + if context is not None: + eval_ctx = context.eval_ctx + else: + eval_ctx = EvalContext(self) + args.insert(0, eval_ctx) + elif getattr(func, 'environmentfilter', False): + args.insert(0, self) + return func(*args, **(kwargs or {})) + + def call_test(self, name, value, args=None, kwargs=None): + """Invokes a test on a value the same way the compiler does it. + + .. versionadded:: 2.7 + """ + func = self.tests.get(name) + if func is None: + fail_for_missing_callable('no test named %r', name) + return func(value, *(args or ()), **(kwargs or {})) + + @internalcode + def parse(self, source, name=None, filename=None): + """Parse the sourcecode and return the abstract syntax tree. This + tree of nodes is used by the compiler to convert the template into + executable source- or bytecode. This is useful for debugging or to + extract information from templates. + + If you are :ref:`developing Jinja2 extensions ` + this gives you a good overview of the node tree generated. + """ + try: + return self._parse(source, name, filename) + except TemplateSyntaxError: + exc_info = sys.exc_info() + self.handle_exception(exc_info, source_hint=source) + + def _parse(self, source, name, filename): + """Internal parsing function used by `parse` and `compile`.""" + return Parser(self, source, name, encode_filename(filename)).parse() + + def lex(self, source, name=None, filename=None): + """Lex the given sourcecode and return a generator that yields + tokens as tuples in the form ``(lineno, token_type, value)``. + This can be useful for :ref:`extension development ` + and debugging templates. + + This does not perform preprocessing. If you want the preprocessing + of the extensions to be applied you have to filter source through + the :meth:`preprocess` method. + """ + source = text_type(source) + try: + return self.lexer.tokeniter(source, name, filename) + except TemplateSyntaxError: + exc_info = sys.exc_info() + self.handle_exception(exc_info, source_hint=source) + + def preprocess(self, source, name=None, filename=None): + """Preprocesses the source with all extensions. This is automatically + called for all parsing and compiling methods but *not* for :meth:`lex` + because there you usually only want the actual source tokenized. + """ + return reduce(lambda s, e: e.preprocess(s, name, filename), + self.iter_extensions(), text_type(source)) + + def _tokenize(self, source, name, filename=None, state=None): + """Called by the parser to do the preprocessing and filtering + for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. + """ + source = self.preprocess(source, name, filename) + stream = self.lexer.tokenize(source, name, filename, state) + for ext in self.iter_extensions(): + stream = ext.filter_stream(stream) + if not isinstance(stream, TokenStream): + stream = TokenStream(stream, name, filename) + return stream + + def _generate(self, source, name, filename, defer_init=False): + """Internal hook that can be overridden to hook a different generate + method in. + + .. versionadded:: 2.5 + """ + return generate(source, self, name, filename, defer_init=defer_init, + optimized=self.optimized) + + def _compile(self, source, filename): + """Internal hook that can be overridden to hook a different compile + method in. + + .. versionadded:: 2.5 + """ + return compile(source, filename, 'exec') + + @internalcode + def compile(self, source, name=None, filename=None, raw=False, + defer_init=False): + """Compile a node or template source code. The `name` parameter is + the load name of the template after it was joined using + :meth:`join_path` if necessary, not the filename on the file system. + the `filename` parameter is the estimated filename of the template on + the file system. If the template came from a database or memory this + can be omitted. + + The return value of this method is a python code object. If the `raw` + parameter is `True` the return value will be a string with python + code equivalent to the bytecode returned otherwise. This method is + mainly used internally. + + `defer_init` is use internally to aid the module code generator. This + causes the generated code to be able to import without the global + environment variable to be set. + + .. versionadded:: 2.4 + `defer_init` parameter added. + """ + source_hint = None + try: + if isinstance(source, string_types): + source_hint = source + source = self._parse(source, name, filename) + source = self._generate(source, name, filename, + defer_init=defer_init) + if raw: + return source + if filename is None: + filename = '