masqmail-0.2

annotate src/md5/md5.h @ 179:ec3fe72a3e99

Fixed an important bug with folded headers! g_strconcat() returns a *copy* of the string, but hdr->value still pointed to the old header (which probably was a memory leak, too). If the folded part had been quite small it was likely that the new string was at the same position as the old one, thus making everything go well. But if pretty long headers were folded several times it was likely that the new string was allocated somewhere else in memory, thus breaking things. In result mails to lots of recipients (folded header) were frequently only sent to the ones in the first line. Sorry for the inconvenience.
author meillo@marmaro.de
date Fri, 03 Jun 2011 09:52:17 +0200
parents 52c82d755215
children
rev   line source
meillo@162 1 /*
meillo@162 2 * This is an OpenSSL-compatible implementation of the RSA Data Security,
meillo@162 3 * Inc. MD5 Message-Digest Algorithm (RFC 1321).
meillo@162 4 *
meillo@162 5 * Written by Solar Designer <solar at openwall.com> in 2001, and placed
meillo@162 6 * in the public domain. There's absolutely no warranty.
meillo@162 7 *
meillo@162 8 * See md5.c for more information.
meillo@0 9 */
meillo@0 10
meillo@162 11 #ifdef HAVE_OPENSSL
meillo@162 12 #include <openssl/md5.h>
meillo@162 13 #elif !defined(_MD5_H)
meillo@162 14 #define _MD5_H
meillo@0 15
meillo@162 16 /* Any 32-bit or wider unsigned integer data type will do */
meillo@163 17 typedef unsigned long MD5_u32plus;
meillo@0 18
meillo@0 19 typedef struct {
meillo@162 20 MD5_u32plus lo, hi;
meillo@162 21 MD5_u32plus a, b, c, d;
meillo@162 22 unsigned char buffer[64];
meillo@162 23 MD5_u32plus block[16];
meillo@0 24 } MD5_CTX;
meillo@0 25
meillo@162 26 extern void MD5_Init(MD5_CTX *ctx);
meillo@162 27 extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
meillo@162 28 extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
meillo@162 29
meillo@162 30 #endif