Add crypto timeout - step 1 #220
Open
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.
Add crypto timeout to RNG and AES
The changes add timeout control logic to cryptographic operations under the wolfHSM framework. The modifications allow the client to enforce a maximum allowed time for crypto operations.
Added new callback function pointers to the relevant configuration/context structures to support timeout handling. These callbacks allow the application to provide custom time-related functions, such as:
GetCurrentTime)CheckTimeout)When the crypt-timeout feature is enabled, the
GetCurrentTimecallback must be provided as a user-defined function. If theCheckTimeoutcallback is not defined, internal default implementation is used.Added a new build-time configuration macro:
WOLFHSM_CFG_ENABLE_CLIENT_CRYPTIMEOUTThis macro enables the client-side cryptographic timeout feature.When enabled, the wolfHSM client checks for timeout conditions during cryptographic operations.
The feature has been added to RNG and AES. It will be extended to the remaining cryptographic algorithms once this PR is approved.
For testing,
make CRYPTIMEOUT=1enables the items in tests/ folder.