Resolve issue with openssl 3.5.3 encrypt#1956
Merged
swlars merged 5 commits intoesnet:masterfrom Oct 23, 2025
mdlowman:master
Merged
Resolve issue with openssl 3.5.3 encrypt#1956swlars merged 5 commits intoesnet:masterfrom mdlowman:master
swlars merged 5 commits intoesnet:masterfrom
mdlowman:master
Conversation
When calling EVP_PKEY_encrypt with a non-null output buffer, the output buffer length must be provided. Attempts to write beyond this length will fail.
This more accurately represents the meaning; it is the minimum buffer allocation necessary for an encrypt or decrypt operation to succeed. This is the same size for both ciphertext and cleartext, as padding is applied.
Check the length before reading memory.
We know how much we expect to read; the input buffer has a defined size. Allocate the exact buffer expected instead of a larger one with a read expected to return only partial data. This makes it simpler to follow the logic and to avoid off-by-one errors.
Input should not be this long, but makes the expectations of the code clearer.
Contributor
|
Looks good! Thank you for the pull request! |
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":
The complete iperf3 license is available in the
LICENSEfile in thetop directory of the iperf3 source tree.
Version of iperf3 (or development branch, such as
masteror3.1-STABLE) to which this pull request applies: masterIssues fixed (if any):
Only the first commit is necessary to resolve the issue with openssl 3.5.3.
If you prefer to accept only a subset, or to consider them in separate pull requests, I can edit this/open others.
Set output buffer size prior to encrypt operation
When calling EVP_PKEY_encrypt with a non-null output buffer,
the output buffer length must be provided. Attempts to write
beyond this length will fail.
Rename keysize to output_buffer_len
This more accurately represents the meaning; it is the minimum
buffer allocation necessary for an encrypt or decrypt operation
to succeed. This is the same size for both ciphertext and
cleartext, as padding is applied.
Avoid out-of-bounds access when base64 decoding short strings
Check the length before reading memory.
Don't over-allocate followed by partial reads
We know how much we expect to read; the input buffer
has a defined size. Allocate the exact buffer expected
instead of a larger one with a read expected to return
only partial data. This makes it simpler to follow the
logic and to avoid off-by-one errors.
Add warnings on silent truncation
Input should not be this long, but makes the expectations
of the code clearer.