aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/ssh/auth_method.go
Commit message (Collapse)AuthorAgeFilesLines
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-111-2/+1
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* fix(ssh): unable to pass a custom HostKeyCallback funcAyman Bagabas2023-03-051-13/+15
| | | | | | | | Don't overwrite HostKeyCallback if one is provided. Fixes: c35b8082c863 ("plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes #411") Fixes: https://github.com/go-git/go-git/issues/654 Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
* plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes ↵Evan Elias2022-09-221-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | #411 This commit adjusts the transport/ssh logic in command.connect(), so that it now auto-populates ssh.ClientConfig.HostKeyAlgorithms. The algorithms are chosen based on the known host keys for the target host, as obtained from the known_hosts file. In order to look-up the algorithms from the known_hosts file, external module github.com/skeema/knownhosts is used. This package is just a thin wrapper around golang.org/x/crypto/ssh/knownhosts, adding an extra mechanism to query the known_hosts keys, implemented in a way which avoids duplication of any golang.org/x/crypto/ssh/knownhosts logic. Because HostKeyAlgorithms vary by target host, some related logic for setting HostKeyCallback has been moved out of the various AuthMethod implementations. This was necessary because the old HostKeyCallbackHelper is not host-specific. Since known_hosts handling isn't really tied to AuthMethod anyway, it seems reasonable to separate these. Previously-exported types/methods remain in place for backwards compat, but some of them are now unused. For testing approach, see pull request. Issue #411 can only be reproduced via end-to-end / integration testing, since it requires actually launching an SSH connection, in order to see the key mismatch error triggered from https://github.com/golang/go/issues/29286 as the root cause.
* all: replace go-homedir with os.UserHomeDirDaniel Martí2022-05-291-5/+6
| | | | Added in Go 1.12, this means we need one less dependency.
* *: use go-billy instead of os callsMáximo Cuadros2021-05-021-1/+1
|
* plumbing: transport/ssh, support more formats in `NewPublicKeys` SSH helper ↵Hidde Beydals2021-04-171-18/+4
| | | | | | | | | | | | | | | (#298) * Add failing ED25519 encrypted PEM test Signed-off-by: Hidde Beydals <hello@hidde.co> * Support more formats in `NewPublicKeys` SSH helper By switching to `ParsePrivateKey` and `ParsePrivateKeyWithPassphrase` from `crypto/ssh`, which has support for RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. Signed-off-by: Hidde Beydals <hello@hidde.co>
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-1/+1
|
* *: avoid unnecessary conversionsChristian Muehlhaeuser2019-07-291-1/+1
| | | | | | | No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
* plumbing/transport: ssh check if list of known_hosts files is emptyKuba Podgórski2018-09-071-6/+8
| | | Signed-off-by: kuba-- <kuba@sourced.tech>
* Return error when creating public keys from invalid PEMMark DeLillo2018-02-251-0/+3
| | | | | | * pem.Decode will return nil in this case, and passing that to x509.IsEncryptedBlock will cause it to panic Signed-off-by: Mark DeLillo <github.med@delillo.org>
* Fix mistypingDmitry Labutin2018-02-071-2/+2
| | | | Signed-off-by: Dmitry Labutin <dmitry@labutin.com>
* transport: made public all the fields and standardize AuthMethodMáximo Cuadros2017-11-211-34/+48
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Avoid using user.Current()Kim, Hirokuni2017-08-081-6/+20
| | | | | user.Current() causes 'Current not implemented' error when crosscompiled. See https://github.com/golang/go/issues/6376
* Use xanzy/ssh-agent to create the ssh agent correctly based on os.Ethan Young2017-06-011-13/+4
|
* transport: make Endpoint an interface, fixes #362Santiago M. Mola2017-04-271-4/+9
| | | | | * add internal *url.URL implementation for regular URLs. * add internal implementation for SCP-like URLs.
* transport: ssh, NewPublicKeys support for encrypted PEM filesMáximo Cuadros2017-04-211-7/+26
|
* transport: ssh, NewPublicKeys helperMáximo Cuadros2017-04-211-23/+46
|
* transport: ssh, fork knownhosts package (temporal)Máximo Cuadros2017-04-171-1/+1
|
* transport: ssh, default HostKeyCallbackMáximo Cuadros2017-04-161-0/+86
|
* plumbing/transport: git, error on empty SSH_AUTH_SOCKMáximo Cuadros2017-02-211-3/+11
|
* transport: create Client interface (#132)Santiago M. Mola2016-11-231-0/+157
* plumbing: move plumbing/client package to plumbing/transport. * transport: create Client interface. * A Client can instantiate any client transport service. * InstallProtocol installs a Client for a given protocol, instead of just a UploadPackService. * A Client can open a session for fetch-pack or send-pack for a specific Endpoint. * Adapt ssh and http clients to the new client interface. * updated doc