diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index ba46c922ba82c7..2426da914892de 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -129,15 +129,16 @@ CHIP_ERROR AndroidDeviceControllerWrapper::GenerateNOCChain(const ByteSpan & csr ReturnErrorCodeIf(!rcac.Alloc(kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); uint16_t rootCertBufLen = kMaxCHIPDERCertLength; - CHIP_ERROR err = CHIP_NO_ERROR; PERSISTENT_KEY_OP(mNextFabricId, kOperationalCredentialsRootCertificateStorage, key, err = SyncGetKeyValue(key, rcac.Get(), rootCertBufLen)); if (err != CHIP_NO_ERROR) { // Storage doesn't have an existing root certificate. Let's create one and add it to the storage. - chip::Credentials::X509CertRequestParams request = { 0, mIssuerId, mNow, mNow + mValidity, true, mNextFabricId, false, 0 }; - uint32_t outCertLen = 0; - ReturnErrorOnFailure(NewRootX509Cert(request, mIssuer, rcac.Get(), kMaxCHIPDERCertLength, outCertLen)); + chip::Credentials::X509CertRequestParams rcac_request = { 0, mIssuerId, mNow, mNow + mValidity, + true, mNextFabricId, false, 0 }; + + uint32_t outCertLen = 0; + ReturnErrorOnFailure(NewRootX509Cert(rcac_request, mIssuer, rcac.Get(), kMaxCHIPDERCertLength, outCertLen)); VerifyOrReturnError(CanCastTo(outCertLen), CHIP_ERROR_INVALID_ARGUMENT); rootCertBufLen = static_cast(outCertLen); diff --git a/src/controller/java/AndroidDeviceControllerWrapper.h b/src/controller/java/AndroidDeviceControllerWrapper.h index f7f7918d0da816..5ffcf1bccbb94b 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.h +++ b/src/controller/java/AndroidDeviceControllerWrapper.h @@ -62,13 +62,13 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel const chip::ByteSpan & DAC, const chip::ByteSpan & PAI, const chip::ByteSpan & PAA, chip::Callback::Callback * onCompletion) override; - void SetNodeIdForNextNOCRequest(NodeId nodeId) override + void SetNodeIdForNextNOCRequest(chip::NodeId nodeId) override { mNextRequestedNodeId = nodeId; mNodeIdRequested = true; } - void SetFabricIdForNextNOCRequest(FabricId fabricId) override { mNextFabricId = fabricId; } + void SetFabricIdForNextNOCRequest(chip::FabricId fabricId) override { mNextFabricId = fabricId; } // DeviceStatusDelegate implementation void OnMessage(chip::System::PacketBufferHandle && msg) override; @@ -106,9 +106,9 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel chip::NodeId mNextAvailableNodeId = 1; - NodeId mNextRequestedNodeId = 1; - FabricId mNextFabricId = 0; - bool mNodeIdRequested = false; + chip::NodeId mNextRequestedNodeId = 1; + chip::FabricId mNextFabricId = 0; + bool mNodeIdRequested = false; AndroidDeviceControllerWrapper(ChipDeviceControllerPtr controller, pthread_mutex_t * stackLock) : mController(std::move(controller)), mStackLock(stackLock)