Coverage Report

Created: 2026-01-22 06:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/TlsCertificateManagement/Commands.ipp
Line
Count
Source
1
/*
2
 *
3
 *    Copyright (c) 2022 Project CHIP Authors
4
 *
5
 *    Licensed under the Apache License, Version 2.0 (the "License");
6
 *    you may not use this file except in compliance with the License.
7
 *    You may obtain a copy of the License at
8
 *
9
 *        http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *    Unless required by applicable law or agreed to in writing, software
12
 *    distributed under the License is distributed on an "AS IS" BASIS,
13
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *    See the License for the specific language governing permissions and
15
 *    limitations under the License.
16
 */
17
18
// THIS FILE IS GENERATED BY ZAP
19
// This file is generated from clusters-Commands.ipp.zapt
20
21
#include <clusters/TlsCertificateManagement/Commands.h>
22
23
#include <app/data-model/Decode.h>
24
#include <app/data-model/StructDecodeIterator.h>
25
#include <app/data-model/WrappedStructEncoder.h>
26
27
namespace chip {
28
namespace app {
29
namespace Clusters {
30
namespace TlsCertificateManagement {
31
namespace Commands {
32
namespace ProvisionRootCertificate {
33
34
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
35
0
{
36
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
37
0
    encoder.Encode(to_underlying(Fields::kCertificate), certificate);
38
0
    encoder.Encode(to_underlying(Fields::kCaid), caid);
39
0
    return encoder.Finalize();
40
0
}
41
42
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
43
0
{
44
0
    detail::StructDecodeIterator __iterator(reader);
45
0
    while (true)
46
0
    {
47
0
        uint8_t __context_tag = 0;
48
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
49
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
50
0
        ReturnErrorOnFailure(err);
51
52
0
        if (__context_tag == to_underlying(Fields::kCertificate))
53
0
        {
54
0
            err = DataModel::Decode(reader, certificate);
55
0
        }
56
0
        else if (__context_tag == to_underlying(Fields::kCaid))
57
0
        {
58
0
            err = DataModel::Decode(reader, caid);
59
0
        }
60
61
0
        ReturnErrorOnFailure(err);
62
0
    }
63
0
}
64
} // namespace ProvisionRootCertificate.
65
namespace ProvisionRootCertificateResponse {
66
67
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
68
0
{
69
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
70
0
    encoder.Encode(to_underlying(Fields::kCaid), caid);
71
0
    return encoder.Finalize();
72
0
}
73
74
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
75
0
{
76
0
    detail::StructDecodeIterator __iterator(reader);
77
0
    while (true)
78
0
    {
79
0
        uint8_t __context_tag = 0;
80
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
81
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
82
0
        ReturnErrorOnFailure(err);
83
84
0
        if (__context_tag == to_underlying(Fields::kCaid))
85
0
        {
86
0
            err = DataModel::Decode(reader, caid);
87
0
        }
88
89
0
        ReturnErrorOnFailure(err);
90
0
    }
91
0
}
92
} // namespace ProvisionRootCertificateResponse.
93
namespace FindRootCertificate {
94
95
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
96
0
{
97
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
98
0
    encoder.Encode(to_underlying(Fields::kCaid), caid);
99
0
    return encoder.Finalize();
100
0
}
101
102
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
103
0
{
104
0
    detail::StructDecodeIterator __iterator(reader);
105
0
    while (true)
106
0
    {
107
0
        uint8_t __context_tag = 0;
108
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
109
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
110
0
        ReturnErrorOnFailure(err);
111
112
0
        if (__context_tag == to_underlying(Fields::kCaid))
113
0
        {
114
0
            err = DataModel::Decode(reader, caid);
115
0
        }
116
117
0
        ReturnErrorOnFailure(err);
118
0
    }
119
0
}
120
} // namespace FindRootCertificate.
121
namespace FindRootCertificateResponse {
122
123
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
124
0
{
125
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
126
0
    encoder.EncodeResponseCommandFabricScopedStructField(to_underlying(Fields::kCertificateDetails), aWriter.mAccessingFabricIndex,
127
0
                                                         certificateDetails);
128
0
    return encoder.Finalize();
129
0
}
130
131
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
132
0
{
133
0
    detail::StructDecodeIterator __iterator(reader);
134
0
    while (true)
135
0
    {
136
0
        uint8_t __context_tag = 0;
137
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
138
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
139
0
        ReturnErrorOnFailure(err);
140
141
0
        if (__context_tag == to_underlying(Fields::kCertificateDetails))
142
0
        {
143
0
            err = DataModel::Decode(reader, certificateDetails);
144
0
        }
145
146
0
        ReturnErrorOnFailure(err);
147
0
    }
148
0
}
149
} // namespace FindRootCertificateResponse.
150
namespace LookupRootCertificate {
151
152
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
153
0
{
154
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
155
0
    encoder.Encode(to_underlying(Fields::kFingerprint), fingerprint);
156
0
    return encoder.Finalize();
157
0
}
158
159
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
160
0
{
161
0
    detail::StructDecodeIterator __iterator(reader);
162
0
    while (true)
163
0
    {
164
0
        uint8_t __context_tag = 0;
165
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
166
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
167
0
        ReturnErrorOnFailure(err);
168
169
0
        if (__context_tag == to_underlying(Fields::kFingerprint))
170
0
        {
171
0
            err = DataModel::Decode(reader, fingerprint);
172
0
        }
173
174
0
        ReturnErrorOnFailure(err);
175
0
    }
176
0
}
177
} // namespace LookupRootCertificate.
178
namespace LookupRootCertificateResponse {
179
180
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
181
0
{
182
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
183
0
    encoder.Encode(to_underlying(Fields::kCaid), caid);
184
0
    return encoder.Finalize();
185
0
}
186
187
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
188
0
{
189
0
    detail::StructDecodeIterator __iterator(reader);
190
0
    while (true)
191
0
    {
192
0
        uint8_t __context_tag = 0;
193
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
194
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
195
0
        ReturnErrorOnFailure(err);
196
197
0
        if (__context_tag == to_underlying(Fields::kCaid))
198
0
        {
199
0
            err = DataModel::Decode(reader, caid);
200
0
        }
201
202
0
        ReturnErrorOnFailure(err);
203
0
    }
204
0
}
205
} // namespace LookupRootCertificateResponse.
206
namespace RemoveRootCertificate {
207
208
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
209
0
{
210
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
211
0
    encoder.Encode(to_underlying(Fields::kCaid), caid);
212
0
    return encoder.Finalize();
213
0
}
214
215
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
216
0
{
217
0
    detail::StructDecodeIterator __iterator(reader);
218
0
    while (true)
219
0
    {
220
0
        uint8_t __context_tag = 0;
221
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
222
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
223
0
        ReturnErrorOnFailure(err);
224
225
0
        if (__context_tag == to_underlying(Fields::kCaid))
226
0
        {
227
0
            err = DataModel::Decode(reader, caid);
228
0
        }
229
230
0
        ReturnErrorOnFailure(err);
231
0
    }
232
0
}
233
} // namespace RemoveRootCertificate.
234
namespace ClientCSR {
235
236
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
237
0
{
238
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
239
0
    encoder.Encode(to_underlying(Fields::kNonce), nonce);
240
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
241
0
    return encoder.Finalize();
242
0
}
243
244
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
245
0
{
246
0
    detail::StructDecodeIterator __iterator(reader);
247
0
    while (true)
248
0
    {
249
0
        uint8_t __context_tag = 0;
250
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
251
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
252
0
        ReturnErrorOnFailure(err);
253
254
0
        if (__context_tag == to_underlying(Fields::kNonce))
255
0
        {
256
0
            err = DataModel::Decode(reader, nonce);
257
0
        }
258
0
        else if (__context_tag == to_underlying(Fields::kCcdid))
259
0
        {
260
0
            err = DataModel::Decode(reader, ccdid);
261
0
        }
262
263
0
        ReturnErrorOnFailure(err);
264
0
    }
265
0
}
266
} // namespace ClientCSR.
267
namespace ClientCSRResponse {
268
269
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
270
0
{
271
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
272
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
273
0
    encoder.Encode(to_underlying(Fields::kCsr), csr);
274
0
    encoder.Encode(to_underlying(Fields::kNonceSignature), nonceSignature);
275
0
    return encoder.Finalize();
276
0
}
277
278
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
279
0
{
280
0
    detail::StructDecodeIterator __iterator(reader);
281
0
    while (true)
282
0
    {
283
0
        uint8_t __context_tag = 0;
284
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
285
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
286
0
        ReturnErrorOnFailure(err);
287
288
0
        if (__context_tag == to_underlying(Fields::kCcdid))
289
0
        {
290
0
            err = DataModel::Decode(reader, ccdid);
291
0
        }
292
0
        else if (__context_tag == to_underlying(Fields::kCsr))
293
0
        {
294
0
            err = DataModel::Decode(reader, csr);
295
0
        }
296
0
        else if (__context_tag == to_underlying(Fields::kNonceSignature))
297
0
        {
298
0
            err = DataModel::Decode(reader, nonceSignature);
299
0
        }
300
301
0
        ReturnErrorOnFailure(err);
302
0
    }
303
0
}
304
} // namespace ClientCSRResponse.
305
namespace ProvisionClientCertificate {
306
307
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
308
0
{
309
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
310
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
311
0
    encoder.Encode(to_underlying(Fields::kClientCertificate), clientCertificate);
312
0
    encoder.Encode(to_underlying(Fields::kIntermediateCertificates), intermediateCertificates);
313
0
    return encoder.Finalize();
314
0
}
315
316
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
317
0
{
318
0
    detail::StructDecodeIterator __iterator(reader);
319
0
    while (true)
320
0
    {
321
0
        uint8_t __context_tag = 0;
322
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
323
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
324
0
        ReturnErrorOnFailure(err);
325
326
0
        if (__context_tag == to_underlying(Fields::kCcdid))
327
0
        {
328
0
            err = DataModel::Decode(reader, ccdid);
329
0
        }
330
0
        else if (__context_tag == to_underlying(Fields::kClientCertificate))
331
0
        {
332
0
            err = DataModel::Decode(reader, clientCertificate);
333
0
        }
334
0
        else if (__context_tag == to_underlying(Fields::kIntermediateCertificates))
335
0
        {
336
0
            err = DataModel::Decode(reader, intermediateCertificates);
337
0
        }
338
339
0
        ReturnErrorOnFailure(err);
340
0
    }
341
0
}
342
} // namespace ProvisionClientCertificate.
343
namespace FindClientCertificate {
344
345
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
346
0
{
347
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
348
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
349
0
    return encoder.Finalize();
350
0
}
351
352
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
353
0
{
354
0
    detail::StructDecodeIterator __iterator(reader);
355
0
    while (true)
356
0
    {
357
0
        uint8_t __context_tag = 0;
358
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
359
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
360
0
        ReturnErrorOnFailure(err);
361
362
0
        if (__context_tag == to_underlying(Fields::kCcdid))
363
0
        {
364
0
            err = DataModel::Decode(reader, ccdid);
365
0
        }
366
367
0
        ReturnErrorOnFailure(err);
368
0
    }
369
0
}
370
} // namespace FindClientCertificate.
371
namespace FindClientCertificateResponse {
372
373
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
374
0
{
375
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
376
0
    encoder.EncodeResponseCommandFabricScopedStructField(to_underlying(Fields::kCertificateDetails), aWriter.mAccessingFabricIndex,
377
0
                                                         certificateDetails);
378
0
    return encoder.Finalize();
379
0
}
380
381
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
382
0
{
383
0
    detail::StructDecodeIterator __iterator(reader);
384
0
    while (true)
385
0
    {
386
0
        uint8_t __context_tag = 0;
387
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
388
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
389
0
        ReturnErrorOnFailure(err);
390
391
0
        if (__context_tag == to_underlying(Fields::kCertificateDetails))
392
0
        {
393
0
            err = DataModel::Decode(reader, certificateDetails);
394
0
        }
395
396
0
        ReturnErrorOnFailure(err);
397
0
    }
398
0
}
399
} // namespace FindClientCertificateResponse.
400
namespace LookupClientCertificate {
401
402
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
403
0
{
404
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
405
0
    encoder.Encode(to_underlying(Fields::kFingerprint), fingerprint);
406
0
    return encoder.Finalize();
407
0
}
408
409
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
410
0
{
411
0
    detail::StructDecodeIterator __iterator(reader);
412
0
    while (true)
413
0
    {
414
0
        uint8_t __context_tag = 0;
415
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
416
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
417
0
        ReturnErrorOnFailure(err);
418
419
0
        if (__context_tag == to_underlying(Fields::kFingerprint))
420
0
        {
421
0
            err = DataModel::Decode(reader, fingerprint);
422
0
        }
423
424
0
        ReturnErrorOnFailure(err);
425
0
    }
426
0
}
427
} // namespace LookupClientCertificate.
428
namespace LookupClientCertificateResponse {
429
430
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
431
0
{
432
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
433
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
434
0
    return encoder.Finalize();
435
0
}
436
437
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
438
0
{
439
0
    detail::StructDecodeIterator __iterator(reader);
440
0
    while (true)
441
0
    {
442
0
        uint8_t __context_tag = 0;
443
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
444
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
445
0
        ReturnErrorOnFailure(err);
446
447
0
        if (__context_tag == to_underlying(Fields::kCcdid))
448
0
        {
449
0
            err = DataModel::Decode(reader, ccdid);
450
0
        }
451
452
0
        ReturnErrorOnFailure(err);
453
0
    }
454
0
}
455
} // namespace LookupClientCertificateResponse.
456
namespace RemoveClientCertificate {
457
458
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
459
0
{
460
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
461
0
    encoder.Encode(to_underlying(Fields::kCcdid), ccdid);
462
0
    return encoder.Finalize();
463
0
}
464
465
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
466
0
{
467
0
    detail::StructDecodeIterator __iterator(reader);
468
0
    while (true)
469
0
    {
470
0
        uint8_t __context_tag = 0;
471
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
472
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
473
0
        ReturnErrorOnFailure(err);
474
475
0
        if (__context_tag == to_underlying(Fields::kCcdid))
476
0
        {
477
0
            err = DataModel::Decode(reader, ccdid);
478
0
        }
479
480
0
        ReturnErrorOnFailure(err);
481
0
    }
482
0
}
483
} // namespace RemoveClientCertificate.
484
} // namespace Commands
485
} // namespace TlsCertificateManagement
486
} // namespace Clusters
487
} // namespace app
488
} // namespace chip