-
Notifications
You must be signed in to change notification settings - Fork 23
Enforce NVM objects' flags #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rizlik
wants to merge
15
commits into
wolfSSL:main
Choose a base branch
from
rizlik:nvm_flags_enforce
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c3bc706
nvm: rename IMMUTABLE flag to NONMODIFIABLE
rizlik d43a3f8
nvm, keystore: enforce NVM flags controls
rizlik 01361ff
keystore: support key revocation
rizlik c21082d
keystore: use wh_Nvm_GetMetadata instead of wh_Nvm_List in GetUniqueId
rizlik 0cdd77e
keystore: invert check and avoid a nested if level, typos
rizlik 46fcb7a
keystore: bring the key in the cache in wh_Server_KeystoreExportKeyDma
rizlik d6d8311
keystore: improvements
rizlik 3a91704
nvm: add revocation and nvm flag tests
rizlik b7b7193
ci: temporarly fix wolfssl tag as master broke testing
rizlik edb28d0
docs: updates documentation with nvm enforcing and key revocation
rizlik 6cd6fd9
fixup! docs: updates documentation with nvm enforcing and key revocation
rizlik 83a8a0a
keystore: remove unused WH_KS_OP_ERASE operation
rizlik d90ba22
test: move nvmflags test in its own file
rizlik 6ee2489
test: nvmflags: add missing string.h header
rizlik 490454e
Revert "ci: temporarly fix wolfssl tag as master broke testing"
rizlik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,93 @@ | ||
| # wolfHSM API reference | ||
|
|
||
| ## Key Revocation | ||
|
|
||
| ### wh_Client_KeyRevokeRequest | ||
|
|
||
| Send a key revocation request to the server (non-blocking). | ||
|
|
||
| This function prepares and sends a revoke request for the specified key ID. It | ||
| returns after the request is sent; use `wh_Client_KeyRevokeResponse()` to | ||
| retrieve the result. | ||
|
|
||
| Parameters: | ||
|
|
||
| - `c`: Client context. | ||
| - `keyId`: Key ID to revoke. | ||
|
|
||
| Return values: | ||
|
|
||
| - `WH_ERROR_OK` on successful request send. | ||
| - A negative error code on failure. | ||
|
|
||
| Error codes: | ||
|
|
||
| - `WH_ERROR_BADARGS` if `c` is NULL or `keyId` is invalid. | ||
| - Propagates comm layer errors on send failure. | ||
|
|
||
| ### wh_Client_KeyRevokeResponse | ||
|
|
||
| Receive a key revocation response. | ||
|
|
||
| This function polls for the revoke response and returns `WH_ERROR_NOTREADY` | ||
| until the server reply is available. | ||
|
|
||
| Parameters: | ||
|
|
||
| - `c`: Client context. | ||
|
|
||
| Return values: | ||
|
|
||
| - `WH_ERROR_OK` on success. | ||
| - `WH_ERROR_NOTREADY` if the response has not arrived. | ||
| - A negative error code on failure. | ||
|
|
||
| Error codes: | ||
|
|
||
| - `WH_ERROR_BADARGS` if `c` is NULL. | ||
| - Server error codes such as `WH_ERROR_NOTFOUND`. | ||
|
|
||
| ### wh_Client_KeyRevoke | ||
|
|
||
| Revoke a key using a blocking request/response. | ||
|
|
||
| This helper sends a revoke request and waits for the response. | ||
|
|
||
| Parameters: | ||
|
|
||
| - `c`: Client context. | ||
| - `keyId`: Key ID to revoke. | ||
|
|
||
| Return values: | ||
|
|
||
| - `WH_ERROR_OK` on success. | ||
| - A negative error code on failure. | ||
|
|
||
| Error codes: | ||
|
|
||
| - Any error code returned by `wh_Client_KeyRevokeRequest()` or | ||
| `wh_Client_KeyRevokeResponse()`. | ||
|
|
||
| ### wh_Server_KeystoreRevokeKey | ||
|
|
||
| Revoke a key by updating its metadata. | ||
|
|
||
| This server-side function marks a key as non-modifiable and clears all usage | ||
| flags. If the key exists in NVM, the metadata update is committed so the revoke | ||
| state persists. | ||
|
|
||
| Parameters: | ||
|
|
||
| - `server`: Server context. | ||
| - `keyId`: Key ID to revoke. | ||
|
|
||
| Return values: | ||
|
|
||
| - `WH_ERROR_OK` on success. | ||
| - A negative error code on failure. | ||
|
|
||
| Error codes: | ||
|
|
||
| - `WH_ERROR_BADARGS` if parameters are invalid. | ||
| - `WH_ERROR_NOTFOUND` if the key is missing. | ||
| - Propagates NVM/storage errors (for example `WH_ERROR_NOSPACE`). |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.