GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — Support dynamically linking with OpenSSL 3.0 by danbev · Pull Request #37669 · nodejs/node Conversation
Contributor
This PR enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to While most changes have been in tests, there have been updates to src/crypto as well. Refs: #29817 Steps to build and linkDuring development we have been building OpenSSL upstream and linking against that and used the following commands. Configure and build OpenSSLWe specify an $ ./config -Werror --strict-warnings --debug --prefix=/path/openssl_build_master linux-x86_64 $ make -j8 install_sw Configure and build Node.jsThe following will configure Node to link against OpenSSl 3.0 that was configured $ ./configure --shared-openssl --shared-openssl-libpath=/path/openssl_build_master/lib --shared-openssl-includes=/path/openssl_build_master/include --shared-openssl-libname=crypto,ssl $ make -j8 test
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
jasnell
approved these changes
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
addaleax
reviewed
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
danbev
force-pushed
the
dynamically-link-openssl-3.0
branch
from
28f2c9b to
518e678
Compare
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
mhdawson
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
danbev
force-pushed
the
dynamically-link-openssl-3.0
branch
from
518e678 to
7da5860
Compare
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Currently there are three compilation errors generated for
crypto_hkdf.cc:
./src/crypto/crypto_hkdf.cc:
In static member function ‘static bool
node::crypto::HKDFTraits::DeriveBits(node::Environment*,
const node::crypto::HKDFConfig&, node::crypto::ByteSource*)’:
../src/crypto/crypto_hkdf.cc:113:24: error:
invalid conversion from ‘const char*’ to ‘const unsigned char*’
[-fpermissive]
113 | params.salt.get(),
| ~~~~~~~~~~~~~~~^~
| |
| const char*
In file included from ../src/crypto/crypto_util.h:18,
from ../src/crypto/crypto_keys.h:6,
from ../src/crypto/crypto_hkdf.h:6,
from ../src/crypto/crypto_hkdf.cc:1:
/openssl_build_master/include/openssl/kdf.h:130:54: note:
initializing argument 2 of ‘int EVP_PKEY_CTX_set1_hkdf_salt(
EVP_PKEY_CTX*, const unsigned char*, int)’
130 | const unsigned char *salt, int saltlen);
| ~~~~~~~~~~~~~~~~~~~~~^~~~
This commit adds the OPENSSL_API_COMPAT macro and sets it to version 1.0.0 of OpenSSL when linking with a shared OpenSSL library. The motivation for this is that when linking against OpenSSL 3.x there are a lot of deprecation warnings and this allows them to be avoided. When we later upgrade the code base to 3.x this value can then be updated. This commit adds a constant to identify if the version of OpenSSl is 3 or above. The motivation for this is it allows for checking this value in tests to make sure that they work with OpenSSL 3.x, and also with earlier versions. This commit fixes a number of test failures reported when using OpenSSL 3.0, for example: Error: error:0500007E:Diffie-Hellman routines::modulus too small Check have been added for OpenSSL 3 and use the larger sizes only for OpenSSL 3.0 as these sizes seem to cause timeouts when using OpenSSL 1.1.1. This commit adds a macro check for OpenSSL 3 and used EVP_default_properties_is_fips_enabled instead of FIPS_mode which has been removed in OpenSSL 3. This commit aquires the Mutex in ManagedEVPPKey::operator= to avoid multiple threads updating the underlying EVP_PKEY in OpenSSL 3.0. There are additional changes to the code to avoid dead locks, making sure to release the lock before aquiring a new lock. Refs: nodejs@79d44baae2 This commit add const to EC_KEY, DSA, RSA pointer to avoid compilation errors when linking against OpenSSL 3.0. Refs: openssl/openssl@7bc0fdd
danbev
force-pushed
the
dynamically-link-openssl-3.0
branch
from
7da5860 to
6b8c504
Compare
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
danbev
added a commit
that referenced
this pull request
This commit enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to allow a nightly CI job to be created. This will allow us stay on top of changes required for OpenSSL 3.0, and also to make sure that changes to node crypto do not cause issues when linking to OpenSSL 3.0. PR-URL: #37669 Refs: #29817 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
danielleadams
pushed a commit
that referenced
this pull request
This commit enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to allow a nightly CI job to be created. This will allow us stay on top of changes required for OpenSSL 3.0, and also to make sure that changes to node crypto do not cause issues when linking to OpenSSL 3.0. PR-URL: #37669 Refs: #29817 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Merged
danielleadams
pushed a commit
that referenced
this pull request
This commit enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to allow a nightly CI job to be created. This will allow us stay on top of changes required for OpenSSL 3.0, and also to make sure that changes to node crypto do not cause issues when linking to OpenSSL 3.0. PR-URL: #37669 Refs: #29817 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
codebytere
added a commit
to electron/electron
that referenced
this pull request
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers+1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |