Skip to content

Commit

Permalink
Set ICAC to nullable to align with spec (#14411)
Browse files Browse the repository at this point in the history
* If no ICAC is present in the chain, this field SHALL be set to null

* Run codegen
  • Loading branch information
yufengwangca authored and pull[bot] committed Feb 16, 2022
1 parent d715f82 commit 1612562
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ client cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down Expand Up @@ -1431,7 +1431,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ server cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,15 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadNOCs(EndpointId endpoint, Attri

if (accessingFabricIndex == fabricInfo.GetFabricIndex())
{
ByteSpan icac;

ReturnErrorOnFailure(fabricInfo.GetNOCCert(noc.noc));
ReturnErrorOnFailure(fabricInfo.GetICACert(noc.icac));
ReturnErrorOnFailure(fabricInfo.GetICACert(icac));

if (!icac.empty())
{
noc.icac.SetNonNull(icac);
}
}

ReturnErrorOnFailure(encoder.Encode(noc));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ limitations under the License.
<cluster code="0x003E"/>
<item name="FabricIndex" type="fabric_idx"/>
<item name="NOC" type="OCTET_STRING"/>
<item name="ICAC" type="OCTET_STRING"/>
<item name="ICAC" type="OCTET_STRING" isNullable="true"/>
</struct>

<cluster>
Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,7 @@ client cluster OperationalCredentials = 62 {
struct NOCStruct {
fabric_idx fabricIndex = 0;
OCTET_STRING noc = 1;
OCTET_STRING icac = 2;
nullable OCTET_STRING icac = 2;
}

struct FabricDescriptor {
Expand Down
15 changes: 11 additions & 4 deletions src/controller/java/zap-generated/CHIPReadCallbacks.cpp

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.

4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Objects.py

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.

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

2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h

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

2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm

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.

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

0 comments on commit 1612562

Please sign in to comment.