[dovecot-cvs] dovecot/src/lib md5.c,1.9,1.10 md5.h,1.4,1.5
tss at dovecot.org
tss at dovecot.org
Mon Oct 9 00:10:22 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv32580
Modified Files:
md5.c md5.h
Log Message:
Added MD5_RESULTLEN macro.
Index: md5.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/md5.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- md5.c 16 Jun 2006 10:28:32 -0000 1.9
+++ md5.c 8 Oct 2006 23:10:18 -0000 1.10
@@ -219,7 +219,7 @@
memcpy(ctx->buffer, data, size);
}
-void md5_final(struct md5_context *ctx, unsigned char result[16])
+void md5_final(struct md5_context *ctx, unsigned char result[MD5_RESULTLEN])
{
/* @UNSAFE */
unsigned long used, free;
@@ -271,7 +271,8 @@
safe_memset(ctx, 0, sizeof(*ctx));
}
-void md5_get_digest(const void *data, size_t size, unsigned char result[16])
+void md5_get_digest(const void *data, size_t size,
+ unsigned char result[MD5_RESULTLEN])
{
struct md5_context ctx;
Index: md5.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/md5.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- md5.h 5 Jan 2003 13:09:51 -0000 1.4
+++ md5.h 8 Oct 2006 23:10:19 -0000 1.5
@@ -9,17 +9,20 @@
#ifndef __MD5_H
#define __MD5_H
+#define MD5_RESULTLEN (128/8)
+
struct md5_context {
uint_fast32_t lo, hi;
uint_fast32_t a, b, c, d;
unsigned char buffer[64];
- uint_fast32_t block[16];
+ uint_fast32_t block[MD5_RESULTLEN];
};
void md5_init(struct md5_context *ctx);
void md5_update(struct md5_context *ctx, const void *data, size_t size);
-void md5_final(struct md5_context *ctx, unsigned char result[16]);
+void md5_final(struct md5_context *ctx, unsigned char result[MD5_RESULTLEN]);
-void md5_get_digest(const void *data, size_t size, unsigned char result[16]);
+void md5_get_digest(const void *data, size_t size,
+ unsigned char result[MD5_RESULTLEN]);
#endif
More information about the dovecot-cvs
mailing list