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: fix pass-through for SSH #38563

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

StefanKarpinski
Copy link
Sponsor Member

According to the libgit2 documentation, if the callback returns any postive value, it will behave as if the callback were unset (i.e. pass-through), but that's not true. The value that needs to be returned is actually -30 (GIT_PASSTHROUGH).

According to the libgit2 documentation, if the callback returns any
postive value, it will behave as if the callback were unset (i.e.
pass-through), but that's not true. The value that needs to be returned
is actually -30 (`GIT_PASSTHROUGH`).
@StefanKarpinski
Copy link
Sponsor Member Author

StefanKarpinski commented Nov 24, 2020

Yes, but:

So while returning a negative positive value to indicate pass-through does work for SSH, it does not work for HTTPS. The previous version of this code was just rejecting invalid certificates, which works for HTTPS but does not seem to work for SSH, which seems to need to try something else after this callback in order to work. The GIT_PASSTHROUGH constant (-30) actually works as a pass-through value for all protocols.

@Keno
Copy link
Member

Keno commented Nov 24, 2020

So while returning a negative value to indicate pass-through does work for SSH

You mean a positive value?

@StefanKarpinski
Copy link
Sponsor Member Author

Yes, that's what I meant.

@Keno
Copy link
Member

Keno commented Nov 24, 2020

So the design of NetworkOptions.verify_host is to allow additional hosts, but never be able to reject anything the system allows?

@StefanKarpinski
Copy link
Sponsor Member Author

Yes, it is a mechanism for allowing unverified access to hosts that would otherwise fail verification. Why would we want a mechanism for rejecting verified hosts?

@StefanKarpinski StefanKarpinski merged commit 6614645 into master Nov 24, 2020
@StefanKarpinski StefanKarpinski deleted the sk/libgit2-fix-ssh-passthrough branch November 24, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants