Skip to content

Re-implement SSHKey to remove sshkey gem dependency - #4643

Merged
johha merged 1 commit into
mainfrom
remove-ssh-key-gem
Nov 6, 2025
Merged

Re-implement SSHKey to remove sshkey gem dependency#4643
johha merged 1 commit into
mainfrom
remove-ssh-key-gem

Conversation

@johha

@johha johha commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Refactor the VCAP::CloudController::Diego::SSHKey class to remove the dependency on the sshkey gem. This change reduces external dependencies and avoids potential compilation issues related to native extensions.

The class is re-implemented using the standard openssl and digest libraries. The public interface and output formats of the private_key, authorized_key, fingerprint (SHA1), and sha256_fingerprint methods are preserved, ensuring it acts as a transparent, drop-in replacement.

The performance impact is negligible as the most expensive operation, RSA key generation, still relies on OpenSSL, and all derived values are memoized.

  • 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 on BBL env with FIPS stemcell (fips-snape)

Refactor the `VCAP::CloudController::Diego::SSHKey` class to remove the dependency on the `sshkey` gem. This change reduces external dependencies and avoids potential compilation issues related to native extensions.

The class is re-implemented using the standard `openssl` and `digest` libraries. The public interface and output formats of the `private_key`, `authorized_key`, `fingerprint` (SHA1), and `sha256_fingerprint` methods are preserved, ensuring it acts as a transparent, drop-in replacement.

The performance impact is negligible as the most expensive operation, RSA key generation, still relies on OpenSSL, and all derived values are memoized.
@johha
johha force-pushed the remove-ssh-key-gem branch from d07e292 to 37c3df7 Compare November 4, 2025 17:25
@johha johha removed the do not merge label Nov 5, 2025
@johha
johha marked this pull request as ready for review November 5, 2025 11:38
@johha
johha merged commit 003f49f into main Nov 6, 2025
16 of 17 checks passed
@johha
johha deleted the remove-ssh-key-gem branch November 6, 2025 11:51
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Nov 6, 2025
Changes in cloud_controller_ng:

- Re-implement SSHKey to remove sshkey gem dependency
    PR: cloudfoundry/cloud_controller_ng#4643
    Author: Johannes Haass <johannes.haass@sap.com>
sethboyles pushed a commit to atanas-attodorov-wq/cloud_controller_ng that referenced this pull request Dec 11, 2025
Refactor the `VCAP::CloudController::Diego::SSHKey` class to remove the dependency on the `sshkey` gem. This change reduces external dependencies and avoids potential compilation issues related to native extensions.

The class is re-implemented using the standard `openssl` and `digest` libraries. The public interface and output formats of the `private_key`, `authorized_key`, `fingerprint` (SHA1), and `sha256_fingerprint` methods are preserved, ensuring it acts as a transparent, drop-in replacement.

The performance impact is negligible as the most expensive operation, RSA key generation, still relies on OpenSSL, and all derived values are memoized.
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