Skip to content

Fix/fenrir9929 - #11653

Open
ageprocpp wants to merge 2 commits into
wolfSSL:masterfrom
ageprocpp:fix/fenrir9929
Open

ageprocpp wants to merge 2 commits into
wolfSSL:masterfrom
ageprocpp:fix/fenrir9929

Conversation

@ageprocpp

@ageprocpp ageprocpp commented Oct 6, 2026 •

Copy link
Copy Markdown

Description

Fixes F-9929

wc_Sha256Copy(wc_Sha256* src, wc_Sha256* dst), which copies wc_Sha256 instances, lacked error handling when src and dst memories have overlapping.
It is unclear if this function should return BAD_FUNC_ARG on all such opportunity, but implemented that behavior.
The same changes to wc_Sha224Copy.

Testing

Did not add any test because the specification does NOT guarantee this function returns BAD_FUNC_ARG and just stipulate that this is an undefined behavior.
(If guaranteeing this returns BAD_FUNC_ARG, we'd have to change all other ad-hoc implementations for a number of environments)

Checklist

  • added tests (not needed)
  • updated/added doxygen
  • updated appropriate READMEs (not needed)
  • Updated manual and documentation (not needed)

Discussion

It is unclear if this function should return BAD_FUNC_ARG when src == dst because it is somehow reasonable expectation for the function to work fine by doing nothing. I would like have reviewers' comments in this respect.
It should be noted that src is not const pointer and in some environment the content of src can be changed by this function.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 03:32

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ageprocpp
ageprocpp requested a balanced review from Copilot October 6, 2026 05:28

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ageprocpp
ageprocpp marked this pull request as ready for review October 6, 2026 05:40
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

retest this please

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m0plus

  • FLASH: .text +12 B (+0.0%, 69,203 B / 262,144 B, total: 26% used)

gcc-arm-cortex-m3

  • FLASH: .text +12 B (+0.0%, 129,077 B / 262,144 B, total: 49% used)

gcc-arm-cortex-m7-tls13

  • FLASH: .text +64 B (+0.0%, 247,134 B / 262,144 B, total: 94% used)

stm32-sim-stm32h753

@dgarske

dgarske commented Oct 6, 2026

Copy link
Copy Markdown
Member

Okay to test. Intern for wolfSSL

@ageprocpp

Copy link
Copy Markdown
Author

Will rebase after #11665 is merged

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.

4 participants