Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove needless OpcredsIssuer dependency #12338

Merged
merged 7 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/chip-tool/commands/clusters/ModelCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "../../config/PersistentStorage.h"
#include "../common/CHIPCommand.h"
#include <app/chip-zcl-zpro-codec.h>
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <lib/core/CHIPEncoding.h>

class ModelCommand : public CHIPCommand
Expand Down
11 changes: 7 additions & 4 deletions examples/chip-tool/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "CHIPCommand.h"

#include "controller/ExampleOperationalCredentialsIssuer.h"
tcarmelveilleux marked this conversation as resolved.
Show resolved Hide resolved
#include <controller/CHIPDeviceControllerFactory.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/DeviceAttestationVerifier.h>
Expand All @@ -31,13 +32,15 @@ using DeviceControllerFactory = chip::Controller::DeviceControllerFactory;

CHIP_ERROR CHIPCommand::Run()
{
chip::Controller::ExampleOperationalCredentialsIssuer opCredsIssuer;
tcarmelveilleux marked this conversation as resolved.
Show resolved Hide resolved

#if CHIP_DEVICE_LAYER_TARGET_LINUX && CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
// By default, Linux device is configured as a BLE peripheral while the controller needs a BLE central.
ReturnLogErrorOnFailure(chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(0, true));
#endif

ReturnLogErrorOnFailure(mStorage.Init());
ReturnLogErrorOnFailure(mOpCredsIssuer.Initialize(mStorage));
ReturnLogErrorOnFailure(opCredsIssuer.Initialize(mStorage));
ReturnLogErrorOnFailure(mFabricStorage.Initialize(&mStorage));

chip::Platform::ScopedMemoryBuffer<uint8_t> noc;
Expand All @@ -64,16 +67,16 @@ CHIP_ERROR CHIPCommand::Run()
// TODO - OpCreds should only be generated for pairing command
// store the credentials in persistent storage, and
// generate when not available in the storage.
ReturnLogErrorOnFailure(mOpCredsIssuer.GenerateNOCChainAfterValidation(mStorage.GetLocalNodeId(), mStorage.GetFabricId(),
ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan));
ReturnLogErrorOnFailure(opCredsIssuer.GenerateNOCChainAfterValidation(mStorage.GetLocalNodeId(), mStorage.GetFabricId(),
ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan));

chip::Controller::FactoryInitParams factoryInitParams;
factoryInitParams.fabricStorage = &mFabricStorage;
factoryInitParams.listenPort = mStorage.GetListenPort();

chip::Controller::SetupParams commissionerParams;
commissionerParams.storageDelegate = &mStorage;
commissionerParams.operationalCredentialsDelegate = &mOpCredsIssuer;
commissionerParams.operationalCredentialsDelegate = &opCredsIssuer;
commissionerParams.ephemeralKeypair = &ephemeralKey;
commissionerParams.controllerRCAC = rcacSpan;
commissionerParams.controllerICAC = icacSpan;
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class CHIPCommand : public Command
static void RunQueuedCommand(intptr_t commandArg);

CHIP_ERROR mCommandExitStatus = CHIP_ERROR_INTERNAL;
chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer;
tcarmelveilleux marked this conversation as resolved.
Show resolved Hide resolved

CHIP_ERROR StartWaiting(chip::System::Clock::Timeout seconds);
void StopWaiting();
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/common/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#pragma once

#include "controller/ExampleOperationalCredentialsIssuer.h"
#include <app/data-model/Nullable.h>
#include <controller/CHIPDeviceController.h>
#include <inet/InetInterface.h>
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/common/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "../../config/PersistentStorage.h"
#include "Command.h"
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <map>

class Commands
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/discover/DiscoverCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "../../config/PersistentStorage.h"
#include "../common/CHIPCommand.h"
#include <controller/ExampleOperationalCredentialsIssuer.h>

class DiscoverCommand : public CHIPCommand, public chip::Controller::DeviceAddressUpdateDelegate
{
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <zap-generated/CHIPClientCallbacks.h>
#include <zap-generated/CHIPClusters.h>

#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <lib/support/Span.h>
#include <lib/support/ThreadOperationalDataset.h>
#include <setup_payload/SetupPayload.h>
Expand Down
2 changes: 0 additions & 2 deletions examples/chip-tool/commands/reporting/ReportingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include "../../config/PersistentStorage.h"
#include "../common/CHIPCommand.h"

#include <controller/ExampleOperationalCredentialsIssuer.h>

class ReportingCommand : public CHIPCommand
{
public:
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/tests/TestCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <app/data-model/DecodableList.h>
#include <app/tests/suites/pics/PICSBooleanExpressionParser.h>
#include <app/tests/suites/pics/PICSBooleanReader.h>
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <lib/support/BitFlags.h>
#include <lib/support/TypeTraits.h>
#include <lib/support/UnitTestUtils.h>
Expand Down