2003-06-10 20:22:19 +08:00
|
|
|
/***************************************************************************
|
2004-06-24 19:54:11 +08:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
2003-06-10 20:22:19 +08:00
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2012-01-17 04:14:05 +08:00
|
|
|
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2003-06-10 20:22:19 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
2004-06-24 19:54:11 +08:00
|
|
|
*
|
2003-06-10 20:22:19 +08:00
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2011-07-26 23:23:27 +08:00
|
|
|
|
2013-01-07 02:06:49 +08:00
|
|
|
#include "curl_setup.h"
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2003-09-19 20:56:22 +08:00
|
|
|
#ifdef HAVE_GSSAPI
|
2008-04-07 17:26:30 +08:00
|
|
|
#ifdef HAVE_OLD_GSSMIT
|
2003-09-19 20:56:22 +08:00
|
|
|
#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
|
2011-07-29 05:03:07 +08:00
|
|
|
#define NCOMPAT 1
|
2003-09-19 20:56:22 +08:00
|
|
|
#endif
|
2003-06-10 20:22:19 +08:00
|
|
|
|
|
|
|
#ifndef CURL_DISABLE_HTTP
|
|
|
|
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "urldata.h"
|
|
|
|
#include "sendf.h"
|
2011-07-14 04:54:54 +08:00
|
|
|
#include "curl_gssapi.h"
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "rawstr.h"
|
2008-08-17 08:25:38 +08:00
|
|
|
#include "curl_base64.h"
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "http_negotiate.h"
|
2009-04-21 19:46:16 +08:00
|
|
|
#include "curl_memory.h"
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "url.h"
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2008-05-26 11:10:34 +08:00
|
|
|
#ifdef HAVE_SPNEGO
|
2008-08-16 11:27:07 +08:00
|
|
|
# include <spnegohelp.h>
|
|
|
|
# ifdef USE_SSLEAY
|
|
|
|
# ifdef USE_OPENSSL
|
|
|
|
# include <openssl/objects.h>
|
|
|
|
# else
|
|
|
|
# include <objects.h>
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# error "Can't compile SPNEGO support without OpenSSL."
|
|
|
|
# endif
|
2008-05-26 11:10:34 +08:00
|
|
|
#endif
|
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
#define _MPRINTF_REPLACE /* use our functions only */
|
|
|
|
#include <curl/mprintf.h>
|
|
|
|
|
|
|
|
/* The last #include file should be: */
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "memdebug.h"
|
2003-06-10 20:22:19 +08:00
|
|
|
|
|
|
|
static int
|
2007-09-21 19:05:31 +08:00
|
|
|
get_gss_name(struct connectdata *conn, bool proxy, gss_name_t *server)
|
2003-06-10 20:22:19 +08:00
|
|
|
{
|
2007-11-21 07:17:08 +08:00
|
|
|
struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg:
|
|
|
|
&conn->data->state.negotiate;
|
2003-06-10 20:22:19 +08:00
|
|
|
OM_uint32 major_status, minor_status;
|
|
|
|
gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
|
|
|
|
char name[2048];
|
2003-09-12 06:21:11 +08:00
|
|
|
const char* service;
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2003-07-23 19:28:59 +08:00
|
|
|
/* GSSAPI implementation by Globus (known as GSI) requires the name to be
|
|
|
|
of form "<service>/<fqdn>" instead of <service>@<fqdn> (ie. slash instead
|
|
|
|
of at-sign). Also GSI servers are often identified as 'host' not 'khttp'.
|
|
|
|
Change following lines if you want to use GSI */
|
2003-09-12 06:21:11 +08:00
|
|
|
|
|
|
|
/* IIS uses the <service>@<fqdn> form but uses 'http' as the service name */
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->gss)
|
2004-08-06 02:52:54 +08:00
|
|
|
service = "KHTTP";
|
2003-09-12 06:21:11 +08:00
|
|
|
else
|
2004-08-06 02:52:54 +08:00
|
|
|
service = "HTTP";
|
2003-09-12 06:21:11 +08:00
|
|
|
|
2007-11-21 07:02:58 +08:00
|
|
|
token.length = strlen(service) + 1 + strlen(proxy ? conn->proxy.name :
|
|
|
|
conn->host.name) + 1;
|
2007-11-05 17:45:09 +08:00
|
|
|
if(token.length + 1 > sizeof(name))
|
2003-06-10 20:22:19 +08:00
|
|
|
return EMSGSIZE;
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2007-11-21 07:02:58 +08:00
|
|
|
snprintf(name, sizeof(name), "%s@%s", service, proxy ? conn->proxy.name :
|
|
|
|
conn->host.name);
|
2003-07-23 19:28:59 +08:00
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
token.value = (void *) name;
|
|
|
|
major_status = gss_import_name(&minor_status,
|
|
|
|
&token,
|
|
|
|
GSS_C_NT_HOSTBASED_SERVICE,
|
|
|
|
server);
|
2003-09-12 06:21:11 +08:00
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
return GSS_ERROR(major_status) ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-20 21:17:42 +08:00
|
|
|
log_gss_error(struct connectdata *conn, OM_uint32 error_status,
|
|
|
|
const char *prefix)
|
2003-06-10 20:22:19 +08:00
|
|
|
{
|
|
|
|
OM_uint32 maj_stat, min_stat;
|
|
|
|
OM_uint32 msg_ctx = 0;
|
|
|
|
gss_buffer_desc status_string;
|
|
|
|
char buf[1024];
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s", prefix);
|
|
|
|
len = strlen(buf);
|
|
|
|
do {
|
2007-11-21 07:17:08 +08:00
|
|
|
maj_stat = gss_display_status(&min_stat,
|
|
|
|
error_status,
|
|
|
|
GSS_C_MECH_CODE,
|
|
|
|
GSS_C_NO_OID,
|
|
|
|
&msg_ctx,
|
|
|
|
&status_string);
|
2007-11-05 17:45:09 +08:00
|
|
|
if(sizeof(buf) > len + status_string.length + 1) {
|
2004-06-24 19:54:11 +08:00
|
|
|
snprintf(buf + len, sizeof(buf) - len,
|
|
|
|
": %s", (char*) status_string.value);
|
2003-06-10 20:22:19 +08:00
|
|
|
len += status_string.length;
|
|
|
|
}
|
|
|
|
gss_release_buffer(&min_stat, &status_string);
|
2007-11-05 17:45:09 +08:00
|
|
|
} while(!GSS_ERROR(maj_stat) && msg_ctx != 0);
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2012-01-17 04:14:05 +08:00
|
|
|
infof(conn->data, "%s\n", buf);
|
2003-06-10 20:22:19 +08:00
|
|
|
}
|
|
|
|
|
2008-04-12 19:50:51 +08:00
|
|
|
/* returning zero (0) means success, everything else is treated as "failure"
|
|
|
|
with no care exactly what the failure was */
|
2007-11-21 07:02:58 +08:00
|
|
|
int Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
|
|
|
const char *header)
|
2004-06-24 19:54:11 +08:00
|
|
|
{
|
2011-07-20 01:10:43 +08:00
|
|
|
struct SessionHandle *data = conn->data;
|
|
|
|
struct negotiatedata *neg_ctx = proxy?&data->state.proxyneg:
|
|
|
|
&data->state.negotiate;
|
2003-06-10 20:22:19 +08:00
|
|
|
OM_uint32 major_status, minor_status, minor_status2;
|
|
|
|
gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
|
|
|
|
gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
|
|
|
|
int ret;
|
2011-08-24 14:07:36 +08:00
|
|
|
size_t len;
|
|
|
|
size_t rawlen = 0;
|
2003-09-12 06:21:11 +08:00
|
|
|
bool gss;
|
|
|
|
const char* protocol;
|
2011-08-24 14:07:36 +08:00
|
|
|
CURLcode error;
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2006-10-18 05:32:56 +08:00
|
|
|
while(*header && ISSPACE(*header))
|
2003-06-10 20:22:19 +08:00
|
|
|
header++;
|
2003-09-12 06:21:11 +08:00
|
|
|
if(checkprefix("GSS-Negotiate", header)) {
|
|
|
|
protocol = "GSS-Negotiate";
|
|
|
|
gss = TRUE;
|
|
|
|
}
|
2007-11-05 17:45:09 +08:00
|
|
|
else if(checkprefix("Negotiate", header)) {
|
2003-09-12 06:21:11 +08:00
|
|
|
protocol = "Negotiate";
|
|
|
|
gss = FALSE;
|
|
|
|
}
|
|
|
|
else
|
2003-06-10 20:22:19 +08:00
|
|
|
return -1;
|
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->context) {
|
|
|
|
if(neg_ctx->gss != gss) {
|
2003-09-12 06:21:11 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
neg_ctx->protocol = protocol;
|
|
|
|
neg_ctx->gss = gss;
|
|
|
|
}
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->context && neg_ctx->status == GSS_S_COMPLETE) {
|
2011-04-19 21:54:13 +08:00
|
|
|
/* We finished successfully our part of authentication, but server
|
2003-06-10 20:22:19 +08:00
|
|
|
* rejected it (since we're again here). Exit with an error since we
|
|
|
|
* can't invent anything better */
|
2011-07-20 01:10:43 +08:00
|
|
|
Curl_cleanup_negotiate(data);
|
2003-06-10 20:22:19 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->server_name == NULL &&
|
2007-09-21 19:05:31 +08:00
|
|
|
(ret = get_gss_name(conn, proxy, &neg_ctx->server_name)))
|
2003-06-10 20:22:19 +08:00
|
|
|
return ret;
|
|
|
|
|
2003-09-12 06:21:11 +08:00
|
|
|
header += strlen(neg_ctx->protocol);
|
2006-10-18 05:32:56 +08:00
|
|
|
while(*header && ISSPACE(*header))
|
2003-06-10 20:22:19 +08:00
|
|
|
header++;
|
|
|
|
|
|
|
|
len = strlen(header);
|
2007-11-05 17:45:09 +08:00
|
|
|
if(len > 0) {
|
2011-08-24 14:07:36 +08:00
|
|
|
error = Curl_base64_decode(header,
|
|
|
|
(unsigned char **)&input_token.value, &rawlen);
|
|
|
|
if(error || rawlen == 0)
|
2003-06-10 20:22:19 +08:00
|
|
|
return -1;
|
2003-06-26 19:25:23 +08:00
|
|
|
input_token.length = rawlen;
|
2003-09-19 20:56:22 +08:00
|
|
|
|
2003-11-27 17:52:44 +08:00
|
|
|
#ifdef HAVE_SPNEGO /* Handle SPNEGO */
|
2007-11-05 17:45:09 +08:00
|
|
|
if(checkprefix("Negotiate", header)) {
|
2011-04-20 21:17:42 +08:00
|
|
|
ASN1_OBJECT * object = NULL;
|
|
|
|
unsigned char * spnegoToken = NULL;
|
|
|
|
size_t spnegoTokenLength = 0;
|
|
|
|
unsigned char * mechToken = NULL;
|
|
|
|
size_t mechTokenLength = 0;
|
|
|
|
|
|
|
|
if(input_token.value == NULL)
|
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
spnegoToken = malloc(input_token.length);
|
|
|
|
if(spnegoToken == NULL)
|
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
spnegoTokenLength = input_token.length;
|
|
|
|
|
|
|
|
object = OBJ_txt2obj ("1.2.840.113554.1.2.2", 1);
|
|
|
|
if(!parseSpnegoTargetToken(spnegoToken,
|
|
|
|
spnegoTokenLength,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
&mechToken,
|
|
|
|
&mechTokenLength,
|
|
|
|
NULL,
|
|
|
|
NULL)) {
|
|
|
|
free(spnegoToken);
|
|
|
|
spnegoToken = NULL;
|
2011-07-20 01:10:43 +08:00
|
|
|
infof(data, "Parse SPNEGO Target Token failed\n");
|
2011-04-20 21:17:42 +08:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
free(input_token.value);
|
|
|
|
input_token.value = malloc(mechTokenLength);
|
2007-11-05 17:45:09 +08:00
|
|
|
if(input_token.value == NULL)
|
2008-04-12 19:50:51 +08:00
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
|
2011-04-20 21:17:42 +08:00
|
|
|
memcpy(input_token.value, mechToken,mechTokenLength);
|
|
|
|
input_token.length = mechTokenLength;
|
|
|
|
free(mechToken);
|
|
|
|
mechToken = NULL;
|
2011-07-20 01:10:43 +08:00
|
|
|
infof(data, "Parse SPNEGO Target Token succeeded\n");
|
2011-04-20 21:17:42 +08:00
|
|
|
}
|
2003-09-19 20:56:22 +08:00
|
|
|
}
|
|
|
|
#endif
|
2003-06-10 20:22:19 +08:00
|
|
|
}
|
|
|
|
|
2011-07-20 01:10:43 +08:00
|
|
|
major_status = Curl_gss_init_sec_context(data,
|
|
|
|
&minor_status,
|
2011-06-10 23:16:06 +08:00
|
|
|
&neg_ctx->context,
|
|
|
|
neg_ctx->server_name,
|
|
|
|
GSS_C_NO_CHANNEL_BINDINGS,
|
|
|
|
&input_token,
|
|
|
|
&output_token,
|
|
|
|
NULL);
|
2007-11-05 17:45:09 +08:00
|
|
|
if(input_token.length > 0)
|
2003-06-10 20:22:19 +08:00
|
|
|
gss_release_buffer(&minor_status2, &input_token);
|
|
|
|
neg_ctx->status = major_status;
|
2007-11-05 17:45:09 +08:00
|
|
|
if(GSS_ERROR(major_status)) {
|
2011-07-20 01:10:43 +08:00
|
|
|
/* Curl_cleanup_negotiate(data) ??? */
|
2003-06-26 19:25:23 +08:00
|
|
|
log_gss_error(conn, minor_status,
|
2008-09-03 01:41:20 +08:00
|
|
|
"gss_init_sec_context() failed: ");
|
2003-06-10 20:22:19 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(output_token.length == 0) {
|
2003-06-10 20:22:19 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
neg_ctx->output_token = output_token;
|
|
|
|
/* conn->bits.close = FALSE; */
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2007-09-21 19:05:31 +08:00
|
|
|
CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
2004-06-24 19:54:11 +08:00
|
|
|
{
|
2007-11-21 07:17:08 +08:00
|
|
|
struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg:
|
|
|
|
&conn->data->state.negotiate;
|
2003-06-10 20:22:19 +08:00
|
|
|
char *encoded = NULL;
|
2011-08-24 14:07:36 +08:00
|
|
|
size_t len = 0;
|
2010-08-17 04:19:38 +08:00
|
|
|
char *userp;
|
2011-08-24 14:07:36 +08:00
|
|
|
CURLcode error;
|
2003-09-19 20:56:22 +08:00
|
|
|
|
2003-11-27 17:52:44 +08:00
|
|
|
#ifdef HAVE_SPNEGO /* Handle SPNEGO */
|
2007-11-21 07:17:08 +08:00
|
|
|
if(checkprefix("Negotiate", neg_ctx->protocol)) {
|
2003-09-19 20:56:22 +08:00
|
|
|
ASN1_OBJECT * object = NULL;
|
|
|
|
unsigned char * spnegoToken = NULL;
|
|
|
|
size_t spnegoTokenLength = 0;
|
|
|
|
unsigned char * responseToken = NULL;
|
|
|
|
size_t responseTokenLength = 0;
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2003-09-19 20:56:22 +08:00
|
|
|
responseToken = malloc(neg_ctx->output_token.length);
|
2011-04-23 05:01:30 +08:00
|
|
|
if(responseToken == NULL)
|
2003-09-19 20:56:22 +08:00
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
memcpy(responseToken, neg_ctx->output_token.value,
|
|
|
|
neg_ctx->output_token.length);
|
|
|
|
responseTokenLength = neg_ctx->output_token.length;
|
|
|
|
|
|
|
|
object=OBJ_txt2obj ("1.2.840.113554.1.2.2", 1);
|
2007-11-05 17:45:09 +08:00
|
|
|
if(!makeSpnegoInitialToken (object,
|
2003-09-19 20:56:22 +08:00
|
|
|
responseToken,
|
|
|
|
responseTokenLength,
|
|
|
|
&spnegoToken,
|
|
|
|
&spnegoTokenLength)) {
|
|
|
|
free(responseToken);
|
|
|
|
responseToken = NULL;
|
|
|
|
infof(conn->data, "Make SPNEGO Initial Token failed\n");
|
|
|
|
}
|
|
|
|
else {
|
2010-06-02 18:44:46 +08:00
|
|
|
free(responseToken);
|
2003-09-19 20:56:22 +08:00
|
|
|
responseToken = NULL;
|
2010-06-02 18:44:46 +08:00
|
|
|
free(neg_ctx->output_token.value);
|
2003-09-19 20:56:22 +08:00
|
|
|
neg_ctx->output_token.value = malloc(spnegoTokenLength);
|
2010-06-02 18:44:46 +08:00
|
|
|
if(neg_ctx->output_token.value == NULL) {
|
|
|
|
free(spnegoToken);
|
|
|
|
spnegoToken = NULL;
|
2010-05-25 21:53:48 +08:00
|
|
|
return CURLE_OUT_OF_MEMORY;
|
2010-06-02 18:44:46 +08:00
|
|
|
}
|
2003-09-19 20:56:22 +08:00
|
|
|
memcpy(neg_ctx->output_token.value, spnegoToken,spnegoTokenLength);
|
|
|
|
neg_ctx->output_token.length = spnegoTokenLength;
|
|
|
|
free(spnegoToken);
|
|
|
|
spnegoToken = NULL;
|
2005-02-25 02:54:23 +08:00
|
|
|
infof(conn->data, "Make SPNEGO Initial Token succeeded\n");
|
2003-09-19 20:56:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2011-08-24 14:07:36 +08:00
|
|
|
error = Curl_base64_encode(conn->data,
|
|
|
|
neg_ctx->output_token.value,
|
|
|
|
neg_ctx->output_token.length,
|
|
|
|
&encoded, &len);
|
|
|
|
if(error) {
|
|
|
|
Curl_safefree(neg_ctx->output_token.value);
|
|
|
|
neg_ctx->output_token.value = NULL;
|
|
|
|
return error;
|
|
|
|
}
|
2003-09-19 20:56:22 +08:00
|
|
|
|
2011-08-24 14:07:36 +08:00
|
|
|
if(len == 0) {
|
|
|
|
Curl_safefree(neg_ctx->output_token.value);
|
|
|
|
neg_ctx->output_token.value = NULL;
|
|
|
|
return CURLE_REMOTE_ACCESS_DENIED;
|
|
|
|
}
|
2003-06-10 20:22:19 +08:00
|
|
|
|
2010-08-17 04:19:38 +08:00
|
|
|
userp = aprintf("%sAuthorization: %s %s\r\n", proxy ? "Proxy-" : "",
|
|
|
|
neg_ctx->protocol, encoded);
|
|
|
|
|
|
|
|
if(proxy)
|
|
|
|
conn->allocptr.proxyuserpwd = userp;
|
|
|
|
else
|
|
|
|
conn->allocptr.userpwd = userp;
|
2003-06-10 20:22:19 +08:00
|
|
|
free(encoded);
|
2008-03-02 06:32:03 +08:00
|
|
|
Curl_cleanup_negotiate (conn->data);
|
2010-08-17 04:19:38 +08:00
|
|
|
return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
|
2003-06-10 20:22:19 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 07:17:08 +08:00
|
|
|
static void cleanup(struct negotiatedata *neg_ctx)
|
2004-06-24 19:54:11 +08:00
|
|
|
{
|
2003-06-10 20:22:19 +08:00
|
|
|
OM_uint32 minor_status;
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->context != GSS_C_NO_CONTEXT)
|
2003-06-10 20:22:19 +08:00
|
|
|
gss_delete_sec_context(&minor_status, &neg_ctx->context, GSS_C_NO_BUFFER);
|
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->output_token.length != 0)
|
2003-06-10 20:22:19 +08:00
|
|
|
gss_release_buffer(&minor_status, &neg_ctx->output_token);
|
|
|
|
|
2007-11-05 17:45:09 +08:00
|
|
|
if(neg_ctx->server_name != GSS_C_NO_NAME)
|
2003-06-10 20:22:19 +08:00
|
|
|
gss_release_name(&minor_status, &neg_ctx->server_name);
|
2004-06-24 19:54:11 +08:00
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
memset(neg_ctx, 0, sizeof(*neg_ctx));
|
|
|
|
}
|
|
|
|
|
2007-11-21 07:17:08 +08:00
|
|
|
void Curl_cleanup_negotiate(struct SessionHandle *data)
|
|
|
|
{
|
|
|
|
cleanup(&data->state.negotiate);
|
|
|
|
cleanup(&data->state.proxyneg);
|
|
|
|
}
|
|
|
|
|
2003-06-10 20:22:19 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|