Skip to content

Commit 1114858

Browse files
authored
Log VerifyCredentials error (#37955)
Log error coming from `VerifyCredentials` as it's later overwritten with `CHIP_ERROR_UNSUPPORTED_CERT_FORMAT` which hides root cause of the failure. Signed-off-by: Adrian Gielniewski <[email protected]>
1 parent 914079d commit 1114858

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/credentials/FabricTable.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,17 @@ CHIP_ERROR FabricTable::ValidateIncomingNOCChain(const ByteSpan & noc, const Byt
346346
ChipLogProgress(FabricProvisioning, "Validating NOC chain");
347347
CHIP_ERROR err = FabricTable::VerifyCredentials(noc, icac, rcac, validContext, outCompressedFabricId, outFabricId, outNodeId,
348348
outNocPubkey, &outRootPubkey);
349-
if (err != CHIP_NO_ERROR && err != CHIP_ERROR_WRONG_NODE_ID)
350-
{
351-
err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT;
352-
}
353349
if (err != CHIP_NO_ERROR)
354350
{
355-
ChipLogError(FabricProvisioning, "Failed NOC chain validation: %" CHIP_ERROR_FORMAT, err.Format());
351+
ChipLogError(FabricProvisioning, "Failed NOC chain validation, VerifyCredentials returned: %" CHIP_ERROR_FORMAT,
352+
err.Format());
353+
354+
if (err != CHIP_ERROR_WRONG_NODE_ID)
355+
{
356+
err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT;
357+
}
358+
return err;
356359
}
357-
ReturnErrorOnFailure(err);
358360

359361
// Validate fabric ID match for cases like UpdateNOC.
360362
if (existingFabricId != kUndefinedFabricId)

0 commit comments

Comments
 (0)