Граф коммитов

630 Коммитов

Автор SHA1 Сообщение Дата
Christopher Weimer 001c5da1e4 Separate the task allocation and start operations into separate calls.
This allows applications greater control over when and how FreeRTOS tasks are created and executed.  It's now possible to allocate the memory for the task without having it also start to execute.
2024-07-09 18:16:46 +00:00
Christopher Weimer b4d4a717f8 Switch to new authorized command handling and remove legacy handlers.
This is the final piece rearchitecting the authorized command handling and config reset flows.  It decouples the command handling from the types of operations that can be executed after authorization, allowing easy extension to any platform-specific workflows.  Without the direct dependency on config_resete APIs, intrusion reset is also decoupled from resetting other configuration in the system.
2024-07-08 16:33:33 +00:00
Christopher Weimer f3800a90c9 Create authorized execution contexts for existing authorized commands.
- Execution handler for all configuration reset calls.  This excludes intrusion reset, since that will ultimately be pulled out of config_reset.
- Execution handler for resetting intrusion state via the intrusion manager.
- Update config_reset to support static/const initialization.
2024-07-03 00:12:58 +00:00
Anton Rakovchuk eabca51439 Merged PR 3752: Report SPDM as supported message type for MCTP protocol
Report SPDM as supported message type for MCTP protocol
2024-06-27 19:01:34 +00:00
Anton Rakovchuk 253d548a9d Merged PR 3726: SPDM_CHALLENGE message
SPDM_CHALLENGE message
2024-06-26 21:05:21 +00:00
Christopher Weimer 7c575d5a85 Create the framework for executing arbitrary authorized commands.
Update to the background command handler to support executing arbitrary commands that have been securely authorized.  This is the first step of this refactoring to provide the hooks for this handling.  A subsequent update will provide execution contexts for the current commands and update the command processing to use these new interfaces.
2024-06-12 20:06:45 +00:00
Gandhimathi Anand d205a2c03f Merged PR 3686: New API for set device size less than 16MB without SFDP.
New API for set device size less than 16MB without SFDP.

Related work items: #4064
2024-06-06 18:25:20 +00:00
Ashvinkumar Parmar 4181f24aa4 Merged PR 3663: [Cerberus-core]: Integrate uncrustify on onefleet pipeline
Add uncrustify in onefleet pipeline

Related work items: #3970
2024-06-06 14:44:29 +00:00
Christopher Weimer 7b3fa88e2f Create a message transport for handling MCTP VDM encapsulation.
This will handle any type of vendor defined, and it may or may not be a necessary layer of the protocol stack depending on how the vendor protocol is constructed.

As part of this update, commonalities between all these intermediate layers of the protocol stack has been factored out into a new type that each of the MCTP message transports inherits.
2024-06-05 17:15:22 +00:00
Umar Farooq Kolimi 7d6b98f566 Merged PR 3648: Added mock test API and updated the little endian sign spdm 1.2 unit test.
Added the necessary test mocks and rerun the Valgrind tests with these changes, ensuring they pass successfully.

Related work items: #4033
2024-06-05 04:08:46 +00:00
Long Wei 8414366879 Merged PR 3356: Check intrusion state before resetting intrusion
- Check intrusion state before resetting intrusion
- Modify intrusion_manager_test correspondingly.

Related work items: #3906
2024-06-04 23:42:05 +00:00
Christopher Weimer 344427deb5 Updates to command authorization handing.
This is the first part of several steps to support impactless vs. impactful detection in the FW update process.

The existing command authorization handling is not easily scalable to support different numbers and types of authorization handlers.  Every new authenticated command would need an explicit API added to the interface for handling and the init call would get extended.  This would also require a more complicated integration if certain platforms had authenticated commands that didn't exist on others.  The command authorization has been updated to remove these inefficiencies by providing a single API that would work for any arbitrary command.  The supported commands and identifiers for these commands is configured per-platform at init time.  The existing APIs for specific commands have been left for now, but may be removed in the future.

In addition, the command authorization handler was updated to support static and const instances.  This change had the ripple effect of requiring updates to the authorization contexts as well.  These were equally updated to support static and const instances.

Authorization using a challenge token was even further updated, since the current implementation is limited to using SHA-256 hashes for token signing and verifying.  To provide flexibility to support any combination of keys and hashes, the challenge handler was updated to use the auth_token type for token management.  This makes challenge authorization not much more than an adaptor between the authorization and auth_token APIs.
2024-06-04 23:08:38 +00:00
Christopher Weimer 845e1a7495 Update MCTP interface to only include Cerberus handler for response processing.
With the removal of all error handling from the MCTP layer, the Cerberus handler is only needed for the deprecated response processing, just like MCTP control and SPDM.
2024-06-04 17:33:03 +00:00
Rob Unoki 218738cab3 Merged PR 3611: Fixes and improvements for debug log tests
Fixes and improvements for debug log tests
- Properly clear debug_timestamp and debug_log on release
- Don't assert on first error encountered on release
- Rename init and release functions with standard naming convention.
2024-06-04 00:20:31 +00:00
Anton Rakovchuk 850822f791 Merged PR 3665: Few fixes for in session SPDM message handling
Logan has discovered and made some fixes for SPDM responder. This PR summarizes all of them making even more validation tests to pass.
2024-06-03 20:14:45 +00:00
Christopher Weimer e9703b7c82 Create a message transport for handling MCTP message encapsulation.
This defines an intermediate msg_transport implementation to handle the MCTP message layer of the protocol stack.  It's designed to handle MCTP messages of a single type.  If multiple different types of messages need to be handled, multiple different msg_transport instances would need to be instantiated.
2024-06-01 21:18:36 +00:00
Christopher Weimer a972c94aea Fix several issues with RSA ephemeral key generation
- Unit test suite was wrong in many ways.  Most critically, the mock was never actually getting validated.  This  masked all the construction issues with the tests.
- Fixed Valgrind issues.
- Removed the compile checks on RSA private key support being enabled.  This module doesn't make sense if RSA private keys are not supported, so it would be better to have a compile-time failure.
- Fixed argument naming consistency across API, mock, and implementation definitions.
- Cleaned up a bunch of comments.
2024-06-01 20:34:57 +00:00
Krutik Amin dbd356af83 Merged PR 3271: Added ephemeral key generation
Added ephemeral key generation support

- Added ephemeral key generation support
- Added ephemeral key generation rsa support
- Added ephemeral key generation mock support

Related work items: #3929
2024-05-30 05:28:10 +00:00
Vishal Mhatre f04fc7dd70 Merged PR 3617: Consolidating error reporting
This change consolidates error encoding at a single place for each SPDM Responder processor function.

Related work items: #4037
2024-05-29 18:11:41 +00:00
Anton Rakovchuk 80d9796538 Merged PR 3595: SPDM fixes for conformance verification with SPDM device validator
SPDM fixes for conformance verification
2024-05-29 01:15:06 +00:00
Christopher Weimer e678ef72c0 Update attestation to request a single certificate at a time from a device.
Requesting the entire certificate chain and building it in dynamically allocated memory is not scalable to arbitrary certificate chain lengths.  The certificate chain processing has been updated to only get one certificate at a time from the device and authenticate it, starting from the root CA.  As each certificate is validated, the trust anchor of the chain is moved.  This ensures there are no more than two certificates in memory any given time.  It does have the side effect of no longer enforcing path length constraints on CA certificates.

This change was applied to both Cerberus and SPDM based attestation.  In addition, most situations will completely rely on the static message buffer for certificate storage, removing dynamic allocation out of the request path.  Overall, this approach may be slightly less performant, especially for SPDM, but is much more efficient in terms of memory usage.
2024-05-28 19:41:33 +00:00
Christopher Weimer bdde7dd250 Update the X.509 API to allow an intermediate CA to act as a trust anchor for a cert chain.
Additional test keys and certs have been created to support this new workflow:
- A new ECC-521 key pair
- End entity certificates that through an ICA to the root

The X.509 test suite was also generally updated for the authenticate tests to remove random ECC key generation in favor of using pre-determined ECC test keys.  The old tests were actually leaking the ECC engine, so changing this code also fixed that issue.
2024-05-28 18:52:49 +00:00
Rajesh Bhagat 50909097d2 Merged PR 3328: Add new attestation states for attestation requester
Add new attestation states for attestation requester

 1. DEVICE_MANAGER_ATTESTATION_INTERRUPED
 2. DEVICE_MANAGER_ATTESTATION_INVALID_VERSION
 3. DEVICE_MANAGER_ATTESTATION_INVALID_CAPS
 4. DEVICE_MANAGER_ATTESTATION_INVALID_ALGORITHM
 5. DEVICE_MANAGER_ATTESTATION_INVALID_DIGESTS
 6. DEVICE_MANAGER_ATTESTATION_INVALID_CERTS
 7. DEVICE_MANAGER_ATTESTATION_INVALID_CHALLENEGE
 8. DEVICE_MANAGER_ATTESTATION_INVALID_MEASUREMENT
 9. DEVICE_MANAGER_ATTESTATION_MEASUREMENT_MISMATCH
10. DEVICE_MANAGER_ATTESTATION_UNTRUSTED_CERTS
11. DEVICE_MANAGER_ATTESTATION_INVALID_RESPONSE
12. DEVICE_MANAGER_AUTHENTICATED_WITH_TIMEOUT

Above attestation states help to clearly identify the errors
and take appropriate actions.

Related work items: #3895
2024-05-27 07:16:34 +00:00
Anton Rakovchuk a18a894abf Merged PR 3623: Fix unit test for valgrind issue
Unit test was not initializing stack allocated struct
2024-05-25 22:58:20 +00:00
Maheshkumar Prajapati cf669f243a Merged PR 3415: [Recovery] Created separate file init_cmd for recovery
separate command interface system for recovery

Related work items: #3947
2024-05-25 00:07:18 +00:00
Paul Rhea 112d1c822c Merged PR 3616: resolve Valgrind failure in pipeline
resolve Valgrind failure in pipeline

Related work items: #4028
2024-05-23 17:40:14 +00:00
Christopher Weimer 908f7577ac Enable FIPS-compatible ECDSA sign/verify for ECC hardware implementations.
Add general support for enabling ECDSA usage directly with ecc_hw instances in a FIPS compliant way.  Only direct interfacing with ECC HW is part of this update.  FIPS compliant usage for the ECC API will come later.

- Provide ECDSA sign functions that interact directly with an ecc_hw instance and bundle together the hash and sign operations of ECDSA.  This function takes an optional RNG instance, providing the ability to override random 'k' generation during signing.
- Provide ECDSA verify functions that interact directly with an ecc_hw instance and bundle together the hash and verify operations of ECDSA.
- Update the ecc_hw sign API to take an optional RNG to use for 'k' generation.
- Build known answer tests for ECDSA sign/verify ECC HW wrapper functions.
- Update the ECC API implementation using ecc_hw to take an RNG instance for use with signing calls.  This is meant to accommodate ECC HW implementations that don't have a default RNG to use when one isn't provided.
2024-05-23 17:33:12 +00:00
Thiyagu Selvam 3522a13dde Merged PR 3602: [feature] Updated the IDE driver interface
This change includes:
 - Add new error codes to differentiate key set go failure for rx and tx direction.
 - Update the AES key definitions with MACRO instead of hardcoded values.

Related work items: #4010
2024-05-23 16:25:08 +00:00
Christopher Weimer eec92a3052 Refactor hash self-tests to optimize execution.
It's not always necessary to test all the different ways of interfacing with the hash engine, since data management is not part of the algorithm.  For hash self-tests, separate the two different calculation mechanisms into separate self-tests so that both don't always get run for any given algorithm.  For HMAC self-tests, remove the start/update/finish set of HMAC calls, as this is redundant.
2024-05-23 01:22:23 +00:00
Ashvinkumar Parmar cf70eca74e Merged PR 3286: Run uncrustify on cerberus-core repo
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
2024-05-16 05:19:56 +00:00
Anton Rakovchuk f0af127d5f Merged PR 3567: Fix build break caused by SPDM changes
Fix build break caused by SPDM changes
2024-05-15 01:23:08 +00:00
Vishal Mhatre e9f7c86ce7 Merged PR 3516: [feat] SPDM FINISH + END_SESSION request processing
This change contains the implementation of the FINISH + END_SESSION request processing for the SPDM responder.

Related work items: #3414, #3415
2024-05-14 02:19:29 +00:00
Christopher Weimer 9ceec7d89f Move error and response generation out of the MCTP transport layer.
This is the final step to remove details from other protocols out of the MCTP transport handling.  Rather than generating Cerberus status responses based on errors or lack of payload, this step is handled by the Cerberus protocol handlers.

This also moves error logging for Cerberus messages out of the MCTP layer.  The error message that is logged now contains more relevant details about the failure, such as command code being executed.

Currently both MSFT VDM and Cerberus handlers have this functionality, but this is likely a temporary state until the Cerberus protocol handler is better integrated with Cerberus command handling.
2024-05-13 18:40:06 +00:00
Anjali Verma 2ec360a997 Merged PR 3161: Update to make spdm script common for all components
Update to make spdm script common for all components

    - Add parameter to take the component name as input and use it for naming the output xml files
    - Add parameter to take the signed status as input

Related work items: #3292
2024-05-09 05:36:38 +00:00
Paul Rhea 58d1a086c6 Merged PR 3264: SPDM 1.0 support for review
SPDM 1.0 support for review

Related work items: #3740
2024-05-09 04:37:51 +00:00
Rajib Dutta 274dcd9ebf Merged PR 3525: [Build Fix] Fixing hash_type params to point to the right enum value.
[Build Fix] Fixing hash_type params to point to the right enum value.
2024-05-07 22:46:28 +00:00
Christopher Weimer 2198c45cbe Implement RFC6979 for deterministic ECDSA signature generation. 2024-05-06 23:36:40 +00:00
Anton Rakovchuk 489cc3d832 Merged PR 3504: Make session manager optional for SPDM responder
Make session manager optional for SPDM responder
2024-05-05 09:02:44 +00:00
Anton Rakovchuk 7d24a87bb5 Merged PR 3502: Fix some build issues
Fix some build issues
2024-05-04 02:52:16 +00:00
Vishal Mhatre 2d92ea03db Merged PR 3426: [feat] SPDM KEY_EXCHANGE request processing
This change contains the implementation of the KEY_EXCHANGE request processing for the SPDM responder.

Related work items: #3409
2024-05-03 18:56:42 +00:00
Christopher Weimer f7e93972a8 Updates for additional ECC hardware functionality.
- Add a function to check for an empty buffer.  This is useful when generating ECDSA signatures that need to check for a 0 value.
- Additional error codes for ECC hardware implementations.
2024-05-02 21:06:04 +00:00
Vishal Mhatre 5a4b46a168 Merged PR 3460: [feat] TDISP GET_DEVICE_INTERFACE_REPORT and STOP_INTERFACE request handling
This change contains processing of the GET_DEVICE_INTERFACE_REPORT and STOP_INTERFACE request.

Related work items: #3601, #3604
2024-04-27 02:43:19 +00:00
Christopher Weimer a319f31a23 Minor formatting fix to hash KAT file. 2024-04-25 23:49:54 +00:00
Vishal Mhatre 9284898e1a Merged PR 3448: [feat] TDISP START_INTERFACE request handling
This change contains processing of the START_INTERFACE request.

Related work items: #3600
2024-04-24 20:05:55 +00:00
Christopher Weimer 9504c3c151 Refactor hash and KDF self-tests for better isolation.
To isolate KAT tests and vectors from targets that don't need them, move the SHA, HMAC, and KDF self-tests to a separate files from the main APIs.

This is just moving functions from one file to another.  No contents have been changed from what was there previously.
2024-04-22 22:01:43 +00:00
Vishal Mhatre cdf3d0da23 Merged PR 3316: [feat] TDISP GET_DEVICE_INTERFACE_STATE request handling
This change contains processing of the GET_DEVICE_INTERFACE_STATE request.

Related work items: #3599
2024-04-19 15:59:35 +00:00
Cristian Pop d4da2b4a9a Merged PR 3394: Build fix if FIRMWARE_UPDATE_DISABLE_SELF_RESET is defined.
Build fix if FIRMWARE_UPDATE_DISABLE_SELF_RESET is defined.
2024-04-17 19:41:00 +00:00
Sriram Prasad Sahoo 5409b95717 Merged PR 3170: Add support for infineon OSPI flash
Add support for infineon OSPI flash

Related work items: #3074
2024-04-17 16:22:24 +00:00
Christopher Weimer c86e8969b3 Create known answer tests for SHA, HMAC, and KDF.
FIPS requires known answer tests to be executed at run-time before using any crypto instantiation.  Self tests have been created for the hash API, HMAC, and KDFs that can be executed to satisfy run-time FIPS requirements.

Additionally, there have been optimizations and updates to the HMAC and KDF implementations and test suites.

Updated the 'to_array.sh' script to align with current array initializer formatting.
2024-04-16 18:29:57 +00:00
Atul Shah acc7661f0f Merged PR 3416: TODO for better error handling when attempting to load key from keystore
Added a TODO for better error handling when attempting to load key from keystore

Related work items: #3927
2024-04-16 17:18:05 +00:00