Skip to content

iperf_auth: keep RSA_private_decrypt and RSA_public_encrypt errors#2017

Merged
swlars merged 1 commit intoesnet:masterfrom
OldManYellsAtCloud:master
Mar 23, 2026
Merged

iperf_auth: keep RSA_private_decrypt and RSA_public_encrypt errors#2017
swlars merged 1 commit intoesnet:masterfrom
OldManYellsAtCloud:master

Conversation

@OldManYellsAtCloud
Copy link
Copy Markdown
Contributor

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:

master

  • Issues fixed (if any):

None

  • Brief description of code changes (suitable for use as a commit message):

The return values of RSA_private_decrypt() and RSA_public_encrypt() calls are stored in unsigned variables, however upon error these functions return -1.

This PR stores these return values in signed integers, and makes the error-checking later based on these values. Also, some tab-indentations were mixed among spaces, cleaned them up also.

This is a re-submission of #1926, which I somehow borked.

The return values of RSA_public_encrypt and RSA_private_decrypt calls
are stored in unsigned types. These functions return -1 upon error.

These return values are checked after the call if they are negative, but
since they are stored in unsigned type, they are lost - when the error code
is compared to 0, the value is always bigger than 0.

To avoid this, store the return value in a signed integer, and set
the value encryptedtext_len and plaintext_len for later comparison based on
the result.

Also, change some tab indents to space.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
@swlars
Copy link
Copy Markdown
Contributor

swlars commented Mar 23, 2026

Thanks for the update and the pull request! I don't see any more warnings, and it seems to work well.

@swlars swlars merged commit 105b870 into esnet:master Mar 23, 2026
7 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.

2 participants