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.
This commit is contained in:
Linus Nielsen 2015-03-29 14:52:31 +02:00 committed by Daniel Stenberg
parent 54c394699d
commit 97c272e5d1
17 changed files with 185 additions and 5 deletions

View file

@ -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);

View file

@ -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 */

View file

@ -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 */

View file

@ -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 */