TLS 1.3: AEAD limit fixed#10513
Open
SparkiDev wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Jenkins: retest this please |
7ac44bb to
6a77706
Compare
Values were 16-bit each when they are 32-bit each. Add tests for KeyUpdate limits for TLS 1.3.
91510ed to
8dae4b3
Compare
JacobBarthelmeh
approved these changes
May 27, 2026
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10513
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
Contributor
There was a problem hiding this comment.
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 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); |
| #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) |
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.
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