Skip to content

Commit 79e97e5

Browse files
Provide rationale for LIBSPDM_MAX_CT_EXPONENT
Fix #2561. Signed-off-by: Steven Bellock <[email protected]>
1 parent f6558cc commit 79e97e5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/internal/libspdm_common_lib.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright Notice:
3-
* Copyright 2021-2022 DMTF. All rights reserved.
3+
* Copyright 2021-2024 DMTF. All rights reserved.
44
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
55
**/
66

@@ -23,6 +23,13 @@
2323
#include "hal/library/cryptlib.h"
2424

2525
#define INVALID_SESSION_ID 0
26+
/* The SPDM specification does not limit the values of CTExponent and RDTExponent.
27+
* libspdm artificially limits their values to 31, which corresponds to approximately 35 minutes
28+
* for CT and RDT. If an endpoint takes longer than 35 minutes to generate an SPDM message then
29+
* libspdm assumes the Integrator would not want to interact with such an endpoint. A maximum value
30+
* of 31 also means that, when calculating CT and RDT, a left-shift will not result in C undefined
31+
* behavior.
32+
*/
2633
#define LIBSPDM_MAX_CT_EXPONENT 31
2734
#define LIBSPDM_MAX_RDT_EXPONENT 31
2835

0 commit comments

Comments
 (0)