summaryrefslogtreecommitdiff
path: root/security/cyrus-sasl/patches
diff options
context:
space:
mode:
authorjlam <jlam>2000-12-10 09:43:36 +0000
committerjlam <jlam>2000-12-10 09:43:36 +0000
commit5b94ecf974ea59e8276714dfe89c4d4bebd057f9 (patch)
tree12f3e763415b8bd5ac9961d432e1cee53ff8e52d /security/cyrus-sasl/patches
parentb93920bc4685b4ed134c4c814444cc474fae36d2 (diff)
downloadpkgsrc-5b94ecf974ea59e8276714dfe89c4d4bebd057f9.tar.gz
Update cyrus-sasl to 1.5.24nb2:
* Move headers to ${PREFIX}/include and get rid of need for the MD5 headers. * Move creation of cyrus user and mail group from cyrus-imapd to cyrus-sasl. * Always compile support for pwcheck. * Supply a ${PREFIX}/etc/rc.d/pwcheck script that drops in the rc.d startup scheme. * Supply a sasl-config script that can return compiler flags needed for linking against -lsasl. * Install documentation. * Supply DEINSTALL/INSTALL scripts to manage the /var/pwcheck directory and /etc/sasldb shared secrets database. * Improve the descriptions in the COMMENT and DESCR files. * Make me the maintainer.
Diffstat (limited to 'security/cyrus-sasl/patches')
-rw-r--r--security/cyrus-sasl/patches/patch-aa59
-rw-r--r--security/cyrus-sasl/patches/patch-ab24
-rw-r--r--security/cyrus-sasl/patches/patch-ac15
-rw-r--r--security/cyrus-sasl/patches/patch-ad17
-rw-r--r--security/cyrus-sasl/patches/patch-ae395
-rw-r--r--security/cyrus-sasl/patches/patch-af26
-rw-r--r--security/cyrus-sasl/patches/patch-ag13
-rw-r--r--security/cyrus-sasl/patches/patch-ah16
8 files changed, 523 insertions, 42 deletions
diff --git a/security/cyrus-sasl/patches/patch-aa b/security/cyrus-sasl/patches/patch-aa
index 9caebd2d635..453c5143d37 100644
--- a/security/cyrus-sasl/patches/patch-aa
+++ b/security/cyrus-sasl/patches/patch-aa
@@ -1,35 +1,34 @@
-$NetBSD: patch-aa,v 1.1.1.1 2000/08/25 15:23:49 jlam Exp $
+$NetBSD: patch-aa,v 1.2 2000/12/10 09:43:37 jlam Exp $
---- include/Makefile.in Fri Jul 21 04:36:01 2000
-+++ include/Makefile.in Fri Aug 4 12:12:16 2000
-@@ -246,17 +246,17 @@
+--- configure.in.orig Thu Jul 20 22:35:01 2000
++++ configure.in
+@@ -65,9 +65,12 @@
- install-includeHEADERS: $(include_HEADERS)
- @$(NORMAL_INSTALL)
-- $(mkinstalldirs) $(DESTDIR)$(includedir)
-+ $(mkinstalldirs) $(DESTDIR)$(pkgincludedir)
- @list='$(include_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
-- echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
-- $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
-+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p"; \
-+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgincludedir)/$$p; \
- done
+ dnl check for -R, etc. switch
+ CMU_GUESS_RUNPATH_SWITCH
+-dnl let's just link against local. otherwise we never find anything useful.
+-CPPFLAGS="-I/usr/local/include ${CPPFLAGS}"
+-CMU_ADD_LIBPATH("/usr/local/lib")
++
++AC_PATH_PROG(SED, sed, no)
++if test "$SED" = "no"; then
++ AC_ERROR([sed is required to build sasl-config])
++fi
++AC_SUBST(SED)
- uninstall-includeHEADERS:
- @$(NORMAL_UNINSTALL)
- list='$(include_HEADERS)'; for p in $$list; do \
-- rm -f $(DESTDIR)$(includedir)/$$p; \
-+ rm -f $(DESTDIR)$(pkgincludedir)/$$p; \
- done
+ AM_DISABLE_STATIC
- tags: TAGS
-@@ -327,7 +327,7 @@
- install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
- installdirs:
-- $(mkinstalldirs) $(DESTDIR)$(includedir)
-+ $(mkinstalldirs) $(DESTDIR)$(pkgincludedir)
+@@ -352,8 +355,11 @@
+ CPPFLAGS="$CPPFLAGS -I${with_des}/include"
+ LDFLAGS="$LDFLAGS -L${with_des}/lib"
+ fi
+- AC_CHECK_LIB(des, des_pcbc_encrypt, [LIB_DES="-ldes";
+- with_des=yes], with_des=no)
++ AC_CHECK_LIB(des, des_pcbc_encrypt,
++ AC_CHECK_HEADER(des.h, [LIB_DES="-ldes";
++ with_des=yes],
++ with_des=no),
++ with_des=no)
-
- mostlyclean-generic:
+ if test "$with_des" = no; then
+ dnl if openssl is around, we might be able to use that for des
diff --git a/security/cyrus-sasl/patches/patch-ab b/security/cyrus-sasl/patches/patch-ab
index 90d98beb252..f2ec479e850 100644
--- a/security/cyrus-sasl/patches/patch-ab
+++ b/security/cyrus-sasl/patches/patch-ab
@@ -1,13 +1,13 @@
-$NetBSD: patch-ab,v 1.1 2000/12/08 14:32:01 wiz Exp $
+$NetBSD: patch-ab,v 1.2 2000/12/10 09:43:37 jlam Exp $
---- configure.orig Fri Jul 21 04:35:50 2000
-+++ configure
-@@ -3512,6 +3512,8 @@
- echo "$ac_t""yes" 1>&6
- LIB_DES="-ldes";
- with_des=yes
-+# we want the des code form openssl
-+ with_des=no
- else
- echo "$ac_t""no" 1>&6
- with_des=no
+--- include/Makefile.am.orig Wed Mar 8 16:54:33 2000
++++ include/Makefile.am
+@@ -42,7 +42,7 @@
+ #
+ ################################################################
+
+-include_HEADERS = hmac-md5.h md5.h md5global.h sasl.h saslplug.h saslutil.h
++include_HEADERS = hmac-md5.h sasl.h saslplug.h saslutil.h
+
+ noinst_PROGRAMS = makemd5
+
diff --git a/security/cyrus-sasl/patches/patch-ac b/security/cyrus-sasl/patches/patch-ac
new file mode 100644
index 00000000000..641812fc2f8
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-ac
@@ -0,0 +1,15 @@
+$NetBSD: patch-ac,v 1.1 2000/12/10 09:43:37 jlam Exp $
+
+--- include/hmac-md5.h.orig Mon Nov 16 15:06:38 1998
++++ include/hmac-md5.h
+@@ -15,8 +15,8 @@
+ * values stored in network byte order (Big Endian)
+ */
+ typedef struct HMAC_MD5_STATE_s {
+- UINT4 istate[4];
+- UINT4 ostate[4];
++ u_int32_t istate[4];
++ u_int32_t ostate[4];
+ } HMAC_MD5_STATE;
+
+ /* One step hmac computation
diff --git a/security/cyrus-sasl/patches/patch-ad b/security/cyrus-sasl/patches/patch-ad
new file mode 100644
index 00000000000..b5e2e7a1497
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-ad
@@ -0,0 +1,17 @@
+$NetBSD: patch-ad,v 1.1 2000/12/10 09:43:37 jlam Exp $
+
+--- include/saslplug.h.orig Sun Feb 27 17:39:02 2000
++++ include/saslplug.h
+@@ -4,11 +4,8 @@
+ #ifndef SASLPLUG_H
+ #define SASLPLUG_H 1
+
+-#ifndef MD5GLOBAL_H
+-#include "md5global.h"
+-#endif
+ #ifndef MD5_H
+-#include "md5.h"
++#include <md5.h>
+ #endif
+ #ifndef HMAC_MD5_H
+ #include "hmac-md5.h"
diff --git a/security/cyrus-sasl/patches/patch-ae b/security/cyrus-sasl/patches/patch-ae
new file mode 100644
index 00000000000..e4bde9d97c6
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-ae
@@ -0,0 +1,395 @@
+$NetBSD: patch-ae,v 1.1 2000/12/10 09:43:37 jlam Exp $
+
+--- lib/md5.c.orig Mon Mar 29 16:26:14 1999
++++ lib/md5.c
+@@ -24,327 +24,10 @@
+ */
+
+ #include <config.h>
+-#include "md5global.h"
+-#include "md5.h"
++#include <md5.h>
++#include <string.h>
+ #include "hmac-md5.h"
+
+-/* Constants for MD5Transform routine.
+-*/
+-
+-#define S11 7
+-#define S12 12
+-#define S13 17
+-#define S14 22
+-#define S21 5
+-#define S22 9
+-#define S23 14
+-#define S24 20
+-#define S31 4
+-#define S32 11
+-#define S33 16
+-#define S34 23
+-#define S41 6
+-#define S42 10
+-#define S43 15
+-#define S44 21
+-
+-static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
+-static void Encode PROTO_LIST
+- ((unsigned char *, UINT4 *, unsigned int));
+-static void Decode PROTO_LIST
+- ((UINT4 *, unsigned char *, unsigned int));
+-static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
+-static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
+-
+-static unsigned char PADDING[64] = {
+- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+-};
+-
+-/* F, G, H and I are basic MD5 functions.
+-
+- */
+-#ifdef I
+-/* This might be defined via NANA */
+-#undef I
+-#endif
+-
+-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+-#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+-#define H(x, y, z) ((x) ^ (y) ^ (z))
+-#define I(x, y, z) ((y) ^ ((x) | (~z)))
+-
+-/* ROTATE_LEFT rotates x left n bits.
+-
+- */
+-
+-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+-
+-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+-Rotation is separate from addition to prevent recomputation.
+-*/
+-
+-#define FF(a, b, c, d, x, s, ac) { (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
+-#define GG(a, b, c, d, x, s, ac) { (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
+-#define HH(a, b, c, d, x, s, ac) { (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
+-#define II(a, b, c, d, x, s, ac) { (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
+-
+-/* MD5 initialization. Begins an MD5 operation, writing a new context.
+-*/
+-
+-void MD5Init (context)
+-MD5_CTX *context; /* context */
+-{
+- context->count[0] = context->count[1] = 0;
+-
+- /* Load magic initialization constants.
+-
+-*/
+- context->state[0] = 0x67452301;
+- context->state[1] = 0xefcdab89;
+- context->state[2] = 0x98badcfe;
+- context->state[3] = 0x10325476;
+-}
+-
+-/* MD5 block update operation. Continues an MD5 message-digest
+- operation, processing another message block, and updating the context.
+-*/
+-
+-void MD5Update (context, input, inputLen)
+-MD5_CTX *context; /* context */
+-unsigned char *input; /* input block */
+-unsigned int inputLen; /* length of input block */
+-{
+- unsigned int i, index, partLen;
+-
+- /* Compute number of bytes mod 64 */
+- index = (unsigned int)((context->count[0] >> 3) & 0x3F);
+-
+- /* Update number of bits */
+- if ((context->count[0] += ((UINT4)inputLen << 3))
+- < ((UINT4)inputLen << 3))
+- context->count[1]++;
+- context->count[1] += ((UINT4)inputLen >> 29);
+-
+- partLen = 64 - index;
+-
+- /* Transform as many times as possible.
+-
+-*/
+- if (inputLen >= partLen) {
+- MD5_memcpy
+- ((POINTER)&context->buffer[index], (POINTER)input, partLen); MD5Transform
+- (context->state, context->buffer);
+-
+- for (i = partLen; i + 63 < inputLen; i += 64)
+- MD5Transform (context->state, &input[i]);
+-
+- index = 0;
+- }
+- else
+- i = 0;
+-
+- /* Buffer remaining input */
+- MD5_memcpy
+- ((POINTER)&context->buffer[index], (POINTER)&input[i],
+- inputLen-i);
+-
+-}
+-
+-/* MD5 finalization. Ends an MD5 message-digest operation, writing the
+- the message digest and zeroizing the context.
+-
+- */
+-
+-void MD5Final (digest, context)
+-unsigned char digest[16]; /* message digest */
+-MD5_CTX *context; /* context */
+-{
+- unsigned char bits[8];
+- unsigned int index, padLen;
+-
+- /* Save number of bits */
+- Encode (bits, context->count, 8);
+-
+- /* Pad out to 56 mod 64.
+-
+-*/
+- index = (unsigned int)((context->count[0] >> 3) & 0x3f);
+- padLen = (index < 56) ? (56 - index) : (120 - index);
+- MD5Update (context, PADDING, padLen);
+-
+- /* Append length (before padding) */
+- MD5Update (context, bits, 8);
+-
+- /* Store state in digest */
+- Encode (digest, context->state, 16);
+-
+- /* Zeroize sensitive information.
+-
+-*/
+- MD5_memset ((POINTER)context, 0, sizeof (*context));
+-}
+-
+-/* MD5 basic transformation. Transforms state based on block.
+-
+- */
+-
+-static void MD5Transform (state, block)
+-UINT4 state[4];
+-unsigned char block[64];
+-{
+- UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+-
+- Decode (x, block, 64);
+-
+- /* Round 1 */
+- FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+- FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+- FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+- FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+- FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+- FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+- FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+- FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+- FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+- FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+- FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+- FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+- FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+- FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+- FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+- FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+-
+- /* Round 2 */
+- GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+- GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+- GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+- GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+- GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+- GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
+- GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+- GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+- GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+- GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+- GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+- GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+- GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+- GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+- GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+- GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+-
+- /* Round 3 */
+- HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+- HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+- HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+- HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+- HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+- HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+- HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+- HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+- HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+- HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+- HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+- HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
+- HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+- HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+- HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+- HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+-
+- /* Round 4 */
+- II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+- II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+- II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+- II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+- II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+- II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+- II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+- II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+- II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+- II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+- II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+- II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+- II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+- II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+- II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+- II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+-
+- state[0] += a;
+- state[1] += b;
+- state[2] += c;
+- state[3] += d;
+-
+- /* Zeroize sensitive information.
+- */
+- MD5_memset ((POINTER)x, 0, sizeof (x));
+-}
+-
+-/* Encodes input (UINT4) into output (unsigned char). Assumes len is
+- a multiple of 4.
+-
+- */
+-
+-static void Encode (output, input, len)
+-unsigned char *output;
+-UINT4 *input;
+-unsigned int len;
+-{
+- unsigned int i, j;
+-
+- for (i = 0, j = 0; j < len; i++, j += 4) {
+- output[j] = (unsigned char)(input[i] & 0xff);
+- output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
+- output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
+- output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
+- }
+-}
+-
+-/* Decodes input (unsigned char) into output (UINT4). Assumes len is
+- a multiple of 4.
+-
+- */
+-
+-static void Decode (output, input, len)
+-UINT4 *output;
+-unsigned char *input;
+-unsigned int len;
+-{
+- unsigned int i, j;
+-
+- for (i = 0, j = 0; j < len; i++, j += 4)
+- output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16)
+- | (((UINT4)input[j+3]) << 24);
+-}
+-
+-/* Note: Replace "for loop" with standard memcpy if possible.
+-
+- */
+-
+-static void MD5_memcpy (output, input, len)
+-POINTER output;
+-POINTER input;
+-unsigned int len;
+-{
+- unsigned int i;
+-
+- for (i = 0; i < len; i++)
+- output[i] = input[i];
+-}
+-
+-/* Note: Replace "for loop" with standard memset if possible.
+-*/
+-
+-static void MD5_memset (output, value, len)
+-POINTER output;
+-int value;
+-unsigned int len;
+-{
+- unsigned int i;
+-
+- for (i = 0; i < len; i++)
+- ((char *)output)[i] = (char)value;
+-}
+-
+ void hmac_md5_init(HMAC_MD5_CTX *hmac,
+ const unsigned char *key,
+ int key_len)
+@@ -382,10 +65,10 @@
+ */
+
+ /* start out by storing key in pads */
+- MD5_memset(k_ipad, '\0', sizeof k_ipad);
+- MD5_memset(k_opad, '\0', sizeof k_opad);
+- MD5_memcpy( k_ipad, key, key_len);
+- MD5_memcpy( k_opad, key, key_len);
++ memset(k_ipad, '\0', sizeof k_ipad);
++ memset(k_opad, '\0', sizeof k_opad);
++ memcpy( k_ipad, key, key_len);
++ memcpy( k_opad, key, key_len);
+
+ /* XOR key with ipad and opad values */
+ for (i=0; i<64; i++) {
+@@ -400,9 +83,9 @@
+ MD5Update(&hmac->octx, k_opad, 64); /* apply outer pad */
+
+ /* scrub the pads and key context (if used) */
+- MD5_memset(&k_ipad, 0, sizeof(k_ipad));
+- MD5_memset(&k_opad, 0, sizeof(k_opad));
+- MD5_memset(&tk, 0, sizeof(tk));
++ memset(&k_ipad, 0, sizeof(k_ipad));
++ memset(&k_opad, 0, sizeof(k_opad));
++ memset(&tk, 0, sizeof(tk));
+
+ /* and we're done. */
+ }
+@@ -427,7 +110,7 @@
+ state->istate[lupe] = htonl(hmac.ictx.state[lupe]);
+ state->ostate[lupe] = htonl(hmac.octx.state[lupe]);
+ }
+- MD5_memset(&hmac, 0, sizeof(hmac));
++ memset(&hmac, 0, sizeof(hmac));
+ }
+
+
+@@ -435,7 +118,7 @@
+ HMAC_MD5_STATE *state)
+ {
+ unsigned lupe;
+- MD5_memset(hmac, 0, sizeof(HMAC_MD5_CTX));
++ memset(hmac, 0, sizeof(HMAC_MD5_CTX));
+ for (lupe = 0; lupe < 4; lupe++) {
+ hmac->ictx.state[lupe] = ntohl(state->istate[lupe]);
+ hmac->octx.state[lupe] = ntohl(state->ostate[lupe]);
+@@ -497,10 +180,10 @@
+ */
+
+ /* start out by storing key in pads */
+- MD5_memset(k_ipad, '\0', sizeof k_ipad);
+- MD5_memset(k_opad, '\0', sizeof k_opad);
+- MD5_memcpy( k_ipad, key, key_len);
+- MD5_memcpy( k_opad, key, key_len);
++ memset(k_ipad, '\0', sizeof k_ipad);
++ memset(k_opad, '\0', sizeof k_opad);
++ memcpy( k_ipad, key, key_len);
++ memcpy( k_opad, key, key_len);
+
+ /* XOR key with ipad and opad values */
+ for (i=0; i<64; i++) {
diff --git a/security/cyrus-sasl/patches/patch-af b/security/cyrus-sasl/patches/patch-af
new file mode 100644
index 00000000000..14abe036488
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-af
@@ -0,0 +1,26 @@
+$NetBSD: patch-af,v 1.1 2000/12/10 09:43:37 jlam Exp $
+
+--- plugins/Makefile.am.orig Thu Jul 20 22:25:51 2000
++++ plugins/Makefile.am
+@@ -66,6 +66,10 @@
+ sasl_LTLIBRARIES = @SASL_MECHS@
+ EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la libscrammd5.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la
+
++bin_SCRIPTS = sasl-config
++sasl_config_CFLAGS = $(CPPFLAGS)
++sasl_config_LIBS = $(libplain_la_LIBADD) $(libkerberos4_la_LIBADD) $(libgssapiv2_la_LIBADD) $(libdigestmd5_la_LIBADD) $(liblogin_la_LIBADD) $(libsrp_la_LIBADD)
++
+ libplain_la_SOURCES = plain.c
+ libplain_la_LDFLAGS = -version-info $(plain_version)
+ libplain_la_LIBADD = $(PLAIN_LIBS)
+@@ -102,3 +106,10 @@
+ # libx509_la_SOURCES = x509.c
+ # libx509_la_LDFLAGS = -version-info $(x509_version)
+ # libx509_la_LIBADD = $(X509_LIBS)
++
++sasl-config: sasl-config.in
++ $(SED) -e "s,%%sasl_config_LIBS%%,$(sasl_config_LIBS),g" \
++ -e "s,%%sasl_config_CFLAGS%%,$(sasl_config_CFLAGS),g" \
++ -e "s,%%prefix%%,$(prefix),g" \
++ -e "s,%%VERSION%%,$(VERSION),g" \
++ < sasl-config.in > sasl-config
diff --git a/security/cyrus-sasl/patches/patch-ag b/security/cyrus-sasl/patches/patch-ag
new file mode 100644
index 00000000000..ad8013ec6ca
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1 2000/12/10 09:43:38 jlam Exp $
+
+--- plugins/cram.c.orig Sat Mar 11 21:20:00 2000
++++ plugins/cram.c
+@@ -425,7 +425,7 @@
+
+ HMAC_MD5_CTX tmphmac;
+ char *digest_str = NULL;
+- UINT4 digest[4];
++ u_int32_t digest[4];
+
+ VL(("CRAM-MD5 Step 2\n"));
+ VL(("Clientin: %s\n",clientin));
diff --git a/security/cyrus-sasl/patches/patch-ah b/security/cyrus-sasl/patches/patch-ah
new file mode 100644
index 00000000000..c68dd0bda66
--- /dev/null
+++ b/security/cyrus-sasl/patches/patch-ah
@@ -0,0 +1,16 @@
+$NetBSD: patch-ah,v 1.1 2000/12/10 09:43:38 jlam Exp $
+
+--- plugins/gssapi.c.orig Thu Jul 20 22:06:52 2000
++++ plugins/gssapi.c
+@@ -50,6 +50,11 @@
+ #include <gssapi/gssapi.h>
+ #endif
+
++/* Heimdal has this, but MIT Kerberos doesn't */
++#ifndef GSS_C_NO_NAME
++#define GSS_C_NO_NAME ((gss_name_t) 0)
++#endif
++
+ #ifdef WIN32
+ #include <winsock.h>
+ #else