4 * DEBUG: section 29 Negotiate Authenticator
5 * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
35 /* The functions in this file handle authentication.
36 * They DO NOT perform access control or auditing.
37 * See acl.c for access control and client_side.c for auditing */
41 #include "auth/negotiate/auth_negotiate.h"
42 #include "auth/Gadgets.h"
43 #include "CacheManager.h"
45 #include "client_side.h"
46 #include "HttpReply.h"
47 #include "HttpRequest.h"
48 #include "SquidTime.h"
49 /** \todo remove this include */
50 #include "auth/negotiate/negotiateScheme.h"
54 \defgroup AuthNegotiateInternal Negotiate Authenticator Internals
55 \ingroup AuthNegotiateAPI
59 * Maximum length (buffer size) for token strings.
61 // AYJ: must match re-definition in helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c
62 #define MAX_AUTHTOKEN_LEN 32768
65 /// \ingroup AuthNegotiateInternal
67 authenticateStateFree(authenticateStateData
* r
)
69 r
->auth_user_request
= NULL
;
73 /* Negotiate Scheme */
74 static HLPSCB authenticateNegotiateHandleReply
;
75 static AUTHSSTATS authenticateNegotiateStats
;
77 /// \ingroup AuthNegotiateInternal
78 static statefulhelper
*negotiateauthenticators
= NULL
;
80 CBDATA_TYPE(authenticateStateData
);
82 /// \ingroup AuthNegotiateInternal
83 static int authnegotiate_initialised
= 0;
85 /// \ingroup AuthNegotiateInternal
86 static auth_negotiate_config negotiateConfig
;
88 /// \ingroup AuthNegotiateInternal
89 static hash_table
*proxy_auth_cache
= NULL
;
98 AuthNegotiateConfig::done()
100 authnegotiate_initialised
= 0;
102 if (negotiateauthenticators
) {
103 helperStatefulShutdown(negotiateauthenticators
);
109 delete negotiateauthenticators
;
110 negotiateauthenticators
= NULL
;
113 wordlistDestroy(&authenticate
);
115 debugs(29, 2, "negotiateScheme::done: Negotiate authentication Shutdown.");
119 AuthNegotiateConfig::dump(StoreEntry
* entry
, const char *name
, AuthConfig
* scheme
)
121 wordlist
*list
= authenticate
;
122 storeAppendPrintf(entry
, "%s %s", name
, "negotiate");
124 while (list
!= NULL
) {
125 storeAppendPrintf(entry
, " %s", list
->key
);
129 storeAppendPrintf(entry
, "\n%s negotiate children %d startup=%d idle=%d concurrency=%d\n",
130 name
, authenticateChildren
.n_max
, authenticateChildren
.n_startup
, authenticateChildren
.n_idle
, authenticateChildren
.concurrency
);
131 storeAppendPrintf(entry
, "%s %s keep_alive %s\n", name
, "negotiate", keep_alive
? "on" : "off");
135 AuthNegotiateConfig::AuthNegotiateConfig() : authenticateChildren(20,0,1,1), keep_alive(1), authenticate(NULL
)
139 AuthNegotiateConfig::parse(AuthConfig
* scheme
, int n_configured
, char *param_str
)
141 if (strcasecmp(param_str
, "program") == 0) {
143 wordlistDestroy(&authenticate
);
145 parse_wordlist(&authenticate
);
147 requirePathnameExists("auth_param negotiate program", authenticate
->key
);
148 } else if (strcasecmp(param_str
, "children") == 0) {
149 authenticateChildren
.parseConfig();
150 } else if (strcasecmp(param_str
, "keep_alive") == 0) {
151 parse_onoff(&keep_alive
);
153 debugs(29, 0, "AuthNegotiateConfig::parse: unrecognised negotiate auth scheme parameter '" << param_str
<< "'");
157 * disable client side request pipelining. There is a race with
158 * Negotiate when the client sends a second request on an Negotiate
159 * connection before the authenticate challenge is sent. With
160 * this patch, the client may fail to authenticate, but squid's
161 * state will be preserved. Caveats: this should be a post-parse
162 * test, but that can wait for the modular parser to be integrated.
165 Config
.onoff
.pipeline_prefetch
= 0;
169 AuthNegotiateConfig::type() const
171 return negotiateScheme::GetInstance()->type();
175 * Initialize helpers and the like for this auth scheme.
176 * Called AFTER parsing the config file
179 AuthNegotiateConfig::init(AuthConfig
* scheme
)
183 authnegotiate_initialised
= 1;
185 if (negotiateauthenticators
== NULL
)
186 negotiateauthenticators
= new statefulhelper("negotiateauthenticator");
188 if (!proxy_auth_cache
)
189 proxy_auth_cache
= hash_create((HASHCMP
*) strcmp
, 7921, hash_string
);
191 assert(proxy_auth_cache
);
193 negotiateauthenticators
->cmdline
= authenticate
;
195 negotiateauthenticators
->childs
= authenticateChildren
;
197 negotiateauthenticators
->ipc_type
= IPC_STREAM
;
199 helperStatefulOpenServers(negotiateauthenticators
);
201 CBDATA_INIT_TYPE(authenticateStateData
);
206 AuthNegotiateConfig::registerWithCacheManager(void)
208 CacheManager::GetInstance()->
209 registerAction("negotiateauthenticator",
210 "Negotiate User Authenticator Stats",
211 authenticateNegotiateStats
, 0, 1);
215 AuthNegotiateConfig::active() const
217 return authnegotiate_initialised
== 1;
221 AuthNegotiateConfig::configured() const
223 if ((authenticate
!= NULL
) && (authenticateChildren
.n_max
!= 0)) {
224 debugs(29, 9, "AuthNegotiateConfig::configured: returning configured");
228 debugs(29, 9, "AuthNegotiateConfig::configured: returning unconfigured");
232 /* Negotiate Scheme */
233 /* See AuthUserRequest.cc::authenticateDirection for return values */
235 AuthNegotiateUserRequest::module_direction()
237 /* null auth_user is checked for by authenticateDirection */
239 if (waiting
|| client_blob
)
240 return -1; /* need helper response to continue */
242 switch (auth_state
) {
244 /* no progress at all. */
246 case AUTHENTICATE_STATE_NONE
:
247 debugs(29, 1, "AuthNegotiateUserRequest::direction: called before Negotiate Authenticate for request " << this << "!. Report a bug to squid-dev.");
248 return -2; /* error */
250 case AUTHENTICATE_STATE_FAILED
:
251 return -2; /* error */
254 case AUTHENTICATE_STATE_IN_PROGRESS
:
256 return 1; /* send to client */
258 case AUTHENTICATE_STATE_DONE
:
259 return 0; /* do nothing */
261 case AUTHENTICATE_STATE_INITIAL
:
262 debugs(29, 1, "AuthNegotiateUserRequest::direction: Unexpected AUTHENTICATE_STATE_INITIAL");
269 /* add the [proxy]authorisation header */
271 AuthNegotiateUserRequest::addHeader(HttpReply
* rep
, int accel
)
278 /* don't add to authentication error pages */
280 if ((!accel
&& rep
->sline
.status
== HTTP_PROXY_AUTHENTICATION_REQUIRED
)
281 || (accel
&& rep
->sline
.status
== HTTP_UNAUTHORIZED
))
284 type
= accel
? HDR_AUTHENTICATION_INFO
: HDR_PROXY_AUTHENTICATION_INFO
;
286 httpHeaderPutStrf(&rep
->header
, type
, "Negotiate %s", server_blob
);
288 safe_free(server_blob
);
292 AuthNegotiateConfig::fixHeader(AuthUserRequest::Pointer auth_user_request
, HttpReply
*rep
, http_hdr_type reqType
, HttpRequest
* request
)
294 AuthNegotiateUserRequest
*negotiate_request
;
299 /* Need keep-alive */
300 if (!request
->flags
.proxy_keepalive
&& request
->flags
.must_keepalive
)
303 /* New request, no user details */
304 if (auth_user_request
== NULL
) {
305 debugs(29, 9, "AuthNegotiateConfig::fixHeader: Sending type:" << reqType
<< " header: 'Negotiate'");
306 httpHeaderPutStrf(&rep
->header
, reqType
, "Negotiate");
309 /* drop the connection */
310 rep
->header
.delByName("keep-alive");
311 request
->flags
.proxy_keepalive
= 0;
314 negotiate_request
= dynamic_cast<AuthNegotiateUserRequest
*>(auth_user_request
.getRaw());
315 assert(negotiate_request
!= NULL
);
317 switch (negotiate_request
->auth_state
) {
319 case AUTHENTICATE_STATE_FAILED
:
320 /* here it makes sense to drop the connection, as auth is
321 * tied to it, even if MAYBE the client could handle it - Kinkie */
322 rep
->header
.delByName("keep-alive");
323 request
->flags
.proxy_keepalive
= 0;
326 case AUTHENTICATE_STATE_DONE
:
327 /* Special case: authentication finished OK but disallowed by ACL.
328 * Need to start over to give the client another chance.
331 if (negotiate_request
->server_blob
) {
332 debugs(29, 9, "authenticateNegotiateFixErrorHeader: Sending type:" << reqType
<< " header: 'Negotiate " << negotiate_request
->server_blob
<< "'");
333 httpHeaderPutStrf(&rep
->header
, reqType
, "Negotiate %s", negotiate_request
->server_blob
);
334 safe_free(negotiate_request
->server_blob
);
336 debugs(29, 9, "authenticateNegotiateFixErrorHeader: Connection authenticated");
337 httpHeaderPutStrf(&rep
->header
, reqType
, "Negotiate");
342 case AUTHENTICATE_STATE_NONE
:
343 /* semantic change: do not drop the connection.
344 * 2.5 implementation used to keep it open - Kinkie */
345 debugs(29, 9, "AuthNegotiateConfig::fixHeader: Sending type:" << reqType
<< " header: 'Negotiate'");
346 httpHeaderPutStrf(&rep
->header
, reqType
, "Negotiate");
349 case AUTHENTICATE_STATE_IN_PROGRESS
:
350 /* we're waiting for a response from the client. Pass it the blob */
351 debugs(29, 9, "AuthNegotiateConfig::fixHeader: Sending type:" << reqType
<< " header: 'Negotiate " << negotiate_request
->server_blob
<< "'");
352 httpHeaderPutStrf(&rep
->header
, reqType
, "Negotiate %s", negotiate_request
->server_blob
);
353 safe_free(negotiate_request
->server_blob
);
358 debugs(29, 0, "AuthNegotiateConfig::fixHeader: state " << negotiate_request
->auth_state
<< ".");
359 fatal("unexpected state in AuthenticateNegotiateFixErrorHeader.\n");
364 NegotiateUser::~NegotiateUser()
366 debugs(29, 5, "NegotiateUser::~NegotiateUser: doing nothing to clearNegotiate scheme data for '" << this << "'");
370 authenticateNegotiateHandleReply(void *data
, void *lastserver
, char *reply
)
372 authenticateStateData
*r
= static_cast<authenticateStateData
*>(data
);
375 char *blob
, *arg
= NULL
;
378 NegotiateUser
*negotiate_user
;
379 AuthNegotiateUserRequest
*negotiate_request
;
381 debugs(29, 8, "authenticateNegotiateHandleReply: helper: '" << lastserver
<< "' sent us '" << (reply
? reply
: "<NULL>") << "'");
382 valid
= cbdataReferenceValid(r
->data
);
385 debugs(29, 1, "authenticateNegotiateHandleReply: invalid callback data. helper '" << lastserver
<< "'.");
386 cbdataReferenceDone(r
->data
);
387 authenticateStateFree(r
);
392 debugs(29, 1, "authenticateNegotiateHandleReply: Helper '" << lastserver
<< "' crashed!.");
393 reply
= (char *)"BH Internal error";
396 AuthUserRequest::Pointer auth_user_request
= r
->auth_user_request
;
397 assert(auth_user_request
!= NULL
);
399 negotiate_request
= dynamic_cast<AuthNegotiateUserRequest
*>(auth_user_request
.getRaw());
400 assert(negotiate_request
!= NULL
);
402 assert(negotiate_request
->waiting
);
403 negotiate_request
->waiting
= 0;
404 safe_free(negotiate_request
->client_blob
);
406 auth_user
= auth_user_request
->user();
407 assert(auth_user
!= NULL
);
408 assert(auth_user
->auth_type
== AUTH_NEGOTIATE
);
410 negotiate_user
= dynamic_cast<negotiate_user_t
*>(auth_user_request
->user());
411 assert(negotiate_user
!= NULL
);
413 if (negotiate_request
->authserver
== NULL
)
414 negotiate_request
->authserver
= static_cast<helper_stateful_server
*>(lastserver
);
416 assert(negotiate_request
->authserver
== lastserver
);
418 /* seperate out the useful data */
419 blob
= strchr(reply
, ' ');
423 arg
= strchr(blob
+ 1, ' ');
428 if (strncasecmp(reply
, "TT ", 3) == 0) {
429 /* we have been given a blob to send to the client */
432 safe_free(negotiate_request
->server_blob
);
433 negotiate_request
->request
->flags
.must_keepalive
= 1;
434 if (negotiate_request
->request
->flags
.proxy_keepalive
) {
435 negotiate_request
->server_blob
= xstrdup(blob
);
436 negotiate_request
->auth_state
= AUTHENTICATE_STATE_IN_PROGRESS
;
437 auth_user_request
->denyMessage("Authentication in progress");
438 debugs(29, 4, "authenticateNegotiateHandleReply: Need to challenge the client with a server blob '" << blob
<< "'");
440 negotiate_request
->auth_state
= AUTHENTICATE_STATE_FAILED
;
441 auth_user_request
->denyMessage("NTLM authentication requires a persistent connection");
443 } else if (strncasecmp(reply
, "AF ", 3) == 0 && arg
!= NULL
) {
444 /* we're finished, release the helper */
449 negotiate_user
->username(arg
);
451 auth_user_request
->denyMessage("Login successful");
453 safe_free(negotiate_request
->server_blob
);
455 negotiate_request
->server_blob
= xstrdup(blob
);
457 negotiate_request
->releaseAuthServer();
459 negotiate_request
->auth_state
= AUTHENTICATE_STATE_DONE
;
461 debugs(29, 4, "authenticateNegotiateHandleReply: Successfully validated user via Negotiate. Username '" << blob
<< "'");
463 /* connection is authenticated */
464 debugs(29, 4, "AuthNegotiateUserRequest::authenticate: authenticated user " << negotiate_user
->username());
465 /* see if this is an existing user with a different proxy_auth
467 AuthUserHashPointer
*usernamehash
= static_cast<AuthUserHashPointer
*>(hash_lookup(proxy_auth_username_cache
, negotiate_user
->username()));
468 AuthUser
*local_auth_user
= negotiate_request
->user();
469 while (usernamehash
&& (usernamehash
->user()->auth_type
!= AUTH_NEGOTIATE
|| strcmp(usernamehash
->user()->username(), negotiate_user
->username()) != 0))
470 usernamehash
= static_cast<AuthUserHashPointer
*>(usernamehash
->next
);
472 /* we can't seamlessly recheck the username due to the
473 * challenge-response nature of the protocol.
474 * Just free the temporary auth_user */
475 usernamehash
->user()->absorb(local_auth_user
);
476 //authenticateAuthUserMerge(local_auth_user, usernamehash->user());
477 local_auth_user
= usernamehash
->user();
478 negotiate_request
->_auth_user
= local_auth_user
;
480 /* store user in hash's */
481 local_auth_user
->addToNameCache();
482 // authenticateUserNameCacheAdd(local_auth_user);
484 /* set these to now because this is either a new login from an
485 * existing user or a new user */
486 local_auth_user
->expiretime
= current_time
.tv_sec
;
487 negotiate_request
->releaseAuthServer();
488 negotiate_request
->auth_state
= AUTHENTICATE_STATE_DONE
;
490 } else if (strncasecmp(reply
, "NA ", 3) == 0 && arg
!= NULL
) {
491 /* authentication failure (wrong password, etc.) */
496 auth_user_request
->denyMessage(arg
);
498 negotiate_request
->auth_state
= AUTHENTICATE_STATE_FAILED
;
500 safe_free(negotiate_request
->server_blob
);
502 negotiate_request
->server_blob
= xstrdup(blob
);
504 negotiate_request
->releaseAuthServer();
506 debugs(29, 4, "authenticateNegotiateHandleReply: Failed validating user via Negotiate. Error returned '" << blob
<< "'");
507 } else if (strncasecmp(reply
, "BH ", 3) == 0) {
508 /* TODO kick off a refresh process. This can occur after a YR or after
509 * a KK. If after a YR release the helper and resubmit the request via
510 * Authenticate Negotiate start.
511 * If after a KK deny the user's request w/ 407 and mark the helper as
513 auth_user_request
->denyMessage(blob
);
514 negotiate_request
->auth_state
= AUTHENTICATE_STATE_FAILED
;
515 safe_free(negotiate_request
->server_blob
);
516 negotiate_request
->releaseAuthServer();
517 debugs(29, 1, "authenticateNegotiateHandleReply: Error validating user via Negotiate. Error returned '" << reply
<< "'");
520 fatalf("authenticateNegotiateHandleReply: *** Unsupported helper response ***, '%s'\n", reply
);
523 negotiate_request
->request
= NULL
;
524 r
->handler(r
->data
, NULL
);
525 cbdataReferenceDone(r
->data
);
526 authenticateStateFree(r
);
530 authenticateNegotiateStats(StoreEntry
* sentry
)
532 helperStatefulStats(sentry
, negotiateauthenticators
, "Negotiate Authenticator Statistics");
536 /** send the initial data to a stateful negotiate authenticator module */
538 AuthNegotiateUserRequest::module_start(RH
* handler
, void *data
)
540 authenticateStateData
*r
= NULL
;
541 static char buf
[MAX_AUTHTOKEN_LEN
];
542 negotiate_user_t
*negotiate_user
;
543 AuthUser
*auth_user
= user();
548 assert(auth_user
->auth_type
== AUTH_NEGOTIATE
);
550 negotiate_user
= dynamic_cast<negotiate_user_t
*>(user());
552 debugs(29, 8, "AuthNegotiateUserRequest::module_start: auth state is '" << auth_state
<< "'");
554 if (negotiateConfig
.authenticate
== NULL
) {
555 debugs(29, 0, "AuthNegotiateUserRequest::module_start: no Negotiate program specified.");
560 r
= cbdataAlloc(authenticateStateData
);
561 r
->handler
= handler
;
562 r
->data
= cbdataReference(data
);
563 r
->auth_user_request
= this;
565 if (auth_state
== AUTHENTICATE_STATE_INITIAL
) {
566 snprintf(buf
, MAX_AUTHTOKEN_LEN
, "YR %s\n", client_blob
); //CHECKME: can ever client_blob be 0 here?
568 snprintf(buf
, MAX_AUTHTOKEN_LEN
, "KK %s\n", client_blob
);
573 safe_free(client_blob
);
574 helperStatefulSubmit(negotiateauthenticators
, buf
, authenticateNegotiateHandleReply
, r
, authserver
);
578 * Atomic action: properly release the Negotiate auth helpers which may have been reserved
579 * for this request connections use.
582 AuthNegotiateUserRequest::releaseAuthServer()
585 debugs(29, 6, HERE
<< "releasing Negotiate auth server '" << authserver
<< "'");
586 helperStatefulReleaseServer(authserver
);
589 debugs(29, 6, HERE
<< "No Negotiate auth server to release.");
592 /* clear any connection related authentication details */
594 AuthNegotiateUserRequest::onConnectionClose(ConnStateData
*conn
)
596 assert(conn
!= NULL
);
598 debugs(29, 8, "AuthNegotiateUserRequest::onConnectionClose: closing connection '" << conn
<< "' (this is '" << this << "')");
600 if (conn
->auth_user_request
== NULL
) {
601 debugs(29, 8, "AuthNegotiateUserRequest::onConnectionClose: no auth_user_request");
607 /* unlock the connection based lock */
608 debugs(29, 9, "AuthNegotiateUserRequest::onConnectionClose: Unlocking auth_user from the connection '" << conn
<< "'.");
610 conn
->auth_user_request
= NULL
;
614 * Decode a Negotiate [Proxy-]Auth string, placing the results in the passed
615 * Auth_user structure.
617 AuthUserRequest::Pointer
618 AuthNegotiateConfig::decode(char const *proxy_auth
)
620 NegotiateUser
*newUser
= new NegotiateUser(&negotiateConfig
);
621 AuthUserRequest
*auth_user_request
= new AuthNegotiateUserRequest();
622 assert(auth_user_request
->user() == NULL
);
624 auth_user_request
->user(newUser
);
625 auth_user_request
->user()->auth_type
= AUTH_NEGOTIATE
;
626 auth_user_request
->user()->addRequest(auth_user_request
);
628 /* all we have to do is identify that it's Negotiate - the helper does the rest */
629 debugs(29, 9, "AuthNegotiateConfig::decode: Negotiate authentication");
630 return auth_user_request
;
634 AuthNegotiateUserRequest::authenticated() const
636 if (auth_state
== AUTHENTICATE_STATE_DONE
) {
637 debugs(29, 9, "AuthNegotiateUserRequest::authenticated: user authenticated.");
641 debugs(29, 9, "AuthNegotiateUserRequest::authenticated: user not fully authenticated.");
647 AuthNegotiateUserRequest::authenticate(HttpRequest
* aRequest
, ConnStateData
* conn
, http_hdr_type type
)
649 const char *proxy_auth
, *blob
;
651 /** \todo rename this!! */
652 AuthUser
*local_auth_user
;
653 negotiate_user_t
*negotiate_user
;
655 local_auth_user
= user();
656 assert(local_auth_user
);
657 assert(local_auth_user
->auth_type
== AUTH_NEGOTIATE
);
658 negotiate_user
= dynamic_cast<negotiate_user_t
*>(local_auth_user
);
661 /** Check that we are in the client side, where we can generate
665 auth_state
= AUTHENTICATE_STATE_FAILED
;
666 debugs(29, 1, "AuthNegotiateUserRequest::authenticate: attempt to perform authentication without a connection!");
671 debugs(29, 1, "AuthNegotiateUserRequest::authenticate: waiting for helper reply!");
676 debugs(29, 2, "AuthNegotiateUserRequest::authenticate: need to challenge client '" << server_blob
<< "'!");
681 proxy_auth
= aRequest
->header
.getStr(type
);
683 /* locate second word */
687 while (xisspace(*blob
) && *blob
)
690 while (!xisspace(*blob
) && *blob
)
693 while (xisspace(*blob
) && *blob
)
697 switch (auth_state
) {
699 case AUTHENTICATE_STATE_NONE
:
700 /* we've received a negotiate request. pass to a helper */
701 debugs(29, 9, "AuthNegotiateUserRequest::authenticate: auth state negotiate none. Received blob: '" << proxy_auth
<< "'");
702 auth_state
= AUTHENTICATE_STATE_INITIAL
;
703 safe_free(client_blob
);
704 client_blob
=xstrdup(blob
);
705 conn
->auth_type
= AUTH_NEGOTIATE
;
706 assert(conn
->auth_user_request
== NULL
);
707 conn
->auth_user_request
= this;
709 HTTPMSGLOCK(request
);
714 case AUTHENTICATE_STATE_INITIAL
:
715 debugs(29, 1, "AuthNegotiateUserRequest::authenticate: need to ask helper");
722 case AUTHENTICATE_STATE_IN_PROGRESS
:
723 /* we should have received a blob from the client. Hand it off to
725 safe_free(client_blob
);
727 client_blob
= xstrdup (blob
);
730 HTTPMSGUNLOCK(request
);
732 HTTPMSGLOCK(request
);
737 case AUTHENTICATE_STATE_DONE
:
738 fatal("AuthNegotiateUserRequest::authenticate: unexpect auth state DONE! Report a bug to the squid developers.\n");
742 case AUTHENTICATE_STATE_FAILED
:
743 /* we've failed somewhere in authentication */
744 debugs(29, 9, "AuthNegotiateUserRequest::authenticate: auth state negotiate failed. " << proxy_auth
);
754 AuthNegotiateUserRequest::AuthNegotiateUserRequest() :
755 /*conn(NULL),*/ auth_state(AUTHENTICATE_STATE_NONE
)
764 AuthNegotiateUserRequest::~AuthNegotiateUserRequest()
766 safe_free(server_blob
);
767 safe_free(client_blob
);
769 if (authserver
!= NULL
) {
770 debugs(29, 9, "AuthNegotiateUserRequest::~AuthNegotiateUserRequest: releasing server '" << authserver
<< "'");
771 helperStatefulReleaseServer(authserver
);
775 HTTPMSGUNLOCK(request
);
781 NegotiateUser::deleteSelf() const
786 NegotiateUser::NegotiateUser (AuthConfig
*aConfig
) : AuthUser (aConfig
)
788 proxy_auth_list
.head
= proxy_auth_list
.tail
= NULL
;
792 AuthNegotiateUserRequest::connLastHeader()