mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-01-22 08:14:08 +00:00
add kex diffie-hellman-group-exchange-sha256
This commit is contained in:
parent
8a4defcb46
commit
b878deaf2d
1 changed files with 14 additions and 3 deletions
|
@ -83,6 +83,16 @@ func (app *app) cmdInstall(cmdCtx context.Context, args []string) error {
|
||||||
return errors.New("ssh: fingerprint didn't match")
|
return errors.New("ssh: fingerprint didn't match")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// kex algos
|
||||||
|
// see defaults: https://cs.opensource.google/go/x/crypto/+/refs/tags/v0.18.0:ssh/common.go;l=62
|
||||||
|
kexAlgos := []string{
|
||||||
|
"curve25519-sha256", "curve25519-sha256@libssh.org",
|
||||||
|
"ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521",
|
||||||
|
"diffie-hellman-group14-sha256", "diffie-hellman-group14-sha1",
|
||||||
|
}
|
||||||
|
// extra for some apc ups
|
||||||
|
kexAlgos = append(kexAlgos, "diffie-hellman-group-exchange-sha256")
|
||||||
|
|
||||||
// install file on UPS
|
// install file on UPS
|
||||||
// ssh config
|
// ssh config
|
||||||
config := &ssh.ClientConfig{
|
config := &ssh.ClientConfig{
|
||||||
|
@ -92,11 +102,12 @@ func (app *app) cmdInstall(cmdCtx context.Context, args []string) error {
|
||||||
},
|
},
|
||||||
// APC seems to require `Client Version` string to start with "SSH-2" and must be at least
|
// APC seems to require `Client Version` string to start with "SSH-2" and must be at least
|
||||||
// 13 characters long
|
// 13 characters long
|
||||||
// e.g. working from Ubuntu ssh: ClientVersion: "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6",
|
// working examples from other clients:
|
||||||
|
// ClientVersion: "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6",
|
||||||
// ClientVersion: "SSH-2.0-PuTTY_Release_0.80",
|
// ClientVersion: "SSH-2.0-PuTTY_Release_0.80",
|
||||||
ClientVersion: fmt.Sprintf("SSH-2.0-apc-p15-tool_v%s %s-%s", appVersion, runtime.GOOS, runtime.GOARCH),
|
ClientVersion: fmt.Sprintf("SSH-2.0-apc-p15-tool_v%s %s-%s", appVersion, runtime.GOOS, runtime.GOARCH),
|
||||||
Config: ssh.Config{
|
Config: ssh.Config{
|
||||||
// KeyExchanges: []string{"ecdh-sha2-nistp256"},
|
KeyExchanges: kexAlgos,
|
||||||
// Ciphers: []string{"aes128-ctr"},
|
// Ciphers: []string{"aes128-ctr"},
|
||||||
// MACs: []string{"hmac-sha2-256"},
|
// MACs: []string{"hmac-sha2-256"},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue