[dovecot-cvs] dovecot/src/auth password-scheme.c,1.31,1.32
tss at dovecot.org
tss at dovecot.org
Sun May 13 13:09:58 EEST 2007
- Previous message: [dovecot-cvs] dovecot/src/auth auth-request.c, 1.97, 1.98 auth-request.h, 1.37, 1.38 auth-worker-client.c, 1.33, 1.34 mech-apop.c, 1.26, 1.27 mech-cram-md5.c, 1.27, 1.28 mech-digest-md5.c, 1.45, 1.46 mech-ntlm.c, 1.29, 1.30 mech-otp.c, 1.3, 1.4 mech-rpa.c, 1.30, 1.31 mech-skey.c, 1.3, 1.4 passdb-blocking.c, 1.17, 1.18 passdb-ldap.c, 1.61, 1.62 passdb-sql.c, 1.33, 1.34 passdb.c, 1.49, 1.50 passdb.h, 1.39, 1.40 password-scheme.c, 1.30, 1.31 password-scheme.h, 1.10, 1.11 userdb-static.c, 1.25, 1.26
- Next message: [dovecot-cvs] dovecot/src/lib hmac-md5.c, 1.2, 1.3 hmac-md5.h, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv7183
Modified Files:
password-scheme.c
Log Message:
cleanup
Index: password-scheme.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/password-scheme.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- password-scheme.c 13 May 2007 08:24:06 -0000 1.31
+++ password-scheme.c 13 May 2007 10:09:56 -0000 1.32
@@ -213,16 +213,17 @@
static const char *ssha_generate(const char *plaintext,
const char *user __attr_unused__)
{
- unsigned char ssha_digest[SHA1_RESULTLEN+4];
+#define SSHA_SALT_LEN 4
+ unsigned char ssha_digest[SHA1_RESULTLEN + SSHA_SALT_LEN];
unsigned char *salt = &ssha_digest[SHA1_RESULTLEN];
struct sha1_ctxt ctx;
string_t *str;
- random_fill(salt, 4);
+ random_fill(salt, SSHA_SALT_LEN);
sha1_init(&ctx);
sha1_loop(&ctx, plaintext, strlen(plaintext));
- sha1_loop(&ctx, salt, 4);
+ sha1_loop(&ctx, salt, SSHA_SALT_LEN);
sha1_result(&ctx, ssha_digest);
str = t_str_new(MAX_BASE64_ENCODED_SIZE(sizeof(ssha_digest))+1);
@@ -265,16 +266,17 @@
static const char *smd5_generate(const char *plaintext,
const char *user __attr_unused__)
{
- unsigned char smd5_digest[20];
+#define SMD5_SALT_LEN 4
+ unsigned char smd5_digest[MD5_RESULTLEN + SMD5_SALT_LEN];
unsigned char *salt = &smd5_digest[MD5_RESULTLEN];
struct md5_context ctx;
string_t *str;
- random_fill(salt, 4);
+ random_fill(salt, SMD5_SALT_LEN);
md5_init(&ctx);
md5_update(&ctx, plaintext, strlen(plaintext));
- md5_update(&ctx, salt, 4);
+ md5_update(&ctx, salt, SMD5_SALT_LEN);
md5_final(&ctx, smd5_digest);
str = t_str_new(MAX_BASE64_ENCODED_SIZE(sizeof(smd5_digest))+1);
- Previous message: [dovecot-cvs] dovecot/src/auth auth-request.c, 1.97, 1.98 auth-request.h, 1.37, 1.38 auth-worker-client.c, 1.33, 1.34 mech-apop.c, 1.26, 1.27 mech-cram-md5.c, 1.27, 1.28 mech-digest-md5.c, 1.45, 1.46 mech-ntlm.c, 1.29, 1.30 mech-otp.c, 1.3, 1.4 mech-rpa.c, 1.30, 1.31 mech-skey.c, 1.3, 1.4 passdb-blocking.c, 1.17, 1.18 passdb-ldap.c, 1.61, 1.62 passdb-sql.c, 1.33, 1.34 passdb.c, 1.49, 1.50 passdb.h, 1.39, 1.40 password-scheme.c, 1.30, 1.31 password-scheme.h, 1.10, 1.11 userdb-static.c, 1.25, 1.26
- Next message: [dovecot-cvs] dovecot/src/lib hmac-md5.c, 1.2, 1.3 hmac-md5.h, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list