Skip to content

Conversation

@embhorn
Copy link
Member

@embhorn embhorn commented Dec 10, 2025

Description

The doc says that the size parameter of wc_SrpGetPublic is the size of the buffer passed in the pub parameter. The buffer was only cleared for the size of the public ephemeral value.

Fixes #3665

Testing

make check

Checklist

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

Copy link
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 addresses issue #3665 by adding buffer size validation and improving documentation for the wc_SrpGetPublic function in the SRP implementation. The changes aim to ensure the size parameter is properly checked before using it, and the buffer is cleared for the full size provided by the caller.

  • Adds explicit buffer size validation before extracting the public key
  • Clears the output buffer using the caller-provided size instead of just the modulus size
  • Updates documentation to clarify the IN/OUT nature of the size parameter and provide a corrected example

Reviewed changes

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

File Description
wolfcrypt/src/srp.c Adds buffer clearing for full size and size validation check for the wc_SrpGetPublic function
doc/dox_comments/header_files/srp.h Clarifies size parameter documentation and fixes example code initialization

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

@embhorn
Copy link
Member Author

embhorn commented Dec 12, 2025

Retest this please

Multiple Arduino test failures

+ exit 1
Primary install failed: curl=0, sh=. Falling back...
/home/runner/work/_temp/c93b99ad-f6b3-4f95-8086-1712242c5803.sh: line 35: pushd: ./Arduino/sketches: No such file or directory
Error: Process completed with exit code 1.

@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Dec 12, 2025
@douzzer douzzer merged commit b9368d7 into wolfSSL:master Dec 15, 2025
478 of 503 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.

wc_SrpGetPublic function output incorrect public key value (pub) when padding is needed.

4 participants