Skip to content

Add some missing length checks and fix length calculation.#10277

Open
kareem-wolfssl wants to merge 3 commits intowolfSSL:masterfrom
kareem-wolfssl:zd21664_5
Open

Add some missing length checks and fix length calculation.#10277
kareem-wolfssl wants to merge 3 commits intowolfSSL:masterfrom
kareem-wolfssl:zd21664_5

Conversation

@kareem-wolfssl
Copy link
Copy Markdown
Contributor

Description

Fixes zd#21664, ZD#21665

Testing

Built-in tests

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this Apr 21, 2026
Copilot AI review requested due to automatic review settings April 21, 2026 22:25
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 targets length validation in handshake parsing/building to address reported issues (zd#21664, ZD#21665), aiming to prevent incorrect length calculations and out-of-bounds accesses in TLS/TLS 1.3 flows.

Changes:

  • Add additional bounds checks when parsing TLS 1.3 ServerHello legacy session ID.
  • Add missing bounds checks for PSK identity handling in SendClientKeyExchange.
  • Adjust length accounting used to size remaining space for (EC)DHE-PSK key material.

Reviewed changes

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

File Description
src/tls13.c Tightens ServerHello legacy session ID length validation during TLS 1.3 parsing.
src/internal.c Adds PSK identity size checks and updates remaining-length calculations for PSK-based key exchanges.

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

Comment thread src/internal.c
Comment thread src/internal.c
Comment thread src/internal.c Outdated
Comment thread src/internal.c Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

MemBrowse Memory Report

No memory changes detected for:

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.

3 participants