Skip to content

Commit 05dd4ec

Browse files
bk2204ttaylorr
authored andcommitted
git-curl-compat: remove check for curl 7.39.0
libcurl 7.39.0 was released in November 2014, which is almost ten years ago, and no major operating system vendor is still providing security support for it. Debian 9 and Ubuntu 16.04, both of which are out of mainstream security support, have supported a newer version, and RHEL 8, which is still in support, also has a newer version. Remove the check for this version and use this functionality unconditionally. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 6545b26 commit 05dd4ec

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

git-curl-compat.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@
2828
* introduced, oldest first, in the official version of cURL library.
2929
*/
3030

31-
/**
32-
* CURLOPT_PINNEDPUBLICKEY was added in 7.39.0, released in November
33-
* 2014. CURLE_SSL_PINNEDPUBKEYNOTMATCH was added in that same version.
34-
*/
35-
#if LIBCURL_VERSION_NUM >= 0x072c00
36-
#define GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY 1
37-
#define GIT_CURL_HAVE_CURLE_SSL_PINNEDPUBKEYNOTMATCH 1
38-
#endif
39-
4031
/**
4132
* CURL_HTTP_VERSION_2 was added in 7.43.0, released in June 2015.
4233
*

http.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ static char *ssl_key;
6363
static char *ssl_key_type;
6464
static char *ssl_capath;
6565
static char *curl_no_proxy;
66-
#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY
6766
static char *ssl_pinnedkey;
68-
#endif
6967
static char *ssl_cainfo;
7068
static long curl_low_speed_limit = -1;
7169
static long curl_low_speed_time = -1;
@@ -509,12 +507,7 @@ static int http_options(const char *var, const char *value,
509507
}
510508

511509
if (!strcmp("http.pinnedpubkey", var)) {
512-
#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY
513510
return git_config_pathname(&ssl_pinnedkey, var, value);
514-
#else
515-
warning(_("Public key pinning not supported with cURL < 7.39.0"));
516-
return 0;
517-
#endif
518511
}
519512

520513
if (!strcmp("http.extraheader", var)) {
@@ -1104,10 +1097,8 @@ static CURL *get_curl_handle(void)
11041097
curl_easy_setopt(result, CURLOPT_SSLKEYTYPE, ssl_key_type);
11051098
if (ssl_capath)
11061099
curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath);
1107-
#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY
11081100
if (ssl_pinnedkey)
11091101
curl_easy_setopt(result, CURLOPT_PINNEDPUBLICKEY, ssl_pinnedkey);
1110-
#endif
11111102
if (http_ssl_backend && !strcmp("schannel", http_ssl_backend) &&
11121103
!http_schannel_use_ssl_cainfo) {
11131104
curl_easy_setopt(result, CURLOPT_CAINFO, NULL);
@@ -1825,10 +1816,8 @@ static int handle_curl_result(struct slot_results *results)
18251816
*/
18261817
credential_reject(&cert_auth);
18271818
return HTTP_NOAUTH;
1828-
#ifdef GIT_CURL_HAVE_CURLE_SSL_PINNEDPUBKEYNOTMATCH
18291819
} else if (results->curl_result == CURLE_SSL_PINNEDPUBKEYNOTMATCH) {
18301820
return HTTP_NOMATCHPUBLICKEY;
1831-
#endif
18321821
} else if (missing_target(results))
18331822
return HTTP_MISSING_TARGET;
18341823
else if (results->http_code == 401) {

0 commit comments

Comments
 (0)