Skip to content

Commit 1207636

Browse files
mlepage-googlepull[bot]
authored andcommitted
Add custom privileges for opcreds cluster (#16590)
One attribute and most commands require administer privilege. (This cluster has no events.) Commissioning chip-all-clusters-app via chip-tool on Linux results in the following commands and their required privilege: GeneralCommissioning/ArmFailSafe --> 0x30 0x0 --> operate GeneralCommissioning/SetRegulatoryConfig --> 0x30 0x2 --> operate OperationalCredentials/CertificateChainRequest --> 0x3e 0x2 --> administer OperationalCredentials/CertificateChainRequest --> 0x3e 0x2 --> administer OperationalCredentials/AttestationRequest --> 0x3e 0x0 --> administer OperationalCredentials/CSRRequest --> 0x3e 0x4 --> administer OperationalCredentials/AddTrustedRootCertificate --> 0x3e 0xb --> administer OperationalCredentials/AddNOC --> 0x3e 0x6 --> administer GeneralCommissioning/CommissioningComplete --> 0x30 0x4 --> operate The last is satisfied over CASE (via the AddNOC installed ACL) and the others before it are satisfied by implicit administer privilege over PASE during commissioning.
1 parent 7e99d20 commit 1207636

File tree

19 files changed

+532
-1
lines changed

19 files changed

+532
-1
lines changed

src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml

+13-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ limitations under the License.
5555
<define>OPERATIONAL_CREDENTIALS_CLUSTER</define>
5656
<description>This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics.</description>
5757

58-
<attribute side="server" code="0x0000" define="NOCS" type="ARRAY" entryType="NOCStruct" writable="false" optional="false">NOCs</attribute>
58+
<attribute side="server" code="0x0000" define="NOCS" type="ARRAY" entryType="NOCStruct" writable="false" optional="false">
59+
<description>NOCs</description>
60+
<access op="read" privilege="administer"/>
61+
</attribute>
5962
<attribute side="server" code="0x0001" define="FABRICS" type="ARRAY" entryType="FabricDescriptor" writable="false" optional="false">Fabrics</attribute>
6063
<attribute side="server" code="0x0002" define="SUPPORTED_FABRICS" type="INT8U" writable="false" optional="false">SupportedFabrics</attribute>
6164
<attribute side="server" code="0x0003" define="COMMISSIONED_FABRICS" type="INT8U" writable="false" optional="false">CommissionedFabrics</attribute>
@@ -65,6 +68,7 @@ limitations under the License.
6568
<command source="client" code="0x00" name="AttestationRequest" response="AttestationResponse" optional="false">
6669
<description>Sender is requesting attestation information from the receiver.</description>
6770
<arg name="AttestationNonce" type="OCTET_STRING"/>
71+
<access op="invoke" privilege="administer"/>
6872
</command>
6973

7074
<command source="server" code="0x01" name="AttestationResponse" optional="false">
@@ -76,6 +80,7 @@ limitations under the License.
7680
<command source="client" code="0x02" name="CertificateChainRequest" response="CertificateChainResponse" optional="false">
7781
<description>Sender is requesting a device attestation certificate from the receiver.</description>
7882
<arg name="CertificateType" type="INT8U"/>
83+
<access op="invoke" privilege="administer"/>
7984
</command>
8085

8186
<command source="server" code="0x03" name="CertificateChainResponse" optional="false">
@@ -86,6 +91,7 @@ limitations under the License.
8691
<command source="client" code="0x04" name="CSRRequest" response="CSRResponse" optional="false">
8792
<description>Sender is requesting a certificate signing request (CSR) from the receiver.</description>
8893
<arg name="CSRNonce" type="OCTET_STRING"/>
94+
<access op="invoke" privilege="administer"/>
8995
</command>
9096

9197
<!-- TODO: Fix to match chip-spec:#3346 -->
@@ -102,12 +108,14 @@ limitations under the License.
102108
<arg name="IPKValue" type="OCTET_STRING"/>
103109
<arg name="CaseAdminNode" type="NODE_ID"/>
104110
<arg name="AdminVendorId" type="INT16U"/>
111+
<access op="invoke" privilege="administer"/>
105112
</command>
106113

107114
<command source="client" code="0x07" name="UpdateNOC" response="NOCResponse" optional="false">
108115
<description>Sender is requesting to update the node operational certificates.</description>
109116
<arg name="NOCValue" type="OCTET_STRING"/>
110117
<arg name="ICACValue" type="OCTET_STRING" optional="true"/>
118+
<access op="invoke" privilege="administer"/>
111119
</command>
112120

113121
<command source="server" code="0x08" name="NOCResponse" optional="false">
@@ -120,21 +128,25 @@ limitations under the License.
120128
<command source="client" code="0x09" name="UpdateFabricLabel" response="NOCResponse" optional="false">
121129
<description>This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute.</description>
122130
<arg name="Label" type="CHAR_STRING" length="32"/>
131+
<access op="invoke" privilege="administer"/>
123132
</command>
124133

125134
<command source="client" code="0x0a" name="RemoveFabric" response="NOCResponse" optional="false">
126135
<description>This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data.</description>
127136
<arg name="FabricIndex" type="fabric_idx"/>
137+
<access op="invoke" privilege="administer"/>
128138
</command>
129139

130140
<command source="client" code="0x0b" name="AddTrustedRootCertificate" optional="false">
131141
<description>This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation.</description>
132142
<arg name="RootCertificate" type="OCTET_STRING"/>
143+
<access op="invoke" privilege="administer"/>
133144
</command>
134145

135146
<command source="client" code="0x0c" name="RemoveTrustedRootCertificate" optional="false">
136147
<description>This command SHALL remove a Trusted Root CA Certificate, provided as its CHIP Certificate representation.</description>
137148
<arg name="TrustedRootIdentifier" type="OCTET_STRING"/>
149+
<access op="invoke" privilege="administer"/>
138150
</command>
139151

140152
</cluster>

zzz_generated/all-clusters-app/zap-generated/access.h

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/bridge-app/zap-generated/access.h

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)