Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps,build: add OpenSSL building of legacy module #40466

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@
default=None,
help='specifies that the OpenSSL library is FIPS compatible')

parser.add_argument('--openssl-legacy-module',
action='store_true',
dest='openssl_legacy_module',
default=None,
help='specifies that the OpenSSL legacy module is to be built')

parser.add_argument('--openssl-use-def-ca-store',
action='store_true',
dest='use_openssl_ca_store',
Expand Down Expand Up @@ -1410,6 +1416,7 @@ def configure_openssl(o):
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
variables['openssl_is_fips'] = b(options.openssl_is_fips)
variables['node_fipsinstall'] = b(False)
variables['node_openssl_legacy_module'] = b(False)

if options.openssl_no_asm:
variables['openssl_no_asm'] = 1
Expand Down Expand Up @@ -1466,6 +1473,9 @@ def without_ssl_error(option):
o['defines'] += ['OPENSSL_FIPS']
variables['node_fipsinstall'] = b(True)

if options.openssl_legacy_module and not options.shared_openssl:
variables['node_openssl_legacy_module'] = b(True)

if options.shared_openssl:
has_quic = getsharedopensslhasquic.get_has_quic(options.__dict__['shared_openssl_includes'])
else:
Expand Down
Binary file added deps/openssl/config/.generate_gypi.pl.swp
Binary file not shown.
16 changes: 8 additions & 8 deletions deps/openssl/config/archs/BSD-x86/asm/configdata.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ our %config = (
"patch" => "0",
"perl_archname" => "x86_64-linux-thread-multi",
"perl_cmd" => "/usr/bin/perl",
"perl_version" => "5.30.3",
"perl_version" => "5.32.1",
"perlargv" => [
"no-comp",
"no-shared",
Expand Down Expand Up @@ -9714,10 +9714,10 @@ our %unified_info = (
},
"providers/fips" => {
"deps" => [
"providers/fips/fips-dso-fips_entry.o",
"providers/fips/libfips-lib-fipsprov.o",
"providers/fips/libfips-lib-self_test.o",
"providers/fips/libfips-lib-self_test_kats.o"
"providers/fips/libfips-lib-self_test_kats.o",
"providers/fips/fips-dso-fips_entry.o"
],
"products" => {
"dso" => [
Expand Down Expand Up @@ -27216,8 +27216,8 @@ unless (caller) {
use File::Copy;
use Pod::Usage;

use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/util/perl';
use OpenSSL::fallback '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/external/perl/MODULES.txt';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/util/perl';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing it does not make sense for this to have danielbevenius in the path. Same for the next line.

Copy link
Member

@mhdawson mhdawson Oct 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although that may be a more general comment since it's not a change in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've taken a look at this and I'm not sure how I can prevent this in Perl. I'll take another look but I don't think this is critical as my understanding is that after we generate this file we only use it to parse out values. Still I'd rather fix this but not sure how at the moment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the paths with be more generic (but still absolute) if regenerating the config via the Docker file?

node/Makefile

Lines 1479 to 1481 in ed01811

gen-openssl: ## Generate platform dependent openssl files (requires docker)
docker build -t node-openssl-builder deps/openssl/config/
$(DOCKER_COMMAND) node-openssl-builder make -C deps/openssl/config

use OpenSSL::fallback '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/external/perl/MODULES.txt';

my $here = dirname($0);

Expand All @@ -27244,7 +27244,7 @@ unless (caller) {
);

use lib '.';
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/Configurations';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/Configurations';
use gentemplate;

print 'Creating ',$buildfile_template,"\n";
Expand All @@ -27261,8 +27261,8 @@ unless (caller) {

my $prepend = <<'_____';
use File::Spec::Functions;
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/util/perl';
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/Configurations';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/util/perl';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/Configurations';
use lib '.';
use platform;
_____
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/config/archs/BSD-x86/asm/crypto/buildinf.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

#define PLATFORM "platform: BSD-x86"
#define DATE "built on: Wed Sep 8 06:02:47 2021 UTC"
#define DATE "built on: Sat Oct 16 04:06:33 2021 UTC"

/*
* Generate compiler_flags as an array of individual characters. This is a
Expand Down
12 changes: 3 additions & 9 deletions deps/openssl/config/archs/BSD-x86/asm/openssl-fips.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,7 @@
'./config/archs/BSD-x86/asm/providers/common/der/der_ecx_gen.c',
'./config/archs/BSD-x86/asm/providers/common/der/der_rsa_gen.c',
'./config/archs/BSD-x86/asm/providers/common/der/der_wrap_gen.c',
'./config/archs/BSD-x86/asm/crypto/bn/bn-586.s',
'./config/archs/BSD-x86/asm/crypto/bn/co-586.s',
'./config/archs/BSD-x86/asm/crypto/bn/x86-gf2m.s',
'./config/archs/BSD-x86/asm/crypto/bn/x86-mont.s',
'./config/archs/BSD-x86/asm/crypto/des/crypt586.s',
'./config/archs/BSD-x86/asm/crypto/des/des-586.s',
'./config/archs/BSD-x86/asm/crypto/md5/md5-586.s',
'./config/archs/BSD-x86/asm/providers/legacy.ld',
'./config/archs/BSD-x86/asm/providers/fips.ld',

],
Expand Down Expand Up @@ -337,7 +331,7 @@
'openssl_ex_libs_BSD-x86': [
'-pthread',
],
'linker_script': '/home/danielbevenius/work/nodejs/openssl/deps/openssl/config'
'version_script': ''
},
'include_dirs': [
'.',
Expand All @@ -349,7 +343,7 @@
'defines': ['<@(openssl_defines_BSD-x86)'],
'cflags': ['<@(openssl_cflags_BSD-x86)'],
'libraries': ['<@(openssl_ex_libs_BSD-x86)'],
'ldflags': ['-Wl,--version-script=<@(linker_script)'],

'sources': ['<@(openssl_sources)', '<@(openssl_sources_BSD-x86)'],
'direct_dependent_settings': {
'include_dirs': ['./include', '.'],
Expand Down
76 changes: 76 additions & 0 deletions deps/openssl/config/archs/BSD-x86/asm/openssl-legacy.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
'variables': {
'openssl_sources': [
'openssl/crypto/md5/md5_dgst.c',
'openssl/crypto/md5/md5_one.c',
'openssl/crypto/md5/md5_sha1.c',
'openssl/providers/implementations/ciphers/cipher_blowfish.c',
'openssl/providers/implementations/ciphers/cipher_blowfish_hw.c',
'openssl/providers/implementations/ciphers/cipher_cast5.c',
'openssl/providers/implementations/ciphers/cipher_cast5_hw.c',
'openssl/providers/implementations/ciphers/cipher_des.c',
'openssl/providers/implementations/ciphers/cipher_des_hw.c',
'openssl/providers/implementations/ciphers/cipher_desx.c',
'openssl/providers/implementations/ciphers/cipher_desx_hw.c',
'openssl/providers/implementations/ciphers/cipher_idea.c',
'openssl/providers/implementations/ciphers/cipher_idea_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc2.c',
'openssl/providers/implementations/ciphers/cipher_rc2_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc4.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hw.c',
'openssl/providers/implementations/ciphers/cipher_seed.c',
'openssl/providers/implementations/ciphers/cipher_seed_hw.c',
'openssl/providers/implementations/ciphers/cipher_tdes_common.c',
'openssl/providers/implementations/digests/md4_prov.c',
'openssl/providers/implementations/digests/mdc2_prov.c',
'openssl/providers/implementations/digests/ripemd_prov.c',
'openssl/providers/implementations/digests/wp_prov.c',
'openssl/providers/implementations/kdfs/pbkdf1.c',
'openssl/providers/prov_running.c',
'openssl/providers/legacyprov.c',

],
'openssl_sources_BSD-x86': [

],
'openssl_defines_BSD-x86': [
'NDEBUG',
'L_ENDIAN',
'OPENSSL_BUILDING_OPENSSL',
'DES_ASM',
'MD5_ASM',
'OPENSSL_BN_ASM_GF2m',
'OPENSSL_BN_ASM_MONT',
'OPENSSL_BN_ASM_PART_WORDS',
'OPENSSL_IA32_SSE2',
],
'openssl_cflags_BSD-x86': [
'-Wa,--noexecstack',
'-Wall -O3 -fomit-frame-pointer',
'-pthread',
'-Wall -O3 -fomit-frame-pointer',
],
'openssl_ex_libs_BSD-x86': [
'-pthread',
],
'version_script': ''
},
'include_dirs': [
'.',
'./include',
'./crypto',
'./crypto/include/internal',
'./providers/common/include',
],
'defines': ['<@(openssl_defines_BSD-x86)'],
'cflags': ['<@(openssl_cflags_BSD-x86)'],
'libraries': ['<@(openssl_ex_libs_BSD-x86)'],

'sources': ['<@(openssl_sources)', '<@(openssl_sources_BSD-x86)'],
'direct_dependent_settings': {
'include_dirs': ['./include', '.'],
'defines': ['<@(openssl_defines_BSD-x86)'],
},
}
36 changes: 1 addition & 35 deletions deps/openssl/config/archs/BSD-x86/asm/openssl.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -912,34 +912,6 @@
'openssl/providers/implementations/ciphers/ciphercommon_hw.c',
'openssl/providers/implementations/digests/digestcommon.c',
'openssl/ssl/record/tls_pad.c',
'openssl/crypto/md5/md5_dgst.c',
'openssl/crypto/md5/md5_one.c',
'openssl/crypto/md5/md5_sha1.c',
'openssl/providers/implementations/ciphers/cipher_blowfish.c',
'openssl/providers/implementations/ciphers/cipher_blowfish_hw.c',
'openssl/providers/implementations/ciphers/cipher_cast5.c',
'openssl/providers/implementations/ciphers/cipher_cast5_hw.c',
'openssl/providers/implementations/ciphers/cipher_des.c',
'openssl/providers/implementations/ciphers/cipher_des_hw.c',
'openssl/providers/implementations/ciphers/cipher_desx.c',
'openssl/providers/implementations/ciphers/cipher_desx_hw.c',
'openssl/providers/implementations/ciphers/cipher_idea.c',
'openssl/providers/implementations/ciphers/cipher_idea_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc2.c',
'openssl/providers/implementations/ciphers/cipher_rc2_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc4.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c',
'openssl/providers/implementations/ciphers/cipher_rc4_hw.c',
'openssl/providers/implementations/ciphers/cipher_seed.c',
'openssl/providers/implementations/ciphers/cipher_seed_hw.c',
'openssl/providers/implementations/ciphers/cipher_tdes_common.c',
'openssl/providers/implementations/digests/md4_prov.c',
'openssl/providers/implementations/digests/mdc2_prov.c',
'openssl/providers/implementations/digests/ripemd_prov.c',
'openssl/providers/implementations/digests/wp_prov.c',
'openssl/providers/implementations/kdfs/pbkdf1.c',
'openssl/providers/prov_running.c',
],
'openssl_sources_BSD-x86': [
'./config/archs/BSD-x86/asm/crypto/aes/aes-586.s',
Expand Down Expand Up @@ -973,13 +945,7 @@
'./config/archs/BSD-x86/asm/providers/common/der/der_ecx_gen.c',
'./config/archs/BSD-x86/asm/providers/common/der/der_rsa_gen.c',
'./config/archs/BSD-x86/asm/providers/common/der/der_wrap_gen.c',
'./config/archs/BSD-x86/asm/crypto/bn/bn-586.s',
'./config/archs/BSD-x86/asm/crypto/bn/co-586.s',
'./config/archs/BSD-x86/asm/crypto/bn/x86-gf2m.s',
'./config/archs/BSD-x86/asm/crypto/bn/x86-mont.s',
'./config/archs/BSD-x86/asm/crypto/des/crypt586.s',
'./config/archs/BSD-x86/asm/crypto/des/des-586.s',
'./config/archs/BSD-x86/asm/crypto/md5/md5-586.s',
'./config/archs/BSD-x86/asm/providers/legacy.ld',
'./config/archs/BSD-x86/asm/providers/fips.ld',
],
'openssl_defines_BSD-x86': [
Expand Down
5 changes: 5 additions & 0 deletions deps/openssl/config/archs/BSD-x86/asm/providers/legacy.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
global:
OSSL_provider_init;
local: *;
};
12 changes: 6 additions & 6 deletions deps/openssl/config/archs/BSD-x86/asm_avx2/configdata.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ our %config = (
"patch" => "0",
"perl_archname" => "x86_64-linux-thread-multi",
"perl_cmd" => "/usr/bin/perl",
"perl_version" => "5.30.3",
"perl_version" => "5.32.1",
"perlargv" => [
"no-comp",
"no-shared",
Expand Down Expand Up @@ -27216,8 +27216,8 @@ unless (caller) {
use File::Copy;
use Pod::Usage;

use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/util/perl';
use OpenSSL::fallback '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/external/perl/MODULES.txt';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/util/perl';
use OpenSSL::fallback '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/external/perl/MODULES.txt';

my $here = dirname($0);

Expand All @@ -27244,7 +27244,7 @@ unless (caller) {
);

use lib '.';
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/Configurations';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/Configurations';
use gentemplate;

print 'Creating ',$buildfile_template,"\n";
Expand All @@ -27261,8 +27261,8 @@ unless (caller) {

my $prepend = <<'_____';
use File::Spec::Functions;
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/util/perl';
use lib '/home/danielbevenius/work/nodejs/openssl/deps/openssl/openssl/Configurations';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/util/perl';
use lib '/home/danielbevenius/work/nodejs/node/deps/openssl/openssl/Configurations';
use lib '.';
use platform;
_____
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

#define PLATFORM "platform: BSD-x86"
#define DATE "built on: Wed Sep 8 06:02:59 2021 UTC"
#define DATE "built on: Sat Oct 16 04:06:48 2021 UTC"

/*
* Generate compiler_flags as an array of individual characters. This is a
Expand Down
12 changes: 3 additions & 9 deletions deps/openssl/config/archs/BSD-x86/asm_avx2/openssl-fips.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,7 @@
'./config/archs/BSD-x86/asm_avx2/providers/common/der/der_ecx_gen.c',
'./config/archs/BSD-x86/asm_avx2/providers/common/der/der_rsa_gen.c',
'./config/archs/BSD-x86/asm_avx2/providers/common/der/der_wrap_gen.c',
'./config/archs/BSD-x86/asm_avx2/crypto/bn/bn-586.s',
'./config/archs/BSD-x86/asm_avx2/crypto/bn/co-586.s',
'./config/archs/BSD-x86/asm_avx2/crypto/bn/x86-gf2m.s',
'./config/archs/BSD-x86/asm_avx2/crypto/bn/x86-mont.s',
'./config/archs/BSD-x86/asm_avx2/crypto/des/crypt586.s',
'./config/archs/BSD-x86/asm_avx2/crypto/des/des-586.s',
'./config/archs/BSD-x86/asm_avx2/crypto/md5/md5-586.s',
'./config/archs/BSD-x86/asm_avx2/providers/legacy.ld',
'./config/archs/BSD-x86/asm_avx2/providers/fips.ld',

],
Expand Down Expand Up @@ -337,7 +331,7 @@
'openssl_ex_libs_BSD-x86': [
'-pthread',
],
'linker_script': '/home/danielbevenius/work/nodejs/openssl/deps/openssl/config'
'version_script': ''
},
'include_dirs': [
'.',
Expand All @@ -349,7 +343,7 @@
'defines': ['<@(openssl_defines_BSD-x86)'],
'cflags': ['<@(openssl_cflags_BSD-x86)'],
'libraries': ['<@(openssl_ex_libs_BSD-x86)'],
'ldflags': ['-Wl,--version-script=<@(linker_script)'],

'sources': ['<@(openssl_sources)', '<@(openssl_sources_BSD-x86)'],
'direct_dependent_settings': {
'include_dirs': ['./include', '.'],
Expand Down
Loading