• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos_var.gni")
15declare_args() {
16  if (defined(is_double_framework) && is_double_framework) {
17    compatible_with_legacy_build_system = true
18  } else {
19    compatible_with_legacy_build_system = false
20  }
21  openssl_enabled = true
22}
23
24if (!compatible_with_legacy_build_system) {
25  import("//build/config/config.gni")
26}
27import("//build/ohos.gni")
28
29print("openssl detecting os now...")
30print("current_cpu = ${current_cpu}")
31print("current_os = ${current_os}")
32print("host_os = ${host_os}")
33openssl_selected_platform = ""
34print("is_mingw = ${is_mingw}")
35if (current_cpu == "arm" && !(current_os == "linux" || host_os == "mac")) {
36  print("openssl selected linux-armv4")
37  openssl_selected_platform = "linux-armv4"
38} else if (current_cpu == "arm64" &&
39           (!(current_os == "linux" || host_os == "mac") ||
40            current_os == "ohos")) {
41  print("openssl selected linux-aarch64")
42  openssl_selected_platform = "linux-aarch64"
43} else if ((current_cpu == "x64" || current_cpu == "x86_64") &&
44           (current_os == "mac" || current_os == "ios")) {
45  # compilation for ios depends the platform
46  print("openssl selected darwin64-x86_64-cc")
47  openssl_selected_platform = "darwin64-x86_64-cc"
48} else if (current_cpu == "arm64" &&
49           (current_os == "mac" || current_os == "ios")) {
50  # ios and macos both use the platform
51  print("openssl selected darwin64-arm64-cc")
52  openssl_selected_platform = "darwin64-arm64-cc"
53} else if ((current_cpu == "x64" || current_cpu == "x86_64") &&
54           current_os != "mingw") {
55  print("openssl selected linux-x86_64")
56  openssl_selected_platform = "linux-x86_64"
57} else if (is_mingw) {
58  print("openssl selected mingw64")
59  openssl_selected_platform = "mingw64"
60} else if (current_cpu == "arm" && current_os == "android") {
61  print("openssl selected linux-armv4")
62  openssl_selected_platform = "linux-armv4"
63} else if (current_cpu == "arm64" && current_os == "android") {
64  print("openssl selected linux-aarch64")
65  openssl_selected_platform = "linux-aarch64"
66}
67print(
68    "openssl detecting os done. openssl_selected_platform = ${openssl_selected_platform}")
69
70openssl_selected_platform_full_path =
71    "${target_out_dir}/build_all_generated/${openssl_selected_platform}"
72
73# 升级修改适配检查点1 libcrypto 不同平台汇编代码
74libcrypto_build_all_generated_linux_armv4_sources = [
75  "${openssl_selected_platform_full_path}/crypto/aes/aes-armv4.S",
76  "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S",
77  "${openssl_selected_platform_full_path}/crypto/aes/bsaes-armv7.S",
78  "${openssl_selected_platform_full_path}/crypto/armv4cpuid.S",
79  "${openssl_selected_platform_full_path}/crypto/bn/armv4-gf2m.S",
80  "${openssl_selected_platform_full_path}/crypto/bn/armv4-mont.S",
81  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv4.S",
82  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv4.S",
83  "${openssl_selected_platform_full_path}/crypto/modes/ghash-armv4.S",
84  "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S",
85  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv4.S",
86  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv4.S",
87  "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv4-large.S",
88  "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv4.S",
89  "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv4.S",
90]
91
92# 升级修改适配检查点2 libcrypto 不同平台汇编代码
93libcrypto_build_all_generated_linux_aarch64_sources = [
94  "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S",
95  "${openssl_selected_platform_full_path}/crypto/aes/vpaes-armv8.S",
96  "${openssl_selected_platform_full_path}/crypto/arm64cpuid.S",
97  "${openssl_selected_platform_full_path}/crypto/bn/armv8-mont.S",
98  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv8.S",
99  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv8.S",
100  "${openssl_selected_platform_full_path}/crypto/modes/aes-gcm-armv8_64.S",
101  "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S",
102  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv8.S",
103  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv8.S",
104  "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv8.S",
105  "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv8.S",
106  "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv8.S",
107]
108
109# 升级修改适配检查点3 libcrypto 不同平台汇编代码
110libcrypto_build_all_generated_darwin64_x86_64_cc_sources = [
111  "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s",
112  "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s",
113  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s",
114  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s",
115  "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s",
116  "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s",
117  "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s",
118  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s",
119  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s",
120  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s",
121  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s",
122  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s",
123  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s",
124  "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s",
125  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s",
126  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s",
127  "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s",
128  "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s",
129  "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s",
130  "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s",
131  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s",
132  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s",
133  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s",
134  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s",
135  "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s",
136  "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s",
137  "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s",
138  "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s",
139  "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
140  "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
141  "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
142  "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
143]
144
145# 升级修改适配检查点4 libcrypto 不同平台汇编代码
146libcrypto_build_all_generated_darwin64_arm64_cc_sources = [
147  "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S",
148  "${openssl_selected_platform_full_path}/crypto/aes/vpaes-armv8.S",
149  "${openssl_selected_platform_full_path}/crypto/arm64cpuid.S",
150  "${openssl_selected_platform_full_path}/crypto/bn/armv8-mont.S",
151  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv8.S",
152  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv8.S",
153  "${openssl_selected_platform_full_path}/crypto/modes/aes-gcm-armv8_64.S",
154  "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S",
155  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv8.S",
156  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv8.S",
157  "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv8.S",
158  "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv8.S",
159  "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv8.S",
160]
161
162# 升级修改适配检查点5 libcrypto 不同平台汇编代码
163libcrypto_build_all_generated_linux_x86_64_sources = [
164  "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s",
165  "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s",
166  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s",
167  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s",
168  "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s",
169  "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s",
170  "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s",
171  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s",
172  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s",
173  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s",
174  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s",
175  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s",
176  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s",
177  "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s",
178  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s",
179  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s",
180  "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s",
181  "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s",
182  "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s",
183  "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s",
184  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s",
185  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s",
186  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s",
187  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s",
188  "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s",
189  "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s",
190  "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s",
191  "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s",
192  "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
193  "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
194  "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
195  "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
196]
197
198# 升级修改适配检查点6 libcrypto 不同平台汇编代码
199libcrypto_build_all_generated_mingw64_sources = [
200  "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s",
201  "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s",
202  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s",
203  "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s",
204  "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s",
205  "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s",
206  "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s",
207  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s",
208  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s",
209  "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s",
210  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s",
211  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s",
212  "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s",
213  "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s",
214  "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s",
215  "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s",
216  "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s",
217  "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s",
218  "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s",
219  "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s",
220  "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s",
221  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s",
222  "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s",
223  "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s",
224  "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s",
225  "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s",
226  "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s",
227  "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s",
228  "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s",
229  "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s",
230  "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s",
231  "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s",
232]
233
234libcrypto_build_all_generated_selected_platform_sources = []
235if (openssl_selected_platform == "linux-armv4") {
236  libcrypto_build_all_generated_selected_platform_sources +=
237      libcrypto_build_all_generated_linux_armv4_sources
238} else if (openssl_selected_platform == "linux-aarch64") {
239  libcrypto_build_all_generated_selected_platform_sources +=
240      libcrypto_build_all_generated_linux_aarch64_sources
241} else if (openssl_selected_platform == "darwin64-x86_64-cc") {
242  libcrypto_build_all_generated_selected_platform_sources +=
243      libcrypto_build_all_generated_darwin64_x86_64_cc_sources
244} else if (openssl_selected_platform == "darwin64-arm64-cc") {
245  libcrypto_build_all_generated_selected_platform_sources +=
246      libcrypto_build_all_generated_darwin64_arm64_cc_sources
247} else if (openssl_selected_platform == "linux-x86_64") {
248  libcrypto_build_all_generated_selected_platform_sources +=
249      libcrypto_build_all_generated_linux_x86_64_sources
250} else if (openssl_selected_platform == "mingw64") {
251  libcrypto_build_all_generated_selected_platform_sources +=
252      libcrypto_build_all_generated_mingw64_sources
253}
254
255# 升级修改适配检查点7 libcommon 生成的源码列表
256libcommon_build_all_generated_selected_platform_sources = [
257  "${openssl_selected_platform_full_path}/providers/common/der/der_digests_gen.c",
258  "${openssl_selected_platform_full_path}/providers/common/der/der_dsa_gen.c",
259  "${openssl_selected_platform_full_path}/providers/common/der/der_ec_gen.c",
260  "${openssl_selected_platform_full_path}/providers/common/der/der_ecx_gen.c",
261  "${openssl_selected_platform_full_path}/providers/common/der/der_rsa_gen.c",
262  "${openssl_selected_platform_full_path}/providers/common/der/der_wrap_gen.c",
263]
264
265# 升级修改适配检查点8 libdefault 生成的源码列表
266libdefault_build_all_generated_selected_platform_sources = [
267  "${openssl_selected_platform_full_path}/providers/common/der/der_sm2_gen.c",
268]
269
270# We make use of both exec_script and action to build openssl build_all_generated items.
271#
272# Some modules use openssl in an incorrect way, leading to the confusing building sequences,
273# so the user modules building fail because openssl headers have not been generated at the building time.
274# The exec_script in the global area will be executed before ninja command,
275# and it ensures that the headers is generated properly before the building of any modules.
276#
277# Openssl generate some assembly codes before it is building.
278# The sources list in BUILD.gn include the assembly codes.
279# The gn build system requires that all items in sources list should be the output of another build item.
280# So we use an empty action to generate the assembly codes.
281# Actually we generate the assembly codes in exec_script, not in action.
282#
283# The gn build system requires the script in exec_script and action should be python script,
284# so we invoke the shell script in python script
285print(exec_script(
286          rebase_path("//third_party/openssl/run_command.py"),
287          [
288            rebase_path(
289                "//third_party/openssl/make_openssl_build_all_generated.sh"),
290            rebase_path("//third_party/openssl"),
291            rebase_path("${target_out_dir}/build_all_generated"),
292            openssl_selected_platform,
293          ],
294          "string",
295          []))
296action("openssl_build_all_generated") {
297  script = rebase_path("//third_party/openssl/empty.py")
298  outputs = []
299  outputs += libcommon_build_all_generated_selected_platform_sources
300  outputs += libdefault_build_all_generated_selected_platform_sources
301  outputs += libcrypto_build_all_generated_selected_platform_sources
302  outputs += [ "${openssl_selected_platform_full_path}/apps/progs.c" ]
303  if (openssl_selected_platform == "mingw64") {
304    outputs += [ "${openssl_selected_platform_full_path}/apps/openssl.rc" ]
305  }
306}
307
308openssl_internal_cflags = [
309  "-Wall",
310
311  # ../../third_party/openssl/crypto/o_str.c:309:9: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Werror,-Wint-conversion]
312  #     err = strerror_r(errnum, buf, buflen);
313  #         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314  "-Wno-error=int-conversion",
315
316  # ../../third_party/openssl/crypto/bn/bn_conv.c:92:34: error: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 10000000000000000000 to 2313682944 [-Werror,-Wconstant-conversion]
317  #             *lp = BN_div_word(t, BN_DEC_CONV);
318  #                   ~~~~~~~~~~~    ^~~~~~~~~~~
319  "-Wno-error=constant-conversion",
320
321  # ../../third_party/openssl/crypto/bn/bn_exp.c:382:38: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
322  #     if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
323  #                                      ^  ~~~~~~~~~~~~~~
324  "-Wno-error=shift-count-overflow",
325
326  # ../../third_party/openssl/crypto/conf/conf_def.c:31:11: error: 'stat' macro redefined [-Werror,-Wmacro-redefined]
327  # #  define stat    _stat
328  #           ^
329  # ../../prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/include/sys/stat.h:279:9: note: previous definition is here
330  # #define stat _stat64
331  #         ^
332  # 1 error generated.
333  "-Wno-error=macro-redefined",
334
335  "-Wno-error=implicit-fallthrough",
336  "-Wno-error=sign-compare",
337]
338if (!compatible_with_legacy_build_system) {
339  openssl_internal_cflags += [
340    # Fix llvm-15 build error
341    "-Wno-unused-but-set-variable",
342  ]
343}
344
345# 升级修改适配检查点9 内部公共头文件目录列表
346crypto_config_common_private_include_dirs = [
347  # -I args from Makefile
348  ".",
349  "crypto",
350  "include",
351  "providers/common/include",
352  "providers/implementations/include",
353
354  # internal include dirs
355  "apps/include",
356  "crypto/bn",
357  "crypto/ec",
358  "crypto/ec/curve448",
359  "crypto/modes",
360  "crypto/rsa",
361  "providers/common/include/prov",
362
363  "${openssl_selected_platform_full_path}/apps",
364  "${openssl_selected_platform_full_path}/crypto",
365  "${openssl_selected_platform_full_path}/include",
366  "${openssl_selected_platform_full_path}/include/crypto",
367  "${openssl_selected_platform_full_path}/include/openssl",
368  "${openssl_selected_platform_full_path}/providers/common/include",
369  "${openssl_selected_platform_full_path}/providers/common/include/prov",
370]
371crypto_config_common_public_include_dirs = [
372  "include",
373  "${openssl_selected_platform_full_path}/include",
374]
375
376# located at /system/etc/
377ohos_prebuilt_etc("openssl.cnf") {
378  source = "open_harmony_openssl_config/openssl.cnf"
379  if (compatible_with_legacy_build_system) {
380    subsystem_name = "security"
381    part_name = "huks"
382  } else {
383    subsystem_name = "thirdparty"
384    part_name = "openssl"
385  }
386}
387
388# 升级修改适配检查点10 内部公共编译选项宏列表
389crypto_config_common_cflags = [
390  "-Wa,--noexecstack",
391  "-DNDEBUG",
392  "-DOPENSSL_BUILDING_OPENSSL",
393  "-DOPENSSL_CPUID_OBJ",
394  "-DOPENSSL_PIC",
395
396  # use `openssl version -a` cmd to see runtime OPENSSLDIR, ENGINESDIR, MODULESDIR value
397
398  # the origin value generated by Configure
399  # linux-armv4, linux-aarch64, darwin64-x86_64-cc, darwin64-arm64-cc
400  # /usr/local/lib/engines-3
401  # linux-x86_64, mingw64
402  # /usr/local/lib64/engines-3
403  "-DENGINESDIR=\"\"",
404
405  # the origin value generated by Configure
406  # linux-armv4, linux-aarch64, darwin64-x86_64-cc, darwin64-arm64-cc
407  # /usr/local/lib/ossl-modules
408  # linux-x86_64, mingw64
409  # /usr/local/lib64/ossl-modules
410  "-DMODULESDIR=\"\"",
411
412  # the origin value generated by Configure
413  # /usr/local/ssl
414  # we set the variable as the following to locate openssl.cnf
415  "-DOPENSSLDIR=\"/system/etc\"",
416
417  "-DSTATIC_LEGACY",
418]
419
420# 升级修改适配检查点11 内部不同平台编译选项列表
421crypto_config_linux_armv4_cflags = [
422  "-DOPENSSL_USE_NODELETE",
423  "-fPIC",
424  "-pthread",
425
426  "-DAES_ASM",
427  "-DBSAES_ASM",
428  "-DECP_NISTZ256_ASM",
429  "-DGHASH_ASM",
430  "-DKECCAK1600_ASM",
431  "-DOPENSSL_BN_ASM_GF2m",
432  "-DOPENSSL_BN_ASM_MONT",
433  "-DPOLY1305_ASM",
434  "-DSHA1_ASM",
435  "-DSHA256_ASM",
436  "-DSHA512_ASM",
437]
438
439# 升级修改适配检查点12 内部不同平台编译选项列表
440crypto_config_linux_aarch64_cflags = [
441  "-DOPENSSL_USE_NODELETE",
442  "-fPIC",
443  "-pthread",
444
445  "-DECP_NISTZ256_ASM",
446  "-DKECCAK1600_ASM",
447  "-DOPENSSL_BN_ASM_MONT",
448  "-DPOLY1305_ASM",
449  "-DSHA1_ASM",
450  "-DSHA256_ASM",
451  "-DSHA512_ASM",
452  "-DVPAES_ASM",
453]
454
455# 升级修改适配检查点13 内部不同平台编译选项列表
456crypto_config_darwin64_x86_64_cc_cflags = [
457  "-fPIC",
458  "-DL_ENDIAN",
459  "-D_REENTRANT",
460  "-DOPENSSL_IA32_SSE2",
461
462  "-DAES_ASM",
463  "-DBSAES_ASM",
464  "-DCMLL_ASM",
465  "-DECP_NISTZ256_ASM",
466  "-DGHASH_ASM",
467  "-DKECCAK1600_ASM",
468  "-DMD5_ASM",
469  "-DOPENSSL_BN_ASM_GF2m",
470  "-DOPENSSL_BN_ASM_MONT",
471  "-DOPENSSL_BN_ASM_MONT5",
472  "-DPADLOCK_ASM",
473  "-DPOLY1305_ASM",
474  "-DSHA1_ASM",
475  "-DSHA256_ASM",
476  "-DSHA512_ASM",
477  "-DVPAES_ASM",
478  "-DWHIRLPOOL_ASM",
479  "-DX25519_ASM",
480]
481
482# 升级修改适配检查点14 内部不同平台编译选项列表
483crypto_config_darwin64_arm64_cc_cflags = [
484  "-DL_ENDIAN",
485  "-D_REENTRANT",
486  "-fPIC",
487
488  "-DECP_NISTZ256_ASM",
489  "-DKECCAK1600_ASM",
490  "-DOPENSSL_BN_ASM_MONT",
491  "-DPOLY1305_ASM",
492  "-DSHA1_ASM",
493  "-DSHA256_ASM",
494  "-DSHA512_ASM",
495  "-DVPAES_ASM",
496]
497
498# 升级修改适配检查点15 内部不同平台编译选项列表
499crypto_config_linux_x86_64_cflags = [
500  "-DL_ENDIAN",
501  "-DOPENSSL_IA32_SSE2",
502  "-DOPENSSL_USE_NODELETE",
503  "-fPIC",
504  "-m64",
505  "-pthread",
506
507  "-DAES_ASM",
508  "-DBSAES_ASM",
509  "-DCMLL_ASM",
510  "-DECP_NISTZ256_ASM",
511  "-DGHASH_ASM",
512  "-DKECCAK1600_ASM",
513  "-DMD5_ASM",
514  "-DOPENSSL_BN_ASM_GF2m",
515  "-DOPENSSL_BN_ASM_MONT",
516  "-DOPENSSL_BN_ASM_MONT5",
517  "-DPADLOCK_ASM",
518  "-DPOLY1305_ASM",
519  "-DSHA1_ASM",
520  "-DSHA256_ASM",
521  "-DSHA512_ASM",
522  "-DVPAES_ASM",
523  "-DWHIRLPOOL_ASM",
524  "-DX25519_ASM",
525]
526
527# 升级修改适配检查点16 内部不同平台编译选项列表
528crypto_config_mingw64_cflags = [
529  "-D_MT",
530  "-D_UNICODE",
531  "-DL_ENDIAN",
532  "-DOPENSSL_IA32_SSE2",
533  "-DUNICODE",
534  "-DWIN32_LEAN_AND_MEAN",
535  "-m64",
536
537  "-DAES_ASM",
538  "-DBSAES_ASM",
539  "-DCMLL_ASM",
540  "-DECP_NISTZ256_ASM",
541  "-DGHASH_ASM",
542  "-DKECCAK1600_ASM",
543  "-DMD5_ASM",
544  "-DOPENSSL_BN_ASM_GF2m",
545  "-DOPENSSL_BN_ASM_MONT",
546  "-DOPENSSL_BN_ASM_MONT5",
547  "-DPADLOCK_ASM",
548  "-DPOLY1305_ASM",
549  "-DSHA1_ASM",
550  "-DSHA256_ASM",
551  "-DSHA512_ASM",
552  "-DVPAES_ASM",
553  "-DWHIRLPOOL_ASM",
554  "-DX25519_ASM",
555]
556
557crypto_config_current_platform_cflags = []
558if (openssl_selected_platform == "linux-armv4") {
559  crypto_config_current_platform_cflags += crypto_config_linux_armv4_cflags
560} else if (openssl_selected_platform == "linux-aarch64") {
561  crypto_config_current_platform_cflags += crypto_config_linux_aarch64_cflags
562} else if (openssl_selected_platform == "darwin64-x86_64-cc") {
563  crypto_config_current_platform_cflags +=
564      crypto_config_darwin64_x86_64_cc_cflags
565} else if (openssl_selected_platform == "darwin64-arm64-cc") {
566  crypto_config_current_platform_cflags +=
567      crypto_config_darwin64_arm64_cc_cflags
568} else if (openssl_selected_platform == "linux-x86_64") {
569  crypto_config_current_platform_cflags += crypto_config_linux_x86_64_cflags
570} else if (openssl_selected_platform == "mingw64") {
571  crypto_config_current_platform_cflags += crypto_config_mingw64_cflags
572}
573
574mingw32_libs_path = []
575mingw32_libs = []
576if (is_mingw || is_win) {
577  mingw32_libs_path += [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib" ]
578  mingw32_libs += [
579    "ws2_32",
580    "crypt32",
581  ]
582}
583
584config("crypto_config_private") {
585  include_dirs = crypto_config_common_private_include_dirs
586  cflags = crypto_config_common_cflags + crypto_config_current_platform_cflags +
587           openssl_internal_cflags
588  lib_dirs = mingw32_libs_path
589  libs = mingw32_libs
590}
591
592config("crypto_config_public") {
593  include_dirs = crypto_config_common_public_include_dirs
594  libs = mingw32_libs
595}
596
597# 升级修改适配检查点17 libcommon 原目录源码列表
598libcommon_common_sources = [
599  "providers/common/der/der_dsa_key.c",
600  "providers/common/der/der_dsa_sig.c",
601  "providers/common/der/der_ec_key.c",
602  "providers/common/der/der_ec_sig.c",
603  "providers/common/der/der_ecx_key.c",
604  "providers/common/der/der_rsa_key.c",
605  "providers/common/provider_ctx.c",
606  "providers/common/provider_err.c",
607  "providers/implementations/ciphers/ciphercommon.c",
608  "providers/implementations/ciphers/ciphercommon_block.c",
609  "providers/implementations/ciphers/ciphercommon_ccm.c",
610  "providers/implementations/ciphers/ciphercommon_ccm_hw.c",
611  "providers/implementations/ciphers/ciphercommon_gcm.c",
612  "providers/implementations/ciphers/ciphercommon_gcm_hw.c",
613  "providers/implementations/ciphers/ciphercommon_hw.c",
614  "providers/implementations/digests/digestcommon.c",
615  "ssl/record/tls_pad.c",
616]
617
618# 升级修改适配检查点18 libdefault 原目录源码列表
619libdefault_common_sources = [
620  "providers/common/bio_prov.c",
621  "providers/common/capabilities.c",
622  "providers/common/der/der_rsa_sig.c",
623  "providers/common/der/der_sm2_key.c",
624  "providers/common/der/der_sm2_sig.c",
625  "providers/common/digest_to_nid.c",
626  "providers/common/provider_seeding.c",
627  "providers/common/provider_util.c",
628  "providers/common/securitycheck.c",
629  "providers/common/securitycheck_default.c",
630  "providers/implementations/asymciphers/rsa_enc.c",
631  "providers/implementations/asymciphers/sm2_enc.c",
632  "providers/implementations/ciphers/cipher_aes.c",
633  "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c",
634  "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c",
635  "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c",
636  "providers/implementations/ciphers/cipher_aes_ccm.c",
637  "providers/implementations/ciphers/cipher_aes_ccm_hw.c",
638  "providers/implementations/ciphers/cipher_aes_gcm.c",
639  "providers/implementations/ciphers/cipher_aes_gcm_hw.c",
640  "providers/implementations/ciphers/cipher_aes_hw.c",
641  "providers/implementations/ciphers/cipher_aes_ocb.c",
642  "providers/implementations/ciphers/cipher_aes_ocb_hw.c",
643  "providers/implementations/ciphers/cipher_aes_siv.c",
644  "providers/implementations/ciphers/cipher_aes_siv_hw.c",
645  "providers/implementations/ciphers/cipher_aes_wrp.c",
646  "providers/implementations/ciphers/cipher_aes_xts.c",
647  "providers/implementations/ciphers/cipher_aes_xts_fips.c",
648  "providers/implementations/ciphers/cipher_aes_xts_hw.c",
649  "providers/implementations/ciphers/cipher_aria.c",
650  "providers/implementations/ciphers/cipher_aria_ccm.c",
651  "providers/implementations/ciphers/cipher_aria_ccm_hw.c",
652  "providers/implementations/ciphers/cipher_aria_gcm.c",
653  "providers/implementations/ciphers/cipher_aria_gcm_hw.c",
654  "providers/implementations/ciphers/cipher_aria_hw.c",
655  "providers/implementations/ciphers/cipher_camellia.c",
656  "providers/implementations/ciphers/cipher_camellia_hw.c",
657  "providers/implementations/ciphers/cipher_chacha20.c",
658  "providers/implementations/ciphers/cipher_chacha20_hw.c",
659  "providers/implementations/ciphers/cipher_chacha20_poly1305.c",
660  "providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c",
661  "providers/implementations/ciphers/cipher_cts.c",
662  "providers/implementations/ciphers/cipher_null.c",
663  "providers/implementations/ciphers/cipher_sm4.c",
664  "providers/implementations/ciphers/cipher_sm4_hw.c",
665  "providers/implementations/ciphers/cipher_tdes.c",
666  "providers/implementations/ciphers/cipher_tdes_common.c",
667  "providers/implementations/ciphers/cipher_tdes_default.c",
668  "providers/implementations/ciphers/cipher_tdes_default_hw.c",
669  "providers/implementations/ciphers/cipher_tdes_hw.c",
670  "providers/implementations/ciphers/cipher_tdes_wrap.c",
671  "providers/implementations/ciphers/cipher_tdes_wrap_hw.c",
672  "providers/implementations/digests/blake2_prov.c",
673  "providers/implementations/digests/blake2b_prov.c",
674  "providers/implementations/digests/blake2s_prov.c",
675  "providers/implementations/digests/md5_prov.c",
676  "providers/implementations/digests/md5_sha1_prov.c",
677  "providers/implementations/digests/null_prov.c",
678  "providers/implementations/digests/ripemd_prov.c",
679  "providers/implementations/digests/sha2_prov.c",
680  "providers/implementations/digests/sha3_prov.c",
681  "providers/implementations/digests/sm3_prov.c",
682  "providers/implementations/encode_decode/decode_der2key.c",
683  "providers/implementations/encode_decode/decode_epki2pki.c",
684  "providers/implementations/encode_decode/decode_msblob2key.c",
685  "providers/implementations/encode_decode/decode_pem2der.c",
686  "providers/implementations/encode_decode/decode_pvk2key.c",
687  "providers/implementations/encode_decode/decode_spki2typespki.c",
688  "providers/implementations/encode_decode/encode_key2any.c",
689  "providers/implementations/encode_decode/encode_key2blob.c",
690  "providers/implementations/encode_decode/encode_key2ms.c",
691  "providers/implementations/encode_decode/encode_key2text.c",
692  "providers/implementations/encode_decode/endecoder_common.c",
693  "providers/implementations/exchange/dh_exch.c",
694  "providers/implementations/exchange/ecdh_exch.c",
695  "providers/implementations/exchange/ecx_exch.c",
696  "providers/implementations/exchange/kdf_exch.c",
697  "providers/implementations/kdfs/hkdf.c",
698  "providers/implementations/kdfs/kbkdf.c",
699  "providers/implementations/kdfs/krb5kdf.c",
700  "providers/implementations/kdfs/pbkdf2.c",
701  "providers/implementations/kdfs/pbkdf2_fips.c",
702  "providers/implementations/kdfs/pkcs12kdf.c",
703  "providers/implementations/kdfs/scrypt.c",
704  "providers/implementations/kdfs/sshkdf.c",
705  "providers/implementations/kdfs/sskdf.c",
706  "providers/implementations/kdfs/tls1_prf.c",
707  "providers/implementations/kdfs/x942kdf.c",
708  "providers/implementations/kem/rsa_kem.c",
709  "providers/implementations/keymgmt/dh_kmgmt.c",
710  "providers/implementations/keymgmt/dsa_kmgmt.c",
711  "providers/implementations/keymgmt/ec_kmgmt.c",
712  "providers/implementations/keymgmt/ecx_kmgmt.c",
713  "providers/implementations/keymgmt/kdf_legacy_kmgmt.c",
714  "providers/implementations/keymgmt/mac_legacy_kmgmt.c",
715  "providers/implementations/keymgmt/rsa_kmgmt.c",
716  "providers/implementations/macs/blake2b_mac.c",
717  "providers/implementations/macs/blake2s_mac.c",
718  "providers/implementations/macs/cmac_prov.c",
719  "providers/implementations/macs/gmac_prov.c",
720  "providers/implementations/macs/hmac_prov.c",
721  "providers/implementations/macs/kmac_prov.c",
722  "providers/implementations/macs/poly1305_prov.c",
723  "providers/implementations/macs/siphash_prov.c",
724  "providers/implementations/rands/crngt.c",
725  "providers/implementations/rands/drbg.c",
726  "providers/implementations/rands/drbg_ctr.c",
727  "providers/implementations/rands/drbg_hash.c",
728  "providers/implementations/rands/drbg_hmac.c",
729  "providers/implementations/rands/seed_src.c",
730  "providers/implementations/rands/seeding/rand_cpu_x86.c",
731  "providers/implementations/rands/seeding/rand_tsc.c",
732  "providers/implementations/rands/seeding/rand_unix.c",
733  "providers/implementations/rands/seeding/rand_win.c",
734  "providers/implementations/rands/test_rng.c",
735  "providers/implementations/signature/dsa_sig.c",
736  "providers/implementations/signature/ecdsa_sig.c",
737  "providers/implementations/signature/eddsa_sig.c",
738  "providers/implementations/signature/mac_legacy_sig.c",
739  "providers/implementations/signature/rsa_sig.c",
740  "providers/implementations/signature/sm2_sig.c",
741  "providers/implementations/storemgmt/file_store.c",
742  "providers/implementations/storemgmt/file_store_any2obj.c",
743  "ssl/s3_cbc.c",
744]
745
746# 升级修改适配检查点19 liblegacy 源码列表
747liblegacy_sources = [
748  "providers/implementations/ciphers/cipher_blowfish.c",
749  "providers/implementations/ciphers/cipher_blowfish_hw.c",
750  "providers/implementations/ciphers/cipher_cast5.c",
751  "providers/implementations/ciphers/cipher_cast5_hw.c",
752  "providers/implementations/ciphers/cipher_des.c",
753  "providers/implementations/ciphers/cipher_des_hw.c",
754  "providers/implementations/ciphers/cipher_desx.c",
755  "providers/implementations/ciphers/cipher_desx_hw.c",
756  "providers/implementations/ciphers/cipher_idea.c",
757  "providers/implementations/ciphers/cipher_idea_hw.c",
758  "providers/implementations/ciphers/cipher_rc2.c",
759  "providers/implementations/ciphers/cipher_rc2_hw.c",
760  "providers/implementations/ciphers/cipher_rc4.c",
761  "providers/implementations/ciphers/cipher_rc4_hmac_md5.c",
762  "providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c",
763  "providers/implementations/ciphers/cipher_rc4_hw.c",
764  "providers/implementations/ciphers/cipher_seed.c",
765  "providers/implementations/ciphers/cipher_seed_hw.c",
766  "providers/implementations/digests/md4_prov.c",
767  "providers/implementations/digests/mdc2_prov.c",
768  "providers/implementations/digests/wp_prov.c",
769  "providers/implementations/kdfs/pbkdf1.c",
770]
771
772ohos_source_set("crypto_source") {
773  if (!compatible_with_legacy_build_system) {
774    subsystem_name = "thirdparty"
775    part_name = "openssl"
776  }
777
778  # 升级修改适配检查点20 libcrypto 原目录源码列表
779  sources = [
780    "crypto/aes/aes_cfb.c",
781    "crypto/aes/aes_ecb.c",
782    "crypto/aes/aes_ige.c",
783    "crypto/aes/aes_misc.c",
784    "crypto/aes/aes_ofb.c",
785    "crypto/aes/aes_wrap.c",
786    "crypto/aria/aria.c",
787    "crypto/asn1/a_bitstr.c",
788    "crypto/asn1/a_d2i_fp.c",
789    "crypto/asn1/a_digest.c",
790    "crypto/asn1/a_dup.c",
791    "crypto/asn1/a_gentm.c",
792    "crypto/asn1/a_i2d_fp.c",
793    "crypto/asn1/a_int.c",
794    "crypto/asn1/a_mbstr.c",
795    "crypto/asn1/a_object.c",
796    "crypto/asn1/a_octet.c",
797    "crypto/asn1/a_print.c",
798    "crypto/asn1/a_sign.c",
799    "crypto/asn1/a_strex.c",
800    "crypto/asn1/a_strnid.c",
801    "crypto/asn1/a_time.c",
802    "crypto/asn1/a_type.c",
803    "crypto/asn1/a_utctm.c",
804    "crypto/asn1/a_utf8.c",
805    "crypto/asn1/a_verify.c",
806    "crypto/asn1/ameth_lib.c",
807    "crypto/asn1/asn1_err.c",
808    "crypto/asn1/asn1_gen.c",
809    "crypto/asn1/asn1_item_list.c",
810    "crypto/asn1/asn1_lib.c",
811    "crypto/asn1/asn1_parse.c",
812    "crypto/asn1/asn_mime.c",
813    "crypto/asn1/asn_moid.c",
814    "crypto/asn1/asn_mstbl.c",
815    "crypto/asn1/asn_pack.c",
816    "crypto/asn1/bio_asn1.c",
817    "crypto/asn1/bio_ndef.c",
818    "crypto/asn1/d2i_param.c",
819    "crypto/asn1/d2i_pr.c",
820    "crypto/asn1/d2i_pu.c",
821    "crypto/asn1/evp_asn1.c",
822    "crypto/asn1/f_int.c",
823    "crypto/asn1/f_string.c",
824    "crypto/asn1/i2d_evp.c",
825    "crypto/asn1/n_pkey.c",
826    "crypto/asn1/nsseq.c",
827    "crypto/asn1/p5_pbe.c",
828    "crypto/asn1/p5_pbev2.c",
829    "crypto/asn1/p5_scrypt.c",
830    "crypto/asn1/p8_pkey.c",
831    "crypto/asn1/t_bitst.c",
832    "crypto/asn1/t_pkey.c",
833    "crypto/asn1/t_spki.c",
834    "crypto/asn1/tasn_dec.c",
835    "crypto/asn1/tasn_enc.c",
836    "crypto/asn1/tasn_fre.c",
837    "crypto/asn1/tasn_new.c",
838    "crypto/asn1/tasn_prn.c",
839    "crypto/asn1/tasn_scn.c",
840    "crypto/asn1/tasn_typ.c",
841    "crypto/asn1/tasn_utl.c",
842    "crypto/asn1/x_algor.c",
843    "crypto/asn1/x_bignum.c",
844    "crypto/asn1/x_info.c",
845    "crypto/asn1/x_int64.c",
846    "crypto/asn1/x_long.c",
847    "crypto/asn1/x_pkey.c",
848    "crypto/asn1/x_sig.c",
849    "crypto/asn1/x_spki.c",
850    "crypto/asn1/x_val.c",
851    "crypto/asn1_dsa.c",
852    "crypto/async/arch/async_null.c",
853    "crypto/async/arch/async_posix.c",
854    "crypto/async/arch/async_win.c",
855    "crypto/async/async.c",
856    "crypto/async/async_err.c",
857    "crypto/async/async_wait.c",
858    "crypto/bf/bf_cfb64.c",
859    "crypto/bf/bf_ecb.c",
860    "crypto/bf/bf_enc.c",
861    "crypto/bf/bf_ofb64.c",
862    "crypto/bf/bf_skey.c",
863    "crypto/bio/bf_buff.c",
864    "crypto/bio/bf_lbuf.c",
865    "crypto/bio/bf_nbio.c",
866    "crypto/bio/bf_null.c",
867    "crypto/bio/bf_prefix.c",
868    "crypto/bio/bf_readbuff.c",
869    "crypto/bio/bio_addr.c",
870    "crypto/bio/bio_cb.c",
871    "crypto/bio/bio_dump.c",
872    "crypto/bio/bio_err.c",
873    "crypto/bio/bio_lib.c",
874    "crypto/bio/bio_meth.c",
875    "crypto/bio/bio_print.c",
876    "crypto/bio/bio_sock.c",
877    "crypto/bio/bio_sock2.c",
878    "crypto/bio/bss_acpt.c",
879    "crypto/bio/bss_bio.c",
880    "crypto/bio/bss_conn.c",
881    "crypto/bio/bss_core.c",
882    "crypto/bio/bss_dgram.c",
883    "crypto/bio/bss_fd.c",
884    "crypto/bio/bss_file.c",
885    "crypto/bio/bss_log.c",
886    "crypto/bio/bss_mem.c",
887    "crypto/bio/bss_null.c",
888    "crypto/bio/bss_sock.c",
889    "crypto/bio/ossl_core_bio.c",
890    "crypto/bn/bn_add.c",
891    "crypto/bn/bn_blind.c",
892    "crypto/bn/bn_const.c",
893    "crypto/bn/bn_conv.c",
894    "crypto/bn/bn_ctx.c",
895    "crypto/bn/bn_depr.c",
896    "crypto/bn/bn_dh.c",
897    "crypto/bn/bn_div.c",
898    "crypto/bn/bn_err.c",
899    "crypto/bn/bn_exp.c",
900    "crypto/bn/bn_exp2.c",
901    "crypto/bn/bn_gcd.c",
902    "crypto/bn/bn_gf2m.c",
903    "crypto/bn/bn_intern.c",
904    "crypto/bn/bn_kron.c",
905    "crypto/bn/bn_lib.c",
906    "crypto/bn/bn_mod.c",
907    "crypto/bn/bn_mont.c",
908    "crypto/bn/bn_mpi.c",
909    "crypto/bn/bn_mul.c",
910    "crypto/bn/bn_nist.c",
911    "crypto/bn/bn_prime.c",
912    "crypto/bn/bn_print.c",
913    "crypto/bn/bn_rand.c",
914    "crypto/bn/bn_recp.c",
915    "crypto/bn/bn_rsa_fips186_4.c",
916    "crypto/bn/bn_shift.c",
917    "crypto/bn/bn_sqr.c",
918    "crypto/bn/bn_sqrt.c",
919    "crypto/bn/bn_srp.c",
920    "crypto/bn/bn_word.c",
921    "crypto/bn/bn_x931p.c",
922    "crypto/bsearch.c",
923    "crypto/buffer/buf_err.c",
924    "crypto/buffer/buffer.c",
925    "crypto/camellia/cmll_cfb.c",
926    "crypto/camellia/cmll_ctr.c",
927    "crypto/camellia/cmll_ecb.c",
928    "crypto/camellia/cmll_misc.c",
929    "crypto/camellia/cmll_ofb.c",
930    "crypto/cast/c_cfb64.c",
931    "crypto/cast/c_ecb.c",
932    "crypto/cast/c_enc.c",
933    "crypto/cast/c_ofb64.c",
934    "crypto/cast/c_skey.c",
935    "crypto/cmac/cmac.c",
936    "crypto/cmp/cmp_asn.c",
937    "crypto/cmp/cmp_client.c",
938    "crypto/cmp/cmp_ctx.c",
939    "crypto/cmp/cmp_err.c",
940    "crypto/cmp/cmp_hdr.c",
941    "crypto/cmp/cmp_http.c",
942    "crypto/cmp/cmp_msg.c",
943    "crypto/cmp/cmp_protect.c",
944    "crypto/cmp/cmp_server.c",
945    "crypto/cmp/cmp_status.c",
946    "crypto/cmp/cmp_util.c",
947    "crypto/cmp/cmp_vfy.c",
948    "crypto/cms/cms_asn1.c",
949    "crypto/cms/cms_att.c",
950    "crypto/cms/cms_cd.c",
951    "crypto/cms/cms_dd.c",
952    "crypto/cms/cms_dh.c",
953    "crypto/cms/cms_ec.c",
954    "crypto/cms/cms_enc.c",
955    "crypto/cms/cms_env.c",
956    "crypto/cms/cms_err.c",
957    "crypto/cms/cms_ess.c",
958    "crypto/cms/cms_io.c",
959    "crypto/cms/cms_kari.c",
960    "crypto/cms/cms_lib.c",
961    "crypto/cms/cms_pwri.c",
962    "crypto/cms/cms_rsa.c",
963    "crypto/cms/cms_sd.c",
964    "crypto/cms/cms_smime.c",
965    "crypto/comp/c_zlib.c",
966    "crypto/comp/comp_err.c",
967    "crypto/comp/comp_lib.c",
968    "crypto/conf/conf_api.c",
969    "crypto/conf/conf_def.c",
970    "crypto/conf/conf_err.c",
971    "crypto/conf/conf_lib.c",
972    "crypto/conf/conf_mall.c",
973    "crypto/conf/conf_mod.c",
974    "crypto/conf/conf_sap.c",
975    "crypto/conf/conf_ssl.c",
976    "crypto/context.c",
977    "crypto/core_algorithm.c",
978    "crypto/core_fetch.c",
979    "crypto/core_namemap.c",
980    "crypto/cpt_err.c",
981    "crypto/cpuid.c",
982    "crypto/crmf/crmf_asn.c",
983    "crypto/crmf/crmf_err.c",
984    "crypto/crmf/crmf_lib.c",
985    "crypto/crmf/crmf_pbm.c",
986    "crypto/cryptlib.c",
987    "crypto/ct/ct_b64.c",
988    "crypto/ct/ct_err.c",
989    "crypto/ct/ct_log.c",
990    "crypto/ct/ct_oct.c",
991    "crypto/ct/ct_policy.c",
992    "crypto/ct/ct_prn.c",
993    "crypto/ct/ct_sct.c",
994    "crypto/ct/ct_sct_ctx.c",
995    "crypto/ct/ct_vfy.c",
996    "crypto/ct/ct_x509v3.c",
997    "crypto/ctype.c",
998    "crypto/cversion.c",
999    "crypto/der_writer.c",
1000    "crypto/des/cbc_cksm.c",
1001    "crypto/des/cbc_enc.c",
1002    "crypto/des/cfb64ede.c",
1003    "crypto/des/cfb64enc.c",
1004    "crypto/des/cfb_enc.c",
1005    "crypto/des/des_enc.c",
1006    "crypto/des/ecb3_enc.c",
1007    "crypto/des/ecb_enc.c",
1008    "crypto/des/fcrypt.c",
1009    "crypto/des/fcrypt_b.c",
1010    "crypto/des/ofb64ede.c",
1011    "crypto/des/ofb64enc.c",
1012    "crypto/des/ofb_enc.c",
1013    "crypto/des/pcbc_enc.c",
1014    "crypto/des/qud_cksm.c",
1015    "crypto/des/rand_key.c",
1016    "crypto/des/set_key.c",
1017    "crypto/des/str2key.c",
1018    "crypto/des/xcbc_enc.c",
1019    "crypto/dh/dh_ameth.c",
1020    "crypto/dh/dh_asn1.c",
1021    "crypto/dh/dh_backend.c",
1022    "crypto/dh/dh_check.c",
1023    "crypto/dh/dh_depr.c",
1024    "crypto/dh/dh_err.c",
1025    "crypto/dh/dh_gen.c",
1026    "crypto/dh/dh_group_params.c",
1027    "crypto/dh/dh_kdf.c",
1028    "crypto/dh/dh_key.c",
1029    "crypto/dh/dh_lib.c",
1030    "crypto/dh/dh_meth.c",
1031    "crypto/dh/dh_pmeth.c",
1032    "crypto/dh/dh_prn.c",
1033    "crypto/dh/dh_rfc5114.c",
1034    "crypto/dsa/dsa_ameth.c",
1035    "crypto/dsa/dsa_asn1.c",
1036    "crypto/dsa/dsa_backend.c",
1037    "crypto/dsa/dsa_check.c",
1038    "crypto/dsa/dsa_depr.c",
1039    "crypto/dsa/dsa_err.c",
1040    "crypto/dsa/dsa_gen.c",
1041    "crypto/dsa/dsa_key.c",
1042    "crypto/dsa/dsa_lib.c",
1043    "crypto/dsa/dsa_meth.c",
1044    "crypto/dsa/dsa_ossl.c",
1045    "crypto/dsa/dsa_pmeth.c",
1046    "crypto/dsa/dsa_prn.c",
1047    "crypto/dsa/dsa_sign.c",
1048    "crypto/dsa/dsa_vrf.c",
1049    "crypto/dso/dso_dl.c",
1050    "crypto/dso/dso_dlfcn.c",
1051    "crypto/dso/dso_err.c",
1052    "crypto/dso/dso_lib.c",
1053    "crypto/dso/dso_openssl.c",
1054    "crypto/dso/dso_vms.c",
1055    "crypto/dso/dso_win32.c",
1056    "crypto/ebcdic.c",
1057    "crypto/ec/curve25519.c",
1058    "crypto/ec/curve448/arch_32/f_impl32.c",
1059    "crypto/ec/curve448/arch_64/f_impl64.c",
1060    "crypto/ec/curve448/curve448.c",
1061    "crypto/ec/curve448/curve448_tables.c",
1062    "crypto/ec/curve448/eddsa.c",
1063    "crypto/ec/curve448/f_generic.c",
1064    "crypto/ec/curve448/scalar.c",
1065    "crypto/ec/ec2_oct.c",
1066    "crypto/ec/ec2_smpl.c",
1067    "crypto/ec/ec_ameth.c",
1068    "crypto/ec/ec_asn1.c",
1069    "crypto/ec/ec_backend.c",
1070    "crypto/ec/ec_check.c",
1071    "crypto/ec/ec_curve.c",
1072    "crypto/ec/ec_cvt.c",
1073    "crypto/ec/ec_deprecated.c",
1074    "crypto/ec/ec_err.c",
1075    "crypto/ec/ec_key.c",
1076    "crypto/ec/ec_kmeth.c",
1077    "crypto/ec/ec_lib.c",
1078    "crypto/ec/ec_mult.c",
1079    "crypto/ec/ec_oct.c",
1080    "crypto/ec/ec_pmeth.c",
1081    "crypto/ec/ec_print.c",
1082    "crypto/ec/ecdh_kdf.c",
1083    "crypto/ec/ecdh_ossl.c",
1084    "crypto/ec/ecdsa_ossl.c",
1085    "crypto/ec/ecdsa_sign.c",
1086    "crypto/ec/ecdsa_vrf.c",
1087    "crypto/ec/eck_prn.c",
1088    "crypto/ec/ecp_mont.c",
1089    "crypto/ec/ecp_nist.c",
1090    "crypto/ec/ecp_nistz256.c",
1091    "crypto/ec/ecp_oct.c",
1092    "crypto/ec/ecp_smpl.c",
1093    "crypto/ec/ecx_backend.c",
1094    "crypto/ec/ecx_key.c",
1095    "crypto/ec/ecx_meth.c",
1096    "crypto/encode_decode/decoder_err.c",
1097    "crypto/encode_decode/decoder_lib.c",
1098    "crypto/encode_decode/decoder_meth.c",
1099    "crypto/encode_decode/decoder_pkey.c",
1100    "crypto/encode_decode/encoder_err.c",
1101    "crypto/encode_decode/encoder_lib.c",
1102    "crypto/encode_decode/encoder_meth.c",
1103    "crypto/encode_decode/encoder_pkey.c",
1104    "crypto/engine/eng_all.c",
1105    "crypto/engine/eng_cnf.c",
1106    "crypto/engine/eng_ctrl.c",
1107    "crypto/engine/eng_dyn.c",
1108    "crypto/engine/eng_err.c",
1109    "crypto/engine/eng_fat.c",
1110    "crypto/engine/eng_init.c",
1111    "crypto/engine/eng_lib.c",
1112    "crypto/engine/eng_list.c",
1113    "crypto/engine/eng_openssl.c",
1114    "crypto/engine/eng_pkey.c",
1115    "crypto/engine/eng_rdrand.c",
1116    "crypto/engine/eng_table.c",
1117    "crypto/engine/tb_asnmth.c",
1118    "crypto/engine/tb_cipher.c",
1119    "crypto/engine/tb_dh.c",
1120    "crypto/engine/tb_digest.c",
1121    "crypto/engine/tb_dsa.c",
1122    "crypto/engine/tb_eckey.c",
1123    "crypto/engine/tb_pkmeth.c",
1124    "crypto/engine/tb_rand.c",
1125    "crypto/engine/tb_rsa.c",
1126    "crypto/err/err.c",
1127    "crypto/err/err_all.c",
1128    "crypto/err/err_all_legacy.c",
1129    "crypto/err/err_blocks.c",
1130    "crypto/err/err_prn.c",
1131    "crypto/ess/ess_asn1.c",
1132    "crypto/ess/ess_err.c",
1133    "crypto/ess/ess_lib.c",
1134    "crypto/evp/asymcipher.c",
1135    "crypto/evp/bio_b64.c",
1136    "crypto/evp/bio_enc.c",
1137    "crypto/evp/bio_md.c",
1138    "crypto/evp/bio_ok.c",
1139    "crypto/evp/c_allc.c",
1140    "crypto/evp/c_alld.c",
1141    "crypto/evp/cmeth_lib.c",
1142    "crypto/evp/ctrl_params_translate.c",
1143    "crypto/evp/dh_ctrl.c",
1144    "crypto/evp/dh_support.c",
1145    "crypto/evp/digest.c",
1146    "crypto/evp/dsa_ctrl.c",
1147    "crypto/evp/e_aes.c",
1148    "crypto/evp/e_aes_cbc_hmac_sha1.c",
1149    "crypto/evp/e_aes_cbc_hmac_sha256.c",
1150    "crypto/evp/e_aria.c",
1151    "crypto/evp/e_bf.c",
1152    "crypto/evp/e_camellia.c",
1153    "crypto/evp/e_cast.c",
1154    "crypto/evp/e_chacha20_poly1305.c",
1155    "crypto/evp/e_des.c",
1156    "crypto/evp/e_des3.c",
1157    "crypto/evp/e_idea.c",
1158    "crypto/evp/e_null.c",
1159    "crypto/evp/e_old.c",
1160    "crypto/evp/e_rc2.c",
1161    "crypto/evp/e_rc4.c",
1162    "crypto/evp/e_rc4_hmac_md5.c",
1163    "crypto/evp/e_rc5.c",
1164    "crypto/evp/e_seed.c",
1165    "crypto/evp/e_sm4.c",
1166    "crypto/evp/e_xcbc_d.c",
1167    "crypto/evp/ec_ctrl.c",
1168    "crypto/evp/ec_support.c",
1169    "crypto/evp/encode.c",
1170    "crypto/evp/evp_cnf.c",
1171    "crypto/evp/evp_enc.c",
1172    "crypto/evp/evp_err.c",
1173    "crypto/evp/evp_fetch.c",
1174    "crypto/evp/evp_key.c",
1175    "crypto/evp/evp_lib.c",
1176    "crypto/evp/evp_pbe.c",
1177    "crypto/evp/evp_pkey.c",
1178    "crypto/evp/evp_rand.c",
1179    "crypto/evp/evp_utils.c",
1180    "crypto/evp/exchange.c",
1181    "crypto/evp/kdf_lib.c",
1182    "crypto/evp/kdf_meth.c",
1183    "crypto/evp/kem.c",
1184    "crypto/evp/keymgmt_lib.c",
1185    "crypto/evp/keymgmt_meth.c",
1186    "crypto/evp/legacy_blake2.c",
1187    "crypto/evp/legacy_md4.c",
1188    "crypto/evp/legacy_md5.c",
1189    "crypto/evp/legacy_md5_sha1.c",
1190    "crypto/evp/legacy_mdc2.c",
1191    "crypto/evp/legacy_ripemd.c",
1192    "crypto/evp/legacy_sha.c",
1193    "crypto/evp/legacy_wp.c",
1194    "crypto/evp/m_null.c",
1195    "crypto/evp/m_sigver.c",
1196    "crypto/evp/mac_lib.c",
1197    "crypto/evp/mac_meth.c",
1198    "crypto/evp/names.c",
1199    "crypto/evp/p5_crpt.c",
1200    "crypto/evp/p5_crpt2.c",
1201    "crypto/evp/p_dec.c",
1202    "crypto/evp/p_enc.c",
1203    "crypto/evp/p_legacy.c",
1204    "crypto/evp/p_lib.c",
1205    "crypto/evp/p_open.c",
1206    "crypto/evp/p_seal.c",
1207    "crypto/evp/p_sign.c",
1208    "crypto/evp/p_verify.c",
1209    "crypto/evp/pbe_scrypt.c",
1210    "crypto/evp/pmeth_check.c",
1211    "crypto/evp/pmeth_gn.c",
1212    "crypto/evp/pmeth_lib.c",
1213    "crypto/evp/signature.c",
1214    "crypto/ex_data.c",
1215    "crypto/ffc/ffc_backend.c",
1216    "crypto/ffc/ffc_dh.c",
1217    "crypto/ffc/ffc_key_generate.c",
1218    "crypto/ffc/ffc_key_validate.c",
1219    "crypto/ffc/ffc_params.c",
1220    "crypto/ffc/ffc_params_generate.c",
1221    "crypto/ffc/ffc_params_validate.c",
1222    "crypto/getenv.c",
1223    "crypto/hmac/hmac.c",
1224    "crypto/http/http_client.c",
1225    "crypto/http/http_err.c",
1226    "crypto/http/http_lib.c",
1227    "crypto/idea/i_cbc.c",
1228    "crypto/idea/i_cfb64.c",
1229    "crypto/idea/i_ecb.c",
1230    "crypto/idea/i_ofb64.c",
1231    "crypto/idea/i_skey.c",
1232    "crypto/info.c",
1233    "crypto/init.c",
1234    "crypto/initthread.c",
1235    "crypto/kdf/kdf_err.c",
1236    "crypto/lhash/lh_stats.c",
1237    "crypto/lhash/lhash.c",
1238    "crypto/md4/md4_dgst.c",
1239    "crypto/md4/md4_one.c",
1240    "crypto/md5/md5_dgst.c",
1241    "crypto/md5/md5_one.c",
1242    "crypto/md5/md5_sha1.c",
1243    "crypto/mdc2/mdc2_one.c",
1244    "crypto/mdc2/mdc2dgst.c",
1245    "crypto/mem.c",
1246    "crypto/mem_sec.c",
1247    "crypto/modes/cbc128.c",
1248    "crypto/modes/ccm128.c",
1249    "crypto/modes/cfb128.c",
1250    "crypto/modes/ctr128.c",
1251    "crypto/modes/cts128.c",
1252    "crypto/modes/gcm128.c",
1253    "crypto/modes/ocb128.c",
1254    "crypto/modes/ofb128.c",
1255    "crypto/modes/siv128.c",
1256    "crypto/modes/wrap128.c",
1257    "crypto/modes/xts128.c",
1258    "crypto/o_dir.c",
1259    "crypto/o_fopen.c",
1260    "crypto/o_init.c",
1261    "crypto/o_str.c",
1262    "crypto/o_time.c",
1263    "crypto/objects/o_names.c",
1264    "crypto/objects/obj_dat.c",
1265    "crypto/objects/obj_err.c",
1266    "crypto/objects/obj_lib.c",
1267    "crypto/objects/obj_xref.c",
1268    "crypto/ocsp/ocsp_asn.c",
1269    "crypto/ocsp/ocsp_cl.c",
1270    "crypto/ocsp/ocsp_err.c",
1271    "crypto/ocsp/ocsp_ext.c",
1272    "crypto/ocsp/ocsp_http.c",
1273    "crypto/ocsp/ocsp_lib.c",
1274    "crypto/ocsp/ocsp_prn.c",
1275    "crypto/ocsp/ocsp_srv.c",
1276    "crypto/ocsp/ocsp_vfy.c",
1277    "crypto/ocsp/v3_ocsp.c",
1278    "crypto/packet.c",
1279    "crypto/param_build.c",
1280    "crypto/param_build_set.c",
1281    "crypto/params.c",
1282    "crypto/params_dup.c",
1283    "crypto/params_from_text.c",
1284    "crypto/passphrase.c",
1285    "crypto/pem/pem_all.c",
1286    "crypto/pem/pem_err.c",
1287    "crypto/pem/pem_info.c",
1288    "crypto/pem/pem_lib.c",
1289    "crypto/pem/pem_oth.c",
1290    "crypto/pem/pem_pk8.c",
1291    "crypto/pem/pem_pkey.c",
1292    "crypto/pem/pem_sign.c",
1293    "crypto/pem/pem_x509.c",
1294    "crypto/pem/pem_xaux.c",
1295    "crypto/pem/pvkfmt.c",
1296    "crypto/pkcs12/p12_add.c",
1297    "crypto/pkcs12/p12_asn.c",
1298    "crypto/pkcs12/p12_attr.c",
1299    "crypto/pkcs12/p12_crpt.c",
1300    "crypto/pkcs12/p12_crt.c",
1301    "crypto/pkcs12/p12_decr.c",
1302    "crypto/pkcs12/p12_init.c",
1303    "crypto/pkcs12/p12_key.c",
1304    "crypto/pkcs12/p12_kiss.c",
1305    "crypto/pkcs12/p12_mutl.c",
1306    "crypto/pkcs12/p12_npas.c",
1307    "crypto/pkcs12/p12_p8d.c",
1308    "crypto/pkcs12/p12_p8e.c",
1309    "crypto/pkcs12/p12_sbag.c",
1310    "crypto/pkcs12/p12_utl.c",
1311    "crypto/pkcs12/pk12err.c",
1312    "crypto/pkcs7/bio_pk7.c",
1313    "crypto/pkcs7/pk7_asn1.c",
1314    "crypto/pkcs7/pk7_attr.c",
1315    "crypto/pkcs7/pk7_doit.c",
1316    "crypto/pkcs7/pk7_lib.c",
1317    "crypto/pkcs7/pk7_mime.c",
1318    "crypto/pkcs7/pk7_smime.c",
1319    "crypto/pkcs7/pkcs7err.c",
1320    "crypto/poly1305/poly1305.c",
1321    "crypto/property/defn_cache.c",
1322    "crypto/property/property.c",
1323    "crypto/property/property_err.c",
1324    "crypto/property/property_parse.c",
1325    "crypto/property/property_query.c",
1326    "crypto/property/property_string.c",
1327    "crypto/provider.c",
1328    "crypto/provider_child.c",
1329    "crypto/provider_conf.c",
1330    "crypto/provider_core.c",
1331    "crypto/provider_predefined.c",
1332    "crypto/punycode.c",
1333    "crypto/rand/prov_seed.c",
1334    "crypto/rand/rand_deprecated.c",
1335    "crypto/rand/rand_err.c",
1336    "crypto/rand/rand_lib.c",
1337    "crypto/rand/rand_meth.c",
1338    "crypto/rand/rand_pool.c",
1339    "crypto/rand/randfile.c",
1340    "crypto/rc2/rc2_cbc.c",
1341    "crypto/rc2/rc2_ecb.c",
1342    "crypto/rc2/rc2_skey.c",
1343    "crypto/rc2/rc2cfb64.c",
1344    "crypto/rc2/rc2ofb64.c",
1345    "crypto/ripemd/rmd_dgst.c",
1346    "crypto/ripemd/rmd_one.c",
1347    "crypto/rsa/rsa_ameth.c",
1348    "crypto/rsa/rsa_asn1.c",
1349    "crypto/rsa/rsa_backend.c",
1350    "crypto/rsa/rsa_chk.c",
1351    "crypto/rsa/rsa_crpt.c",
1352    "crypto/rsa/rsa_depr.c",
1353    "crypto/rsa/rsa_err.c",
1354    "crypto/rsa/rsa_gen.c",
1355    "crypto/rsa/rsa_lib.c",
1356    "crypto/rsa/rsa_meth.c",
1357    "crypto/rsa/rsa_mp.c",
1358    "crypto/rsa/rsa_mp_names.c",
1359    "crypto/rsa/rsa_none.c",
1360    "crypto/rsa/rsa_oaep.c",
1361    "crypto/rsa/rsa_ossl.c",
1362    "crypto/rsa/rsa_pk1.c",
1363    "crypto/rsa/rsa_pmeth.c",
1364    "crypto/rsa/rsa_prn.c",
1365    "crypto/rsa/rsa_pss.c",
1366    "crypto/rsa/rsa_saos.c",
1367    "crypto/rsa/rsa_schemes.c",
1368    "crypto/rsa/rsa_sign.c",
1369    "crypto/rsa/rsa_sp800_56b_check.c",
1370    "crypto/rsa/rsa_sp800_56b_gen.c",
1371    "crypto/rsa/rsa_x931.c",
1372    "crypto/rsa/rsa_x931g.c",
1373    "crypto/seed/seed.c",
1374    "crypto/seed/seed_cbc.c",
1375    "crypto/seed/seed_cfb.c",
1376    "crypto/seed/seed_ecb.c",
1377    "crypto/seed/seed_ofb.c",
1378    "crypto/self_test_core.c",
1379    "crypto/sha/sha1_one.c",
1380    "crypto/sha/sha1dgst.c",
1381    "crypto/sha/sha256.c",
1382    "crypto/sha/sha3.c",
1383    "crypto/sha/sha512.c",
1384    "crypto/siphash/siphash.c",
1385    "crypto/sm2/sm2_crypt.c",
1386    "crypto/sm2/sm2_err.c",
1387    "crypto/sm2/sm2_key.c",
1388    "crypto/sm2/sm2_sign.c",
1389    "crypto/sm3/legacy_sm3.c",
1390    "crypto/sm3/sm3.c",
1391    "crypto/sm4/sm4.c",
1392    "crypto/sparse_array.c",
1393    "crypto/srp/srp_lib.c",
1394    "crypto/srp/srp_vfy.c",
1395    "crypto/stack/stack.c",
1396    "crypto/store/store_err.c",
1397    "crypto/store/store_init.c",
1398    "crypto/store/store_lib.c",
1399    "crypto/store/store_meth.c",
1400    "crypto/store/store_register.c",
1401    "crypto/store/store_result.c",
1402    "crypto/store/store_strings.c",
1403    "crypto/threads_lib.c",
1404    "crypto/threads_none.c",
1405    "crypto/threads_pthread.c",
1406    "crypto/threads_win.c",
1407    "crypto/trace.c",
1408    "crypto/ts/ts_asn1.c",
1409    "crypto/ts/ts_conf.c",
1410    "crypto/ts/ts_err.c",
1411    "crypto/ts/ts_lib.c",
1412    "crypto/ts/ts_req_print.c",
1413    "crypto/ts/ts_req_utils.c",
1414    "crypto/ts/ts_rsp_print.c",
1415    "crypto/ts/ts_rsp_sign.c",
1416    "crypto/ts/ts_rsp_utils.c",
1417    "crypto/ts/ts_rsp_verify.c",
1418    "crypto/ts/ts_verify_ctx.c",
1419    "crypto/txt_db/txt_db.c",
1420    "crypto/ui/ui_err.c",
1421    "crypto/ui/ui_lib.c",
1422    "crypto/ui/ui_null.c",
1423    "crypto/ui/ui_openssl.c",
1424    "crypto/ui/ui_util.c",
1425    "crypto/uid.c",
1426    "crypto/whrlpool/wp_dgst.c",
1427    "crypto/x509/by_dir.c",
1428    "crypto/x509/by_file.c",
1429    "crypto/x509/by_store.c",
1430    "crypto/x509/pcy_cache.c",
1431    "crypto/x509/pcy_data.c",
1432    "crypto/x509/pcy_lib.c",
1433    "crypto/x509/pcy_map.c",
1434    "crypto/x509/pcy_node.c",
1435    "crypto/x509/pcy_tree.c",
1436    "crypto/x509/t_crl.c",
1437    "crypto/x509/t_req.c",
1438    "crypto/x509/t_x509.c",
1439    "crypto/x509/v3_addr.c",
1440    "crypto/x509/v3_admis.c",
1441    "crypto/x509/v3_akeya.c",
1442    "crypto/x509/v3_akid.c",
1443    "crypto/x509/v3_asid.c",
1444    "crypto/x509/v3_bcons.c",
1445    "crypto/x509/v3_bitst.c",
1446    "crypto/x509/v3_conf.c",
1447    "crypto/x509/v3_cpols.c",
1448    "crypto/x509/v3_crld.c",
1449    "crypto/x509/v3_enum.c",
1450    "crypto/x509/v3_extku.c",
1451    "crypto/x509/v3_genn.c",
1452    "crypto/x509/v3_ia5.c",
1453    "crypto/x509/v3_info.c",
1454    "crypto/x509/v3_int.c",
1455    "crypto/x509/v3_ist.c",
1456    "crypto/x509/v3_lib.c",
1457    "crypto/x509/v3_ncons.c",
1458    "crypto/x509/v3_pci.c",
1459    "crypto/x509/v3_pcia.c",
1460    "crypto/x509/v3_pcons.c",
1461    "crypto/x509/v3_pku.c",
1462    "crypto/x509/v3_pmaps.c",
1463    "crypto/x509/v3_prn.c",
1464    "crypto/x509/v3_purp.c",
1465    "crypto/x509/v3_san.c",
1466    "crypto/x509/v3_skid.c",
1467    "crypto/x509/v3_sxnet.c",
1468    "crypto/x509/v3_tlsf.c",
1469    "crypto/x509/v3_utf8.c",
1470    "crypto/x509/v3_utl.c",
1471    "crypto/x509/v3err.c",
1472    "crypto/x509/x509_att.c",
1473    "crypto/x509/x509_cmp.c",
1474    "crypto/x509/x509_d2.c",
1475    "crypto/x509/x509_def.c",
1476    "crypto/x509/x509_err.c",
1477    "crypto/x509/x509_ext.c",
1478    "crypto/x509/x509_lu.c",
1479    "crypto/x509/x509_meth.c",
1480    "crypto/x509/x509_obj.c",
1481    "crypto/x509/x509_r2x.c",
1482    "crypto/x509/x509_req.c",
1483    "crypto/x509/x509_set.c",
1484    "crypto/x509/x509_trust.c",
1485    "crypto/x509/x509_txt.c",
1486    "crypto/x509/x509_v3.c",
1487    "crypto/x509/x509_vfy.c",
1488    "crypto/x509/x509_vpm.c",
1489    "crypto/x509/x509cset.c",
1490    "crypto/x509/x509name.c",
1491    "crypto/x509/x509rset.c",
1492    "crypto/x509/x509spki.c",
1493    "crypto/x509/x509type.c",
1494    "crypto/x509/x_all.c",
1495    "crypto/x509/x_attrib.c",
1496    "crypto/x509/x_crl.c",
1497    "crypto/x509/x_exten.c",
1498    "crypto/x509/x_name.c",
1499    "crypto/x509/x_pubkey.c",
1500    "crypto/x509/x_req.c",
1501    "crypto/x509/x_x509.c",
1502    "crypto/x509/x_x509a.c",
1503    "engines/e_capi.c",
1504    "engines/e_padlock.c",
1505    "providers/baseprov.c",
1506    "providers/defltprov.c",
1507    "providers/legacyprov.c",
1508    "providers/nullprov.c",
1509    "providers/prov_running.c",
1510  ]
1511  sources += libcommon_common_sources
1512  sources += libcommon_build_all_generated_selected_platform_sources
1513  sources += libdefault_common_sources
1514  sources += libdefault_build_all_generated_selected_platform_sources
1515  sources += libcrypto_build_all_generated_selected_platform_sources
1516  sources += liblegacy_sources
1517
1518  if (openssl_selected_platform == "linux-armv4") {
1519    # 升级修改适配检查点21 libcrypto 不同平台c源码列表
1520    sources += [
1521      "crypto/aes/aes_cbc.c",
1522      "crypto/armcap.c",
1523      "crypto/bn/bn_asm.c",
1524      "crypto/camellia/camellia.c",
1525      "crypto/camellia/cmll_cbc.c",
1526      "crypto/rc4/rc4_enc.c",
1527      "crypto/rc4/rc4_skey.c",
1528      "crypto/whrlpool/wp_block.c",
1529      "engines/e_afalg.c",
1530    ]
1531  } else if (openssl_selected_platform == "linux-aarch64") {
1532    # 升级修改适配检查点22 libcrypto 不同平台c源码列表
1533    sources += [
1534      "crypto/aes/aes_cbc.c",
1535      "crypto/aes/aes_core.c",
1536      "crypto/armcap.c",
1537      "crypto/bn/bn_asm.c",
1538      "crypto/camellia/camellia.c",
1539      "crypto/camellia/cmll_cbc.c",
1540      "crypto/rc4/rc4_enc.c",
1541      "crypto/rc4/rc4_skey.c",
1542      "crypto/whrlpool/wp_block.c",
1543      "engines/e_afalg.c",
1544    ]
1545  } else if (openssl_selected_platform == "darwin64-x86_64-cc") {
1546    # 升级修改适配检查点23 libcrypto 不同平台c源码列表
1547    sources += [
1548      "crypto/bn/asm/x86_64-gcc.c",
1549      "crypto/bn/rsaz_exp.c",
1550      "crypto/bn/rsaz_exp_x2.c",
1551    ]
1552  } else if (openssl_selected_platform == "darwin64-arm64-cc") {
1553    # 升级修改适配检查点24 libcrypto 不同平台c源码列表
1554    sources += [
1555      "crypto/aes/aes_cbc.c",
1556      "crypto/aes/aes_core.c",
1557      "crypto/armcap.c",
1558      "crypto/bn/bn_asm.c",
1559      "crypto/camellia/camellia.c",
1560      "crypto/camellia/cmll_cbc.c",
1561      "crypto/rc4/rc4_enc.c",
1562      "crypto/rc4/rc4_skey.c",
1563      "crypto/whrlpool/wp_block.c",
1564    ]
1565  } else if (openssl_selected_platform == "linux-x86_64") {
1566    # 升级修改适配检查点25 libcrypto 不同平台c源码列表
1567    sources += [
1568      "crypto/bn/asm/x86_64-gcc.c",
1569      "crypto/bn/rsaz_exp.c",
1570      "crypto/bn/rsaz_exp_x2.c",
1571      "engines/e_afalg.c",
1572    ]
1573  } else if (openssl_selected_platform == "mingw64") {
1574    # 升级修改适配检查点26 libcrypto 不同平台c源码列表
1575    sources += [
1576      "crypto/bn/asm/x86_64-gcc.c",
1577      "crypto/bn/rsaz_exp.c",
1578      "crypto/bn/rsaz_exp_x2.c",
1579    ]
1580  }
1581
1582  configs = [ ":crypto_config_private" ]
1583  public_configs = [ ":crypto_config_public" ]
1584  deps = [ ":openssl_build_all_generated" ]
1585}
1586
1587ohos_static_library("libcrypto_static") {
1588  if (!compatible_with_legacy_build_system) {
1589    subsystem_name = "thirdparty"
1590    part_name = "openssl"
1591  }
1592  deps = [ ":crypto_source" ]
1593  public_configs = [ ":crypto_config_public" ]
1594  complete_static_lib = true
1595}
1596
1597if (is_mingw || is_mac) {
1598  ohos_shared_library("libcrypto_restool") {
1599    sources = []
1600    configs = []
1601    deps = [ ":crypto_source" ]
1602    if (openssl_selected_platform == "mingw64") {
1603      sources += [ "crypto/dllmain.c" ]
1604      configs += [ ":crypto_config_private" ]
1605    }
1606    if (compatible_with_legacy_build_system) {
1607      subsystem_name = "security"
1608      part_name = "huks"
1609    } else {
1610      subsystem_name = "thirdparty"
1611      part_name = "openssl"
1612    }
1613    public_configs = [ ":crypto_config_public" ]
1614    install_images = [
1615      "system",
1616      "updater",
1617    ]
1618  }
1619}
1620
1621ohos_shared_library("libcrypto_shared") {
1622  sources = []
1623  configs = []
1624  deps = [
1625    ":crypto_source",
1626    ":openssl.cnf",
1627  ]
1628  if (openssl_selected_platform == "mingw64") {
1629    sources += [ "crypto/dllmain.c" ]
1630    configs += [ ":crypto_config_private" ]
1631  }
1632  if (current_os == "ios") {
1633    ldflags = [
1634      "-Wl",
1635      "-install_name",
1636      "@rpath/libcrypto_openssl.framework/libcrypto_openssl",
1637    ]
1638    output_name = "crypto_openssl"
1639  } else {
1640    output_name = "libcrypto_openssl"
1641  }
1642  if (compatible_with_legacy_build_system) {
1643    subsystem_name = "security"
1644    part_name = "huks"
1645  } else {
1646    subsystem_name = "thirdparty"
1647    part_name = "openssl"
1648  }
1649  if (!compatible_with_legacy_build_system) {
1650    innerapi_tags = [
1651      "platformsdk",
1652      "chipsetsdk",
1653    ]
1654  }
1655  public_configs = [ ":crypto_config_public" ]
1656  install_images = [
1657    "system",
1658    "updater",
1659  ]
1660}
1661
1662if (current_os == "ios") {
1663  ohos_combine_darwin_framework("libcrypto_openssl") {
1664    deps = [ ":libcrypto_shared" ]
1665    subsystem_name = "thirdparty"
1666    part_name = "openssl"
1667  }
1668}
1669
1670unused_variables = []
1671unused_variables += unused_variables
1672unused_variables += crypto_config_common_private_include_dirs
1673unused_variables += crypto_config_common_public_include_dirs
1674unused_variables += crypto_config_common_cflags
1675unused_variables += crypto_config_linux_armv4_cflags
1676unused_variables += crypto_config_linux_aarch64_cflags
1677unused_variables += crypto_config_darwin64_x86_64_cc_cflags
1678unused_variables += crypto_config_darwin64_arm64_cc_cflags
1679unused_variables += crypto_config_linux_x86_64_cflags
1680unused_variables += crypto_config_mingw64_cflags
1681unused_variables += libcommon_common_sources
1682unused_variables += libdefault_common_sources
1683unused_variables += libcrypto_build_all_generated_linux_armv4_sources
1684unused_variables += libcrypto_build_all_generated_linux_aarch64_sources
1685unused_variables += libcrypto_build_all_generated_darwin64_x86_64_cc_sources
1686unused_variables += libcrypto_build_all_generated_darwin64_arm64_cc_sources
1687unused_variables += libcrypto_build_all_generated_linux_x86_64_sources
1688unused_variables += libcrypto_build_all_generated_mingw64_sources
1689
1690config("ssl_config_private") {
1691  include_dirs = crypto_config_common_private_include_dirs
1692  cflags = crypto_config_common_cflags + crypto_config_current_platform_cflags +
1693           openssl_internal_cflags
1694}
1695
1696config("ssl_config_public") {
1697  include_dirs = crypto_config_common_public_include_dirs
1698}
1699
1700ohos_source_set("ssl_source") {
1701  if (!compatible_with_legacy_build_system) {
1702    subsystem_name = "thirdparty"
1703    part_name = "openssl"
1704  }
1705
1706  # 升级修改适配检查点27 libssl 源码列表
1707  sources = [
1708    "ssl/bio_ssl.c",
1709    "ssl/d1_lib.c",
1710    "ssl/d1_msg.c",
1711    "ssl/d1_srtp.c",
1712    "ssl/methods.c",
1713    "ssl/pqueue.c",
1714    "ssl/record/dtls1_bitmap.c",
1715    "ssl/record/rec_layer_d1.c",
1716    "ssl/record/rec_layer_s3.c",
1717    "ssl/record/ssl3_buffer.c",
1718    "ssl/record/ssl3_record.c",
1719    "ssl/record/ssl3_record_tls13.c",
1720    "ssl/s3_enc.c",
1721    "ssl/s3_lib.c",
1722    "ssl/s3_msg.c",
1723    "ssl/ssl_asn1.c",
1724    "ssl/ssl_cert.c",
1725    "ssl/ssl_ciph.c",
1726    "ssl/ssl_conf.c",
1727    "ssl/ssl_err.c",
1728    "ssl/ssl_err_legacy.c",
1729    "ssl/ssl_init.c",
1730    "ssl/ssl_lib.c",
1731    "ssl/ssl_mcnf.c",
1732    "ssl/ssl_rsa.c",
1733    "ssl/ssl_rsa_legacy.c",
1734    "ssl/ssl_sess.c",
1735    "ssl/ssl_stat.c",
1736    "ssl/ssl_txt.c",
1737    "ssl/ssl_utst.c",
1738    "ssl/statem/extensions.c",
1739    "ssl/statem/extensions_clnt.c",
1740    "ssl/statem/extensions_cust.c",
1741    "ssl/statem/extensions_srvr.c",
1742    "ssl/statem/statem.c",
1743    "ssl/statem/statem_clnt.c",
1744    "ssl/statem/statem_dtls.c",
1745    "ssl/statem/statem_lib.c",
1746    "ssl/statem/statem_srvr.c",
1747    "ssl/t1_enc.c",
1748    "ssl/t1_lib.c",
1749    "ssl/t1_trce.c",
1750    "ssl/tls13_enc.c",
1751    "ssl/tls_depr.c",
1752    "ssl/tls_srp.c",
1753  ]
1754
1755  configs = [ ":ssl_config_private" ]
1756  public_configs = [ ":ssl_config_public" ]
1757  deps = [ ":openssl_build_all_generated" ]
1758}
1759
1760ohos_static_library("libssl_static") {
1761  if (!compatible_with_legacy_build_system) {
1762    subsystem_name = "thirdparty"
1763    part_name = "openssl"
1764  }
1765  deps = [ ":ssl_source" ]
1766  public_configs = [ ":ssl_config_public" ]
1767  complete_static_lib = true
1768}
1769
1770ohos_shared_library("libssl_shared") {
1771  deps = [
1772    ":libcrypto_shared",
1773    ":openssl.cnf",
1774    ":ssl_source",
1775  ]
1776  if (current_os == "ios") {
1777    ldflags = [
1778      "-Wl",
1779      "-install_name",
1780      "@rpath/libssl_openssl.framework/libssl_openssl",
1781    ]
1782    output_name = "ssl_openssl"
1783  } else {
1784    output_name = "libssl_openssl"
1785  }
1786  if (compatible_with_legacy_build_system) {
1787    subsystem_name = "developtools"
1788    part_name = "profiler"
1789  } else {
1790    subsystem_name = "thirdparty"
1791    part_name = "openssl"
1792  }
1793
1794  if (!compatible_with_legacy_build_system) {
1795    innerapi_tags = [
1796      "platformsdk",
1797      "chipsetsdk",
1798    ]
1799  }
1800  public_configs = [
1801    ":crypto_config_public",
1802    ":ssl_config_public",
1803  ]
1804
1805  install_images = [
1806    "system",
1807
1808    # compile libssl_openssl.z.so to the updater image for wpa to use
1809    "updater",
1810  ]
1811}
1812
1813if (current_os == "ios") {
1814  ohos_combine_darwin_framework("libssl_openssl") {
1815    deps = [ ":libssl_shared" ]
1816    subsystem_name = "thirdparty"
1817    part_name = "openssl"
1818  }
1819}
1820
1821ohos_static_library("libapps") {
1822  # 升级修改适配检查点28 libapps 源码列表
1823  sources = [
1824    "apps/lib/app_libctx.c",
1825    "apps/lib/app_params.c",
1826    "apps/lib/app_provider.c",
1827    "apps/lib/app_rand.c",
1828    "apps/lib/app_x509.c",
1829    "apps/lib/apps.c",
1830    "apps/lib/apps_ui.c",
1831    "apps/lib/columns.c",
1832    "apps/lib/engine.c",
1833    "apps/lib/engine_loader.c",
1834    "apps/lib/fmt.c",
1835    "apps/lib/http_server.c",
1836    "apps/lib/names.c",
1837    "apps/lib/opt.c",
1838    "apps/lib/s_cb.c",
1839    "apps/lib/s_socket.c",
1840    "apps/lib/tlssrp_depr.c",
1841  ]
1842  if (openssl_selected_platform == "mingw64") {
1843    sources += [ "apps/lib/win32_init.c" ]
1844  }
1845  if (!compatible_with_legacy_build_system) {
1846    subsystem_name = "thirdparty"
1847    part_name = "openssl"
1848  }
1849  configs = [ ":crypto_config_private" ]
1850}
1851
1852ohos_executable("openssl") {
1853  # 升级修改适配检查点29 apps/openssl 源码列表
1854  sources = [
1855    "${openssl_selected_platform_full_path}/apps/progs.c",
1856    "apps/asn1parse.c",
1857    "apps/ca.c",
1858    "apps/ciphers.c",
1859    "apps/cmp.c",
1860    "apps/cms.c",
1861    "apps/crl.c",
1862    "apps/crl2pkcs7.c",
1863    "apps/dgst.c",
1864    "apps/dhparam.c",
1865    "apps/dsa.c",
1866    "apps/dsaparam.c",
1867    "apps/ec.c",
1868    "apps/ecparam.c",
1869    "apps/enc.c",
1870    "apps/engine.c",
1871    "apps/errstr.c",
1872    "apps/fipsinstall.c",
1873    "apps/gendsa.c",
1874    "apps/genpkey.c",
1875    "apps/genrsa.c",
1876    "apps/info.c",
1877    "apps/kdf.c",
1878    "apps/lib/cmp_mock_srv.c",
1879    "apps/list.c",
1880    "apps/mac.c",
1881    "apps/nseq.c",
1882    "apps/ocsp.c",
1883    "apps/openssl.c",
1884    "apps/passwd.c",
1885    "apps/pkcs12.c",
1886    "apps/pkcs7.c",
1887    "apps/pkcs8.c",
1888    "apps/pkey.c",
1889    "apps/pkeyparam.c",
1890    "apps/pkeyutl.c",
1891    "apps/prime.c",
1892    "apps/rand.c",
1893    "apps/rehash.c",
1894    "apps/req.c",
1895    "apps/rsa.c",
1896    "apps/rsautl.c",
1897    "apps/s_client.c",
1898    "apps/s_server.c",
1899    "apps/s_time.c",
1900    "apps/sess_id.c",
1901    "apps/smime.c",
1902    "apps/speed.c",
1903    "apps/spkac.c",
1904    "apps/srp.c",
1905    "apps/storeutl.c",
1906    "apps/ts.c",
1907    "apps/verify.c",
1908    "apps/version.c",
1909    "apps/x509.c",
1910  ]
1911  if (openssl_selected_platform == "mingw64") {
1912    sources += [ "${openssl_selected_platform_full_path}/apps/openssl.rc" ]
1913  }
1914  deps = [
1915    ":libapps",
1916    ":libcrypto_shared",
1917    ":libssl_shared",
1918    ":openssl.cnf",
1919    ":openssl_build_all_generated",
1920  ]
1921  if (compatible_with_legacy_build_system) {
1922    subsystem_name = "security"
1923    part_name = "huks"
1924  } else {
1925    subsystem_name = "thirdparty"
1926    part_name = "openssl"
1927  }
1928  configs = [ ":crypto_config_private" ]
1929}
1930# 升级修改适配检查点 汇总
1931#
1932# libcommon =
1933#     libcommon 生成的源码列表(7) +
1934#     libcommon 原目录源码列表(17)
1935#
1936# libdefault =
1937#     libdefault 生成的源码列表(8) +
1938#     libdefault 原目录源码列表(18)
1939#
1940# liblegacy =
1941#     liblegacy 源码列表(19)
1942#
1943# libcrypto =
1944#     libcrypto 不同平台汇编代码(1,2,3,4,5,6) +
1945#     libcrypto 不同平台c源码列表(21,22,23,24,25,26) +
1946#     libcrypto 原目录源码列表(20) +
1947#     libcommon +
1948#     libdefault +
1949#     liblegacy
1950#
1951# libssl =
1952#     libssl 源码列表(27)
1953#
1954# libapps =
1955#     libapps 源码列表(28)
1956#
1957# apps/openssl =
1958#     apps/openssl 源码列表(29) +
1959#     libapps
1960#
1961# 编译选项 =
1962#     内部公共头文件目录列表(9) +
1963#     内部公共编译选项宏列表(10) +
1964#     内部不同平台编译选项列表(11,12,13,14,15,16)
1965