Skip to content

TLS 1.3: AEAD limit fixed#10513

Open
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:tls13_aead_limit_fix
Open

TLS 1.3: AEAD limit fixed#10513
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:tls13_aead_limit_fix

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

Description

Values were 16-bit each when they are 32-bit each.
Add tests for KeyUpdate limits for TLS 1.3.

Fixes zd#21845

Testing

Added tests.
./configure
./configure --enable-aesccm

@SparkiDev SparkiDev self-assigned this May 21, 2026
@SparkiDev
Copy link
Copy Markdown
Contributor Author

Jenkins: retest this please

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

MemBrowse Memory Report

No memory changes detected for:

@SparkiDev SparkiDev force-pushed the tls13_aead_limit_fix branch from 7ac44bb to 6a77706 Compare May 21, 2026 23:43
Values were 16-bit each when they are 32-bit each.
Add tests for KeyUpdate limits for TLS 1.3.
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10513

Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects TLS 1.3 / DTLS 1.3 AEAD limit constants in internal.h so the record-protection limits are represented with the intended 32-bit values, and adds API tests to ensure TLS 1.3 KeyUpdate is triggered at the correct boundary.

Changes:

  • Fix AEAD limit macros to pass full 32-bit constants into w64From32(hi, lo) (avoids unintended huge 64-bit limits).
  • Add regression test that validates the AEAD limit macro expansions against RFC-derived constants.
  • Add KeyUpdate-boundary tests that drive the record sequence number to the limit and verify the post-send KeyUpdate behavior for several TLS 1.3 AES-based suites.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wolfssl/internal.h Fixes AEAD limit macro construction so TLS 1.3/DTLS 1.3 limit checks operate on the correct numeric thresholds.
tests/api/test_tls13.h Registers new TLS 1.3 AEAD limit and KeyUpdate-limit tests in the API test declarations.
tests/api/test_tls13.c Adds regression tests for AEAD limit macros and KeyUpdate triggering behavior at the configured limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/api/test_tls13.h
Comment on lines +77 to +81
int test_tls13_AEAD_limit_macros(void);
int test_tls13_AEAD_limit_KU_aes128_gcm_sha256(void);
int test_tls13_AEAD_limit_KU_aes256_gcm_sha384(void);
int test_tls13_AEAD_limit_KU_aes128_ccm_sha256(void);
int test_tls13_AEAD_limit_KU_aes128_ccm_8_sha256(void);
Comment thread wolfssl/internal.h
#define AEAD_AES_LIMIT w64From32(0, 0x016A09E6)
/* Limit is 2^23
* https://www.rfc-editor.org/rfc/rfc9147.html#name-integrity-limits */
#define DTLS_AEAD_AES_CCM_LIMIT w64From32(0, 1 << 22)
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.

5 participants