source-controller/pkg/git
Hidde Beydals b2f6639c01 libgit2: use provided host to validate public key
The callback from libgit2 only provides a hostname (without the port),
but the `known_hosts` file indexes the public keys based on the full
host (e.g. `[localhost]:123` for a host behind a specific port).

As a result, it was unable to find the correct public key for the
hostname when it was added to the `known_hosts` file with the port.

To work around this, we add the user provided host that includes the
port to the `PublicKeyAuth` strategy, and use this to find the right
entry in the `known_hosts` file, after having validated that the
hostname provided to the callback matches the hostname of the host
provided by the user.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-11 12:52:55 +01:00
..
gogit Move `git/common` to `git` 2021-02-08 14:05:05 +01:00
libgit2 libgit2: use provided host to validate public key 2021-02-11 12:52:55 +01:00
strategy Move `git/common` to `git` 2021-02-08 14:05:05 +01:00
git.go Move `git/common` to `git` 2021-02-08 14:05:05 +01:00