Fixes for AF-ALG code paths and add CI test - #11162
Open
JacobBarthelmeh wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request tightens correctness of the Linux AF_ALG AES-GCM implementation by ensuring the AF_ALG operation (encrypt vs decrypt) is set on every call when reusing an Aes context, and adds CI coverage so these kernel-offload paths are exercised continuously.
Changes:
- Add an AES-GCM regression test that reuses a single
Aescontext across encrypt → decrypt → encrypt without re-setting the key. - Fix AF_ALG AES-GCM to always set the AF_ALG operation control message on every encrypt/decrypt call.
- Add a dedicated GitHub Actions workflow to build/test AF_ALG configurations and preflight kernel algorithm availability.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wolfcrypt/test/test.c | Adds an AES-GCM “reuse context across directions” regression test and runs it from aesgcm_default_test(). |
| wolfcrypt/src/port/af_alg/afalg_aes.c | Ensures AF_ALG operation selection is refreshed per AES-GCM call when reusing the same socket/context; updates related comments. |
| doc/dox_comments/header_files/aes.h | Documents the Xilinx AF_ALG combined ciphertext+tag buffer behavior and alignment expectations for GCM encrypt/decrypt. |
| .github/workflows/afalg.yml | Introduces CI that preflights AF_ALG kernel support and runs parallel out-of-tree builds/tests with --enable-afalg. |
Suppressed comments (1)
wolfcrypt/src/port/af_alg/afalg_aes.c:809
- Same as above: the warning comment says
sz | 16 bytesbut this should besz + 16 bytesto describe the required buffer sizing for the combined ciphertext+tag path.
* and out buffers are large enough to hold cipher text and tag. That is
* sz | 16 bytes. The in buffer has tag appended even though it is
* const for this wolfSSL API, and sz | 16 bytes are read back into the
* out buffer. The input and output buffer is expected to be 64 bit
* aligned.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
JacobBarthelmeh
force-pushed
the
afalg
branch
2 times, most recently
from
August 13, 2026 16:14
32d937b to
d6924df
Compare
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.
No description provided.