Skip to content

Conversation

@vcsjones
Copy link
Member

When we encapsulate something with ML-KEM on OpenSSL, we were checking that the amount written is what we expected, but a missing goto caused it to be marked as a success.

This isn't really a reliability problem since we already know how much encapsulation sizes are, we're just making sure OpenSSL and the managed side agree on it.

When we encapsulate something with ML-KEM on OpenSSL, we were checking that the amount written is what we expected, but a missing `goto` caused it to be marked as a success.

This isn't really a reliability problem since we already know how much encapsulation sizes are, we're just making sure OpenSSL and the managed side agree on it.
@vcsjones vcsjones added this to the 11.0.0 milestone Nov 12, 2025
@vcsjones vcsjones self-assigned this Nov 12, 2025
Copilot AI review requested due to automatic review settings November 12, 2025 22:26
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Copilot finished reviewing on behalf of vcsjones November 12, 2025 22:28
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 fixes a bug in the ML-KEM encapsulation error handling where a missing goto statement caused an error condition to be incorrectly reported as success. When the encapsulation output lengths didn't match expected values, the code would set ret = -1 but then immediately proceed to set ret = 1, causing the function to return success despite the validation failure.

Key Changes:

  • Added missing goto done; statement after setting error code in length validation check

@vcsjones
Copy link
Member Author

/ba-g Android timeouts and Android is not affected by this change.

@vcsjones vcsjones merged commit 1fb92aa into dotnet:main Nov 13, 2025
101 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants