Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Break CASESession::SendSigma3 into fg/bg parts This unblocks the main event loop while performance intensive (e.g. crypto) parts of the process occur. * Fix host tests * Remove temp log statements * Restyle * Refactor CASESession::SendSigma3 Add more structure to manage multiple steps of work. * Remove temporary logging * Restyle * Minor cleanup * Minor cleanup * Restyle * Use Platform::SharedPtr Also add alias template for Platform::WeakPtr. * Add mutex to FabricTable This supports locking during SignWithOpKeypair, and other operations that may alter state in the fabric table, while CASESession is performing work in the background during session establishment. CASESession registers as a fabric table listener, and when a fabric is removed (e.g. timeout) it attempts to cancel any outstanding work, and also clears out the fabric index in the work helper data. Therefore, if outstanding work has made it into SignWithOpKeypair, it should be OK until complete. It still relies on other tasks not altering FabricInfo, or the configured OperationalKeystore, but that would have had to have been true before anyways. The mutex was not made recursive. It's omitted from a few functions, which should be OK for now, and there should be cleanup on a subsequent commit (and probably fix up const-ness of member functions, and factoring of API vs. impl functions). This commit is to flush out build/test errors on all CI platforms, and to discuss/review/comment on the general approach. * Remove mutex, only async sometimes It's tricky to async background the signing operation, because of the two ways operational signing occurs. Legacy way: opkeypair manually added for fabric info Recommended way: opkeystore handles everything Removed std::mutex because it wasn't supported by all platforms. Instead, made background signing occur only if using the operational keystore (recommended way), since implementors can perform any needed mutual exclusion in the operational keystore. If using manually added operational keypairs (legacy way), keep signing in the foreground, since it's not feasible to mutex the entire fabric table and typically the operations is simpler anyways. * Clean up error handling * Restyle * Only store data.fabricTable if fg case Store only one of data.fabricTable or data.keystore. * Declare wither signing in background is supported OperationalKeystore declares whether it supports this capability. If so, then CASE session establishment may take advantage of it. If not, then CASE session establishment must use foreground. * Make some variables const * Clean up a few comments
- Loading branch information