1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

CURLOPT_SOCKS5_GSSAPI_SERVICE: Merged with CURLOPT_PROXY_SERVICE_NAME

As these two options provide identical functionality, the former for
SOCK5 proxies and the latter for HTTP proxies, merged the two options
together.

As such CURLOPT_SOCKS5_GSSAPI_SERVICE is marked as deprecated as of
7.49.0.
This commit is contained in:
Steve Holme 2016-04-09 20:47:05 +01:00
parent 830a4e55a2
commit ccf7a82605
13 changed files with 31 additions and 50 deletions

View File

@ -29,7 +29,8 @@ CURLOPT_PROXY_SERVICE_NAME \- proxy authentication service name
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SERVICE_NAME, char *name); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SERVICE_NAME, char *name);
.SH DESCRIPTION .SH DESCRIPTION
Pass a char * as parameter to a string holding the \fIname\fP of the Pass a char * as parameter to a string holding the \fIname\fP of the
service. The default service name is "HTTP". This option allows you to change it. service. The default service name is "HTTP" for HTTP based proxies and "rcmd"
for SOCKS5. This option allows you to change it.
.SH DEFAULT .SH DEFAULT
See above See above
.SH PROTOCOLS .SH PROTOCOLS
@ -37,7 +38,7 @@ All network protocols
.SH EXAMPLE .SH EXAMPLE
TODO TODO
.SH AVAILABILITY .SH AVAILABILITY
Added in 7.43.0 Added in 7.43.0 for HTTP proxies, 7.49.0 for SOCKS5 proxies.
.SH RETURN VALUE .SH RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space. CURLE_OUT_OF_MEMORY if there was insufficient heap space.

View File

@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@ -22,23 +22,25 @@
.\" .\"
.TH CURLOPT_SOCKS5_GSSAPI_SERVICE 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options" .TH CURLOPT_SOCKS5_GSSAPI_SERVICE 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
.SH NAME .SH NAME
CURLOPT_SOCKS5_GSSAPI_SERVICE \- proxy socks gssapi service name CURLOPT_SOCKS5_GSSAPI_SERVICE \- SOCKS5 proxy authentication service name
.SH SYNOPSIS .SH SYNOPSIS
#include <curl/curl.h> #include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_GSSAPI_SERVICE, char *name); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SOCKS5_GSSAPI_SERVICE, char *name);
.SH DESCRIPTION .SH DESCRIPTION
Pass a char * as parameter to a string holding the \fIname\fP of the Deprecated since 7.49.0. Use \CURLOPT_PROXY_SERVICE_NAME(3)\fP instead.
service. The default service name for a SOCKS5 server is
rcmd/server-fqdn. This option allows you to change it. Pass a char * as parameter to a string holding the \fIname\fP of the service.
The default service name for a SOCKS5 server is "rcmd". This option allows you
to change it.
.SH DEFAULT .SH DEFAULT
See above See above
.SH PROTOCOLS .SH PROTOCOLS
Most All network protocols
.SH EXAMPLE .SH EXAMPLE
TODO TODO
.SH AVAILABILITY .SH AVAILABILITY
Added in 7.19.4 Added in 7.19.4, deprecated in 7.49.0
.SH RETURN VALUE .SH RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space. CURLE_OUT_OF_MEMORY if there was insufficient heap space.

View File

@ -492,7 +492,7 @@ CURLOPT_SHARE 7.10
CURLOPT_SOCKOPTDATA 7.16.0 CURLOPT_SOCKOPTDATA 7.16.0
CURLOPT_SOCKOPTFUNCTION 7.16.0 CURLOPT_SOCKOPTFUNCTION 7.16.0
CURLOPT_SOCKS5_GSSAPI_NEC 7.19.4 CURLOPT_SOCKS5_GSSAPI_NEC 7.19.4
CURLOPT_SOCKS5_GSSAPI_SERVICE 7.19.4 CURLOPT_SOCKS5_GSSAPI_SERVICE 7.19.4 7.49.0
CURLOPT_SOURCE_HOST 7.12.1 - 7.15.5 CURLOPT_SOURCE_HOST 7.12.1 - 7.15.5
CURLOPT_SOURCE_PATH 7.12.1 - 7.15.5 CURLOPT_SOURCE_PATH 7.12.1 - 7.15.5
CURLOPT_SOURCE_PORT 7.12.1 - 7.15.5 CURLOPT_SOURCE_PORT 7.12.1 - 7.15.5

View File

@ -1462,7 +1462,7 @@ typedef enum {
CINIT(TFTP_BLKSIZE, LONG, 178), CINIT(TFTP_BLKSIZE, LONG, 178),
/* Socks Service */ /* Socks Service */
CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
/* Socks Service */ /* Socks Service */
CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),

View File

@ -120,7 +120,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
unsigned short us_length; unsigned short us_length;
char *user=NULL; char *user=NULL;
unsigned char socksreq[4]; /* room for GSS-API exchange header only */ unsigned char socksreq[4]; /* room for GSS-API exchange header only */
char *serviceptr = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE]; const char *serviceptr = data->set.str[STRING_PROXY_SERVICE_NAME] ?
data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd";
/* GSS-API request looks like /* GSS-API request looks like
* +----+------+-----+----------------+ * +----+------+-----+----------------+

View File

@ -83,7 +83,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
unsigned short us_length; unsigned short us_length;
unsigned long qop; unsigned long qop;
unsigned char socksreq[4]; /* room for GSS-API exchange header only */ unsigned char socksreq[4]; /* room for GSS-API exchange header only */
char *service = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE]; const char *service = data->set.str[STRING_PROXY_SERVICE_NAME] ?
data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd";
/* GSS-API request looks like /* GSS-API request looks like
* +----+------+-----+----------------+ * +----+------+-----+----------------+

View File

@ -571,11 +571,6 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
* seem not to follow rfc1961 section 4.3/4.4 * seem not to follow rfc1961 section 4.3/4.4
*/ */
set->socks5_gssapi_nec = FALSE; set->socks5_gssapi_nec = FALSE;
/* set default GSS-API service name */
result = setstropt(&set->str[STRING_SOCKS5_GSSAPI_SERVICE],
CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE);
if(result)
return result;
#endif #endif
/* This is our preferred CA cert bundle/path since install time */ /* This is our preferred CA cert bundle/path since install time */
@ -1478,28 +1473,21 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
#endif /* CURL_DISABLE_PROXY */ #endif /* CURL_DISABLE_PROXY */
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
case CURLOPT_SOCKS5_GSSAPI_SERVICE: case CURLOPT_SOCKS5_GSSAPI_NEC:
/* /*
* Set GSS-API service name * Set flag for NEC SOCK5 support
*/ */
result = setstropt(&data->set.str[STRING_SOCKS5_GSSAPI_SERVICE], data->set.socks5_gssapi_nec = (0 != va_arg(param, long)) ? TRUE : FALSE;
va_arg(param, char *));
break; break;
case CURLOPT_SOCKS5_GSSAPI_SERVICE:
case CURLOPT_PROXY_SERVICE_NAME: case CURLOPT_PROXY_SERVICE_NAME:
/* /*
* Set negotiate proxy service name * Set proxy authentication service name for Kerberos 5 and SPNEGO
*/ */
result = setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME], result = setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME],
va_arg(param, char *)); va_arg(param, char *));
break; break;
case CURLOPT_SOCKS5_GSSAPI_NEC:
/*
* set flag for nec socks5 support
*/
data->set.socks5_gssapi_nec = (0 != va_arg(param, long)) ? TRUE : FALSE;
break;
#endif #endif
#if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_KERBEROS5) || \ #if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_KERBEROS5) || \

View File

@ -67,8 +67,6 @@ void Curl_getoff_all_pipelines(struct SessionHandle *data,
void Curl_close_connections(struct SessionHandle *data); void Curl_close_connections(struct SessionHandle *data);
#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */ #define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
#define CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE "rcmd" /* default socks5 gssapi
service */
CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex); CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex);

View File

@ -1407,7 +1407,6 @@ enum dupstring {
STRING_SSH_KNOWNHOSTS, /* file name of knownhosts file */ STRING_SSH_KNOWNHOSTS, /* file name of knownhosts file */
#endif #endif
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
STRING_SOCKS5_GSSAPI_SERVICE, /* GSSAPI service name */
STRING_PROXY_SERVICE_NAME, /* Proxy service name */ STRING_PROXY_SERVICE_NAME, /* Proxy service name */
#endif #endif
#if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_KERBEROS5) || \ #if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_KERBEROS5) || \

View File

@ -137,7 +137,6 @@ static void free_config_fields(struct OperationConfig *config)
curl_slist_free_all(config->resolve); curl_slist_free_all(config->resolve);
Curl_safefree(config->socksproxy); Curl_safefree(config->socksproxy);
Curl_safefree(config->socks5_gssapi_service);
Curl_safefree(config->proxy_service_name); Curl_safefree(config->proxy_service_name);
Curl_safefree(config->service_name); Curl_safefree(config->service_name);

View File

@ -165,12 +165,10 @@ struct OperationConfig {
char *socksproxy; /* set to server string */ char *socksproxy; /* set to server string */
int socksver; /* set to CURLPROXY_SOCKS* define */ int socksver; /* set to CURLPROXY_SOCKS* define */
char *socks5_gssapi_service; /* set service name for gssapi principal int socks5_gssapi_nec; /* The NEC reference server does not protect the
* default rcmd */ encryption type exchange */
char *proxy_service_name; /* set service name for proxy negotiation char *proxy_service_name; /* set authentication service name for HTTP and
* default HTTP */ SOCKS5 proxies */
int socks5_gssapi_nec ; /* The NEC reference server does not protect
* the encryption type exchange */
char *service_name; /* set authentication service name for DIGEST-MD5, char *service_name; /* set authentication service name for DIGEST-MD5,
Kerberos 5 and SPNEGO */ Kerberos 5 and SPNEGO */

View File

@ -158,7 +158,6 @@ static const struct LongShort aliases[]= {
{"$3", "keepalive-time", TRUE}, {"$3", "keepalive-time", TRUE},
{"$4", "post302", FALSE}, {"$4", "post302", FALSE},
{"$5", "noproxy", TRUE}, {"$5", "noproxy", TRUE},
{"$6", "socks5-gssapi-service", TRUE},
{"$7", "socks5-gssapi-nec", FALSE}, {"$7", "socks5-gssapi-nec", FALSE},
{"$8", "proxy1.0", TRUE}, {"$8", "proxy1.0", TRUE},
{"$9", "tftp-blksize", TRUE}, {"$9", "tftp-blksize", TRUE},
@ -176,6 +175,9 @@ static const struct LongShort aliases[]= {
{"$L", "test-event", FALSE}, {"$L", "test-event", FALSE},
{"$M", "unix-socket", TRUE}, {"$M", "unix-socket", TRUE},
{"$N", "path-as-is", FALSE}, {"$N", "path-as-is", FALSE},
{"$O", "socks5-gssapi-service", TRUE},
/* 'socks5-gssapi-service' merged with'proxy-service-name' and
deprecated since 7.49.0 */
{"$O", "proxy-service-name", TRUE}, {"$O", "proxy-service-name", TRUE},
{"$P", "service-name", TRUE}, {"$P", "service-name", TRUE},
{"$Q", "proto-default", TRUE}, {"$Q", "proto-default", TRUE},
@ -901,10 +903,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
/* This specifies the noproxy list */ /* This specifies the noproxy list */
GetStr(&config->noproxy, nextarg); GetStr(&config->noproxy, nextarg);
break; break;
case '6': /* --socks5-gssapi-service */ case '7': /* --socks5-gssapi-nec*/
GetStr(&config->socks5_gssapi_service, nextarg);
break;
case '7': /* --socks5-gssapi-nec*/
config->socks5_gssapi_nec = toggle; config->socks5_gssapi_nec = toggle;
break; break;
case '8': /* --proxy1.0 */ case '8': /* --proxy1.0 */

View File

@ -1209,11 +1209,6 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC, my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC,
(long)config->ftp_ssl_ccc_mode); (long)config->ftp_ssl_ccc_mode);
/* new in curl 7.19.4 */
if(config->socks5_gssapi_service)
my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_SERVICE,
config->socks5_gssapi_service);
/* new in curl 7.19.4 */ /* new in curl 7.19.4 */
if(config->socks5_gssapi_nec) if(config->socks5_gssapi_nec)
my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_NEC, my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_NEC,