Skip to content

Commit

Permalink
Remove all dead config options from SDK (#17119)
Browse files Browse the repository at this point in the history
* Remove all dead config options from SDK

- All `CHIP_CONFIG_*` that came from OpenWeave and had no current usage
  outside CHIPProjectConfig.h or were always disabled in common code for
  > 1 year and have obviously no use anymore, were removed.

Fixes #17118

* Update src/lib/core/CHIPConfig.h

Co-authored-by: Evgeny Margolis <emargolis@google.com>

* Restyled by clang-format

* Fix missing dependency

Co-authored-by: Evgeny Margolis <emargolis@google.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
3 people authored and pull[bot] committed Apr 13, 2022
1 parent 575d435 commit 2528240
Show file tree
Hide file tree
Showing 59 changed files with 187 additions and 1,436 deletions.
3 changes: 0 additions & 3 deletions config/android/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

// Enable use of an ephemeral UDP source port for locally initiated CHIP exchanges.
#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

// Enable UDP listening on demand in the CHIPDeviceController
#define CHIP_CONFIG_DEVICE_CONTROLLER_DEMAND_ENABLE_UDP 1

Expand Down
3 changes: 0 additions & 3 deletions config/ios/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

// Enable use of an ephemeral UDP source port for locally initiated CHIP exchanges.
#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

// Enable UDP listening on demand in the CHIPDeviceController
#define CHIP_CONFIG_DEVICE_CONTROLLER_DEMAND_ENABLE_UDP 1

Expand Down
3 changes: 0 additions & 3 deletions config/python/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand All @@ -51,7 +49,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
3 changes: 0 additions & 3 deletions config/standalone/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand Down Expand Up @@ -57,7 +55,6 @@
// To build with this flag, pass 'treat_warnings_as_errors=false' to gn/ninja.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
Expand Down
3 changes: 0 additions & 3 deletions examples/chip-tool/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#define CHIP_CONFIG_MAX_FABRICS 17

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand All @@ -53,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
*
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
*
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/ota-requestor-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

// Security and Authentication enabled for release build.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#else // development build

Expand All @@ -42,7 +41,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/persistent-storage/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/pigweed-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

// Security and Authentication always enabled
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#if BUILD_RELEASE // release build
// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

// Security and Authentication always enabled
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#if BUILD_RELEASE // release build
// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds
Expand Down
1 change: 0 additions & 1 deletion examples/shell/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* @def CHIP_CONFIG_ENABLE_SERVER_IM_EVENT
*
Expand Down
1 change: 0 additions & 1 deletion examples/shell/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/window-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 1 addition & 0 deletions src/credentials/CHIPCert.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class ChipDN
**/
bool IsEmpty() const { return RDNCount() == 0; }

static_assert((CHIP_CONFIG_CERT_MAX_RDN_ATTRIBUTES) >= 5, "Spec requires at least 5 RDN to be supported per Matter TLV cert");
ChipRDN rdn[CHIP_CONFIG_CERT_MAX_RDN_ATTRIBUTES];

uint8_t RDNCount() const;
Expand Down
1 change: 0 additions & 1 deletion src/lib/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ source_set("chip_config_header") {
sources = [
"CHIPConfig.h",
"CHIPEventLoggingConfig.h",
"CHIPTimeConfig.h",
]

public_configs = [ "${chip_root}/src:includes" ]
Expand Down
Loading

0 comments on commit 2528240

Please sign in to comment.