Skip to content

Commit

Permalink
Added Similar Check for ICAC Id.
Browse files Browse the repository at this point in the history
  • Loading branch information
emargolis committed Apr 15, 2022
1 parent e0b6071 commit eda9df5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controller/ExampleOperationalCredentialsIssuer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::GenerateNOCChainAfterValidation(
err = mStorage->SyncGetKeyValue(key, icac.data(), icacBufLen));
if (err == CHIP_NO_ERROR)
{
uint64_t icacId;
// Found intermediate certificate in the storage.
icac.reduce_size(icacBufLen);
ReturnErrorOnFailure(ExtractSubjectDNFromX509Cert(icac, icac_dn));
ReturnErrorOnFailure(icac_dn.GetCertChipId(icacId));
VerifyOrReturnError(icacId == mIntermediateIssuerId, CHIP_ERROR_INTERNAL);
}
// If intermediate certificate not found in the storage, generate new intermediate certificate.
else
Expand Down

0 comments on commit eda9df5

Please sign in to comment.