-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dynamically linking with OpenSSL 3.0 #37669
Commits on Mar 15, 2021
-
src: fix crypto_hkdf.cc compilation error
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); | ~~~~~~~~~~~~~~~~~~~~~^~~~
Configuration menu - View commit details
-
Copy full SHA for a88e77a - Browse repository at this point
Copy the full SHA a88e77aView commit details -
build: add OPENSSL_API_COMPAT macro
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.
Configuration menu - View commit details
-
Copy full SHA for 3d9a5e5 - Browse repository at this point
Copy the full SHA 3d9a5e5View commit details -
test: add hasOpenSSL3 constant
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.
Configuration menu - View commit details
-
Copy full SHA for a8d117c - Browse repository at this point
Copy the full SHA a8d117cView commit details -
test: fix diffie-hellman 'module to small' failures
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.
Configuration menu - View commit details
-
Copy full SHA for 2a68e7b - Browse repository at this point
Copy the full SHA 2a68e7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbd2206 - Browse repository at this point
Copy the full SHA dbd2206View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8e7c2d - Browse repository at this point
Copy the full SHA b8e7c2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for b1b268b - Browse repository at this point
Copy the full SHA b1b268bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ecbb48 - Browse repository at this point
Copy the full SHA 5ecbb48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 470fc73 - Browse repository at this point
Copy the full SHA 470fc73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80834e2 - Browse repository at this point
Copy the full SHA 80834e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d6eae6d - Browse repository at this point
Copy the full SHA d6eae6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e27bde8 - Browse repository at this point
Copy the full SHA e27bde8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f879b9c - Browse repository at this point
Copy the full SHA f879b9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b320aa3 - Browse repository at this point
Copy the full SHA b320aa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 183d4d9 - Browse repository at this point
Copy the full SHA 183d4d9View commit details -
test: add min/max iv lengths for OpenSSL3 test-crypto-cipheriv-deciph…
…eriv.js This commit adds min and max IV lengths to the test crypto-cipheriv-decipher-iv when OpenSSL 3.x is in use. The motivation for this is that OpenSSL 3.x has a check in providers/implementations/ciphers/ciphercommon_gcm: if (iv != NULL) { if (ivlen < ctx->ivlen_min || ivlen > sizeof(ctx->iv)) { ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH); return 0; } And the ivlen_min is 8 and max is 64: (lldb) expr ctx->ivlen_min (size_t) $25 = 8 (lldb) expr sizeof(ctx->iv) (unsigned long) $28 = 64 (size_t) $25 = 8
Configuration menu - View commit details
-
Copy full SHA for f135cd0 - Browse repository at this point
Copy the full SHA f135cd0View commit details -
test: skip blowfish if using OpenSSL3 test-crypto-ecb.js
This commit adds a check and a skip if using OpenSSL 3.x. The reason for this is that Blowfish (BF) is only available when using the legacy provider in OpenSSL 3.x.
Configuration menu - View commit details
-
Copy full SHA for 9afc54d - Browse repository at this point
Copy the full SHA 9afc54dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae768e2 - Browse repository at this point
Copy the full SHA ae768e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6145d57 - Browse repository at this point
Copy the full SHA 6145d57View commit details -
Configuration menu - View commit details
-
Copy full SHA for fda8d72 - Browse repository at this point
Copy the full SHA fda8d72View commit details -
test: add openssl 3.x check to --openssl-config tests test-crypto-fip…
…s.js This commit adds a check to skip tests that depend on OpenSSL 1.x config files. These test will not work with OpenSSL 3.x as the configuration files have changed. Once FIPS support is available in OpenSSL 3.x we should revisit these test and add tests specific to OpenSSL 3.x.
Configuration menu - View commit details
-
Copy full SHA for 1ff4d8d - Browse repository at this point
Copy the full SHA 1ff4d8dView commit details -
test: specify security level 0 for tls-session-cache test-tls-session…
…-cache.js Currently this test will fail if the default security level 1 is used when linked against OpenSSL 3.x.
Configuration menu - View commit details
-
Copy full SHA for 0f8b754 - Browse repository at this point
Copy the full SHA 0f8b754View commit details -
test: set security level to 0 test-https-agent-session-eviction.js, t…
…est-tls-getprotocol.js, test-tls-min-max-version.js
Configuration menu - View commit details
-
Copy full SHA for 14973b5 - Browse repository at this point
Copy the full SHA 14973b5View commit details -
test: test-crypto-keygen fixes for OpenSSL 3.x test-crypto-keygen.js
Note that there is still an issue with OpenSSL 3.x for which there is an open issue: openssl/openssl#12384
Configuration menu - View commit details
-
Copy full SHA for e2d3592 - Browse repository at this point
Copy the full SHA e2d3592View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e117b9 - Browse repository at this point
Copy the full SHA 3e117b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4003105 - Browse repository at this point
Copy the full SHA 4003105View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2964e25 - Browse repository at this point
Copy the full SHA 2964e25View commit details -
Configuration menu - View commit details
-
Copy full SHA for af5997f - Browse repository at this point
Copy the full SHA af5997fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed88487 - Browse repository at this point
Copy the full SHA ed88487View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a42ca9 - Browse repository at this point
Copy the full SHA 8a42ca9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 408186f - Browse repository at this point
Copy the full SHA 408186fView commit details -
test: add OpenSSL3.x checks test-crypto-x509.js
This commit adds an check for OpenSSL 3.0 to deal with changes to the newline output of infoAccess. Refs: https://github.com/danbev/learning-libcrypto/blob/master/notes/issues.md#test-crypto-x509js
Configuration menu - View commit details
-
Copy full SHA for 875f060 - Browse repository at this point
Copy the full SHA 875f060View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37bb747 - Browse repository at this point
Copy the full SHA 37bb747View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4aff4cb - Browse repository at this point
Copy the full SHA 4aff4cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d59871 - Browse repository at this point
Copy the full SHA 7d59871View commit details -
Configuration menu - View commit details
-
Copy full SHA for d92e224 - Browse repository at this point
Copy the full SHA d92e224View commit details -
src: use EVP_default_properties_is_fips_enabled
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.
Configuration menu - View commit details
-
Copy full SHA for ec3237a - Browse repository at this point
Copy the full SHA ec3237aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8efd22a - Browse repository at this point
Copy the full SHA 8efd22aView commit details -
src: aquire mutex lock in ManagedEVPPKey::operator=
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
Configuration menu - View commit details
-
Copy full SHA for 23b653f - Browse repository at this point
Copy the full SHA 23b653fView commit details -
src: use const for EVP_PKEY legacy function calls
This commit add const to EC_KEY, DSA, RSA pointer to avoid compilation errors when linking against OpenSSL 3.0. Refs: openssl/openssl@7bc0fdd
Configuration menu - View commit details
-
Copy full SHA for 6b8c504 - Browse repository at this point
Copy the full SHA 6b8c504View commit details