crypto: AI generated audit feedback#3536
Open
smalis-msft wants to merge 1 commit into
Open
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens and clarifies parts of the support/crypto APIs and their consumers by aligning parameter naming with the SP800-108 KBKDF spec and standardizing XTS-AES-256 tweak handling to a 64-bit tweak across all backends (matching Windows BCrypt constraints).
Changes:
- Rename KBKDF HMAC-SHA256 parameter from
salttolabelacross backends and the public wrapper. - Restrict XTS-AES-256
ciphertweak type tou64in the public API and backend implementations; update disk encryption call sites accordingly. - Add clarifying documentation/comments (notably around
X509Certificate::issuedsemantics and RSA error TODOs).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vm/devices/storage/disk_crypt/src/lib.rs | Updates XTS cipher calls to pass u64 tweaks directly (no .into() conversion). |
| support/crypto/src/xts_aes_256/win.rs | Changes BCrypt XTS tweak parameter type to u64 and simplifies IV construction. |
| support/crypto/src/xts_aes_256/ossl.rs | Changes OpenSSL XTS tweak parameter type to u64 and zero-extends to 128-bit IV bytes. |
| support/crypto/src/xts_aes_256/mod.rs | Updates the public XTS cipher API to u64 tweaks and adjusts tests/comments accordingly. |
| support/crypto/src/x509/mod.rs | Documents that issued() is structural-only and does not verify signatures (points to verify()). |
| support/crypto/src/rsa/mod.rs | Adds TODO notes about making RSA errors Clone once upstream supports it. |
| support/crypto/src/kbkdf/symcrypt.rs | Renames KBKDF parameter salt → label to match SP800-108 terminology. |
| support/crypto/src/kbkdf/ossl.rs | Renames KBKDF parameter salt → label in the OpenSSL-based implementation. |
| support/crypto/src/kbkdf/mod.rs | Renames KBKDF public API parameter salt → label and forwards accordingly. |
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.
Some small cleanups: