Skip to content

Commit

Permalink
Remove unused "InsufficientPrivilege" NOCResponse status (#21072)
Browse files Browse the repository at this point in the history
* Remove InsufficientPrivilege no longer used

* ZAP regen

* Zap regen

* Regen zap

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and web-flow committed Jul 22, 2022
1 parent bcdfbfa commit 2696b93
Show file tree
Hide file tree
Showing 42 changed files with 12 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
2 changes: 0 additions & 2 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down Expand Up @@ -1316,7 +1315,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
2 changes: 0 additions & 2 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down Expand Up @@ -1316,7 +1315,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
2 changes: 0 additions & 2 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ client cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down Expand Up @@ -1337,7 +1336,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ server cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,22 +490,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 @@ -588,10 +577,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
1 change: 0 additions & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,6 @@ client cluster OperationalCredentials = 62 {
kMissingCsr = 4;
kTableFull = 5;
kInvalidAdminSubject = 6;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
Expand Down
1 change: 0 additions & 1 deletion src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2696b93

Please sign in to comment.