diff --git a/thirdparty/openssl/SHA512SUM b/thirdparty/openssl/SHA512SUM index 292a22f552a51dc2f8d2805f3785ea62cf5dbbcb..ecfe994e90be0bb76dba89b68d1431c4f53c208c 100644 --- a/thirdparty/openssl/SHA512SUM +++ b/thirdparty/openssl/SHA512SUM @@ -1,2 +1,2 @@ 5cde14a1f08e2e744d9c9137cf894e67ace4e79378dfceec8f7aff0715627b59262a351269a9ba14134d7aa15bb220ed32078e5fcdfebd12b51febc6c0a03167 openssl-OpenSSL_1_1_1u.zip -5b3b4fe3570de3d108c8305a9ba94e9d9c7ea96b90fde57af869f7cee6426158a33f98f9711de6a16e1dd46270e8829798248523a1f9f836d659d0655d06de9c openssl_oh_test.patch +920866ce7858197b35880b2ed305504eb8116878b96bc12d3c541799904b571d6de0abcdf04449e5abc3998cebf71ae088b73fce1334f6c93e4aa84d4c1bf840 openssl_oh_test.patch diff --git a/thirdparty/openssl/openssl_oh_test.patch b/thirdparty/openssl/openssl_oh_test.patch index a78edf55bd076ef83d223c7728347dbfd09b9336..a8aa7cee664a3faee3c222c91d921a0f8c2fa895 100644 --- a/thirdparty/openssl/openssl_oh_test.patch +++ b/thirdparty/openssl/openssl_oh_test.patch @@ -1,6 +1,90 @@ -diff -rupN openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t openssl-OpenSSL_1_1_1u_patched/test/recipes/90-test_shlibload.t +diff -Nurap openssl-OpenSSL_1_1_1u/Configurations/unix-checker.pm openssl_patch/Configurations/unix-checker.pm +--- openssl-OpenSSL_1_1_1u/Configurations/unix-checker.pm 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/Configurations/unix-checker.pm 2024-08-17 19:50:03.296147901 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + + use Config; + +diff -Nurap openssl-OpenSSL_1_1_1u/Configurations/windows-checker.pm openssl_patch/Configurations/windows-checker.pm +--- openssl-OpenSSL_1_1_1u/Configurations/windows-checker.pm 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/Configurations/windows-checker.pm 2024-08-17 19:50:03.296147901 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + + use Config; + +diff -Nurap openssl-OpenSSL_1_1_1u/test/README openssl_patch/test/README +--- openssl-OpenSSL_1_1_1u/test/README 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/README 2024-08-17 19:50:03.296147901 +0800 +@@ -38,7 +38,7 @@ A recipe that just runs a test executabl + + A script that just runs a program looks like this: + +- #! /usr/bin/perl ++ #! /data/CIusr/bin/perl + + use OpenSSL::Test::Simple; + +@@ -62,7 +62,7 @@ documentation. For OpenSSL::Test, do `p + + A script to start from could be this: + +- #! /usr/bin/perl ++ #! /data/CIusr/bin/perl + + use strict; + use warnings; +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/06-test-rdrand.t openssl_patch/test/recipes/06-test-rdrand.t +--- openssl-OpenSSL_1_1_1u/test/recipes/06-test-rdrand.t 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/recipes/06-test-rdrand.t 2024-08-17 19:50:03.296147901 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + + # Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + # +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/80-test_cipherbytes.t openssl_patch/test/recipes/80-test_cipherbytes.t +--- openssl-OpenSSL_1_1_1u/test/recipes/80-test_cipherbytes.t 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/recipes/80-test_cipherbytes.t 2024-08-17 19:50:03.297147872 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + # + # Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. + # +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/80-test_cipherlist.t openssl_patch/test/recipes/80-test_cipherlist.t +--- openssl-OpenSSL_1_1_1u/test/recipes/80-test_cipherlist.t 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/recipes/80-test_cipherlist.t 2024-08-17 19:50:03.297147872 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + # + # Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. + # +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/80-test_ciphername.t openssl_patch/test/recipes/80-test_ciphername.t +--- openssl-OpenSSL_1_1_1u/test/recipes/80-test_ciphername.t 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/recipes/80-test_ciphername.t 2024-08-17 19:50:03.297147872 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + # + # Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. + # Copyright 2017 BaishanCloud. All rights reserved. +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/90-test_includes.t openssl_patch/test/recipes/90-test_includes.t +--- openssl-OpenSSL_1_1_1u/test/recipes/90-test_includes.t 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/test/recipes/90-test_includes.t 2024-08-17 19:50:03.298147843 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + + use strict; + use warnings; +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t openssl_patch/test/recipes/90-test_shlibload.t --- openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t 2023-05-30 20:42:39.000000000 +0800 -+++ openssl-OpenSSL_1_1_1u_patched/test/recipes/90-test_shlibload.t 2023-08-04 17:46:10.482627103 +0800 ++++ openssl_patch/test/recipes/90-test_shlibload.t 2024-08-17 19:45:21.608418709 +0800 @@ -36,22 +36,22 @@ my $libssl = bldtop_file(shlib('libssl') (my $fh, my $filename) = tempfile(); ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl, $filename])), @@ -28,9 +112,127 @@ diff -rupN openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t openssl-OpenS unlink $filename; ($fh, $filename) = tempfile(); ok(run(test(["shlibloadtest", "-no_atexit", $libcrypto, $libssl, $filename])), -diff -rupN openssl-OpenSSL_1_1_1u/test/shlibloadtest.c openssl-OpenSSL_1_1_1u_patched/test/shlibloadtest.c +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t.orig openssl_patch/test/recipes/90-test_shlibload.t.orig +--- openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t.orig 1970-01-01 08:00:00.000000000 +0800 ++++ openssl_patch/test/recipes/90-test_shlibload.t.orig 2024-08-17 19:48:17.870272171 +0800 +@@ -0,0 +1,81 @@ ++#! /usr/bin/env perl ++# Copyright 2016-2019 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 qw/:DEFAULT bldtop_dir bldtop_file/; ++use OpenSSL::Test::Utils; ++use File::Temp qw(tempfile); ++ ++#Load configdata.pm ++ ++BEGIN { ++ setup("test_shlibload"); ++} ++use lib bldtop_dir('.'); ++use configdata; ++ ++plan skip_all => "Test only supported in a shared build" if disabled("shared"); ++plan skip_all => "Test is disabled on AIX" if config('target') =~ m|^aix|; ++plan skip_all => "Test is disabled on VMS" if config('target') =~ m|^vms|; ++plan skip_all => "Test only supported in a dso build" if disabled("dso"); ++ ++plan tests => 10; ++ ++# When libssl and libcrypto are compiled on Linux with "-rpath", but not ++# "--enable-new-dtags", the RPATH takes precedence over LD_LIBRARY_PATH, ++# and we end up running with the wrong libraries. This is resolved by ++# using paths to the shared objects, not just the names. ++ ++my $libcrypto = bldtop_file(shlib('libcrypto')); ++my $libssl = bldtop_file(shlib('libssl')); ++ ++(my $fh, my $filename) = tempfile(); ++ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -crypto_first $filename"); ++ok(!check_atexit($fh)); ++unlink $filename; ++($fh, $filename) = tempfile(); ++ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -ssl_first $filename"); ++ok(!check_atexit($fh)); ++unlink $filename; ++($fh, $filename) = tempfile(); ++ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -just_crypto $filename"); ++ok(!check_atexit($fh)); ++unlink $filename; ++($fh, $filename) = tempfile(); ++ok(run(test(["shlibloadtest", "-dso_ref", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -dso_ref $filename"); ++ok(!check_atexit($fh)); ++unlink $filename; ++($fh, $filename) = tempfile(); ++ok(run(test(["shlibloadtest", "-no_atexit", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -no_atexit $filename"); ++ok(!check_atexit($fh)); ++unlink $filename; ++ ++sub shlib { ++ my $lib = shift; ++ $lib = $unified_info{rename}->{$lib} ++ if defined $unified_info{rename}->{$lib}; ++ $lib = $unified_info{sharednames}->{$lib} ++ . ($target{shlib_variant} || "") ++ . ($target{shared_extension} || ".so"); ++ $lib =~ s|\.\$\(SHLIB_VERSION_NUMBER\) ++ |.$config{shlib_version_number}|x; ++ return $lib; ++} ++ ++sub check_atexit { ++ my $fh = shift; ++ my $data = <$fh>; ++ ++ return 1 if (defined $data && $data =~ m/atexit\(\) run/); ++ ++ return 0; ++} +diff -Nurap openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t.rej openssl_patch/test/recipes/90-test_shlibload.t.rej +--- openssl-OpenSSL_1_1_1u/test/recipes/90-test_shlibload.t.rej 1970-01-01 08:00:00.000000000 +0800 ++++ openssl_patch/test/recipes/90-test_shlibload.t.rej 2024-08-17 19:48:17.870272171 +0800 +@@ -0,0 +1,29 @@ ++--- test/recipes/90-test_shlibload.t 2023-05-30 20:42:39.000000000 +0800 +++++ test/recipes/90-test_shlibload.t 2023-08-04 17:46:10.482627103 +0800 ++@@ -36,22 +36,22 @@ my $libssl = bldtop_file(shlib('libssl') ++ (my $fh, my $filename) = tempfile(); ++ ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -crypto_first $filename"); ++-ok(check_atexit($fh)); +++ok(!check_atexit($fh)); ++ unlink $filename; ++ ($fh, $filename) = tempfile(); ++ ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -ssl_first $filename"); ++-ok(check_atexit($fh)); +++ok(!check_atexit($fh)); ++ unlink $filename; ++ ($fh, $filename) = tempfile(); ++ ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -just_crypto $filename"); ++-ok(check_atexit($fh)); +++ok(!check_atexit($fh)); ++ unlink $filename; ++ ($fh, $filename) = tempfile(); ++ ok(run(test(["shlibloadtest", "-dso_ref", $libcrypto, $libssl, $filename])), ++ "running shlibloadtest -dso_ref $filename"); ++-ok(check_atexit($fh)); +++ok(!check_atexit($fh)); ++ unlink $filename; ++ ($fh, $filename) = tempfile(); ++ ok(run(test(["shlibloadtest", "-no_atexit", $libcrypto, $libssl, $filename])), +diff -Nurap openssl-OpenSSL_1_1_1u/test/shlibloadtest.c openssl_patch/test/shlibloadtest.c --- openssl-OpenSSL_1_1_1u/test/shlibloadtest.c 2023-05-30 20:42:39.000000000 +0800 -+++ openssl-OpenSSL_1_1_1u_patched/test/shlibloadtest.c 2023-08-04 17:45:39.494633694 +0800 ++++ openssl_patch/test/shlibloadtest.c 2024-08-17 19:45:21.608418709 +0800 @@ -160,7 +160,7 @@ static int test_lib(void) break; } @@ -49,3 +251,89 @@ diff -rupN openssl-OpenSSL_1_1_1u/test/shlibloadtest.c openssl-OpenSSL_1_1_1u_pa if (test_type != JUST_CRYPTO && test_type != DSO_REFTEST +diff -Nurap openssl-OpenSSL_1_1_1u/test/shlibloadtest.c.rej openssl_patch/test/shlibloadtest.c.rej +--- openssl-OpenSSL_1_1_1u/test/shlibloadtest.c.rej 1970-01-01 08:00:00.000000000 +0800 ++++ openssl_patch/test/shlibloadtest.c.rej 2024-08-17 19:48:19.496257265 +0800 +@@ -0,0 +1,20 @@ ++--- test/shlibloadtest.c 2023-05-30 20:42:39.000000000 +0800 +++++ test/shlibloadtest.c 2023-08-04 17:45:39.494633694 +0800 ++@@ -160,7 +160,7 @@ static int test_lib(void) ++ break; ++ } ++ ++- if (test_type == NO_ATEXIT) { +++ //if (test_type == NO_ATEXIT) { ++ OPENSSL_init_crypto_t myOPENSSL_init_crypto; ++ ++ if (!shlib_sym(cryptolib, "OPENSSL_init_crypto", &symbols[0].sym)) { ++@@ -172,7 +172,7 @@ static int test_lib(void) ++ fprintf(stderr, "Failed to initialise libcrypto\n"); ++ goto end; ++ } ++- } +++ //} ++ ++ if (test_type != JUST_CRYPTO ++ && test_type != DSO_REFTEST +diff -Nurap openssl-OpenSSL_1_1_1u/util/check-malloc-errs openssl_patch/util/check-malloc-errs +--- openssl-OpenSSL_1_1_1u/util/check-malloc-errs 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/util/check-malloc-errs 2024-08-17 19:50:03.298147843 +0800 +@@ -9,8 +9,8 @@ + ( + pcregrep -rnM 'OPENSSL_.?alloc.*\n.*if.*NULL.*\n.*return' crypto ssl + pcregrep -rnM 'if.*OPENSSL_.?alloc.*NULL.*\n.*.*return' crypto ssl +-) | tee /tmp/out$$ ++) | tee /data/local/tmp/out$$ + X=0 +-test -s /tmp/out$$ && X=1 +-rm /tmp/out$$ ++test -s /data/local/tmp/out$$ && X=1 ++rm /data/local/tmp/out$$ + exit $X +diff -Nurap openssl-OpenSSL_1_1_1u/util/echo.pl openssl_patch/util/echo.pl +--- openssl-OpenSSL_1_1_1u/util/echo.pl 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/util/echo.pl 2024-08-17 19:50:03.298147843 +0800 +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#! /data/CIusr/bin/perl + + use strict; + use warnings; +diff -Nurap openssl-OpenSSL_1_1_1u/util/find-doc-nits openssl_patch/util/find-doc-nits +--- openssl-OpenSSL_1_1_1u/util/find-doc-nits 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/util/find-doc-nits 2024-08-17 19:50:03.298147843 +0800 +@@ -42,7 +42,7 @@ EOF + exit; + } + +-my $temp = '/tmp/docnits.txt'; ++my $temp = '/data/local/tmp/docnits.txt'; + my $OUT; + my %public; + +diff -Nurap openssl-OpenSSL_1_1_1u/util/find-unused-errs openssl_patch/util/find-unused-errs +--- openssl-OpenSSL_1_1_1u/util/find-unused-errs 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/util/find-unused-errs 2024-08-17 19:50:03.299147814 +0800 +@@ -10,8 +10,8 @@ + # out of the source. Doesn't handle line-wrapping, might have to do + # some manual cleanups to fix compile errors. + +-export X1=/tmp/f.1.$$ +-export X2=/tmp/f.2.$$ ++export X1=/data/local/tmp/f.1.$$ ++export X2=/data/local/tmp/f.2.$$ + + case "$1" in + -f) +diff -Nurap openssl-OpenSSL_1_1_1u/util/openssl-format-source openssl_patch/util/openssl-format-source +--- openssl-OpenSSL_1_1_1u/util/openssl-format-source 2023-05-30 20:42:39.000000000 +0800 ++++ openssl_patch/util/openssl-format-source 2024-08-17 19:50:03.299147814 +0800 +@@ -95,7 +95,7 @@ do + fi + + if [ "$DONT" = "false" ]; then +- tmp=$(mktemp /tmp/indent.XXXXXX) ++ tmp=$(mktemp /data/local/tmp/indent.XXXXXX) + trap 'rm -f "$tmp"' HUP INT TERM EXIT + + case `basename $j` in