Move AES fallback logic to cryptobackend - #2515
Merged
Merged
Conversation
Move AES constructor dispatch and Go fallback into cryptobackend/aes, reducing the standard-library integration to an import replacement. Preserve public key-size validation and return the original Go AES block so optimized cipher modes continue to recognize it. Updates #2489.
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The existing boring branch still bypasses the new AES backend constructor.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Moves AES constructor dispatch and Go fallback logic into cryptobackend/aes, while preserving existing cipher modes and key validation.
Changes:
- Adds centralized native/fallback AES dispatch.
- Adds platform-specific backend helpers.
- Updates vendored sources and standard-library integration.
| File | Summary |
|---|---|
patches/0002-Add-crypto-backends.patch |
Updates AES integration; unresolved moderate finding (2 votes): the existing boring branch bypasses cryptobackend/aes.New. |
patches/0001-Vendor-external-dependencies.patch |
Vendors the new AES wrapper files. |
cryptobackend/aes/nobackend.go |
Adds the no-backend helper stub. |
cryptobackend/aes/aes.go |
Adds common AES constructor dispatch. |
cryptobackend/aes/aes_windows.go |
Adds the Windows backend adapter. |
cryptobackend/aes/aes_openssl.go |
Adds the OpenSSL backend adapter. |
cryptobackend/aes/aes_nomsgostd.go |
Provides the standalone fallback stub. |
cryptobackend/aes/aes_msgostd.go |
Provides the standard-library Go fallback. |
cryptobackend/aes/aes_darwin.go |
Adds the Darwin backend adapter. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
George Adams (gdams)
approved these changes
Sep 24, 2026
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.

Move AES constructor dispatch and Go fallback into cryptobackend/aes, reducing the standard-library integration to an import replacement. Preserve public key-size validation and return the original Go AES block so CBC, CTR, and GCM keep their existing optimized paths.
No cipher-mode changes or new tests are included.
Updates #2489.
Validation: existing AES and cipher suites with the native backend, the Go fallback, and generic purego code; FIPS-enabled AES/cipher tests; FIPS-only enforcement; dependency checks; standalone backend checks; and reproducible vendoring.