27 #if defined(HAVE_GSSAPI) && defined(USE_SPNEGO) 52 bool Curl_auth_is_spnego_supported(
void)
81 struct negotiatedata *nego)
85 unsigned char *chlg = NULL;
100 Curl_auth_spnego_cleanup(nego);
111 spn_token.
value = spn;
112 spn_token.
length = strlen(spn);
119 Curl_gss_log_error(data,
"gss_import_name() failed: ",
120 major_status, minor_status);
130 if(chlg64 && *chlg64) {
140 infof(data,
"SPNEGO handshake failure (empty challenge message)\n");
146 input_token.
value = chlg;
147 input_token.
length = chlglen;
151 major_status = Curl_gss_init_sec_context(data,
155 &Curl_spnego_mech_oid,
165 nego->status = major_status;
167 if(output_token.
value)
170 Curl_gss_log_error(data,
"gss_init_sec_context() failed: ",
171 major_status, minor_status);
177 if(output_token.
value)
184 if(nego->output_token.length && nego->output_token.value)
187 nego->output_token = output_token;
209 struct negotiatedata *nego,
210 char **outptr,
size_t *outlen)
217 nego->output_token.value,
218 nego->output_token.length,
223 nego->output_token.value = NULL;
224 nego->output_token.length = 0;
229 if(!*outptr || !*outlen) {
231 nego->output_token.value = NULL;
232 nego->output_token.length = 0;
250 void Curl_auth_spnego_cleanup(
struct negotiatedata *nego)
261 if(nego->output_token.value) {
263 nego->output_token.value = NULL;
264 nego->output_token.length = 0;
OM_uint32 gss_release_buffer(OM_uint32 *min, gss_buffer_t buffer)
#define GSS_C_NO_CHANNEL_BINDINGS
CURLcode Curl_base64_decode(const char *src, unsigned char **outptr, size_t *outlen)
CURLcode Curl_base64_encode(struct Curl_easy *data, const char *inputbuff, size_t insize, char **outptr, size_t *outlen)
UNITTEST_START int result
#define GSS_C_NT_HOSTBASED_SERVICE
#define GSS_ERROR(status)
#define Curl_safefree(ptr)
OM_uint32 gss_release_name(OM_uint32 *min, gss_name_t *input_name)
char * Curl_auth_build_spn(const char *service, const char *host, const char *realm)
#define gss_delete_sec_context
#define GSS_C_EMPTY_BUFFER