提交 7311fb64 编写于 作者: C code4lala

add liblegacy into libcrypto

Signed-off-by: Ncode4lala <fengziteng2@huawei.com>
上级 39466a62
...@@ -121,6 +121,7 @@ libcrypto_build_all_generated_darwin64_x86_64_cc_sources = [ ...@@ -121,6 +121,7 @@ libcrypto_build_all_generated_darwin64_x86_64_cc_sources = [
"${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
"${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
] ]
libcrypto_build_all_generated_darwin64_arm64_cc_sources = [ libcrypto_build_all_generated_darwin64_arm64_cc_sources = [
"${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S", "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S",
...@@ -169,6 +170,7 @@ libcrypto_build_all_generated_linux_x86_64_sources = [ ...@@ -169,6 +170,7 @@ libcrypto_build_all_generated_linux_x86_64_sources = [
"${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
"${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
] ]
libcrypto_build_all_generated_mingw64_sources = [ libcrypto_build_all_generated_mingw64_sources = [
"${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s", "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s",
...@@ -202,6 +204,7 @@ libcrypto_build_all_generated_mingw64_sources = [ ...@@ -202,6 +204,7 @@ libcrypto_build_all_generated_mingw64_sources = [
"${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
"${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
"${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
] ]
libcrypto_build_all_generated_selected_platform_sources = [] libcrypto_build_all_generated_selected_platform_sources = []
...@@ -341,6 +344,7 @@ crypto_config_common_cflags = [ ...@@ -341,6 +344,7 @@ crypto_config_common_cflags = [
"-DENGINESDIR=\"\"", "-DENGINESDIR=\"\"",
"-DMODULESDIR=\"\"", "-DMODULESDIR=\"\"",
"-DOPENSSLDIR=\"\"", "-DOPENSSLDIR=\"\"",
"-DSTATIC_LEGACY",
] ]
crypto_config_linux_armv4_cflags = [ crypto_config_linux_armv4_cflags = [
...@@ -392,6 +396,7 @@ crypto_config_darwin64_x86_64_cc_cflags = [ ...@@ -392,6 +396,7 @@ crypto_config_darwin64_x86_64_cc_cflags = [
"-DOPENSSL_BN_ASM_GF2m", "-DOPENSSL_BN_ASM_GF2m",
"-DOPENSSL_BN_ASM_MONT", "-DOPENSSL_BN_ASM_MONT",
"-DOPENSSL_BN_ASM_MONT5", "-DOPENSSL_BN_ASM_MONT5",
"-DPADLOCK_ASM",
"-DPOLY1305_ASM", "-DPOLY1305_ASM",
"-DSHA1_ASM", "-DSHA1_ASM",
"-DSHA256_ASM", "-DSHA256_ASM",
...@@ -434,6 +439,7 @@ crypto_config_linux_x86_64_cflags = [ ...@@ -434,6 +439,7 @@ crypto_config_linux_x86_64_cflags = [
"-DOPENSSL_BN_ASM_GF2m", "-DOPENSSL_BN_ASM_GF2m",
"-DOPENSSL_BN_ASM_MONT", "-DOPENSSL_BN_ASM_MONT",
"-DOPENSSL_BN_ASM_MONT5", "-DOPENSSL_BN_ASM_MONT5",
"-DPADLOCK_ASM",
"-DPOLY1305_ASM", "-DPOLY1305_ASM",
"-DSHA1_ASM", "-DSHA1_ASM",
"-DSHA256_ASM", "-DSHA256_ASM",
...@@ -462,6 +468,7 @@ crypto_config_mingw64_cflags = [ ...@@ -462,6 +468,7 @@ crypto_config_mingw64_cflags = [
"-DOPENSSL_BN_ASM_GF2m", "-DOPENSSL_BN_ASM_GF2m",
"-DOPENSSL_BN_ASM_MONT", "-DOPENSSL_BN_ASM_MONT",
"-DOPENSSL_BN_ASM_MONT5", "-DOPENSSL_BN_ASM_MONT5",
"-DPADLOCK_ASM",
"-DPOLY1305_ASM", "-DPOLY1305_ASM",
"-DSHA1_ASM", "-DSHA1_ASM",
"-DSHA256_ASM", "-DSHA256_ASM",
...@@ -645,6 +652,31 @@ libdefault_common_sources = [ ...@@ -645,6 +652,31 @@ libdefault_common_sources = [
"ssl/s3_cbc.c", "ssl/s3_cbc.c",
] ]
liblegacy_sources = [
"providers/implementations/ciphers/cipher_blowfish.c",
"providers/implementations/ciphers/cipher_blowfish_hw.c",
"providers/implementations/ciphers/cipher_cast5.c",
"providers/implementations/ciphers/cipher_cast5_hw.c",
"providers/implementations/ciphers/cipher_des.c",
"providers/implementations/ciphers/cipher_des_hw.c",
"providers/implementations/ciphers/cipher_desx.c",
"providers/implementations/ciphers/cipher_desx_hw.c",
"providers/implementations/ciphers/cipher_idea.c",
"providers/implementations/ciphers/cipher_idea_hw.c",
"providers/implementations/ciphers/cipher_rc2.c",
"providers/implementations/ciphers/cipher_rc2_hw.c",
"providers/implementations/ciphers/cipher_rc4.c",
"providers/implementations/ciphers/cipher_rc4_hmac_md5.c",
"providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c",
"providers/implementations/ciphers/cipher_rc4_hw.c",
"providers/implementations/ciphers/cipher_seed.c",
"providers/implementations/ciphers/cipher_seed_hw.c",
"providers/implementations/digests/md4_prov.c",
"providers/implementations/digests/mdc2_prov.c",
"providers/implementations/digests/wp_prov.c",
"providers/implementations/kdfs/pbkdf1.c",
]
ohos_source_set("crypto_source") { ohos_source_set("crypto_source") {
subsystem_name = "thirdparty" subsystem_name = "thirdparty"
part_name = "openssl" part_name = "openssl"
...@@ -1373,8 +1405,11 @@ ohos_source_set("crypto_source") { ...@@ -1373,8 +1405,11 @@ ohos_source_set("crypto_source") {
"crypto/x509/x_req.c", "crypto/x509/x_req.c",
"crypto/x509/x_x509.c", "crypto/x509/x_x509.c",
"crypto/x509/x_x509a.c", "crypto/x509/x_x509a.c",
"engines/e_capi.c",
"engines/e_padlock.c",
"providers/baseprov.c", "providers/baseprov.c",
"providers/defltprov.c", "providers/defltprov.c",
"providers/legacyprov.c",
"providers/nullprov.c", "providers/nullprov.c",
"providers/prov_running.c", "providers/prov_running.c",
] ]
...@@ -1383,6 +1418,7 @@ ohos_source_set("crypto_source") { ...@@ -1383,6 +1418,7 @@ ohos_source_set("crypto_source") {
sources += libdefault_common_sources sources += libdefault_common_sources
sources += libdefault_build_all_generated_selected_platform_sources sources += libdefault_build_all_generated_selected_platform_sources
sources += libcrypto_build_all_generated_selected_platform_sources sources += libcrypto_build_all_generated_selected_platform_sources
sources += liblegacy_sources
if (openssl_selected_platform == "linux-armv4") { if (openssl_selected_platform == "linux-armv4") {
sources += [ sources += [
...@@ -1394,6 +1430,7 @@ ohos_source_set("crypto_source") { ...@@ -1394,6 +1430,7 @@ ohos_source_set("crypto_source") {
"crypto/rc4/rc4_enc.c", "crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c", "crypto/rc4/rc4_skey.c",
"crypto/whrlpool/wp_block.c", "crypto/whrlpool/wp_block.c",
"engines/e_afalg.c",
] ]
} else if (openssl_selected_platform == "linux-aarch64") { } else if (openssl_selected_platform == "linux-aarch64") {
sources += [ sources += [
...@@ -1406,6 +1443,7 @@ ohos_source_set("crypto_source") { ...@@ -1406,6 +1443,7 @@ ohos_source_set("crypto_source") {
"crypto/rc4/rc4_enc.c", "crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c", "crypto/rc4/rc4_skey.c",
"crypto/whrlpool/wp_block.c", "crypto/whrlpool/wp_block.c",
"engines/e_afalg.c",
] ]
} else if (openssl_selected_platform == "darwin64-x86_64-cc") { } else if (openssl_selected_platform == "darwin64-x86_64-cc") {
sources += [ sources += [
...@@ -1430,6 +1468,7 @@ ohos_source_set("crypto_source") { ...@@ -1430,6 +1468,7 @@ ohos_source_set("crypto_source") {
"crypto/bn/asm/x86_64-gcc.c", "crypto/bn/asm/x86_64-gcc.c",
"crypto/bn/rsaz_exp.c", "crypto/bn/rsaz_exp.c",
"crypto/bn/rsaz_exp_x2.c", "crypto/bn/rsaz_exp_x2.c",
"engines/e_afalg.c",
] ]
} else if (openssl_selected_platform == "mingw64") { } else if (openssl_selected_platform == "mingw64") {
sources += [ sources += [
......
...@@ -23,7 +23,26 @@ pushd ${build_all_generated_path} ...@@ -23,7 +23,26 @@ pushd ${build_all_generated_path}
rm -rf ./openssl rm -rf ./openssl
cp -r ${openssl_source_path} openssl cp -r ${openssl_source_path} openssl
pushd openssl pushd openssl
./Configure ${openssl_selected_platform} # https://github.com/openssl/openssl/issues/20112#issuecomment-1400388204
# no-shared will disable building shared libcrypto and libssl libraries.
# But the legacy provider would still be built as a shared module.
# So you would need the legacy shared module present on the installed
# system and the paths would have to be correct.
# You can use no-module to make the legacy provider built-in.
# https://github.com/openssl/openssl/issues/17679#issue-1130060263
# Is there a way to build a static version of openssl3, including the "legacy" OSSL_PROVIDER?
# https://github.com/openssl/openssl/issues/17679#issuecomment-1034949099
# Configure with no-shared no-module. The legacy provider is then part of libcrypto.a.
# You still need to "load" it via OSSL_PROVIDER_load() - but no .so file is required in that case.
# https://github.com/openssl/openssl/issues/19368#issuecomment-1274558844
# no-shared affects the building of libcrypto*.dll and libssl*.dll,
# not dynamically loadable modules (which are governed by the configuration option no-module / enable-module,
# which is enabled by default).
configure_cmd="./Configure ${openssl_selected_platform} no-shared no-module"
echo $configure_cmd
$configure_cmd
make build_all_generated -j256 >/dev/null 2>&1 make build_all_generated -j256 >/dev/null 2>&1
popd popd
# https://stackoverflow.com/questions/11325123/how-to-compare-two-directories-using-diff-while-ignoring-non-existing-files # https://stackoverflow.com/questions/11325123/how-to-compare-two-directories-using-diff-while-ignoring-non-existing-files
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册