summaryrefslogtreecommitdiff
path: root/src/ne_sspi.c
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-01-10 22:51:39 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-01-10 22:51:39 +0000
commit85fec42295d0e5e34cea82edca6de73316cfc381 (patch)
tree965014da1c46f0e212a869956e69968e20c3b682 /src/ne_sspi.c
parentecc86e52c00bd11f08e2b4e96717b37163e2470b (diff)
downloadneon-85fec42295d0e5e34cea82edca6de73316cfc381.tar.gz
Patch from Stefan Küng to fix endless authentication loop if the
authentication fails: * src/ne_sspi.c, src/ne_sspi.h: New public function to tell the lib that an authentication was successful. Return an error if the authentication is restarted without a successful authentication before. * src/ne_auth.c: Call the new public function to tell the library about a successful authentication. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@837 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src/ne_sspi.c')
-rw-r--r--src/ne_sspi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ne_sspi.c b/src/ne_sspi.c
index d530112..bec8802 100644
--- a/src/ne_sspi.c
+++ b/src/ne_sspi.c
@@ -34,6 +34,7 @@ struct SSPIContextStruct {
char *serverName;
CredHandle credentials;
int continueNeeded;
+ int authfinished;
char *mechanism;
int ntlm;
ULONG maxTokenSize;
@@ -371,6 +372,7 @@ int ne_sspi_create_context(void **context, char *serverName, int ntlm)
}
sspiContext->ntlm = ntlm;
+ sspiContext->authfinished = 0;
*context = sspiContext;
return 0;
}
@@ -429,7 +431,21 @@ int ne_sspi_destroy_context(void *context)
ne_free(sspiContext);
return 0;
}
+int ne_sspi_clear_context(void *context)
+{
+ int status;
+ SSPIContext *sspiContext;
+
+ if (initialized <= 0) {
+ return -1;
+ }
+ status = getContext(context, &sspiContext);
+ if (status) {
+ return status;
+ }
+ sspiContext->authfinished = 0;
+}
/*
* Processes received authentication tokens as well as supplies the
* response token.