Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2: use provided host to validate public key #288

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Commits on Feb 11, 2021

  1. 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 <[email protected]>
    hiddeco committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    b2f6639 View commit details
    Browse the repository at this point in the history