Skip to content

Add separate client cookie enable config - #11101

Open
padelsbach wants to merge 3 commits into
wolfSSL:masterfrom
padelsbach:client-cookie-enable
Open

Add separate client cookie enable config#11101
padelsbach wants to merge 3 commits into
wolfSSL:masterfrom
padelsbach:client-cookie-enable

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Description

Split the existing flag which enables TLS cookie support WOLFSSL_SEND_HRR_COOKIE into a smaller portion WOLFSSL_TLS13_COOKIE which enables replying with a cookie echo'ed from the HelloClientResponse (HRR). This is enabled by default for clients.

Fixes #11074

Testing

New unit test

Checklist

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

@padelsbach padelsbach changed the title Add separate client cookie enable Add separate client cookie enable config Aug 6, 2026

@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 #11101

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

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

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread tests/api/test_tls13.c Outdated
Comment thread src/tls.c
Comment thread wolfssl/internal.h
Comment thread tests/api/test_tls13.c
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4-dtls13

  • FLASH: .text +64 B (+0.0%, 183,740 B / 1,048,576 B, total: 18% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .rodata +56 B, .text +384 B (+0.1%, 776,980 B / 1,048,576 B, total: 74% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +320 B (+0.1%, 298,268 B / 1,048,576 B, total: 28% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +320 B (+0.1%, 328,880 B / 1,048,576 B, total: 31% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +320 B (+0.1%, 239,073 B / 262,144 B, total: 91% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +320 B (+0.1%, 299,228 B / 1,048,576 B, total: 29% used)

gcc-arm-cortex-m7-tls13

@dgarske

dgarske commented Aug 7, 2026

Copy link
Copy Markdown
Member

Jenkins retest this please

Comment thread src/tls.c Outdated
Comment thread src/tls.c
Comment thread src/tls.c
@padelsbach padelsbach removed their assignment Aug 7, 2026

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Testing configuration:
--enable-tls13 --disable-tlsv12 --enable-secure-renegotiation --enable-nullcipher CFLAGS="-DNO_WOLFSSL_CLIENT"

   1579: test_tls13_server_cookie_parse                     :
ERROR - tests/api/test_tls13.c line 7835 failed with:
    expected: TLSX_Parse(ssl, badExt, (word16)sizeof(badExt), client_hello, (Suites*)((const Suites*) ((ssl)->suites != ((void *)0) ? (ssl)->suites : (ssl)->ctx->suites))) == (BUFFER_E)
    result:   0 != -132
 failed (  0.00005)
ERROR - tests/api.c line 39831 failed with:
    expected: Test failed
    result:   ret 0

@padelsbach padelsbach removed their assignment Aug 7, 2026
@padelsbach

padelsbach commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@padelsbach
padelsbach force-pushed the client-cookie-enable branch from af7f938 to 5cd590b Compare August 7, 2026 20:32
@padelsbach
padelsbach force-pushed the client-cookie-enable branch from 5cd590b to 2dfc2bc Compare August 17, 2026 21:21
@philljj
philljj requested review from philljj and a balanced review from Copilot August 18, 2026 02:41

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.

Pull request overview

Adds default TLS 1.3 client support for echoing HRR cookies, addressing #11074 while retaining server-side opt-in.

Changes:

  • Introduces client-side cookie support and a configurable size limit.
  • Separates client echo behavior from server cookie generation.
  • Adds handshake, parsing, echo, and size-limit tests.

Reviewed changes

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

Show a summary per file
File Description
wolfssl/internal.h Defines cookie capability, limit, and state.
src/tls.c Parses, stores, and echoes HRR cookies.
src/tls13.c Accepts cookie-only HRRs.
src/ssl.c Resets cookie state on reuse.
tests/api/test_tls13.c Adds cookie behavior tests.
tests/api/test_tls13.h Registers new tests.
configure.ac Clarifies Autotools option behavior.
CMakeLists.txt Clarifies CMake option behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tls.c Outdated
Comment thread tests/api/test_tls13.c Outdated
Comment thread tests/api/test_tls13.c Outdated
}

/* Test that a client rejects a HelloRetryRequest cookie larger than it is
* willing to store and echo back. RFC 8446 4.2.2 sets no upper bound.

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.

nit: this is a little confusing.

RFC 8446 4.2.2 says upper bound is 2 ** 16 - 1 = 65535.

This test requires WOLFSSL_MAX_TLS13_COOKIE_SZ <= 65528 because 2 ** 16 - 1 - 1 - 6 = 65528.

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.

comment updated

@philljj philljj assigned padelsbach and unassigned wolfSSL-Bot Aug 18, 2026
@padelsbach
padelsbach force-pushed the client-cookie-enable branch from 2dfc2bc to 9d7ec9a Compare August 19, 2026 20:56
@padelsbach padelsbach assigned philljj and unassigned padelsbach Aug 19, 2026
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.

TLS 1.3 cookie extension is absent in the audited default build and only available behind build/runtime gates

6 participants