diff options
author | Stef Walter <stef@memberwebs.com> | 2004-05-07 17:52:22 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-05-07 17:52:22 +0000 |
commit | 0bc8575dbfb281f5f5e9fb530247d29ba1f296fc (patch) | |
tree | 4e0eda73d880c01e9434b4f1ebb52f513119269b /daemon/ntlm.c | |
parent | c9b851b3194bf4bff6059e9ff471d125afc39c0f (diff) |
Protocol:
- version added to initial Ready
- Added SET command
- Added 202 Accept response
Some structure changes
Diffstat (limited to 'daemon/ntlm.c')
-rw-r--r-- | daemon/ntlm.c | 22 |
1 files changed, 11 insertions, 11 deletions
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; |