Skip to content

Anchor FP ECC cache entries to a and modulus. Avoid writing partial blocks in AES-NI assembly. Ensure that the top bit is masked/rejected throughout curve25519 functions. Enable WOLFSSL_AES_CBC_LENGTH_CHECKS by default. - #11852

Open
kareem-wolfssl wants to merge 8 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd22448_misc

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Partially fixes zd#22448

Testing

Built-in + added tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl
kareem-wolfssl requested review from SparkiDev and a balanced review from Copilot October 21, 2026 21:29
@kareem-wolfssl kareem-wolfssl self-assigned this Oct 21, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

@claude review

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 806,212 B / 1,048,576 B, total: 77% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +64 B (+0.0%, 252,610 B / 262,144 B, total: 96% used)

gcc-arm-cortex-m7-tls13

  • FLASH: .text +64 B (+0.0%, 252,610 B / 262,144 B, total: 96% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

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.

🟡 Changes recommended

Unresolved Curve25519 input-normalization issues and an ECC fault-test coverage regression must be addressed.

2 open issues

Review effort: Lite

Comment thread wolfcrypt/src/curve25519.c Resolved
Comment thread wolfcrypt/src/curve25519.c Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment thread configure.ac Resolved
Comment thread wolfcrypt/src/curve25519.c Resolved
Comment thread wolfcrypt/src/ecc.c Resolved
Comment thread wolfcrypt/src/ecc.c Resolved
Comment thread wolfcrypt/src/ecc.c Resolved
Comment thread wolfcrypt/src/ecc.c Resolved
@kareem-wolfssl
kareem-wolfssl force-pushed the zd22448_misc branch 2 times, most recently from 7ebe175 to 1391188 Compare November 9, 2026 23:37
Comment thread src/ssl_crypto.c Outdated
/* The whole final block is read and only the
* remaining bytes are written. */
if ((ret == 0) && (rem > 0)) {
ret = wc_AesCbcDecrypt(aes, blk, in + whole, sizeof(blk));

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.

I think this tries to read a whole 16 bytes from (in + whole) when there is not 16 bytes left to read? The encryption process above could be similar type of issue where it tries to write a 16 byte block to (out + whole) when out+whole does not have 16 bytes of room left.

@kareem-wolfssl kareem-wolfssl Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, went back to just rejecting partial blocks for decrypt, while still allowing partial (zero padded) blocks for encrypt.
The intention of this is to match OpenSSL's behavior, but I can revert the partial block encryption change as well if desired.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #11852

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): CMakeLists.txt, configure.ac, tests/api/test_ecc.h
Coverage: 10 of 10 in-scope changed file(s) opened by the reviewer

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Max

Comment thread src/ssl_crypto.c Resolved
…em across different curves.

This is using the 0th entry in the LUT to store the a/modulus, as this entry is currently left empty.
Add tests, including whitebox test.

Thanks to Anthropic for the report.
Enable WOLFSSL_AESCBC_LENGTH_CHECKS by default.  This option is low cost and provides defence in depth.

Thanks to Anthropic for the report.
…SL_X25519_NO_MASK_PEER) throughout curve25519 functions, as per RFC 7748 section 5.

Thanks to Anthropic for the report.
…ibility. Always copy curve255519 point before masking to avoid modifying argument. Add LTC Curve25519 masking.
…hey don't actually implement it, it causes test failures.
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.

6 participants