Fixes for AF-ALG code paths and add CI test - #11162
Conversation
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.
|
d6924df to
626950b
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11162
Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 10
10 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
add additional sanity checks and adjust formatting
|
Retest this please Jenkins |
|
Retest this please Jenkins. CAVP fail |
No description provided.