Skip to content

openssl: replace OpenSSL allocator with the SSH2 one in ssh2_rsa_new(), ssh2_dsa_new() - #2564

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:ossl-ssh2-alloc
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:ossl-ssh2-alloc

Conversation

@vszakats

Copy link
Copy Markdown
Member

Follow-up to 5ef9591 #2559
Follow-up to d5149ca #2548
Follow-up to b0ab005 #1207

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Replaces OpenSSL temporary key-buffer allocation with libssh2 session allocators.

Changes:

  • Uses SSH2_ALLOC for RSA and DSA components.
  • Securely clears buffers with ssh2_zero_free.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/openssl.c

if(ddata && dlen > 0) {
dbuf = OPENSSL_malloc(dlen);
dbuf = SSH2_ALLOC(session, dlen);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Pre-existing, tackling separately.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

→ PR #2566

Comment thread src/openssl.c

if(xdata && xlen > 0) {
x_buf = OPENSSL_malloc(xlen);
x_buf = SSH2_ALLOC(session, xlen);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Pre-existing, tackling separately.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

→ PR #2566

@vszakats vszakats closed this in 8aeee00 Aug 29, 2026
@vszakats
vszakats deleted the ossl-ssh2-alloc branch August 29, 2026 00:27
vszakats added a commit that referenced this pull request Aug 29, 2026
…new()` with OpenSSL 3+

Also: delete stray unused `session` suppression.

Reported by Copilot
Bug: #2564 (comment)
Bug: #2564 (comment)
Follow-up to b0ab005 #1207

Closes #2566
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