[dovecot-cvs] dovecot/src/auth auth-client-connection.c, 1.27, 1.28 auth-master-connection.c, 1.22, 1.23 auth-request.c, 1.2, 1.3 auth-request.h, 1.2, 1.3 mech-apop.c, 1.9, 1.10 mech-cram-md5.c, 1.16, 1.17 mech-digest-md5.c, 1.30, 1.31 mech-login.c, 1.7, 1.8 mech-ntlm.c, 1.13, 1.14 mech-plain.c, 1.25, 1.26 mech-rpa.c, 1.12, 1.13 passdb.h, 1.20, 1.21 userdb.h, 1.18, 1.19

cras at dovecot.org cras at dovecot.org
Sat Jan 8 17:59:53 EET 2005


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv19487

Modified Files:
	auth-client-connection.c auth-master-connection.c 
	auth-request.c auth-request.h mech-apop.c mech-cram-md5.c 
	mech-digest-md5.c mech-login.c mech-ntlm.c mech-plain.c 
	mech-rpa.c passdb.h userdb.h 
Log Message:
Cleanups.



Index: auth-client-connection.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-client-connection.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- auth-client-connection.c	7 Jan 2005 19:55:49 -0000	1.27
+++ auth-client-connection.c	8 Jan 2005 15:59:49 -0000	1.28
@@ -313,8 +313,8 @@
 
 	/* connection is referenced only until auth_callback is called. */
 	conn->refcount++;
-	mech->auth_initial(request, initial_resp_data, initial_resp_len,
-			   auth_callback);
+	auth_request_initial(request, initial_resp_data, initial_resp_len,
+			     auth_callback);
 	return TRUE;
 }
 
@@ -367,8 +367,7 @@
 	}
 
 	conn->refcount++;
-	request->mech->auth_continue(request, buf->data, buf->used,
-				     auth_callback);
+	auth_request_continue(request, buf->data, buf->used, auth_callback);
 	return TRUE;
 }
 

Index: auth-master-connection.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-master-connection.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- auth-master-connection.c	7 Jan 2005 19:55:49 -0000	1.22
+++ auth-master-connection.c	8 Jan 2005 15:59:49 -0000	1.23
@@ -149,8 +149,8 @@
 		master_request->auth_request = request;
 
 		conn->refcount++;
-		request->auth->userdb->lookup(request, userdb_callback,
-					      master_request);
+		auth_request_lookup_user(request, userdb_callback,
+					 master_request);
 	}
 	return TRUE;
 }

Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- auth-request.c	7 Jan 2005 19:55:49 -0000	1.2
+++ auth-request.c	8 Jan 2005 15:59:49 -0000	1.3
@@ -117,6 +117,41 @@
 	return FALSE;
 }
 
+void auth_request_initial(struct auth_request *request,
+			  const unsigned char *data, size_t data_size,
+			  mech_callback_t *callback)
+{
+	request->mech->auth_initial(request, data, data_size, callback);
+}
+
+void auth_request_continue(struct auth_request *request,
+			   const unsigned char *data, size_t data_size,
+			   mech_callback_t *callback)
+{
+	request->mech->auth_continue(request, data, data_size, callback);
+}
+
+void auth_request_verify_plain(struct auth_request *request,
+			       const char *password,
+			       verify_plain_callback_t *callback)
+{
+	request->auth->passdb->verify_plain(request, password, callback);
+}
+
+void auth_request_lookup_credentials(struct auth_request *request,
+				     enum passdb_credentials credentials,
+				     lookup_credentials_callback_t *callback)
+{
+	request->auth->passdb->lookup_credentials(request, credentials,
+						  callback);
+}
+
+void auth_request_lookup_user(struct auth_request *request,
+			      userdb_callback_t *callback, void *context)
+{
+	request->auth->userdb->lookup(request, callback, context);
+}
+
 int auth_request_set_username(struct auth_request *request,
 			      const char *username, const char **error_r)
 {

Index: auth-request.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- auth-request.h	7 Jan 2005 19:55:49 -0000	1.2
+++ auth-request.h	8 Jan 2005 15:59:49 -0000	1.3
@@ -3,6 +3,8 @@
 
 #include "network.h"
 #include "mech.h"
+#include "userdb.h"
+#include "passdb.h"
 
 struct auth_client_connection;
 
@@ -45,6 +47,22 @@
 void auth_request_ref(struct auth_request *request);
 int auth_request_unref(struct auth_request *request);
 
+void auth_request_initial(struct auth_request *request,
+			  const unsigned char *data, size_t data_size,
+			  mech_callback_t *callback);
+void auth_request_continue(struct auth_request *request,
+			   const unsigned char *data, size_t data_size,
+			   mech_callback_t *callback);
+
+void auth_request_verify_plain(struct auth_request *request,
+			       const char *password,
+			       verify_plain_callback_t *callback);
+void auth_request_lookup_credentials(struct auth_request *request,
+				     enum passdb_credentials credentials,
+				     lookup_credentials_callback_t *callback);
+void auth_request_lookup_user(struct auth_request *request,
+			      userdb_callback_t *callback, void *context);
+
 int auth_request_set_username(struct auth_request *request,
 			      const char *username, const char **error_r);
 

Index: mech-apop.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-apop.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- mech-apop.c	7 Jan 2005 19:55:50 -0000	1.9
+++ mech-apop.c	8 Jan 2005 15:59:49 -0000	1.10
@@ -141,9 +141,9 @@
 
 	memcpy(request->digest, tmp, sizeof(request->digest));
 
-	auth_request->auth->passdb->
-		lookup_credentials(auth_request, PASSDB_CREDENTIALS_PLAINTEXT,
-				   apop_credentials_callback);
+	auth_request_lookup_credentials(auth_request,
+					PASSDB_CREDENTIALS_PLAINTEXT,
+					apop_credentials_callback);
 }
 
 static void mech_apop_auth_free(struct auth_request *request)

Index: mech-cram-md5.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-cram-md5.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mech-cram-md5.c	7 Jan 2005 19:55:50 -0000	1.16
+++ mech-cram-md5.c	8 Jan 2005 15:59:49 -0000	1.17
@@ -146,10 +146,9 @@
 
 		if (auth_request_set_username(auth_request, request->username,
 					      &error)) {
-			auth_request->auth->passdb->
-				lookup_credentials(auth_request,
-						   PASSDB_CREDENTIALS_CRAM_MD5,
-						   credentials_callback);
+			auth_request_lookup_credentials(auth_request,
+						PASSDB_CREDENTIALS_CRAM_MD5,
+						credentials_callback);
 			return;
 		}
 	}

Index: mech-digest-md5.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-digest-md5.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- mech-digest-md5.c	7 Jan 2005 19:55:50 -0000	1.30
+++ mech-digest-md5.c	8 Jan 2005 15:59:49 -0000	1.31
@@ -569,8 +569,7 @@
 				    request->realm, NULL);
 
 		if (auth_request_set_username(auth_request, username, &error)) {
-			auth_request->auth->passdb->
-				lookup_credentials(auth_request,
+			auth_request_lookup_credentials(auth_request,
 						PASSDB_CREDENTIALS_DIGEST_MD5,
 						credentials_callback);
 			return;

Index: mech-login.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-login.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mech-login.c	7 Jan 2005 19:55:50 -0000	1.7
+++ mech-login.c	8 Jan 2005 15:59:49 -0000	1.8
@@ -56,8 +56,7 @@
 			 prompt2, strlen(prompt2));
 	} else {
 		char *pass = p_strndup(unsafe_data_stack_pool, data, data_size);
-		request->auth->passdb->verify_plain(request, pass,
-						    verify_callback);
+		auth_request_verify_plain(request, pass, verify_callback);
 		safe_memset(pass, 0, strlen(pass));
 	}
 }

Index: mech-ntlm.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-ntlm.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- mech-ntlm.c	7 Jan 2005 19:55:50 -0000	1.13
+++ mech-ntlm.c	8 Jan 2005 15:59:49 -0000	1.14
@@ -175,9 +175,8 @@
 
 	/* NTLM credentials not found or didn't want to use them,
 	   try with LM credentials */
-	auth_request->auth->passdb->
-		lookup_credentials(auth_request, PASSDB_CREDENTIALS_LANMAN,
-				   lm_credentials_callback);
+	auth_request_lookup_credentials(auth_request, PASSDB_CREDENTIALS_LANMAN,
+					lm_credentials_callback);
 }
 
 static void
@@ -248,10 +247,9 @@
 			return;
 		}
 
-		auth_request->auth->passdb->
-			lookup_credentials(auth_request,
-					   PASSDB_CREDENTIALS_NTLM,
-					   ntlm_credentials_callback);
+		auth_request_lookup_credentials(auth_request,
+						PASSDB_CREDENTIALS_NTLM,
+						ntlm_credentials_callback);
 	}
 }
 

Index: mech-plain.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-plain.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- mech-plain.c	7 Jan 2005 19:55:50 -0000	1.25
+++ mech-plain.c	8 Jan 2005 15:59:49 -0000	1.26
@@ -68,8 +68,8 @@
 			}
 			auth_request_fail(request);
 		} else {
-			request->auth->passdb->verify_plain(request, pass,
-							    verify_callback);
+			auth_request_verify_plain(request, pass,
+						  verify_callback);
 		}
 
 		/* make sure it's cleared */

Index: mech-rpa.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-rpa.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- mech-rpa.c	7 Jan 2005 19:55:50 -0000	1.12
+++ mech-rpa.c	8 Jan 2005 15:59:49 -0000	1.13
@@ -486,9 +486,8 @@
 		return;
 	}
 
-	auth_request->auth->passdb->
-		lookup_credentials(auth_request, PASSDB_CREDENTIALS_RPA,
-				   rpa_credentials_callback);
+	auth_request_lookup_credentials(auth_request, PASSDB_CREDENTIALS_RPA,
+					rpa_credentials_callback);
 }
 
 static void

Index: passdb.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- passdb.h	7 Jan 2005 20:01:08 -0000	1.20
+++ passdb.h	8 Jan 2005 15:59:49 -0000	1.21
@@ -1,11 +1,11 @@
 #ifndef __PASSDB_H
 #define __PASSDB_H
 
-#include "mech.h"
-
 #define IS_VALID_PASSWD(pass) \
 	((pass)[0] != '\0' && (pass)[0] != '*' && (pass)[0] != '!')
 
+struct auth_request;
+
 enum passdb_credentials {
 	_PASSDB_CREDENTIALS_INTERNAL = -1,
 
@@ -62,4 +62,6 @@
 void passdb_init(struct auth *auth);
 void passdb_deinit(struct auth *auth);
 
+#include "auth-request.h"
+
 #endif

Index: userdb.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- userdb.h	7 Jan 2005 20:01:08 -0000	1.18
+++ userdb.h	8 Jan 2005 15:59:49 -0000	1.19
@@ -1,7 +1,7 @@
 #ifndef __USERDB_H
 #define __USERDB_H
 
-#include "auth-request.h"
+struct auth_request;
 
 struct user_data {
 	const char *virtual_user;
@@ -33,4 +33,6 @@
 void userdb_init(struct auth *auth);
 void userdb_deinit(struct auth *auth);
 
+#include "auth-request.h"
+
 #endif



More information about the dovecot-cvs mailing list