Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
| 2 | # |
| 3 | # Copyright (c) 2024 Linaro Limited |
| 4 | # Author: Raymond Mao <raymond.mao@linaro.org> |
| 5 | |
| 6 | MBEDTLS_LIB_DIR = external/mbedtls/library |
| 7 | |
Raymond Mao | f51f355 | 2024-10-03 14:50:19 -0700 | [diff] [blame] | 8 | # shim layer for hash |
| 9 | obj-$(CONFIG_$(SPL_)MD5_MBEDTLS) += md5.o |
| 10 | obj-$(CONFIG_$(SPL_)SHA1_MBEDTLS) += sha1.o |
| 11 | obj-$(CONFIG_$(SPL_)SHA256_MBEDTLS) += sha256.o |
| 12 | obj-$(CONFIG_$(SPL_)SHA512_MBEDTLS) += sha512.o |
| 13 | |
Raymond Mao | 702817b | 2024-10-03 14:50:28 -0700 | [diff] [blame] | 14 | # x509 libraries |
| 15 | obj-$(CONFIG_$(SPL_)ASYMMETRIC_PUBLIC_KEY_MBEDTLS) += \ |
| 16 | public_key.o |
Raymond Mao | 7deec0f | 2024-10-03 14:50:30 -0700 | [diff] [blame] | 17 | obj-$(CONFIG_$(SPL_)X509_CERTIFICATE_PARSER_MBEDTLS) += \ |
| 18 | x509_cert_parser.o |
Raymond Mao | 7b3dfd0 | 2024-10-03 14:50:32 -0700 | [diff] [blame] | 19 | obj-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER_MBEDTLS) += pkcs7_parser.o |
Raymond Mao | cd17ac2 | 2024-10-03 14:50:34 -0700 | [diff] [blame] | 20 | obj-$(CONFIG_$(SPL_)MSCODE_PARSER_MBEDTLS) += mscode_parser.o |
Raymond Mao | 42948e8 | 2024-10-03 14:50:36 -0700 | [diff] [blame] | 21 | obj-$(CONFIG_$(SPL_)RSA_PUBLIC_KEY_PARSER_MBEDTLS) += rsa_helper.o |
Raymond Mao | 702817b | 2024-10-03 14:50:28 -0700 | [diff] [blame] | 22 | |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 23 | # MbedTLS crypto library |
| 24 | obj-$(CONFIG_MBEDTLS_LIB) += mbedtls_lib_crypto.o |
| 25 | mbedtls_lib_crypto-y := \ |
| 26 | $(MBEDTLS_LIB_DIR)/platform_util.o \ |
| 27 | $(MBEDTLS_LIB_DIR)/constant_time.o \ |
| 28 | $(MBEDTLS_LIB_DIR)/md.o |
Ilias Apalodimas | 9f75dc1 | 2024-11-10 10:28:37 +0200 | [diff] [blame] | 29 | |
Raymond Mao | f51f355 | 2024-10-03 14:50:19 -0700 | [diff] [blame] | 30 | mbedtls_lib_crypto-$(CONFIG_$(SPL_)MD5_MBEDTLS) += $(MBEDTLS_LIB_DIR)/md5.o |
| 31 | mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA1_MBEDTLS) += $(MBEDTLS_LIB_DIR)/sha1.o |
| 32 | mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA256_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 33 | $(MBEDTLS_LIB_DIR)/sha256.o |
Raymond Mao | f51f355 | 2024-10-03 14:50:19 -0700 | [diff] [blame] | 34 | mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA512_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 35 | $(MBEDTLS_LIB_DIR)/sha512.o |
| 36 | |
| 37 | # MbedTLS X509 library |
| 38 | obj-$(CONFIG_MBEDTLS_LIB_X509) += mbedtls_lib_x509.o |
| 39 | mbedtls_lib_x509-y := $(MBEDTLS_LIB_DIR)/x509.o |
Raymond Mao | 2faa4bd | 2024-10-03 14:50:38 -0700 | [diff] [blame] | 40 | mbedtls_lib_x509-$(CONFIG_$(SPL_)ASN1_DECODER_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 41 | $(MBEDTLS_LIB_DIR)/asn1parse.o \ |
| 42 | $(MBEDTLS_LIB_DIR)/asn1write.o \ |
| 43 | $(MBEDTLS_LIB_DIR)/oid.o |
Raymond Mao | 42948e8 | 2024-10-03 14:50:36 -0700 | [diff] [blame] | 44 | mbedtls_lib_x509-$(CONFIG_$(SPL_)RSA_PUBLIC_KEY_PARSER_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 45 | $(MBEDTLS_LIB_DIR)/bignum.o \ |
| 46 | $(MBEDTLS_LIB_DIR)/bignum_core.o \ |
| 47 | $(MBEDTLS_LIB_DIR)/rsa.o \ |
| 48 | $(MBEDTLS_LIB_DIR)/rsa_alt_helpers.o |
Raymond Mao | 702817b | 2024-10-03 14:50:28 -0700 | [diff] [blame] | 49 | mbedtls_lib_x509-$(CONFIG_$(SPL_)ASYMMETRIC_PUBLIC_KEY_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 50 | $(MBEDTLS_LIB_DIR)/pk.o \ |
| 51 | $(MBEDTLS_LIB_DIR)/pk_wrap.o \ |
| 52 | $(MBEDTLS_LIB_DIR)/pkparse.o |
Raymond Mao | 7deec0f | 2024-10-03 14:50:30 -0700 | [diff] [blame] | 53 | mbedtls_lib_x509-$(CONFIG_$(SPL_)X509_CERTIFICATE_PARSER_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 54 | $(MBEDTLS_LIB_DIR)/x509_crl.o \ |
| 55 | $(MBEDTLS_LIB_DIR)/x509_crt.o |
Raymond Mao | 7b3dfd0 | 2024-10-03 14:50:32 -0700 | [diff] [blame] | 56 | mbedtls_lib_x509-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER_MBEDTLS) += \ |
Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 57 | $(MBEDTLS_LIB_DIR)/pkcs7.o |
Ilias Apalodimas | 9f75dc1 | 2024-11-10 10:28:37 +0200 | [diff] [blame] | 58 | |
| 59 | #mbedTLS TLS support |
| 60 | obj-$(CONFIG_MBEDTLS_LIB_TLS) += mbedtls_lib_tls.o |
| 61 | mbedtls_lib_tls-y := \ |
| 62 | $(MBEDTLS_LIB_DIR)/mps_reader.o \ |
| 63 | $(MBEDTLS_LIB_DIR)/mps_trace.o \ |
| 64 | $(MBEDTLS_LIB_DIR)/net_sockets.o \ |
| 65 | $(MBEDTLS_LIB_DIR)/pk_ecc.o \ |
| 66 | $(MBEDTLS_LIB_DIR)/ssl_cache.o \ |
| 67 | $(MBEDTLS_LIB_DIR)/ssl_ciphersuites.o \ |
| 68 | $(MBEDTLS_LIB_DIR)/ssl_client.o \ |
| 69 | $(MBEDTLS_LIB_DIR)/ssl_cookie.o \ |
| 70 | $(MBEDTLS_LIB_DIR)/ssl_debug_helpers_generated.o \ |
| 71 | $(MBEDTLS_LIB_DIR)/ssl_msg.o \ |
| 72 | $(MBEDTLS_LIB_DIR)/ssl_ticket.o \ |
| 73 | $(MBEDTLS_LIB_DIR)/ssl_tls.o \ |
| 74 | $(MBEDTLS_LIB_DIR)/ssl_tls12_client.o \ |
| 75 | $(MBEDTLS_LIB_DIR)/hmac_drbg.o \ |
| 76 | $(MBEDTLS_LIB_DIR)/ctr_drbg.o \ |
| 77 | $(MBEDTLS_LIB_DIR)/entropy.o \ |
| 78 | $(MBEDTLS_LIB_DIR)/entropy_poll.o \ |
| 79 | $(MBEDTLS_LIB_DIR)/aes.o \ |
| 80 | $(MBEDTLS_LIB_DIR)/cipher.o \ |
| 81 | $(MBEDTLS_LIB_DIR)/cipher_wrap.o \ |
| 82 | $(MBEDTLS_LIB_DIR)/ecdh.o \ |
| 83 | $(MBEDTLS_LIB_DIR)/ecdsa.o \ |
| 84 | $(MBEDTLS_LIB_DIR)/ecp.o \ |
| 85 | $(MBEDTLS_LIB_DIR)/ecp_curves.o \ |
| 86 | $(MBEDTLS_LIB_DIR)/ecp_curves_new.o \ |
| 87 | $(MBEDTLS_LIB_DIR)/gcm.o \ |