Skip to content

Fix: hpke return code improvements#10455

Merged
SparkiDev merged 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:hpke-fix
May 13, 2026
Merged

Fix: hpke return code improvements#10455
SparkiDev merged 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:hpke-fix

Conversation

@sebastian-carpenter

Copy link
Copy Markdown
Contributor

Description

Four switch cases returned -1 rather than a defined error code. Updated all of them (and the X448 fallthrough cases) to return BAD_FUNC_ARG.

X448 isn't supported for HPKE right now, hence the fallthrough.

Fixes F-1908

Checklist

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

@sebastian-carpenter sebastian-carpenter self-assigned this May 11, 2026
Copilot AI review requested due to automatic review settings May 11, 2026 17:40

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

Note

Copilot was unable to run its full agentic suite in this review.

Standardizes HPKE error handling by replacing legacy -1 returns with a defined error code (BAD_FUNC_ARG) for unsupported/default switch cases (including X448 fallthrough paths), aligning with the project’s error-code conventions.

Changes:

  • Replace ret = -1; with ret = BAD_FUNC_ARG; in four HPKE switch default branches.
  • Ensures consistent, defined error codes are returned from serialize/deserialize and encap/decap paths when the KEM/curve is not handled.

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

@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@sebastian-carpenter

sebastian-carpenter commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please.

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

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@SparkiDev SparkiDev self-assigned this May 13, 2026
@SparkiDev
SparkiDev merged commit 9e739c6 into wolfSSL:master May 13, 2026
447 of 448 checks passed
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.

5 participants