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

Async send sigma3 #25695

Merged
merged 35 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
24b9742
Break CASESession::SendSigma3 into fg/bg parts
mlepage-google Feb 27, 2023
1a6aa29
Merge branch 'master' into async-send-sigma3
mlepage-google Feb 27, 2023
1187bee
Fix host tests
mlepage-google Feb 27, 2023
8127f00
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 15, 2023
52f4a6f
Remove temp log statements
mlepage-google Mar 15, 2023
7bbd6f8
Restyle
mlepage-google Mar 15, 2023
f8f39fe
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 17, 2023
e3c2db4
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 20, 2023
ebc6de0
Refactor CASESession::SendSigma3
mlepage-google Mar 27, 2023
35609ef
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 27, 2023
56ca1d5
Remove temporary logging
mlepage-google Mar 28, 2023
e3c6341
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 28, 2023
85bba1e
Restyle
mlepage-google Mar 28, 2023
6410b30
Minor cleanup
mlepage-google Mar 28, 2023
239fce1
Minor cleanup
mlepage-google Mar 28, 2023
e1e16d6
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 29, 2023
5d0f716
Restyle
mlepage-google Mar 29, 2023
c1628d6
Merge branch 'master' into async-send-sigma3
mlepage-google Mar 29, 2023
6d8e2b1
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 3, 2023
ddfff28
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 4, 2023
c9d12f0
Use Platform::SharedPtr
mlepage-google Apr 4, 2023
c9dd9a0
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 6, 2023
54586ca
Add mutex to FabricTable
mlepage-google Apr 6, 2023
43e4e63
Remove mutex, only async sometimes
mlepage-google Apr 12, 2023
6b1afb9
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 12, 2023
94c1f18
Clean up error handling
mlepage-google Apr 12, 2023
025dd23
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 12, 2023
e719521
Restyle
mlepage-google Apr 12, 2023
e807dc5
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 17, 2023
6479997
Only store data.fabricTable if fg case
mlepage-google Apr 17, 2023
51dd538
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 19, 2023
db76a70
Declare wither signing in background is supported
mlepage-google Apr 19, 2023
633b57f
Make some variables const
mlepage-google Apr 27, 2023
b75e079
Clean up a few comments
mlepage-google Apr 27, 2023
7fc0cd6
Merge branch 'master' into async-send-sigma3
mlepage-google Apr 27, 2023
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
8 changes: 8 additions & 0 deletions src/credentials/FabricTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ class DLL_EXPORT FabricTable
*/
bool HasOperationalKeyForFabric(FabricIndex fabricIndex) const;

/**
* @brief Returns the operational keystore. This is used for
* CASE and the only way the keystore should be used.
*
* @return The operational keystore, nullptr otherwise.
*/
const Crypto::OperationalKeystore * GetOperationalKeystore() { return mOperationalKeystore; }

/**
* @brief Add a pending trusted root certificate for the next fabric created with `AddNewPendingFabric*` methods.
*
Expand Down
14 changes: 13 additions & 1 deletion src/crypto/OperationalKeystore.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ class OperationalKeystore
virtual void RevertPendingKeypair() = 0;

// ==== Primary operation required: signature
/**
* @brief Whether `SignWithOpKeypair` may be performed in the background.
*
* If true, `CASESession` may attempt to perform `SignWithOpKeypair` in the
* background. In this case, `OperationalKeystore` should protect itself,
* e.g. with a mutex, as the signing could occur at any time during session
* establishment.
*
* @retval true if `SignWithOpKeypair` may be performed in the background
* @retval false if `SignWithOpKeypair` may NOT be performed in the background
*/
virtual bool SupportsSignWithOpKeypairInBackground() const { return false; }

/**
* @brief Sign a message with a fabric's currently-active operational keypair.
*
Expand All @@ -164,7 +177,6 @@ class OperationalKeystore
* @retval CHIP_ERROR_INVALID_FABRIC_INDEX if no active key is found for the given `fabricIndex` or if
* `fabricIndex` is invalid.
* @retval other CHIP_ERROR value on internal crypto engine errors
*
*/
virtual CHIP_ERROR SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message,
Crypto::P256ECDSASignature & outSignature) const = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/support/CHIPMem.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ inline SharedPtr<T> MakeShared(Args &&... args)
return SharedPtr<T>(New<T>(std::forward<Args>(args)...), Deleter<T>());
}

template <typename T>
using WeakPtr = std::weak_ptr<T>;

// See MemoryDebugCheckPointer().
extern bool MemoryInternalCheckPointer(const void * p, size_t min_size);

Expand Down
Loading