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: improve error when CA root cert can't be set #38827

Merged
merged 1 commit into from
Dec 15, 2020

Commits on Dec 14, 2020

  1. LibGit2: improve error when CA root cert can't be set

    This also fixes an insecure behavior: even if `set_ssl_cert_locations`
    failed, `REFCOUNT` was still incremented, which meant that subsequent
    calls to `ensure_initialized` didn't call `initialize` and so there was
    never a successful call to `set_ssl_cert_locations`. Without this
    libgit2 defaults to not verifying host identities and that is insecure.
    To prevent this, this patch locks on `ensure_initialized` and decrements
    `REFCOUNT` if initialize throws an error, ensuring that `initialize`
    succeeds at least once, including the call to `set_ssl_cert_locations`.
    StefanKarpinski committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    9b4b9c7 View commit details
    Browse the repository at this point in the history