Skip to content

Commit 3094941

Browse files
turonpull[bot]
authored andcommitted
[build] Fix SECURITY_TEST_MODE to be disabled for all builds. Warn/fail builds with it enabled. (#12166)
1 parent 54d0102 commit 3094941

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

config/standalone/CHIPProjectConfig.h

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
// WARNING: These options make it possible to circumvent basic Chip security functionality,
5454
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
5555
//
56+
// To build with this flag, pass 'treat_warnings_as_errors=false' to gn/ninja.
57+
//
5658
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
5759
#define CHIP_CONFIG_REQUIRE_AUTH 1
5860

examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// authentication in various protocols.
4242
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
4343
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
44-
#define CHIP_CONFIG_SECURITY_TEST_MODE 1
44+
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
4545
#define CHIP_CONFIG_REQUIRE_AUTH 0
4646

4747
// Use a default pairing code if one hasn't been provisioned in flash.

examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// authentication in various protocols.
4242
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
4343
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
44-
#define CHIP_CONFIG_SECURITY_TEST_MODE 1
44+
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
4545
#define CHIP_CONFIG_REQUIRE_AUTH 0
4646

4747
// Use a default pairing code if one hasn't been provisioned in flash.

examples/platform/qpg/project_include/CHIPProjectConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// WARNING: These options make it possible to circumvent basic Chip security functionality,
4242
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
4343
//
44-
#define CHIP_CONFIG_SECURITY_TEST_MODE 1
44+
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
4545
#define CHIP_CONFIG_REQUIRE_AUTH 0
4646

4747
/**

src/lib/core/CHIPConfig.h

+2
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,8 @@
14031403
* @note
14041404
* WARNING: This option makes it possible to circumvent basic chip security functionality,
14051405
* including message encryption. Because of this it SHOULD NEVER BE ENABLED IN PRODUCTION BUILDS.
1406+
*
1407+
* To build with this flag, pass 'treat_warnings_as_errors=false' to gn/ninja.
14061408
*/
14071409
#ifndef CHIP_CONFIG_SECURITY_TEST_MODE
14081410
#define CHIP_CONFIG_SECURITY_TEST_MODE 0

src/transport/CryptoContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ CHIP_ERROR CryptoContext::InitFromSecret(const ByteSpan & secret, const ByteSpan
9696
(void) info;
9797
(void) infoLen;
9898

99-
#pragma message \
99+
#warning \
100100
"Warning: CONFIG_SECURITY_TEST_MODE=1 bypassing key negotiation... All sessions will use known, fixed test key. Node can only communicate with other nodes built with this flag set."
101101
ChipLogError(SecureChannel,
102102
"Warning: CONFIG_SECURITY_TEST_MODE=1 bypassing key negotiation... All sessions will use known, fixed test key. "

0 commit comments

Comments
 (0)