Repository navigation
Conversation
Secret keys were moved into wrapper objects before algorithm validation, so constructor exceptions could leave caller-provided key material uncleansed. Existing keys were also overwritten during assignment and key regeneration without cleansing the old bytes first.\n\nRetain constructor ownership until validation and metadata initialization complete, cleanse keys before copy/move assignment and regeneration, and add lifecycle coverage for both KEM and signature wrappers. Signed-off-by: AKG451 <217809809+AKG451@users.noreply.github.com>
Refactor secret key management for KeyEncapsulation and Signature classes. Introduce SecretKeyGuard for automatic cleansing of secret keys upon destruction. Signed-off-by: Aryan K. Gupta <akg451154@gmail.com>
Refactor KEM tests to use TestSecret for memory management and improve thread safety. Signed-off-by: Aryan K. Gupta <akg451154@gmail.com>
Signed-off-by: Aryan K. Gupta <akg451154@gmail.com>
Refactor KEM tests to improve clarity and correctness. Removed TestSecret class usage in favor of direct comparison of shared secrets. Added NotSupported test case for unsupported KEMs. Signed-off-by: Aryan K. Gupta <akg451154@gmail.com>
Refactor signature tests to improve readability and error handling. Update verification checks to log failures and ensure proper thread handling. Signed-off-by: Aryan K. Gupta <akg451154@gmail.com>
Contributor
Author
|
@dstebila @baentsch The Windows CI job is failing while compiling liboqs’s SQIsign code:
This appears unrelated to the files changed in this PR, although I haven’t confirmed the same failure on the base branch. Could you please take a look when convenient? Thank you. |
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.
Secret-key storage in
KeyEncapsulationandSignaturecould be released without cleansing during assignment, regeneration, or failed construction. The move operations also copied secret vectors insidenoexceptfunctions, potentially terminating the process on allocation failure.This PR updates both wrappers to:
The added lifecycle tests cover copying, moving, self-assignment, empty-key assignment, regeneration, and assignment across algorithms when the selected alternatives are enabled. They check that resulting keys remain usable for encapsulation/decapsulation or signing/verification.
Moves now transfer ownership of the existing allocation rather than copying and wiping the source allocation. The destination becomes responsible for cleansing that storage. Private member order also changes, so consumers should rebuild.
Validation completed: