Skip to content

Commit 768d7b3

Browse files
committed
Log VerifyCredentials error
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 <adrian.gielniewski@nordicsemi.no>
1 parent 59c205c commit 768d7b3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/credentials/FabricTable.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,14 @@ 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)
349+
if (err != CHIP_NO_ERROR)
350350
{
351-
err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT;
351+
ChipLogError(FabricProvisioning, "Failed NOC chain validation, VerifyCredentials returned: %" CHIP_ERROR_FORMAT,
352+
err.Format());
352353
}
353-
if (err != CHIP_NO_ERROR)
354+
if (err != CHIP_NO_ERROR && err != CHIP_ERROR_WRONG_NODE_ID)
354355
{
355-
ChipLogError(FabricProvisioning, "Failed NOC chain validation: %" CHIP_ERROR_FORMAT, err.Format());
356+
err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT;
356357
}
357358
ReturnErrorOnFailure(err);
358359

0 commit comments

Comments
 (0)