Skip to content

Commit 905a028

Browse files
avargitster
authored andcommitted
http: correct curl version check for CURLOPT_PINNEDPUBLICKEY
In aeff8a6 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a7f646 commit 905a028

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

http.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static struct {
5959
static const char *ssl_key;
6060
static const char *ssl_capath;
6161
static const char *curl_no_proxy;
62-
#if LIBCURL_VERSION_NUM >= 0x072c00
62+
#if LIBCURL_VERSION_NUM >= 0x072700
6363
static const char *ssl_pinnedkey;
6464
#endif
6565
static const char *ssl_cainfo;
@@ -373,10 +373,10 @@ static int http_options(const char *var, const char *value, void *cb)
373373
}
374374

375375
if (!strcmp("http.pinnedpubkey", var)) {
376-
#if LIBCURL_VERSION_NUM >= 0x072c00
376+
#if LIBCURL_VERSION_NUM >= 0x072700
377377
return git_config_pathname(&ssl_pinnedkey, var, value);
378378
#else
379-
warning(_("Public key pinning not supported with cURL < 7.44.0"));
379+
warning(_("Public key pinning not supported with cURL < 7.39.0"));
380380
return 0;
381381
#endif
382382
}
@@ -845,7 +845,7 @@ static CURL *get_curl_handle(void)
845845
curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
846846
if (ssl_capath != NULL)
847847
curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath);
848-
#if LIBCURL_VERSION_NUM >= 0x072c00
848+
#if LIBCURL_VERSION_NUM >= 0x072700
849849
if (ssl_pinnedkey != NULL)
850850
curl_easy_setopt(result, CURLOPT_PINNEDPUBLICKEY, ssl_pinnedkey);
851851
#endif

0 commit comments

Comments
 (0)