Skip to content

RDKEMW-21384: Revert RDKEMW-13335 code changes#216

Open
KTirumalaSrihari wants to merge 1 commit into
developfrom
revert-pr-183-secure-debug-properties
Open

RDKEMW-21384: Revert RDKEMW-13335 code changes#216
KTirumalaSrihari wants to merge 1 commit into
developfrom
revert-pr-183-secure-debug-properties

Conversation

@KTirumalaSrihari

Copy link
Copy Markdown
Contributor

No description provided.

This reverts commit cc6d71d, reversing
changes made to 61aa426.
@KTirumalaSrihari
KTirumalaSrihari requested a review from a team as a code owner July 10, 2026 07:03
Copilot AI review requested due to automatic review settings July 10, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on DbgServices.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 whenever DbgServices.Enable is true, which is a security-sensitive behavior change (see test/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();
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                             Total:|81.6%   2282|93.1%   131|    -      0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants