Skip to content

DTLS 1.3: correct AEAD limits to match RFC 9147 - #11975

Open
julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:fix/dtls13-aead-limits
Open

julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:fix/dtls13-aead-limits

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

DTLS_AEAD_AES_CCM_LIMIT, DTLS_AEAD_AES_GCM_CHACHA_FAIL_LIMIT and DTLS_AEAD_AES_CCM_8_FAIL_LIMIT were each one bit too small, so they were half the values in RFC 9147.

  • DTLS_AEAD_AES_CCM_LIMIT: 2^22 becomes 2^23
  • DTLS_AEAD_AES_GCM_CHACHA_FAIL_LIMIT: 2^35 becomes 2^36
  • DTLS_AEAD_AES_CCM_8_FAIL_LIMIT: 2^6 becomes 2^7

The key update limits are unchanged and remain at half the hard limit.

Fixes #11973

DTLS_AEAD_AES_CCM_LIMIT, DTLS_AEAD_AES_GCM_CHACHA_FAIL_LIMIT and
DTLS_AEAD_AES_CCM_8_FAIL_LIMIT were shifted one bit short, giving 2^22,
2^35 and 2^6 instead of 2^23, 2^36 and 2^7. Their key update limits stay
at half the hard limit.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 18:27
@julek-wolfssl julek-wolfssl self-assigned this Nov 3, 2026

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

The PR description incorrectly claims key-update limits are unchanged, although the GCM/ChaCha and CCM-8 thresholds now permit twice as many failed decryptions before requesting a key update.

1 open issue
What changed in this PR

Corrects three DTLS 1.3 AEAD limits in wolfSSL to match RFC 9147, addressing issue #11973.

Changes:

  • Doubles the AES-CCM confidentiality limit and the GCM/ChaCha20-Poly1305 and CCM-8 integrity limits.
  • Doubles the corresponding integrity key-update thresholds, keeping them at half the hard limits.
  • Adds assertions for the corrected values and clarifies RFC references.
File Description
wolfssl/​internal.h Corrects AEAD limits, key-update thresholds, and explanatory comments.
tests/​api/​test_tls13.c Adds regression assertions for the corrected limit macros.

Review effort: Balanced

Comment thread wolfssl/internal.h
#define DTLS_AEAD_AES_GCM_CHACHA_FAIL_LIMIT w64From32(1 << 3, 0)
#define DTLS_AEAD_AES_GCM_CHACHA_FAIL_KU_LIMIT w64From32(1 << 2, 0)
#define DTLS_AEAD_AES_GCM_CHACHA_FAIL_LIMIT w64From32(1 << 4, 0)
#define DTLS_AEAD_AES_GCM_CHACHA_FAIL_KU_LIMIT w64From32(1 << 3, 0)
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

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.

[Bug]: DTLS 1.3 AEAD limit macros are half their documented values

2 participants