Run uncrustify on cerberus-core repo
Uncrustify Configuration file run from cerberus-core root directory,
Uncructify format run cerberus-core except below directories,
external\
projects\
cmake\
Related work items: #3970
- For types that have created static initializers and that support const instances, updated references in many APIs and instance structs to be referenced as const. This was mostly a continuation of changes that have been slowly happening throughout the code to support these modes.
- Functions that have unused parameters have been updated to use the UNUSED macro to avoid compiler warnings. It is not guaranteed that unused parameters are universally handled at this point, but there is much higher coverage than there used to be.
- Fixed some missing include references and naming issues, specifically on the periodic task handlers, which are relatively new.
- Updated the NIST800-108 KDF implementation to decouple it from math.h.
- Added new mock argument expectations to allow for values that are less or greater than an expected value.
- Updated protocol and manifest observers to support const instances.
- Added a 'null' app_context implementation that can be used by implementations that don't require any application context to be saved during firmware update and reset.
- Created a periodic task implementation for bare-metal environment. The task just provides an infinite loop that will call registered handlers.
There are a few changes included here:
1. Enhanced the firmware updater to provide options on how and when the recovery and revocation steps get performed. It is now possible to always make sure the recovery image is updated and only do recovery updates and revocation after a device reset. To easily support implementations that want to use different mechanisms for update, the firmware update handler code was refactored out of the task context into another module, with various configurations and derivations to support the desired behavior.
2. The platform abstraction for tasks put too much logic in the task context that needs to be implemented for each platform. New task abstractions have been added that leave all the handling logic in the common code and only require the different platforms to provide a minimal wrapper for the actual task creation and execution. This was leveraged to manage the different ways firmware update can now be handled. Task ports for FreeRTOS were created.
3. There were a few places where the platform_clock APIs were being misused, making assumptions about the API that didn't hold across platform ports. These usages were cleaned up. Specifically for component attestation, the way it determined the time until the next event was not robust across platforms. A new platform API was added to serve this use case. This API was also required for the new platform task abstractions.
4. To avoid platform assumptions and platform API misuse, a common header file has been created that all core code now references. This platform API header file defines the functions that will exist for any port and specifies the contract and usage of these functions.
5. There was a bug in the way the Linux platform port calculated durations that caused it to add an extra second in certain scenarios.
The PFM, and common manifest formats, have been updated to correct some issues with the current structures and to provide additional features. Initially, existing functionality is maintained while supporting that functionality in the new PFM structure. Additional changes will follow to fully enable the new features supported by the new PFM structure.
This PR adds new pcr measurements to the TCG log. A measurement of PFM, CFM and PCD IDs is added to the PCR store.
Also, measurements of PFM and PCD platform IDs is added to PCR store.
Related work items: #457, #481