From 1593300410b5be4ad9bd7603666bcf5b5d2756b4 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 28 Jan 2022 08:14:51 -0800 Subject: [PATCH] Cleanup unused code (#14436) --- src/include/platform/AttributeList.h | 1 - src/include/platform/GeneralFaults.h | 1 - src/lib/core/CHIPConfig.h | 54 ------------------- src/platform/Ameba/CHIPPlatformConfig.h | 3 -- src/platform/Darwin/CHIPPlatformConfig.h | 3 -- src/platform/EFR32/CHIPPlatformConfig.h | 3 -- src/platform/ESP32/CHIPPlatformConfig.h | 3 -- src/platform/Linux/CHIPPlatformConfig.h | 3 -- src/platform/P6/CHIPPlatformConfig.h | 3 -- src/platform/Tizen/CHIPPlatformConfig.h | 3 -- src/platform/android/CHIPPlatformConfig.h | 3 -- src/platform/cc13x2_26x2/CHIPPlatformConfig.h | 4 -- src/platform/mbed/CHIPPlatformConfig.h | 3 -- src/platform/nrfconnect/CHIPPlatformConfig.h | 3 -- .../nxp/k32w/k32w0/CHIPPlatformConfig.h | 3 -- src/platform/qpg/CHIPPlatformConfig.h | 3 -- src/platform/telink/CHIPPlatformConfig.h | 3 -- 17 files changed, 99 deletions(-) diff --git a/src/include/platform/AttributeList.h b/src/include/platform/AttributeList.h index 75bc34089c2ad8..07f9550c8aedca 100644 --- a/src/include/platform/AttributeList.h +++ b/src/include/platform/AttributeList.h @@ -46,7 +46,6 @@ class AttributeList int mIndex = -1; }; -public: AttributeList() = default; ~AttributeList() { mSize = 0; } diff --git a/src/include/platform/GeneralFaults.h b/src/include/platform/GeneralFaults.h index 82bf3bbdac795b..9994449e122416 100644 --- a/src/include/platform/GeneralFaults.h +++ b/src/include/platform/GeneralFaults.h @@ -49,7 +49,6 @@ class GeneralFaults int mIndex = -1; }; -public: GeneralFaults() = default; ~GeneralFaults() { mSize = 0; } diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 1ab3713963e480..061307b5b143f9 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -72,41 +72,6 @@ #include CHIP_PLATFORM_CONFIG_INCLUDE #endif -// Profile-specific Configuration Headers - -/** - * @def CHIP_CONFIG_USE_OPENSSL_ECC - * - * @brief - * Use the OpenSSL implementation of the elliptic curve primitives - * for chip communication. - * - * Note that this option is mutually exclusive with - * #CHIP_CONFIG_USE_MICRO_ECC. - */ -#ifndef CHIP_CONFIG_USE_OPENSSL_ECC -#define CHIP_CONFIG_USE_OPENSSL_ECC 1 -#endif // CHIP_CONFIG_USE_OPENSSL_ECC - -/** - * @def CHIP_CONFIG_USE_MICRO_ECC - * - * @brief - * Use the Micro ECC implementation of the elliptic curve primitives - * for chip communication. - * - * Note that this option is mutually exclusive with - * #CHIP_CONFIG_USE_OPENSSL_ECC. - * - */ -#ifndef CHIP_CONFIG_USE_MICRO_ECC -#define CHIP_CONFIG_USE_MICRO_ECC 0 -#endif // CHIP_CONFIG_USE_MICRO_ECC - -#if CHIP_CONFIG_USE_MICRO_ECC && CHIP_CONFIG_USE_OPENSSL_ECC -#error "Please assert one of either CHIP_CONFIG_USE_MICRO_ECC or CHIP_CONFIG_USE_OPENSSL_ECC, but not both." -#endif // CHIP_CONFIG_USE_MICRO_ECC && CHIP_CONFIG_USE_OPENSSL_ECC - /** * @name chip Elliptic Curve Security Configuration * @@ -328,25 +293,6 @@ #error "Please assert CHIP_CONFIG_SUPPORT_ELLIPTIC_CURVE_SECP256R1 when CHIP_CONFIG_SUPPORT_PASE_CONFIG5 is asserted" #endif // CHIP_CONFIG_SUPPORT_PASE_CONFIG5 && !CHIP_CONFIG_SUPPORT_ELLIPTIC_CURVE_SECP256R1 -/** - * @def CHIP_CONFIG_PASE_MESSAGE_PAYLOAD_ALIGNMENT - * - * @brief - * Align payload on 4-byte boundary for PASE messages. - * Currently, payload alignment is required only when micro-ecc - * library is used and it is compiled with ARM assembly. - * If implementation guarantees that payload is always 4-byte - * aligned this option should stay deasserted to save code size. - * - */ -#ifndef CHIP_CONFIG_PASE_MESSAGE_PAYLOAD_ALIGNMENT -#if CHIP_CONFIG_USE_MICRO_ECC -#define CHIP_CONFIG_PASE_MESSAGE_PAYLOAD_ALIGNMENT 1 -#else -#define CHIP_CONFIG_PASE_MESSAGE_PAYLOAD_ALIGNMENT 0 -#endif // CHIP_CONFIG_USE_MICRO_ECC -#endif // CHIP_CONFIG_PASE_MESSAGE_PAYLOAD_ALIGNMENT - /** * @def CHIP_CONFIG_PASE_RATE_LIMITER_TIMEOUT * diff --git a/src/platform/Ameba/CHIPPlatformConfig.h b/src/platform/Ameba/CHIPPlatformConfig.h index c4702c67fac9d9..ce998b6abf3c54 100644 --- a/src/platform/Ameba/CHIPPlatformConfig.h +++ b/src/platform/Ameba/CHIPPlatformConfig.h @@ -44,9 +44,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 diff --git a/src/platform/Darwin/CHIPPlatformConfig.h b/src/platform/Darwin/CHIPPlatformConfig.h index 5ced752436a19d..ecb10eeb94e614 100644 --- a/src/platform/Darwin/CHIPPlatformConfig.h +++ b/src/platform/Darwin/CHIPPlatformConfig.h @@ -41,9 +41,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/EFR32/CHIPPlatformConfig.h b/src/platform/EFR32/CHIPPlatformConfig.h index 11fb925012f204..c36b1f6ca208b1 100644 --- a/src/platform/EFR32/CHIPPlatformConfig.h +++ b/src/platform/EFR32/CHIPPlatformConfig.h @@ -42,9 +42,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/ESP32/CHIPPlatformConfig.h b/src/platform/ESP32/CHIPPlatformConfig.h index 5c4232e0281dec..a55aa4aefb39a0 100644 --- a/src/platform/ESP32/CHIPPlatformConfig.h +++ b/src/platform/ESP32/CHIPPlatformConfig.h @@ -49,9 +49,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 diff --git a/src/platform/Linux/CHIPPlatformConfig.h b/src/platform/Linux/CHIPPlatformConfig.h index 3dc45ac9bcdf09..2151db75cc857e 100644 --- a/src/platform/Linux/CHIPPlatformConfig.h +++ b/src/platform/Linux/CHIPPlatformConfig.h @@ -45,9 +45,6 @@ using CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE = const char *; // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/P6/CHIPPlatformConfig.h b/src/platform/P6/CHIPPlatformConfig.h index 59f48dc144d61e..d0991c5c83cd0e 100644 --- a/src/platform/P6/CHIPPlatformConfig.h +++ b/src/platform/P6/CHIPPlatformConfig.h @@ -52,9 +52,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 diff --git a/src/platform/Tizen/CHIPPlatformConfig.h b/src/platform/Tizen/CHIPPlatformConfig.h index 796ef5369784d5..de93cf7cee0fad 100644 --- a/src/platform/Tizen/CHIPPlatformConfig.h +++ b/src/platform/Tizen/CHIPPlatformConfig.h @@ -35,9 +35,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/android/CHIPPlatformConfig.h b/src/platform/android/CHIPPlatformConfig.h index 3be5f4a7aa308d..43c7d244982226 100644 --- a/src/platform/android/CHIPPlatformConfig.h +++ b/src/platform/android/CHIPPlatformConfig.h @@ -43,9 +43,6 @@ using CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE = const char *; // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h index 674bd48d6401d0..3c8935a414883b 100644 --- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h @@ -42,10 +42,6 @@ // ==================== Security Adaptations ==================== #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY 2 -// This platform uses mbedtls, but these defines don't seem to be used in source -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 1 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 1 diff --git a/src/platform/mbed/CHIPPlatformConfig.h b/src/platform/mbed/CHIPPlatformConfig.h index ad40d27b6955bc..f6d9e5e0eafc37 100644 --- a/src/platform/mbed/CHIPPlatformConfig.h +++ b/src/platform/mbed/CHIPPlatformConfig.h @@ -41,9 +41,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index fb0446cb4557e8..d78a44be15ce8f 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -38,9 +38,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/nxp/k32w/k32w0/CHIPPlatformConfig.h b/src/platform/nxp/k32w/k32w0/CHIPPlatformConfig.h index ce299ce535152a..2e09e277a78927 100644 --- a/src/platform/nxp/k32w/k32w0/CHIPPlatformConfig.h +++ b/src/platform/nxp/k32w/k32w0/CHIPPlatformConfig.h @@ -49,9 +49,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/qpg/CHIPPlatformConfig.h b/src/platform/qpg/CHIPPlatformConfig.h index 32c53f2b1bcc66..920a1e3bf46ce7 100644 --- a/src/platform/qpg/CHIPPlatformConfig.h +++ b/src/platform/qpg/CHIPPlatformConfig.h @@ -43,9 +43,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 1 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0 diff --git a/src/platform/telink/CHIPPlatformConfig.h b/src/platform/telink/CHIPPlatformConfig.h index 4b095a0babd78e..156d3c23d6235f 100644 --- a/src/platform/telink/CHIPPlatformConfig.h +++ b/src/platform/telink/CHIPPlatformConfig.h @@ -37,9 +37,6 @@ // ==================== Security Adaptations ==================== -#define CHIP_CONFIG_USE_OPENSSL_ECC 0 -#define CHIP_CONFIG_USE_MICRO_ECC 0 - #define CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MINCRYPT 1 #define CHIP_CONFIG_HASH_IMPLEMENTATION_MBEDTLS 0