Skip to content

Commit

Permalink
Remove InsufficientPrivilege no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmelveilleux committed Jul 21, 2022
1 parent 6d54807 commit 9c88499
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
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

0 comments on commit 9c88499

Please sign in to comment.