Skip to content

Add ret_size checking in server keystore#302

Open
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:padelsbach/ret-size-server-keystore
Open

Add ret_size checking in server keystore#302
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:padelsbach/ret-size-server-keystore

Conversation

@padelsbach
Copy link
Contributor

Fixes finding 125

@padelsbach padelsbach force-pushed the padelsbach/ret-size-server-keystore branch from 2e17ece to cf37b07 Compare March 17, 2026 19:00
@padelsbach padelsbach marked this pull request as ready for review March 17, 2026 19:48
@padelsbach padelsbach requested a review from bigbrett March 17, 2026 19:48
Comment on lines +1682 to +1684
if (req_size < sizeof(req)) {
return WH_ERROR_BADARGS;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These early returns cause the serialization of the response to be skipped. We need to ensure the response contains the appropriate error code and serialize it back to the caller. Otherwise we send a stale buffer in the calling context.

Copy link
Contributor

@bigbrett bigbrett Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note these layer-specific request processing functions are not meant to be called directly but only as part of the request processing pipeline internal by wh_Server_HandleRequestMessage()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. There's a bit more reworked error checking now.

@padelsbach padelsbach force-pushed the padelsbach/ret-size-server-keystore branch from cf37b07 to 48cdcea Compare March 18, 2026 00:49
@padelsbach padelsbach assigned bigbrett and unassigned padelsbach Mar 18, 2026
@padelsbach padelsbach force-pushed the padelsbach/ret-size-server-keystore branch from 48cdcea to 072967e Compare March 18, 2026 01:05
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