How dmtf/libspdm works
Main Components
• SPDM Core Libraries – Representing the essential protocol components (e.g., common utilities, requester and responder libraries, message processing logic). For example, components under:
• library/spdm_common_lib
• library/spdm_requester_lib
• library/spdm_responder_lib
• SPDM Secured Message Layer – This manages the encoding, decoding, key exchange, and secure session management. Include:
• library/spdm_secured_message_lib
• library/spdm_transport_mctp_lib
• library/spdm_transport_pcidoe_lib
• Crypto Abstraction Layer – This layer abstracts cryptographic operations. It includes defined headers (in include/hal/library/cryptlib.h) and multiple OS-specific implementations that wrap Mbed TLS, OpenSSL, or even null/dummy cryptographic libraries found in os_stub. Represent:
• Cryptography engine with subcomponents for mbedtls (os_stub/cryptlib_mbedtls), openssl (os_stub/cryptlib_openssl), and fallback alternatives.
• os_stub, platform_lib, and related directories.
• Industry Standard Interfaces – The library also supports standards such as PCI, CXL, and MCTP, so include a branch showing “Standards Interfaces” (found in include/industry_standard).
• Unit Testing and Fuzzing Infrastructure – Add a separate section for the testing harness:
• Unit tests under unit_test/
• Fuzzing and symbolic execution aids
• Test executables for both requester and responder simulation
Relationships and Data Flow
• Interactions between the protocol core and the secured message library – the core sends requests to the secured message encoder/decoder, which in turn calls upon the crypto abstraction layer for cryptographic operations.
• Crypto abstraction layer to the OS Stub. Indicate that the cryptographic library may be chosen at build time (via mbedtls, openssl, etc.).
• Transport layer as a bridge between the SPDM layer and the physical or simulated interconnect interfaces. For example, the requester’s messages are packaged via the MCTP or PCIe modules.
Architectural Patterns and Design Principles
• Modularity: Separate components (e.g., different libraries for requester, responder, secured messaging) should be individually labeled.
• Abstraction & Adapters: Emphasize that the crypto and OS-specific operations are abstracted via wrapper libraries.
• Specification Compliance: Note that many modules refer to published standards (SPDM, SPDM over MCTP, PCIe, CXL).
Technologies and Frameworks
• Cryptographic technologies (Mbed TLS, OpenSSL, and FIPS support) and refer to the operating systems and toolchains (Visual Studio, GCC, CLANG).
Detail and Clarity
• Separate core protocol logic from transport and crypto responsibilities.
• Annotations if needed that mention relevant specifications (e.g., DSP0274 for SPDM protocols and DSP0277 for secured messages).