Skip to content

libgcrypt: fix ssh2_bn_set_word() return value - #2596

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:libg-fix
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:libg-fix

Conversation

@vszakats

@vszakats vszakats commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

It was returning a non-NULL address on success, which translated to
permanent failure as mapped to this internal crypto API. Fix to match it
with the rest of crypto backends and the expectation of callers.

Reported by Copilot
Bug: #2595 (comment)
Follow-up to 95c824d #1354
Follow-up to c9d40af

It was returning a non-NULL address on success, which translated to
permanent failure as mapped to this internal crypto API.

Bug: libssh2#2595 (comment)

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.

🟢 Approval recommended

The focused fix matches caller expectations, with no unresolved issues.

Pull request overview

Aligns libgcrypt’s big-number setter with the internal zero-on-success contract.

Changes:

  • Returns 0 when gcry_mpi_set_ui() succeeds.
  • Returns nonzero when it fails.
File summaries
File Description
src/libgcrypt.h Corrects ssh2_bn_set_word() return semantics.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

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