-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge changes from topic "da_libspdm" into integration
* changes: feat(da): add libspdm version 3.3.0 feat(lib/libc): add strchr required by new mbedtls configs
- Loading branch information
Showing
13 changed files
with
457 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ out | |
*~ | ||
*.patch | ||
*.swp | ||
ext/libspdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
configs/libspdm/0001-cryptlib_mbedtls-use-external-Mbed-TLS.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
From dc3ce817bb479bdf1317c68e5496b93dbbbcb310 Mon Sep 17 00:00:00 2001 | ||
From: Arunachalam Ganapathy <[email protected]> | ||
Date: Wed, 3 Apr 2024 14:13:44 +0100 | ||
Subject: [PATCH] cryptlib_mbedtls: use external Mbed TLS | ||
|
||
Do not include mbedtls headers files from libspdm fork of Mbed TLS. | ||
This change is RMM specific, for building cryptlib_mbedtls library | ||
from RMM. | ||
|
||
crt_wrapper_host.c: duplicate symbols | ||
Rename mbedtls_platform_zeroize as it conflicts with RMM MbedTLS | ||
|
||
Signed-off-by: Arunachalam Ganapathy <[email protected]> | ||
--- | ||
os_stub/cryptlib_mbedtls/CMakeLists.txt | 9 --------- | ||
os_stub/cryptlib_mbedtls/sys_call/crt_wrapper_host.c | 2 +- | ||
2 files changed, 1 insertion(+), 10 deletions(-) | ||
|
||
diff --git a/os_stub/cryptlib_mbedtls/CMakeLists.txt b/os_stub/cryptlib_mbedtls/CMakeLists.txt | ||
index fc87e2cf54..0e8e2248d2 100644 | ||
--- a/os_stub/cryptlib_mbedtls/CMakeLists.txt | ||
+++ b/os_stub/cryptlib_mbedtls/CMakeLists.txt | ||
@@ -9,10 +9,6 @@ INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/os_stub/include | ||
${LIBSPDM_DIR}/os_stub | ||
${LIBSPDM_DIR}/os_stub/cryptlib_mbedtls | ||
- ${LIBSPDM_DIR}/os_stub/mbedtlslib/include | ||
- ${LIBSPDM_DIR}/os_stub/mbedtlslib/include/mbedtls | ||
- ${LIBSPDM_DIR}/os_stub/mbedtlslib/mbedtls/include | ||
- ${LIBSPDM_DIR}/os_stub/mbedtlslib/mbedtls/include/mbedtls | ||
) | ||
|
||
SET(src_cryptlib_mbedtls | ||
@@ -48,8 +44,3 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
TARGET_COMPILE_OPTIONS(cryptlib_mbedtls PRIVATE /wd4090 /wd4200) | ||
endif() | ||
endif() | ||
- | ||
-if(MBEDTLS_CONFIG_FILE) | ||
-else() | ||
- TARGET_COMPILE_DEFINITIONS(cryptlib_mbedtls PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>) | ||
-endif() | ||
diff --git a/os_stub/cryptlib_mbedtls/sys_call/crt_wrapper_host.c b/os_stub/cryptlib_mbedtls/sys_call/crt_wrapper_host.c | ||
index 9ce520c7c5..72decdba7d 100644 | ||
--- a/os_stub/cryptlib_mbedtls/sys_call/crt_wrapper_host.c | ||
+++ b/os_stub/cryptlib_mbedtls/sys_call/crt_wrapper_host.c | ||
@@ -25,7 +25,7 @@ int my_snprintf(char *str, size_t size, const char *format, ...) | ||
return 0; | ||
} | ||
|
||
-void mbedtls_platform_zeroize(void *buf, size_t len) | ||
+void my_mbedtls_platform_zeroize(void *buf, size_t len) | ||
{ | ||
libspdm_zero_mem(buf, len); | ||
} | ||
-- | ||
2.39.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
/* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* SPDX-FileCopyrightText: Copyright TF-RMM Contributors. | ||
*/ | ||
|
||
#ifndef LIBSPDM_CONFIG_H | ||
#define LIBSPDM_CONFIG_H | ||
|
||
/* Disable FIPS 140-3 mode. */ | ||
#define LIBSPDM_FIPS_MODE 0 | ||
|
||
/* Based on RMM build type, set libspdm DEBUG flag */ | ||
#ifdef DEBUG | ||
#define LIBSPDM_DEBUG_ENABLE 1 | ||
#else | ||
#define LIBSPDM_DEBUG_ENABLE 0 | ||
#endif | ||
|
||
/* | ||
* For a Requester this value specifies the maximum number of entries that | ||
* libspdm will tolerate in a `VERSION` response before returning an error. | ||
*/ | ||
#define LIBSPDM_MAX_VERSION_COUNT 5 | ||
|
||
/* | ||
* This value specifies the maximum size, in bytes, of the | ||
* `PSK_EXCHANGE.PSKHint` field. Although RMM disables PSK capability, this | ||
* macro mut be defined as libspdm_secured_message_context_t uses this macro. | ||
*/ | ||
#define LIBSPDM_PSK_MAX_HINT_LENGTH 16 | ||
|
||
/* | ||
* This value specifies the maximum number of root certificates that libspdm | ||
* can support. | ||
*/ | ||
#define LIBSPDM_MAX_ROOT_CERT_SUPPORT 10 | ||
|
||
/* Only one session per device is supported by RMM Specification */ | ||
#define LIBSPDM_MAX_SESSION_COUNT 1 | ||
|
||
/* | ||
* This value specifies the maximum size, in bytes, of a certificate chain or | ||
* measurements that can be stored in a libspdm context. | ||
*/ | ||
#define LIBSPDM_MAX_CERT_CHAIN_SIZE 0x1000 | ||
#define LIBSPDM_MAX_MEASUREMENT_RECORD_SIZE 0x1000 | ||
|
||
/* | ||
* Partial certificates can be retrieved from a Responder and through multiple | ||
* messages the complete certificate chain can be constructed. This value | ||
* specifies the maximum size, in bytes, of a partial certificate that can be | ||
* received. | ||
*/ | ||
#define LIBSPDM_MAX_CERT_CHAIN_BLOCK_LEN 1024 | ||
|
||
/* | ||
* This value specifies whether libspdm will use a running calculation over the | ||
* transcript, where requests and responses are discarded as they are | ||
* cryptographically consumed, or whether libspdm will buffer the entire | ||
* transcript before calculating the digest or signature. | ||
*/ | ||
#define LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT 0 | ||
|
||
/* This can be set to 0 for the device which does not need X509 parser. */ | ||
#define LIBSPDM_CERT_PARSE_SUPPORT 1 | ||
|
||
/* | ||
* Enable only the cryptography configuration that are required for SPDM | ||
* requester for DA. todo: Disable more cryptography configuration. | ||
*/ | ||
#define LIBSPDM_RSA_SSA_2048_SUPPORT 1 | ||
#define LIBSPDM_RSA_SSA_3072_SUPPORT 1 | ||
#define LIBSPDM_RSA_SSA_4096_SUPPORT 1 | ||
|
||
#define LIBSPDM_RSA_PSS_2048_SUPPORT 1 | ||
#define LIBSPDM_RSA_PSS_3072_SUPPORT 1 | ||
#define LIBSPDM_RSA_PSS_4096_SUPPORT 1 | ||
|
||
#define LIBSPDM_ECDSA_P256_SUPPORT 1 | ||
#define LIBSPDM_ECDSA_P384_SUPPORT 1 | ||
#define LIBSPDM_ECDSA_P521_SUPPORT 1 | ||
|
||
#define LIBSPDM_SM2_DSA_P256_SUPPORT 0 | ||
|
||
#define LIBSPDM_EDDSA_ED25519_SUPPORT 0 | ||
#define LIBSPDM_EDDSA_ED448_SUPPORT 0 | ||
|
||
#define LIBSPDM_FFDHE_2048_SUPPORT 1 | ||
#define LIBSPDM_FFDHE_3072_SUPPORT 1 | ||
#define LIBSPDM_FFDHE_4096_SUPPORT 1 | ||
|
||
#define LIBSPDM_ECDHE_P256_SUPPORT 1 | ||
#define LIBSPDM_ECDHE_P384_SUPPORT 1 | ||
#define LIBSPDM_ECDHE_P521_SUPPORT 1 | ||
|
||
#define LIBSPDM_SM2_KEY_EXCHANGE_P256_SUPPORT 0 | ||
|
||
#define LIBSPDM_AEAD_AES_128_GCM_SUPPORT 1 | ||
#define LIBSPDM_AEAD_AES_256_GCM_SUPPORT 1 | ||
|
||
#define LIBSPDM_AEAD_CHACHA20_POLY1305_SUPPORT 1 | ||
|
||
#define LIBSPDM_AEAD_SM4_128_GCM_SUPPORT 0 | ||
|
||
#define LIBSPDM_SHA256_SUPPORT 1 | ||
#define LIBSPDM_SHA384_SUPPORT 1 | ||
#define LIBSPDM_SHA512_SUPPORT 1 | ||
|
||
#define LIBSPDM_SHA3_256_SUPPORT 0 | ||
#define LIBSPDM_SHA3_384_SUPPORT 0 | ||
#define LIBSPDM_SHA3_512_SUPPORT 0 | ||
|
||
#define LIBSPDM_SM3_256_SUPPORT 0 | ||
|
||
/* Enable only the capabilities that are required for SPDM requester for DA */ | ||
#define LIBSPDM_ENABLE_CAPABILITY_CERT_CAP 1 | ||
#define LIBSPDM_ENABLE_CAPABILITY_MEAS_CAP 1 | ||
#define LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP 1 | ||
#define LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP 1 | ||
#define LIBSPDM_ENABLE_CAPABILITY_CHAL_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_PSK_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_HBEAT_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_MUT_AUTH_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_ENCAP_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_CSR_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_CSR_CAP_EX 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_SET_CERT_CAP 0 | ||
#define LIBSPDM_ENABLE_CAPABILITY_EVENT_CAP 0 | ||
|
||
/* Required for IDE_KM and TDISP VDM messages */ | ||
#define LIBSPDM_ENABLE_VENDOR_DEFINED_MESSAGES 1 | ||
|
||
/* | ||
* If 1 then endpoint supports sending GET_CERTIFICATE and GET_DIGESTS requests. | ||
*/ | ||
#define LIBSPDM_SEND_GET_CERTIFICATE_SUPPORT 1 | ||
|
||
/* If 1 then endpoint supports sending CHALLENGE request. */ | ||
#define LIBSPDM_SEND_CHALLENGE_SUPPORT 0 | ||
|
||
/* | ||
* If 1 then endpoint supports sending the GET_SUPPORTED_EVENT_TYPES, | ||
* SUBSCRIBE_EVENT_TYPES, and encapsulated EVENT_ACK messages. In addition, | ||
* LIBSPDM_ENABLE_CAPABILITY_ENCAP_CAP must also be 1. | ||
*/ | ||
#define LIBSPDM_EVENT_RECIPIENT_SUPPORT 0 | ||
|
||
/* | ||
* When LIBSPDM_RESPOND_IF_READY_SUPPORT is 0 then | ||
* - For a Requester, if the Responder sends a ResponseNotReady ERROR response | ||
* then the error is immediately returned to the Integrator. The Requester | ||
* cannot send a RESPOND_IF_READY request. | ||
* When LIBSPDM_RESPOND_IF_READY_SUPPORT is 1 then | ||
* - For a Requester, if the Responder sends a ResponseNotReady ERROR response | ||
* then libspdm waits an amount of time, as specified by the RDTExponent | ||
* parameter, before sending RESPOND_IF_READY. | ||
*/ | ||
#define LIBSPDM_RESPOND_IF_READY_SUPPORT 1 | ||
|
||
/* Enable message logging. */ | ||
#define LIBSPDM_ENABLE_MSG_LOG 0 | ||
|
||
/* Enable libspdm configs macro checking during compilation. */ | ||
#define LIBSPDM_CHECK_MACRO 1 | ||
|
||
/* Enable checks to the SPDM context during runtime. */ | ||
#define LIBSPDM_CHECK_SPDM_CONTEXT 1 | ||
|
||
/* Enable passing the SPDM context to HAL functions. */ | ||
#define LIBSPDM_HAL_PASS_SPDM_CONTEXT 0 | ||
|
||
#endif /* LIBSPDM_CONFIG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.