• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without modification,
4# are permitted provided that the following conditions are met:
5#
6# 1. Redistributions of source code must retain the above copyright notice, this list of
7#    conditions and the following disclaimer.
8#
9# 2. Redistributions in binary form must reproduce the above copyright notice, this list
10#    of conditions and the following disclaimer in the documentation and/or other materials
11#    provided with the distribution.
12#
13# 3. Neither the name of the copyright holder nor the names of its contributors may be used
14#    to endorse or promote products derived from this software without specific prior written
15#    permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29MBEDTLSDIR = "//third_party/mbedtls/"
30KERNELDIR = "//kernel/liteos_m/"
31
32defines = []
33declare_args() {
34  # custom compile flag for bestechnic
35  ohos_security_huks_mbedtls_porting_path = ""
36}
37
38LIBRARYFILES = [
39  "$MBEDTLSDIR/library/aes.c",
40  "$MBEDTLSDIR/library/aesni.c",
41  "$MBEDTLSDIR/library/aesce.c",
42  "$MBEDTLSDIR/library/alignment.c",
43  "$MBEDTLSDIR/library/aria.c",
44  "$MBEDTLSDIR/library/asn1parse.c",
45  "$MBEDTLSDIR/library/asn1write.c",
46  "$MBEDTLSDIR/library/base64.c",
47  "$MBEDTLSDIR/library/bignum.c",
48  "$MBEDTLSDIR/library/bignum_core.c",
49  "$MBEDTLSDIR/library/camellia.c",
50  "$MBEDTLSDIR/library/ccm.c",
51  "$MBEDTLSDIR/library/chacha20.c",
52  "$MBEDTLSDIR/library/chachapoly.c",
53  "$MBEDTLSDIR/library/cipher.c",
54  "$MBEDTLSDIR/library/cipher_wrap.c",
55  "$MBEDTLSDIR/library/cmac.c",
56  "$MBEDTLSDIR/library/common.c",
57  "$MBEDTLSDIR/library/constant_time.c",
58  "$MBEDTLSDIR/library/ctr_drbg.c",
59  "$MBEDTLSDIR/library/des.c",
60  "$MBEDTLSDIR/library/dhm.c",
61  "$MBEDTLSDIR/library/ecdh.c",
62  "$MBEDTLSDIR/library/ecdsa.c",
63  "$MBEDTLSDIR/library/ecjpake.c",
64  "$MBEDTLSDIR/library/ecp.c",
65  "$MBEDTLSDIR/library/ecp_curves.c",
66  "$MBEDTLSDIR/library/entropy.c",
67  "$MBEDTLSDIR/library/entropy_poll.c",
68  "$MBEDTLSDIR/library/error.c",
69  "$MBEDTLSDIR/library/gcm.c",
70  "$MBEDTLSDIR/library/hash_info.c",
71  "$MBEDTLSDIR/library/hkdf.c",
72  "$MBEDTLSDIR/library/hmac_drbg.c",
73  "$MBEDTLSDIR/library/md.c",
74  "$MBEDTLSDIR/library/md5.c",
75  "$MBEDTLSDIR/library/memory_buffer_alloc.c",
76  "$MBEDTLSDIR/library/mps_reader.c",
77  "$MBEDTLSDIR/library/mps_trace.c",
78  "$MBEDTLSDIR/library/net_sockets.c",
79  "$MBEDTLSDIR/library/nist_kw.c",
80  "$MBEDTLSDIR/library/oid.c",
81  "$MBEDTLSDIR/library/padlock.c",
82  "$MBEDTLSDIR/library/pem.c",
83  "$MBEDTLSDIR/library/pk.c",
84  "$MBEDTLSDIR/library/pk_wrap.c",
85  "$MBEDTLSDIR/library/pkcs12.c",
86  "$MBEDTLSDIR/library/pkcs5.c",
87  "$MBEDTLSDIR/library/pkparse.c",
88  "$MBEDTLSDIR/library/pkwrite.c",
89  "$MBEDTLSDIR/library/platform.c",
90  "$MBEDTLSDIR/library/platform_util.c",
91  "$MBEDTLSDIR/library/poly1305.c",
92  "$MBEDTLSDIR/library/psa_crypto.c",
93  "$MBEDTLSDIR/library/psa_crypto_aead.c",
94  "$MBEDTLSDIR/library/psa_crypto_cipher.c",
95  "$MBEDTLSDIR/library/psa_crypto_client.c",
96  "$MBEDTLSDIR/library/psa_crypto_driver_wrappers.c",
97  "$MBEDTLSDIR/library/psa_crypto_ecp.c",
98  "$MBEDTLSDIR/library/psa_crypto_hash.c",
99  "$MBEDTLSDIR/library/psa_crypto_mac.c",
100  "$MBEDTLSDIR/library/psa_crypto_pake.c",
101  "$MBEDTLSDIR/library/psa_crypto_rsa.c",
102  "$MBEDTLSDIR/library/psa_crypto_se.c",
103  "$MBEDTLSDIR/library/psa_its_file.c",
104  "$MBEDTLSDIR/library/psa_crypto_storage.c",
105  "$MBEDTLSDIR/library/psa_crypto_slot_management.c",
106  "$MBEDTLSDIR/library/psa_util.c",
107  "$MBEDTLSDIR/library/ripemd160.c",
108  "$MBEDTLSDIR/library/rsa.c",
109  "$MBEDTLSDIR/library/rsa_alt_helpers.c",
110  "$MBEDTLSDIR/library/sha1.c",
111  "$MBEDTLSDIR/library/sha256.c",
112  "$MBEDTLSDIR/library/sha512.c",
113  "$MBEDTLSDIR/library/ssl_ciphersuites.c",
114  "$MBEDTLSDIR/library/ssl_client.c",
115  "$MBEDTLSDIR/library/ssl_tls12_client.c",
116  "$MBEDTLSDIR/library/ssl_msg.c",
117  "$MBEDTLSDIR/library/ssl_tls.c",
118  "$MBEDTLSDIR/library/ssl_tls13_client.c",
119  "$MBEDTLSDIR/library/ssl_tls13_generic.c",
120  "$MBEDTLSDIR/library/ssl_tls13_keys.c",
121  "$MBEDTLSDIR/library/ssl_tls13_server.c",
122  "$MBEDTLSDIR/library/threading.c",
123  "$MBEDTLSDIR/library/timing.c",
124  "$MBEDTLSDIR/library/version.c",
125  "$MBEDTLSDIR/library/version_features.c",
126  "$MBEDTLSDIR/library/x509.c",
127  "$MBEDTLSDIR/library/x509_crl.c",
128  "$MBEDTLSDIR/library/x509_crt.c",
129]
130
131# MBEDTLS_SOURCES: All MBEDTLS files
132MBEDTLS_SOURCES = LIBRARYFILES
133
134MBEDTLS_INLCUDE_DIRS = [
135  "$MBEDTLSDIR/include",
136  "$MBEDTLSDIR/library",
137  "$MBEDTLSDIR/include/mbedtls",
138  "$MBEDTLSDIR/tests/include",
139]
140
141if (defined(ohos_lite)) {
142  MBEDTLS_SOURCES += [
143    "$MBEDTLSDIR/library/ssl_tls12_server.c",
144    "$MBEDTLSDIR/port/src/tls_client.c",
145    "$MBEDTLSDIR/port/src/tls_certificate.c",
146  ]
147
148  MBEDTLS_INLCUDE_DIRS += [ "$MBEDTLSDIR/port/include" ]
149}
150
151if (product_name == "generic_m55_arm_32_bes_aurora_wear_mini_application") {
152  MBEDTLS_INLCUDE_DIRS += [ "$MBEDTLSDIR/port/config/compat_lwip" ]
153} else if (product_name ==
154           "generic_m55_arm_32_bes_phoinix_wear_mini_application") {
155  MBEDTLS_INLCUDE_DIRS += [ "$MBEDTLSDIR/port/config/compat_lwip" ]
156} else {
157  MBEDTLS_INLCUDE_DIRS += [ "$MBEDTLSDIR/port/config/compat_posix" ]
158}
159