Skip to content

Conversation

@jrvaldes
Copy link
Contributor

This pull request introduces validation and error handling for SSH private keys, aiming to prevent cryptographic panics (such as those caused by corrupted or malformed keys) and to improve the reliability of SSH connectivity.

The changes include adding a key operation validation step during signer creation, implementing panic recovery during SSH dial operations, and providing comprehensive unit tests for these scenarios.

This commit introduces a func to perform a test signature operation to verify
the key is functional.

This will catch issues like:
 - Malformed key material
 - Corrupted private key data
 - Invalid key parameters
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 16, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Jan 16, 2026
@openshift-ci-robot
Copy link

@jrvaldes: This pull request references Jira Issue OCPBUGS-69902, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This pull request introduces validation and error handling for SSH private keys, aiming to prevent cryptographic panics (such as those caused by corrupted or malformed keys) and to improve the reliability of SSH connectivity.

The changes include adding a key operation validation step during signer creation, implementing panic recovery during SSH dial operations, and providing comprehensive unit tests for these scenarios.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jan 16, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrvaldes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2026
Add dialWithPanicRecovery() wrapper around ssh.Dial() to gracefully
handle panics from crypto libraries (e.g., curve25519) when SSH keys
are corrupted or malformed.

Previously, corrupted SSH private keys could cause the operator to
panic during the Curve25519 key exchange phase with errors like
"curve25519: internal error: scalarBaseMult was not 32 bytes".

This panic occurrs deep in golang.org/x/crypto/curve25519 and was not
catchable through normal error handling.

The new wrapper:
- Recovers from panics during ssh.Dial()
- Logs detailed diagnostic information (IP, username, key type)
- Returns a descriptive error message with remediation steps
- Prevents operator crashes due to key corruption

This addresses scenarios where SSH private keys pass initial parsing
validation but fail during actual cryptographic operations.

Fixes: OCPBUGS-69902
@jrvaldes
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jan 16, 2026
@jrvaldes
Copy link
Contributor Author

/test ?

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jan 16, 2026
@openshift-ci-robot
Copy link

@jrvaldes: This pull request references Jira Issue OCPBUGS-69902, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

@jrvaldes: The following commands are available to trigger required jobs:

/test aws-e2e-operator
/test azure-e2e-operator
/test azure-e2e-upgrade
/test ci-bundle-wmco-bundle
/test gcp-e2e-operator
/test images
/test lint
/test nutanix-e2e-operator
/test platform-none-vsphere-e2e-operator
/test security
/test unit
/test vsphere-disconnected-e2e-operator
/test vsphere-e2e-operator
/test vsphere-proxy-e2e-operator
/test wicd-unit-vsphere

Use /test all to run all jobs.

Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jrvaldes
Copy link
Contributor Author

/test unit

@jrvaldes
Copy link
Contributor Author

/test lint

@jrvaldes
Copy link
Contributor Author

/test vsphere-e2e-operator

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 17, 2026

@jrvaldes: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants