From 79e97e50d8bbef4263e2a7c82b5084935a5d965b Mon Sep 17 00:00:00 2001 From: Steven Bellock Date: Thu, 8 Feb 2024 08:20:55 -0800 Subject: [PATCH] Provide rationale for `LIBSPDM_MAX_CT_EXPONENT ` Fix #2561. Signed-off-by: Steven Bellock --- include/internal/libspdm_common_lib.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/internal/libspdm_common_lib.h b/include/internal/libspdm_common_lib.h index cc794f671ea..f3af67ae303 100644 --- a/include/internal/libspdm_common_lib.h +++ b/include/internal/libspdm_common_lib.h @@ -1,6 +1,6 @@ /** * Copyright Notice: - * Copyright 2021-2022 DMTF. All rights reserved. + * Copyright 2021-2024 DMTF. All rights reserved. * License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md **/ @@ -23,6 +23,13 @@ #include "hal/library/cryptlib.h" #define INVALID_SESSION_ID 0 +/* The SPDM specification does not limit the values of CTExponent and RDTExponent. + * libspdm artificially limits their values to 31, which corresponds to approximately 35 minutes + * for CT and RDT. If an endpoint takes longer than 35 minutes to generate an SPDM message then + * libspdm assumes the Integrator would not want to interact with such an endpoint. A maximum value + * of 31 also means that, when calculating CT and RDT, a left-shift will not result in C undefined + * behavior. + */ #define LIBSPDM_MAX_CT_EXPONENT 31 #define LIBSPDM_MAX_RDT_EXPONENT 31