Skip to content

Move AES fallback logic to cryptobackend - #2515

Merged
George Adams (gdams) merged 1 commit into
microsoft/mainfrom
dev/qmuntal/aes-fallback
Sep 24, 2026
Merged

George Adams (gdams) merged 1 commit into
microsoft/mainfrom
dev/qmuntal/aes-fallback

Conversation

@qmuntal

Copy link
Copy Markdown
Member

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.

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.
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner September 23, 2026 14:40
Copilot AI lite review requested due to automatic review settings September 23, 2026 14:40
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

Open (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.

Comment thread patches/0002-Add-crypto-backends.patch
@gdams
George Adams (gdams) merged commit 5d9075a into microsoft/main Sep 24, 2026
59 checks passed
@gdams
George Adams (gdams) deleted the dev/qmuntal/aes-fallback branch September 24, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants