Skip to content

Commit

Permalink
Fix project-chip#12915 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
msandstedt committed Jan 25, 2022
1 parent dc9dbf7 commit 0c51b64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ Optional<System::Clock::Timeout> AutoCommissioner::GetCommandTimeout(Commissioni
}
}

CHIP_ERROR AutoCommissioner::NOCChainGenerated(ByteSpan noc, ByteSpan icac, ByteSpan rcac)
CHIP_ERROR AutoCommissioner::NOCChainGenerated(ByteSpan noc, ByteSpan icac, ByteSpan rcac, AesCcm128KeySpan ipk,
NodeId adminSubject)
{
// Reuse ICA Cert buffer for temporary store Root Cert.
MutableByteSpan rootCert = MutableByteSpan(mICACertBuffer);
Expand All @@ -237,6 +238,9 @@ CHIP_ERROR AutoCommissioner::NOCChainGenerated(ByteSpan noc, ByteSpan icac, Byte
mParams.SetIcac(ByteSpan());
}

mParams.SetIpk(ipk);
mParams.SetAdminSubject(adminSubject);

return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -278,7 +282,8 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio
case CommissioningStage::kGenerateNOCChain:
// For NOC chain generation, we re-use the buffers. NOCChainGenerated triggers the next stage before
// storing the returned certs, so just return here without triggering the next stage.
return NOCChainGenerated(report.Get<NocChain>().noc, report.Get<NocChain>().icac, report.Get<NocChain>().rcac);
return NOCChainGenerated(report.Get<NocChain>().noc, report.Get<NocChain>().icac, report.Get<NocChain>().rcac,
report.Get<NocChain>().ipk, report.Get<NocChain>().adminSubject);
case CommissioningStage::kFindOperational:
mOperationalDeviceProxy = report.Get<OperationalNodeFoundData>().operationalProxy;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/controller/AutoCommissioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AutoCommissioner : public CommissioningDelegate
ByteSpan GetDAC() const { return ByteSpan(mDAC, mDACLen); }
ByteSpan GetPAI() const { return ByteSpan(mPAI, mPAILen); }

CHIP_ERROR NOCChainGenerated(ByteSpan noc, ByteSpan icac, ByteSpan rcac);
CHIP_ERROR NOCChainGenerated(ByteSpan noc, ByteSpan icac, ByteSpan rcac, AesCcm128KeySpan ipk, NodeId adminSubject);
Optional<System::Clock::Timeout> GetCommandTimeout(CommissioningStage stage);

DeviceCommissioner * mCommissioner;
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CommissioningDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class CommissioningParameters
mIpk.SetValue(AesCcm128Key(ipk));
return *this;
}
CommissioningParameters & SetIpk(const NodeId adminSubject)
CommissioningParameters & SetAdminSubject(const NodeId adminSubject)
{
mAdminSubject.SetValue(adminSubject);
return *this;
Expand Down

0 comments on commit 0c51b64

Please sign in to comment.