RDKEMW-21384: Revert RDKEMW-13335 code changes#216
Open
KTirumalaSrihari wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts the RDKEMW-13335 changes around “secure debug services unlock” logic and related functional/gtest coverage, returning RFC local-override behavior closer to the prior gating.
Changes:
- Removes
isSecureDbgSrvUnlocked()and DeviceType/LABSIGNED-based gating from the RFC manager implementation, replacing it with a simpler PROD check based onDbgServices.Enable. - Simplifies the functional RFC override test by removing device.properties/LABSIGNED/DeviceType preconditions and cleanup logic.
- Removes gtests that validated the prior multi-factor secure debug services unlock behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/functional-tests/tests/test_rfc_override_rfc_prop.py | Removes labsigned/device-type preconditions; now relies on debug-services state for local override behavior. |
| test/functional-tests/tests/rfc_test_helper.py | Drops the DEVICE_PROPERTIES constant that was only used by the reverted test flow. |
| rfcMgr/rfc_xconf_handler.h | Removes DeviceType constant and secure-unlock method declarations / friend tests. |
| rfcMgr/rfc_xconf_handler.cpp | Removes multi-factor secure unlock logic; simplifies PROD gating for local override to DbgServices.Enable. |
| rfcMgr/gtest/gtest_main.cpp | Removes unit tests that exercised isSecureDbgSrvUnlocked* scenarios. |
Comments suppressed due to low confidence (1)
rfcMgr/rfc_xconf_handler.cpp:75
- The PROD gating for using the local override file was relaxed from a multi-factor unlock (build type + LABSIGNED + device type + RFC flag) to
_ebuild_type != ePROD || dbgServices. This allows local override in PROD wheneverDbgServices.Enableis true, which is a security-sensitive behavior change (seetest/docs/L2_Analysis_Report.md:752). Please confirm this is intended for RDKEMW-21384; if not, reinstate the additional PROD checks or an equivalent single helper that enforces them consistently.
GetRFCPartnerID();
if((filePresentCheck(RFC_PROPERTIES_PERSISTENCE_FILE) == RDK_API_SUCCESS) && (_ebuild_type != ePROD || dbgServices == true))
{
rfc_file = RFC_PROPERTIES_PERSISTENCE_FILE;
rfc_state = Local;
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Found Persistent file %s, Updating State %d \n", __FUNCTION__, __LINE__, rfc_file.c_str(), rfc_state);
Comment on lines
+59
to
63
| def test_Set_DbgServices_value(): | ||
| command_to_check = "tr181 -d -s -t bool -v true Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DbgServices.Enable" | ||
| result = run_shell_command(command_to_check) | ||
| assert "Set operation success" in result, '"Set operation success" not found in the output' | ||
|
|
Comment on lines
1539
to
1547
| bool skip_direct = IsDirectBlocked(); | ||
| bool isDebugServicesUnlocked = isSecureDbgSrvUnlocked(); | ||
| bool dbgServices = isDebugServicesEnabled(); | ||
|
|
||
| if(skip_direct == false) | ||
| { | ||
| while(retries < RETRY_COUNT) | ||
| { | ||
| if((filePresentCheck(RFC_PROPERTIES_PERSISTENCE_FILE) == RDK_API_SUCCESS) && isDebugServicesUnlocked) | ||
| if((filePresentCheck(RFC_PROPERTIES_PERSISTENCE_FILE) == RDK_API_SUCCESS) && (_ebuild_type != ePROD || dbgServices == true)) | ||
| { |
Comment on lines
569
to
574
| EXPECT_EQ(result, true); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isSecureDbgSrvUnlocked_dev) { | ||
| writeToTr181storeFile("BUILD_TYPE", "dev", "/tmp/device.properties", Plain); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); | ||
| rfcObj->initializeXconfHandler(); | ||
| bool result = rfcObj->isSecureDbgSrvUnlocked(); | ||
| delete rfcObj; | ||
| EXPECT_EQ(result, true); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isSecureDbgSrvUnlocked_labsigned_true) { | ||
| writeToTr181storeFile("BUILD_TYPE", "prod", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("LABSIGNED_ENABLED", "true", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType", "test", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DbgServices.Enable", "true", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); | ||
| rfcObj->initializeXconfHandler(); | ||
| bool result = rfcObj->isSecureDbgSrvUnlocked(); | ||
| delete rfcObj; | ||
| EXPECT_EQ(result, true); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isSecureDbgSrvUnlocked_prod) { | ||
| writeToTr181storeFile("BUILD_TYPE", "prod", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("LABSIGNED_ENABLED", "false", "/tmp/device.properties", Plain); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); | ||
| rfcObj->initializeXconfHandler(); | ||
| bool result = rfcObj->isSecureDbgSrvUnlocked(); | ||
| delete rfcObj; | ||
| EXPECT_EQ(result, false); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isSecureDbgSrvUnlocked_dType_prod) { | ||
| writeToTr181storeFile("BUILD_TYPE", "prod", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("LABSIGNED_ENABLED", "true", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType", "prod", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); | ||
| rfcObj->initializeXconfHandler(); | ||
| bool result = rfcObj->isSecureDbgSrvUnlocked(); | ||
| delete rfcObj; | ||
| EXPECT_EQ(result, false); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isSecureDbgSrvUnlocked_labsigned_DbgSrv_false) { | ||
| writeToTr181storeFile("BUILD_TYPE", "prod", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("LABSIGNED_ENABLED", "true", "/tmp/device.properties", Plain); | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType", "test", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DbgServices.Enable", "false", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); | ||
| rfcObj->initializeXconfHandler(); | ||
| bool result = rfcObj->isSecureDbgSrvUnlocked(); | ||
| delete rfcObj; | ||
| EXPECT_EQ(result, false); | ||
| } | ||
|
|
||
| TEST(rfcMgrTest, isDebugServicesEnabled) { | ||
| writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DbgServices.Enable", "true", "/opt/secure/RFC/tr181store.ini", Quoted); | ||
| RuntimeFeatureControlProcessor *rfcObj = new RuntimeFeatureControlProcessor(); |
Code Coverage Summary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.