Skip to content

Remove net-ssh gem dependency from SSHKey#4929

Merged
johha merged 1 commit intomainfrom
remove-net-ssh-gem
Mar 18, 2026
Merged

Remove net-ssh gem dependency from SSHKey#4929
johha merged 1 commit intomainfrom
remove-net-ssh-gem

Conversation

@johha
Copy link
Copy Markdown
Contributor

@johha johha commented Mar 17, 2026

Replace Net::SSH::Buffer with native Ruby implementation for SSH wire format encoding. The new implementation uses standard Ruby pack/unpack directives to encode SSH public key blobs per RFC 4251 and RFC 4253.

Changes:

  • Implement ssh_string() for SSH string encoding (length-prefixed)
  • Implement ssh_mpint() for SSH multiple precision integer encoding
  • Add helper methods for readability (uint32_big_endian, zero_byte, etc.)
  • Update test to parse SSH blob without Net::SSH::Buffer
  • Remove net-ssh from Gemfile

Manually tested all combinations to ensure compatibility:

  • Old implementation + old test (baseline)
  • Old implementation + new test
  • New implementation + old test
  • New implementation + new test

All combinations pass, confirming the new implementation produces identical SSH wire format output

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Replace Net::SSH::Buffer with native Ruby implementation for SSH wire
format encoding. The new implementation uses standard Ruby pack/unpack
directives to encode SSH public key blobs per RFC 4251 and RFC 4253.

Changes:
- Implement ssh_string() for SSH string encoding (length-prefixed)
- Implement ssh_mpint() for SSH multiple precision integer encoding
- Add helper methods for readability (uint32_big_endian, zero_byte, etc.)
- Update test to parse SSH blob without Net::SSH::Buffer
- Remove net-ssh from Gemfile

Manually tested all combinations to ensure compatibility:
- Old implementation + old test (baseline)
- Old implementation + new test
- New implementation + old test
- New implementation + new test

All combinations pass, confirming the new implementation produces
identical SSH wire format output.
@johha johha force-pushed the remove-net-ssh-gem branch from 989ced5 to eff191c Compare March 17, 2026 09:14
@johha johha marked this pull request as ready for review March 17, 2026 09:35
@jochenehret jochenehret self-requested a review March 18, 2026 07:58
Copy link
Copy Markdown
Contributor

@jochenehret jochenehret left a comment

Choose a reason for hiding this comment

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

Tested on a dev bbl environment, found no regressions.
Also tested from a Windows environment with CF CLI v8.18.0, works.

@johha
Copy link
Copy Markdown
Contributor Author

johha commented Mar 18, 2026

Tested cf ssh against a hello world app using the windows stack from windows and mac machines.

@johha johha merged commit 36b3697 into main Mar 18, 2026
11 checks passed
@johha johha deleted the remove-net-ssh-gem branch March 18, 2026 10:23
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Mar 18, 2026
Changes in cloud_controller_ng:

- Remove net-ssh gem dependency from SSHKey
    PR: cloudfoundry/cloud_controller_ng#4929
    Author: Johannes Haass <johannes.haass@sap.com>
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