diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-09-13 16:51:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-13 10:39:04 -0700 |
commit | 905a02880473c54f6c817e4ec8262d195d149940 (patch) | |
tree | b0b25ddf4e64bdd12a45569212a0d7af06b734db /http.c | |
parent | http: correct version check for CURL_HTTP_VERSION_2 (diff) | |
download | tgif-905a02880473c54f6c817e4ec8262d195d149940.tar.xz |
http: correct curl version check for CURLOPT_PINNEDPUBLICKEY
In aeff8a61216 (http: implement public key pinning, 2016-02-15) a
dependency and warning() was added if curl older than 7.44.0 was used,
but the relevant code depended on CURLOPT_PINNEDPUBLICKEY, introduced
in 7.39.0.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -59,7 +59,7 @@ static struct { static const char *ssl_key; static const char *ssl_capath; static const char *curl_no_proxy; -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 static const char *ssl_pinnedkey; #endif static const char *ssl_cainfo; @@ -373,10 +373,10 @@ static int http_options(const char *var, const char *value, void *cb) } if (!strcmp("http.pinnedpubkey", var)) { -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 return git_config_pathname(&ssl_pinnedkey, var, value); #else - warning(_("Public key pinning not supported with cURL < 7.44.0")); + warning(_("Public key pinning not supported with cURL < 7.39.0")); return 0; #endif } @@ -845,7 +845,7 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key); if (ssl_capath != NULL) curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath); -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 if (ssl_pinnedkey != NULL) curl_easy_setopt(result, CURLOPT_PINNEDPUBLICKEY, ssl_pinnedkey); #endif |