Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused "InsufficientPrivilege" NOCResponse status #21072

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove InsufficientPrivilege no longer used
  • Loading branch information
tcarmelveilleux committed Jul 21, 2022
commit 9c884993e46313aff607b2b8ce626a4659273413
Original file line number Diff line number Diff line change
Expand Up @@ -508,22 +508,11 @@ bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(app::CommandH
}
}

CHIP_ERROR err = CHIP_ERROR_INTERNAL;

// Fetch current fabric
const FabricInfo * fabric = RetrieveCurrentFabric(commandObj);
if (fabric == nullptr)
{
SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kInsufficientPrivilege, ourFabricIndex,
CharSpan::fromCharString("Current fabric not found"));
return true;
}

// Set Label on fabric. Any error on this is basically an internal error...
// NOTE: if an UpdateNOC had caused a pending fabric, that pending fabric is
// the one updated thereafter. Otherwise, the data is committed to storage
// as soon as the update is done.
err = fabricTable.SetFabricLabel(ourFabricIndex, label);
CHIP_ERROR err = fabricTable.SetFabricLabel(ourFabricIndex, label);
VerifyOrExit(err == CHIP_NO_ERROR, finalStatus = Status::Failure);

finalStatus = Status::Success;
Expand Down Expand Up @@ -606,10 +595,6 @@ OperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err)
{
return OperationalCertStatus::kInvalidAdminSubject;
}
if (err == CHIP_ERROR_INSUFFICIENT_PRIVILEGE)
{
return OperationalCertStatus::kInsufficientPrivilege;
}

return OperationalCertStatus::kInvalidNOC;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ limitations under the License.
<item name="MissingCsr" value="0x04"/>
<item name="TableFull" value="0x05"/>
<item name="InvalidAdminSubject" value="0x06"/>
<item name="InsufficientPrivilege" value="0x08"/>
<item name="FabricConflict" value="0x09"/>
<item name="LabelConflict" value="0x0a"/>
<item name="InvalidFabricIndex" value="0x0b"/>
Expand Down
2 changes: 0 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,6 @@ CHIP_ERROR DeviceCommissioner::ConvertFromOperationalCertStatus(OperationalCrede
return CHIP_ERROR_INVALID_ADMIN_SUBJECT;
case OperationalCertStatus::kFabricConflict:
return CHIP_ERROR_FABRIC_EXISTS;
case OperationalCertStatus::kInsufficientPrivilege:
return CHIP_ERROR_INSUFFICIENT_PRIVILEGE;
case OperationalCertStatus::kLabelConflict:
return CHIP_ERROR_INVALID_ARGUMENT;
case OperationalCertStatus::kInvalidFabricIndex:
Expand Down