diff --git a/config/ameba/args.gni b/config/ameba/args.gni index d4a64c2f4ac6d9..3be47a85291024 100755 --- a/config/ameba/args.gni +++ b/config/ameba/args.gni @@ -15,9 +15,7 @@ # Options from standalone-chip.mk that differ from configure defaults. These # options are used from examples/. -import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") -import("${chip_root}/src/crypto/crypto.gni") chip_device_platform = "ameba" @@ -25,10 +23,7 @@ chip_project_config_include = "" chip_system_project_config_include = "" chip_ble_project_config_include = "" -if (chip_crypto == "") { - mbedtls_target = "//mbedtls:mbedtls" -} - +mbedtls_target = "//mbedtls:mbedtls" lwip_platform = "external" chip_build_tests = false diff --git a/src/platform/Ameba/BUILD.gn b/src/platform/Ameba/BUILD.gn index 811055bd90906d..9e06191ae667ca 100755 --- a/src/platform/Ameba/BUILD.gn +++ b/src/platform/Ameba/BUILD.gn @@ -14,8 +14,8 @@ import("//build_overrides/chip.gni") -import("${chip_root}/src/crypto/crypto.gni") import("${chip_root}/src/platform/device.gni") + assert(chip_device_platform == "ameba") static_library("Ameba") { @@ -50,6 +50,8 @@ static_library("Ameba") { "SoftwareUpdateManagerImpl.h", "SystemTimeSupport.cpp", "SystemTimeSupport.h", + "crypto/AmebaPersistentStorageOperationalKeystore.cpp", + "crypto/AmebaPersistentStorageOperationalKeystore.h", ] deps = [ @@ -71,14 +73,4 @@ static_library("Ameba") { "AmebaOTAImageProcessor.h", ] } - - if (chip_crypto == "platform") { - sources += [ - "${chip_root}/src/crypto/CHIPCryptoPALmbedTLS.cpp", - "${chip_root}/src/crypto/CHIPCryptoPALmbedTLS.h", - "${chip_root}/src/crypto/CHIPCryptoPALmbedTLSCert.cpp", - "crypto/AmebaPersistentStorageOperationalKeystore.cpp", - "crypto/AmebaPersistentStorageOperationalKeystore.h", - ] - } } diff --git a/src/platform/Ameba/args.gni b/src/platform/Ameba/args.gni index 82dbccebaf5bc5..bcda3812b8d781 100755 --- a/src/platform/Ameba/args.gni +++ b/src/platform/Ameba/args.gni @@ -13,15 +13,11 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("${chip_root}/src/crypto/crypto.gni") chip_device_platform = "ameba" lwip_platform = "external" - -if (chip_crypto == "") { - mbedtls_target = "//mbedtls:mbedtls" -} +mbedtls_target = "//mbedtls:mbedtls" chip_build_tests = false chip_inet_config_enable_tun_endpoint = false diff --git a/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.cpp b/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.cpp index e33806418191d1..73358f77ea4af0 100644 --- a/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.cpp +++ b/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#if CONFIG_ENABLE_AMEBA_CRYPTO #include #include #include @@ -441,3 +442,5 @@ CHIP_ERROR AmebaPersistentStorageOperationalKeystore::MigrateOpKeypairForFabric( } } // namespace chip + +#endif /* CONFIG_ENABLE_AMEBA_CRYPTO */ diff --git a/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h b/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h index 425f654c68ae01..4969e0677764c9 100644 --- a/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h +++ b/src/platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h @@ -17,6 +17,7 @@ #pragma once +#if CONFIG_ENABLE_AMEBA_CRYPTO #include #include #include @@ -142,3 +143,4 @@ class AmebaPersistentStorageOperationalKeystore : public Crypto::OperationalKeys }; } // namespace chip +#endif /* CONFIG_ENABLE_AMEBA_CRYPTO */