-
Notifications
You must be signed in to change notification settings - Fork 4
Zeroizations, code reinforcements, ECC key size fixes #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
aec0647
Zeroize key data before freeing
danielinux f1e9958
Zeroize volatile keys on destroy
danielinux 19d7da8
Zeroize generated keys after import
danielinux 454e830
Fix ECC curve ids for 192-bit and 224-bit curves
danielinux c48ec68
Fix ECC key bit inference for non-byte-aligned curves
danielinux cecfc2a
Reject oversized PSA random requests
danielinux f1d0585
Zero DES3 expanded keys after setup
danielinux 4ff8496
zero HKDF PRK stack buffer
danielinux f35207c
Scrub TLS 1.2 PSK premaster buffer
danielinux 2138fbf
scrub PBKDF2 CMAC stack buffers
danielinux 3772e4d
Zero derived key buffer before free
danielinux a4f407d
zero ECDH secret before free
danielinux 436714a
Zero key agreement secrets before free
danielinux 024cf0d
Reject wrapped AEAD multipart lengths
danielinux 4647472
Don't shadow variables: reuse existing
danielinux e28140a
Updated .gitignore with new test artifacts
danielinux b06b31b
Addressed copilot's review comments
danielinux 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #ifndef WOLFPSA_PSA_AEAD_INTERNAL_H | ||
| #define WOLFPSA_PSA_AEAD_INTERNAL_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include <wolfpsa/psa/crypto.h> | ||
|
|
||
| typedef struct wolfpsa_aead_ctx { | ||
| psa_algorithm_t alg; | ||
| psa_key_type_t key_type; | ||
| size_t key_bits; | ||
| int direction; | ||
| uint8_t *key; | ||
| size_t key_length; | ||
| uint8_t nonce[PSA_AEAD_NONCE_MAX_SIZE]; | ||
| size_t nonce_length; | ||
| uint8_t *aad; | ||
| size_t aad_length; | ||
| uint8_t *input; | ||
| size_t input_length; | ||
| size_t ad_expected; | ||
| size_t plaintext_expected; | ||
| size_t tag_length; | ||
| int lengths_set; | ||
| } wolfpsa_aead_ctx_t; | ||
|
|
||
| static inline wolfpsa_aead_ctx_t* | ||
| wolfpsa_aead_get_ctx_ptr(psa_aead_operation_t *operation) | ||
| { | ||
| if (operation == NULL) { | ||
| return NULL; | ||
| } | ||
|
|
||
| return (wolfpsa_aead_ctx_t *)(uintptr_t)operation->opaque; | ||
| } | ||
|
|
||
| #endif /* WOLFPSA_PSA_AEAD_INTERNAL_H */ |
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.
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.