Skip to content

proposal: x/crypto/ssh: new callbacks to Config and error type #26840

Open
@ThomasHabets

Description

@ThomasHabets

What version of Go are you using (go version)?

1.9.4 (but it doesn't matter, this isn't in the stdlib yet)

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

Doesn't matter.

What did you do?

I'm trying to get more info from SSH servers, and the API of x/crypto/ssh is not very friendly.

  1. I can only list acceptable crypto algorithms, not find out which the remote end support. One reason for wanting this is that I want to check all host keys, but the HostKeyCallback is only called for the negotiated one. The error message includes all algorithms remote end supports, but it's not programmatically extractable.
  2. No good way to reject host key and know that's why Dial failed.

What did you expect to see?

  1. Config.Remote{Ciphers,KeyExchanges,MACs} callbacks
  2. Being able to identify the error returned by ClientConfig.HostKeyCallback so that I know it failed because I wanted it to.

What did you see instead?

API with deficiencies.

Suggested improvements

  1. Add Remote{Ciphers,KeyExchanges,MACs} callbacks to type Config
  2. Add type HostKeyError, wrapping the error returned from the callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalProposal-CryptoProposal related to crypto packages or other security issues

    Type

    No type

    Projects

    Status

    Incoming

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions