Repository navigation
Conversation
Base automatically changed from
feature/code_cleanup_harmonization
to
dev/1.2.0
November 12, 2026 16:15
Grom-
force-pushed
the
feature/1.2.0/vla_removal
branch
from
November 12, 2026 16:15
a65952b to
2d35993
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes significant improvements to buffer safety, portability, and maintainability across the STSE middleware codebase. The main theme is replacing variable-length stack allocations with fixed-size buffers, using new constants for maximum sizes, and adding additional input validation. This enhances code safety, prevents potential stack overflows, and makes the code more portable across different compilers.
The most important changes are:
Buffer Safety and Consistency
Replaced variable-length arrays (VLAs) with fixed-size buffers using new maximum-size constants (e.g.,
STSE_ECC_MAX_PUB_KEY_SIZE,STSE_ECC_MAX_SIGNATURE_SIZE,STSE_MAX_TBS_SIZE, etc.) throughout the codebase, especially in cryptographic and key management functions. This improves stack safety and portability.Added input validation to ensure buffer sizes do not exceed defined maximums, returning an error if limits are exceeded (e.g., for certificates and key slots).
New and Updated Definitions
Introduced new buffer size and ECC-related constants in
stse_generic_typedef.h(e.g.,STSE_ECC_MAX_COORD_LEN,STSE_ECC_MAX_PUB_KEY_SIZE,STSE_ECC_MAX_SIGNATURE_SIZE,STSE_MAX_HOST_KEYS_ENVELOPE_SIZE,STSE_MAX_KEK_ENVELOPE_SIZE,STSE_MAX_TBS_SIZE,STSE_MAX_HKDF_INFO_SIZE,STSE_MAX_OKM_BUFFER_SIZE) for consistent use across the codebase. Also added theSTSE_NOINLINEmacro for better cross-compiler support.Defined
STSE_DEVICE_MAX_CERTIFICATE_SIZEinstse_device_authentication.hto standardize certificate buffer sizes.Other Improvements
STSAFEA_SHA_512_HASH_SIZEfor digests) to avoid buffer overflows and simplify code paths.These changes collectively improve the robustness, maintainability, and portability of the code.