Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions include/library/spdm_lib_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@
#define LIBSPDM_MAX_SESSION_COUNT 4
#endif

/* This value specifies the maximum size, in bytes, of a certificate chain that can be stored in a
* libspdm context.
*/
#ifndef LIBSPDM_MAX_CERT_CHAIN_SIZE
#define LIBSPDM_MAX_CERT_CHAIN_SIZE 0x1000
#endif

#ifndef LIBSPDM_MAX_MEASUREMENT_RECORD_SIZE
#define LIBSPDM_MAX_MEASUREMENT_RECORD_SIZE 0x1000
#endif
Expand Down Expand Up @@ -431,6 +424,33 @@
#define LIBSPDM_ML_KEM_1024_SUPPORT 1
#endif

/* This value specifies the maximum size, in bytes, of a certificate chain that can be stored in a
* libspdm context.
*/
#ifndef LIBSPDM_MAX_CERT_CHAIN_SIZE
/* MLDSA - 0x8000, SLHDSA - 0x28000 */
#if ((LIBSPDM_SLH_DSA_SHA2_128S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_128S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHA2_128F_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_128F_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHA2_192S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_192S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHA2_192F_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_192F_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHA2_256S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_256S_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHA2_256F_SUPPORT) || \
(LIBSPDM_SLH_DSA_SHAKE_256F_SUPPORT))
#define LIBSPDM_MAX_CERT_CHAIN_SIZE 0x28000
#elif ((LIBSPDM_ML_DSA_44_SUPPORT) || \
(LIBSPDM_ML_DSA_65_SUPPORT) || \
(LIBSPDM_ML_DSA_87_SUPPORT))
#define LIBSPDM_MAX_CERT_CHAIN_SIZE 0x8000
#else
#define LIBSPDM_MAX_CERT_CHAIN_SIZE 0x1000
#endif
#endif

/* If 1 then endpoint supports parsing X.509 certificate chains. */
#ifndef LIBSPDM_CERT_PARSE_SUPPORT
#define LIBSPDM_CERT_PARSE_SUPPORT 1
Expand Down
Loading