Skip to content

Commit

Permalink
Inject only customized operational key storage
Browse files Browse the repository at this point in the history
* Remove the use of chip_crypto = platform, instead keep it as mbedtls, and only inject customized operaional key storage
  • Loading branch information
pankore committed May 1, 2024
1 parent fdf6c52 commit a2d0ca4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
7 changes: 1 addition & 6 deletions config/ameba/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@
# 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"

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
Expand Down
14 changes: 3 additions & 11 deletions src/platform/Ameba/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -50,6 +50,8 @@ static_library("Ameba") {
"SoftwareUpdateManagerImpl.h",
"SystemTimeSupport.cpp",
"SystemTimeSupport.h",
"crypto/AmebaPersistentStorageOperationalKeystore.cpp",
"crypto/AmebaPersistentStorageOperationalKeystore.h",
]

deps = [
Expand All @@ -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",
]
}
}
6 changes: 1 addition & 5 deletions src/platform/Ameba/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

#if CONFIG_ENABLE_AMEBA_CRYPTO
#include <crypto/CHIPCryptoPAL.h>
#include <crypto/CHIPCryptoPALmbedTLS.h>
#include <crypto/OperationalKeystore.h>
Expand Down Expand Up @@ -441,3 +442,5 @@ CHIP_ERROR AmebaPersistentStorageOperationalKeystore::MigrateOpKeypairForFabric(
}

} // namespace chip

#endif /* CONFIG_ENABLE_AMEBA_CRYPTO */
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once

#if CONFIG_ENABLE_AMEBA_CRYPTO
#include <crypto/OperationalKeystore.h>
#include <crypto/PersistentStorageOperationalKeystore.h>
#include <lib/core/CHIPError.h>
Expand Down Expand Up @@ -142,3 +143,4 @@ class AmebaPersistentStorageOperationalKeystore : public Crypto::OperationalKeys
};

} // namespace chip
#endif /* CONFIG_ENABLE_AMEBA_CRYPTO */

0 comments on commit a2d0ca4

Please sign in to comment.