summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinus Nielsen <linus@haxx.se>2015-03-29 14:52:31 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-04-28 08:29:56 +0200
commit97c272e5d173ad5f706443e2477f0a84f0044edd (patch)
treef43116c71d2dd85e4e0e62866a096e3b3bd98a37 /src
parent54c394699de29ea9ca07d9d0ac6f2f43848e5f32 (diff)
downloadcurl-97c272e5d173ad5f706443e2477f0a84f0044edd.tar.gz
Negotiate: custom service names for SPNEGO.
* Add new options, CURLOPT_PROXY_SERVICE_NAME and CURLOPT_SERVICE_NAME. * Add new curl options, --proxy-service-name and --service-name.
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.c2
-rw-r--r--src/tool_cfgable.h4
-rw-r--r--src/tool_getparam.c8
-rw-r--r--src/tool_operate.c11
4 files changed, 25 insertions, 0 deletions
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
index c78c89613..ba6c468c5 100644
--- a/src/tool_cfgable.c
+++ b/src/tool_cfgable.c
@@ -136,6 +136,8 @@ static void free_config_fields(struct OperationConfig *config)
Curl_safefree(config->socksproxy);
Curl_safefree(config->socks5_gssapi_service);
+ Curl_safefree(config->proxy_service_name);
+ Curl_safefree(config->service_name);
Curl_safefree(config->ftp_account);
Curl_safefree(config->ftp_alternative_to_user);
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index d1f223871..048eb4ffe 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -166,8 +166,12 @@ struct OperationConfig {
int socksver; /* set to CURLPROXY_SOCKS* define */
char *socks5_gssapi_service; /* set service name for gssapi principal
* default rcmd */
+ char *proxy_service_name; /* set service name for proxy negotiation
+ * default HTTP */
int socks5_gssapi_nec ; /* The NEC reference server does not protect
* the encryption type exchange */
+ char *service_name; /* set negotiation service name
+ * default HTTP */
bool tcp_nodelay;
long req_retry; /* number of retries */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 1b5d6d2b0..62283a5dd 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -161,6 +161,8 @@ static const struct LongShort aliases[]= {
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
{"$6", "socks5-gssapi-service", TRUE},
{"$7", "socks5-gssapi-nec", FALSE},
+ {"$O", "proxy-service-name", TRUE},
+ {"$P", "service-name", TRUE},
#endif
{"$8", "proxy1.0", TRUE},
{"$9", "tftp-blksize", TRUE},
@@ -903,6 +905,12 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
case '7': /* --socks5-gssapi-nec*/
config->socks5_gssapi_nec = toggle;
break;
+ case 'O': /* --proxy-service-name */
+ GetStr(&config->proxy_service_name, nextarg);
+ break;
+ case 'P': /* --service-name */
+ GetStr(&config->service_name, nextarg);
+ break;
#endif
case '8': /* --proxy1.0 */
/* http 1.0 proxy */
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 74e4002b1..5f7b79211 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1217,6 +1217,17 @@ static CURLcode operate_do(struct GlobalConfig *global,
if(config->socks5_gssapi_nec)
my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_NEC,
config->socks5_gssapi_nec);
+
+ /* new in curl 7.43.0 */
+ if(config->proxy_service_name)
+ my_setopt_str(curl, CURLOPT_PROXY_SERVICE_NAME,
+ config->proxy_service_name);
+
+ /* new in curl 7.43.0 */
+ if(config->service_name)
+ my_setopt_str(curl, CURLOPT_SERVICE_NAME,
+ config->service_name);
+
}
#endif
/* curl 7.13.0 */