Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code in TLSX_PopulateExtensions() around MAX_PSK_ID_LEN check #8308

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Dec 20, 2024

Description

Fixes dead code recently introduced with #8302. Caught by Coverity scan:

>>>     CID 445084:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "sess->ticketLen > 1536" inside this statement: "if (isServer && sess->ticke...".
13784                     if (isServer && (sess->ticketLen > MAX_PSK_ID_LEN)) {
13785                         WOLFSSL_MSG("Session ticket length for PSK ext is too large");
13786                         return BUFFER_ERROR;
13787                     }

The given code block is inside the following condition, which means this will never be called on the server-side (isServer=true):

if (!isServer && IsAtLeastTLSv1_3(ssl->version)) {
...
}

Testing

Caught by Coverity scan. See PR #8302 for testing notes.

Checklist

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

@douzzer douzzer merged commit afc7e0e into wolfSSL:master Dec 20, 2024
148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants