summaryrefslogtreecommitdiff
path: root/mail/spamprobe/files/patch-md5
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2002-10-08 23:48:39 +0000
committerMikhail Teterin <mi@FreeBSD.org>2002-10-08 23:48:39 +0000
commit3e2361eb5ae8aa6b8cda0217b47aee5a50bb4fc6 (patch)
tree3c8b40d85eef51c3280c511de2f9eb15834fb773 /mail/spamprobe/files/patch-md5
parent* Let fluxbox depend on new boxtools port. (diff)
Update to 0.7c. Respect C(XX)FLAGS. The new version uses md5 checksums
to identify messages -- force it to use our -lmd instead of letting it install the N+1st implementation. Use the tiny piece of sprint(3) to convert the 16-byte digest into the printable 32-char string (the wisdom of storing such a string instead of the raw digest discussed with the author already). Don't copy the manpage from FILESDIR -- compress and/or install it directly from FILESDIR. Approved by: maintainer timeout
Diffstat (limited to '')
-rw-r--r--mail/spamprobe/files/patch-md576
1 files changed, 76 insertions, 0 deletions
diff --git a/mail/spamprobe/files/patch-md5 b/mail/spamprobe/files/patch-md5
new file mode 100644
index 000000000000..8ae1e7847c8b
--- /dev/null
+++ b/mail/spamprobe/files/patch-md5
@@ -0,0 +1,76 @@
+--- MimeMessageReader.h Thu Sep 19 12:15:38 2002
++++ MimeMessageReader.h Wed Sep 25 09:19:55 2002
+@@ -34,4 +34,7 @@
+ #include "MimeHeader.h"
++#include <sys/types.h>
++#include <md5.h>
++#define MD5_DIGEST_LENGTH 16
+
+-class md5_state_s;
++typedef unsigned char md5_digest_t[MD5_DIGEST_LENGTH*2 + 1];
+
+@@ -64,3 +65,3 @@
+
+- const string &getMD5Digest();
++ const md5_digest_t &getMD5Digest();
+
+@@ -105,4 +106,4 @@
+ vector<MimeHeader> m_headers;
+- string m_md5digest;
+- NewPtr<md5_state_s> m_md5state;
++ md5_digest_t m_md5digest;
++ NewPtr<MD5_CTX> m_md5state;
+ };
+--- MimeMessageReader.cc Thu Sep 19 12:15:38 2002
++++ MimeMessageReader.cc Wed Sep 25 22:56:17 2002
+@@ -30,4 +30,5 @@
+
+-#include <cstdio>
+-#include "md5.h"
++#include <sys/types.h>
++#include <md5.h>
++#define MD5_DIGEST_LENGTH 16
+ #include "util.h"
+@@ -93,4 +92,4 @@
+
+- m_md5state.set(new md5_state_s);
+- md5_init(m_md5state.get());
++ m_md5state.set(new MD5_CTX);
++ MD5Init(m_md5state.get());
+
+@@ -140,3 +139,3 @@
+ }
+- md5_append(m_md5state.get(), (md5_byte_t *)value.data(), value.length());
++ MD5Update(m_md5state.get(), (const unsigned char *)value.data(), value.length());
+ }
+@@ -228,3 +227,3 @@
+
+-const string &MimeMessageReader::getMD5Digest()
++const md5_digest_t &MimeMessageReader::getMD5Digest()
+ {
+@@ -236,11 +235,10 @@
+
+- m_md5digest.erase();
+-
+- md5_byte_t raw_digest[32];
+- char hexcode[8];
+- md5_finish(m_md5state.get(), raw_digest);
+- for (int i = 0; i < 16; ++i) {
+- sprintf(hexcode, "%02x", (unsigned)raw_digest[i]);
+- m_md5digest += hexcode;
++ MD5Final(m_md5digest + MD5_DIGEST_LENGTH + 1, m_md5state.get());
++ for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
++ char hexdigits[] = "0123456789abcdef";
++ m_md5digest[i*2] = hexdigits[m_md5digest[i + MD5_DIGEST_LENGTH + 1] >> 4];
++ m_md5digest[i*2 + 1] =
++ hexdigits[m_md5digest[i + MD5_DIGEST_LENGTH + 1] & 0x0f];
+ }
++ m_md5digest[MD5_DIGEST_LENGTH*2 + 1] = '\0';
+ m_md5state.clear();
+--- MessageFactory.cc Tue Sep 17 17:39:36 2002
++++ MessageFactory.cc Tue Oct 8 18:59:07 2002
+@@ -127,3 +127,3 @@
+
+- msg.setDigest(reader.getMD5Digest());
++ msg.setDigest((char *)reader.getMD5Digest());
+