Skip to content

quickfix: output size propagation#373

Open
bigbrett wants to merge 1 commit into
wolfSSL:mainfrom
bigbrett:outsize-quickfix
Open

quickfix: output size propagation#373
bigbrett wants to merge 1 commit into
wolfSSL:mainfrom
bigbrett:outsize-quickfix

Conversation

@bigbrett
Copy link
Copy Markdown
Contributor

fix output size propagation on errors for RSA/ED/ECDH/C25519

@bigbrett bigbrett self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 21:07
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

Note

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

Fixes output length propagation when crypto callback operations return WH_ERROR_BUFFER_SIZE, allowing callers to resize buffers and retry for RSA, ECDH, and Ed25519 sign paths.

Changes:

  • Propagate updated *out_len/*outLen on both WH_ERROR_OK and WH_ERROR_BUFFER_SIZE for RSA and ECDH paths.
  • Same propagation for Ed25519 sign, and convert previous else if chain to independent if checks for error remapping.

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

Comment thread src/wh_client_cryptocb.c
Comment on lines +397 to 404
if (((ret == WH_ERROR_OK) || (ret == WH_ERROR_BUFFER_SIZE)) &&
(outLen != NULL)) {
*outLen = len;
}
else if (ret == WH_ERROR_BADARGS) {
if (ret == WH_ERROR_BADARGS) {
ret = BAD_FUNC_ARG;
}
else if (ret == WH_ERROR_NOTIMPL) {
Comment thread src/wh_client_cryptocb.c
Comment on lines +217 to +220
/* Propagate updated length on BUFFER_SIZE so callers can re-call
* with a sufficiently large output buffer. */
if (((ret == WH_ERROR_OK) || (ret == WH_ERROR_BUFFER_SIZE)) &&
(out_len != NULL)) {
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.

2 participants