@@ -196,7 +196,7 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa
196
196
};
197
197
198
198
tempBuf[0 ] = (uint8_t ) TLV::TLVElementType::Structure;
199
- SuccessOrExit (se05xSetCertificate (START_CONTAINER_SE05X_ID, tempBuf, 1 ));
199
+ SuccessOrExit (err = se05xSetCertificate (START_CONTAINER_SE05X_ID, tempBuf, 1 ));
200
200
201
201
for (int i = 1 ; i <= NO_OF_DEV_ATTEST_MSG_TAGS_TO_PARSE; i++)
202
202
{
@@ -206,6 +206,7 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa
206
206
{
207
207
continue ;
208
208
}
209
+ // TODO: Should this be setting err = tlverr?
209
210
SuccessOrExit (tlverr);
210
211
211
212
// Transient binary object ids starting from location 0x7D300005 (TAG1_ID) to 0x7D30000D (TAG3_VALUE_ID)
@@ -215,35 +216,35 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa
215
216
taglen = tagReader.GetLength ();
216
217
tempBuf[0 ] = tagReader.GetControlByte ();
217
218
tempBuf[1 ] = i;
218
- SuccessOrExit (se05xSetCertificate (TAG1_ID + (3 /* tag + length + value ids */ * (i - 1 )), tempBuf, 2 ));
219
+ SuccessOrExit (err = se05xSetCertificate (TAG1_ID + (3 /* tag + length + value ids */ * (i - 1 )), tempBuf, 2 ));
219
220
if (taglen > 256 )
220
221
{
221
222
tempBuf[0 ] = taglen & 0xFF ;
222
223
tempBuf[1 ] = (taglen >> 8 ) & 0xFF ;
223
- SuccessOrExit (se05xSetCertificate (TAG1_LEN_ID + (3 * (i - 1 )), tempBuf, 2 ));
224
+ SuccessOrExit (err = se05xSetCertificate (TAG1_LEN_ID + (3 * (i - 1 )), tempBuf, 2 ));
224
225
}
225
226
else
226
227
{
227
228
tempBuf[0 ] = taglen;
228
- SuccessOrExit (se05xSetCertificate (TAG1_LEN_ID + (3 * (i - 1 )), tempBuf, 1 ));
229
+ SuccessOrExit (err = se05xSetCertificate (TAG1_LEN_ID + (3 * (i - 1 )), tempBuf, 1 ));
229
230
}
230
231
if (taglen > 0 )
231
232
{
232
- SuccessOrExit (tagReader.Get (tagvalue));
233
- SuccessOrExit (se05xSetCertificate (TAG1_VALUE_ID + (3 * (i - 1 )), tagvalue.data (), taglen));
233
+ SuccessOrExit (err = tagReader.Get (tagvalue));
234
+ SuccessOrExit (err = se05xSetCertificate (TAG1_VALUE_ID + (3 * (i - 1 )), tagvalue.data (), taglen));
234
235
}
235
236
}
236
237
237
238
tempBuf[0 ] = (uint8_t ) TLV::TLVElementType::EndOfContainer;
238
- SuccessOrExit (se05xSetCertificate (END_CONTAINER_SE05X_ID, tempBuf, 1 ));
239
+ SuccessOrExit (err = se05xSetCertificate (END_CONTAINER_SE05X_ID, tempBuf, 1 ));
239
240
240
241
if ((tagReader.GetRemainingLength () + 1 /* End container */ ) >= 16 )
241
242
{
242
243
/* Set attestation challenge */
243
- SuccessOrExit (se05xSetCertificate (ATTEST_CHALLENGE_ID, (message_to_sign.end () - 16 ), 16 ));
244
+ SuccessOrExit (err = se05xSetCertificate (ATTEST_CHALLENGE_ID, (message_to_sign.end () - 16 ), 16 ));
244
245
}
245
246
246
- SuccessOrExit (se05xPerformInternalSign (DEV_ATTESTATION_KEY_SE05X_ID_IS, signature_se05x, &signature_se05x_len));
247
+ SuccessOrExit (err = se05xPerformInternalSign (DEV_ATTESTATION_KEY_SE05X_ID_IS, signature_se05x, &signature_se05x_len));
247
248
248
249
err = chip::Crypto::EcdsaAsn1SignatureToRaw (chip::Crypto::kP256_FE_Length , ByteSpan{ signature_se05x, signature_se05x_len },
249
250
out_signature_buffer);
0 commit comments