[dovecot-cvs] dovecot/src/auth mech-apop.c,1.1,1.2
cras at procontrol.fi
cras at procontrol.fi
Tue Jul 6 09:35:32 EEST 2004
Update of /home/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv20952/auth
Modified Files:
mech-apop.c
Log Message:
Fixes, patch by Andrey Panin
Index: mech-apop.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/mech-apop.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mech-apop.c 3 Jul 2004 10:43:12 -0000 1.1
+++ mech-apop.c 6 Jul 2004 06:35:30 -0000 1.2
@@ -10,7 +10,6 @@
*/
#include "common.h"
-#include "safe-memset.h"
#include "mech.h"
#include "passdb.h"
#include "md5.h"
@@ -40,14 +39,18 @@
(struct apop_auth_request *)auth_request;
unsigned char digest[16];
struct md5_context ctx;
+ int ret = FALSE;
- md5_init(&ctx);
- md5_update(&ctx, auth->challenge, strlen(auth->challenge));
- md5_update(&ctx, credentials, strlen(credentials));
- md5_final(&ctx, digest);
+ if (credentials != NULL) {
+ md5_init(&ctx);
+ md5_update(&ctx, auth->challenge, strlen(auth->challenge));
+ md5_update(&ctx, credentials, strlen(credentials));
+ md5_final(&ctx, digest);
- mech_auth_finish(auth_request, NULL, 0,
- memcmp(digest, auth->digest, 16) == 0);
+ ret = memcmp(digest, auth->digest, 16) == 0;
+ }
+
+ mech_auth_finish(auth_request, NULL, 0, ret);
}
static int
More information about the dovecot-cvs
mailing list