From 0bc8575dbfb281f5f5e9fb530247d29ba1f296fc Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 7 May 2004 17:52:22 +0000 Subject: Protocol: - version added to initial Ready - Added SET command - Added 202 Accept response Some structure changes --- daemon/ntlm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'daemon/ntlm.c') diff --git a/daemon/ntlm.c b/daemon/ntlm.c index bbbac5e..a46eecc 100644 --- a/daemon/ntlm.c +++ b/daemon/ntlm.c @@ -252,7 +252,7 @@ int ntlm_auth_basic(ntlm_context_t* ctx, char* key, const char* header, if(found) { int r; - resp->code = HA_SERVER_ACCEPT; + resp->code = HA_SERVER_OK; resp->detail = basic.user; ha_lock(NULL); @@ -584,7 +584,7 @@ int ntlm_init(ha_context_t* context) ASSERT(ctx); /* Make sure there are some types of authentication we can do */ - if(!(context->opts.types & (HA_TYPE_BASIC | HA_TYPE_NTLM))) + if(!(context->opts->types & (HA_TYPE_BASIC | HA_TYPE_NTLM))) { ha_messagex(LOG_ERR, "NTLM module configured, but does not implement any " "configured authentication type."); @@ -655,7 +655,7 @@ void ntlm_destroy(ha_context_t* context) } } -int ntlm_process(ha_context_t* context, ha_request_t* req, +int ntlm_process(ha_context_t* context, const ha_request_t* req, ha_response_t* resp, ha_buffer_t* buf) { ntlm_context_t* ctx = (ntlm_context_t*)(context->data); @@ -682,7 +682,7 @@ int ntlm_process(ha_context_t* context, ha_request_t* req, * well as half open connections which expire. */ r = hash_purge(ctx->pending, t - ctx->pending_timeout); - r += hash_purge(ctx->established, t - context->opts.cache_timeout); + r += hash_purge(ctx->established, t - context->opts->cache_timeout); ha_unlock(NULL); @@ -690,7 +690,7 @@ int ntlm_process(ha_context_t* context, ha_request_t* req, ha_messagex(LOG_DEBUG, "ntlm: purged info from cache: %d", r); /* Look for a NTLM header */ - if(context->opts.types & HA_TYPE_NTLM) + if(context->opts->types & HA_TYPE_NTLM) { header = ha_getheader(req, "Authorization", HA_PREFIX_NTLM); if(header) @@ -707,7 +707,7 @@ int ntlm_process(ha_context_t* context, ha_request_t* req, } /* If basic is enabled, and no NTLM */ - if(!header && context->opts.types & HA_TYPE_BASIC) + if(!header && context->opts->types & HA_TYPE_BASIC) { /* Look for a Basic header */ header = ha_getheader(req, "Authorization", HA_PREFIX_BASIC); @@ -739,12 +739,12 @@ int ntlm_process(ha_context_t* context, ha_request_t* req, if(hash_get(ctx->established, key) == NTLM_ESTABLISHED) { hash_touch(ctx->established, key); - resp->code = HA_SERVER_ACCEPT; + resp->code = HA_SERVER_OK; } ha_unlock(NULL); - if(resp->code == HA_SERVER_ACCEPT) + if(resp->code == HA_SERVER_OK) ha_messagex(LOG_NOTICE, "ntlm: validated user against connection cache"); /* TODO: We need to be able to retrieve the user here somehow */ @@ -757,15 +757,15 @@ int ntlm_process(ha_context_t* context, ha_request_t* req, /* If authentication failed tell the browser about it */ resp->code = HA_SERVER_DECLINE; - if(context->opts.types & HA_TYPE_NTLM) + if(context->opts->types & HA_TYPE_NTLM) { ha_addheader(resp, "WWW-Authenticate", HA_PREFIX_NTLM); ha_messagex(LOG_DEBUG, "ntlm: sent ntlm auth request"); } - if(context->opts.types & HA_TYPE_BASIC) + if(context->opts->types & HA_TYPE_BASIC) { - ha_bufmcat(buf, HA_PREFIX_BASIC, "realm=\"", context->opts.realm, "\"", NULL); + ha_bufmcat(buf, HA_PREFIX_BASIC, "realm=\"", context->opts->realm, "\"", NULL); if(ha_buferr(buf)) return HA_CRITERROR; -- cgit v1.2.3