diff options
author | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-09-29 22:12:20 +0000 |
---|---|---|
committer | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-09-29 22:12:20 +0000 |
commit | cc6a4eebad6baf21aa5eb425c101ab3e95fd55b2 (patch) | |
tree | aa161bae6256f9bed91192f87b3848407856d221 /security/isakmpd | |
parent | cb8c64c20b15b8cf5001b2c2107e55b8ef860079 (diff) | |
download | ports-cc6a4eebad6baf21aa5eb425c101ab3e95fd55b2.tar.gz ports-cc6a4eebad6baf21aa5eb425c101ab3e95fd55b2.zip |
Notes
Diffstat (limited to 'security/isakmpd')
-rw-r--r-- | security/isakmpd/Makefile | 6 | ||||
-rw-r--r-- | security/isakmpd/files/patch-Makefile.sysdep | 15 | ||||
-rw-r--r-- | security/isakmpd/files/patch-sysdep-common-libsysdep-sha1.c | 67 | ||||
-rw-r--r-- | security/isakmpd/files/patch-sysdep-common-md5.h | 32 | ||||
-rw-r--r-- | security/isakmpd/files/patch-sysdep-common-sha1.h | 26 |
5 files changed, 138 insertions, 8 deletions
diff --git a/security/isakmpd/Makefile b/security/isakmpd/Makefile index 7b83f222c0fa..f891c86d63f6 100644 --- a/security/isakmpd/Makefile +++ b/security/isakmpd/Makefile @@ -26,7 +26,6 @@ BUILD_DEPENDS+= keynote:${PORTSDIR}/security/keynote .endif USE_RC_SUBR= isakmpd.sh -USE_OPENSSL= yes WRKSRC= ${WRKDIR}/isakmpd MAKE_ENV+= BINDIR=${PREFIX}/sbin MANDIR=${PREFIX}/man/man LC_ALL=C @@ -35,8 +34,13 @@ MAN8= certpatch.8 isakmpd.8 MANCOMPRESSED= yes .include <bsd.port.pre.mk> + .if ${OSVERSION} >= 700019 BROKEN= is not buildable with OpenSSL 0.9.8b +.else +OPENSSLINC?= /usr/include +OPENSSLLIB?= /usr/lib +MAKE_ENV+= OPENSSLINC="${OPENSSLINC}" OPENSSLLIB="${OPENSSLLIB}" .endif post-patch: diff --git a/security/isakmpd/files/patch-Makefile.sysdep b/security/isakmpd/files/patch-Makefile.sysdep index 387f5ae3389b..cae8990e6f77 100644 --- a/security/isakmpd/files/patch-Makefile.sysdep +++ b/security/isakmpd/files/patch-Makefile.sysdep @@ -1,21 +1,22 @@ ---- sysdep/freebsd/Makefile.sysdep.orig Sat Jun 26 05:40:57 2004 -+++ sysdep/freebsd/Makefile.sysdep Sun Dec 12 02:47:19 2004 -@@ -40,11 +40,11 @@ +--- sysdep/freebsd/Makefile.sysdep.orig Sat Jun 26 00:40:57 2004 ++++ sysdep/freebsd/Makefile.sysdep Sat Sep 29 16:36:41 2007 +@@ -40,12 +40,11 @@ LIBSYSDEPDIR= ${.CURDIR}/sysdep/common/libsysdep .endif -LDADD+= -lgmp ${LIBSYSDEPDIR}/libsysdep.a -lipsec -L/usr/local/lib -+LDADD+= ${LIBSYSDEPDIR}/libsysdep.a -lipsec -L/usr/local/lib ++LDADD+= ${LIBSYSDEPDIR}/libsysdep.a -lipsec -L${OPENSSLLIB} DPADD+= ${LIBGMP} ${LIBSYSDEPDIR}/libsysdep.a -CFLAGS+= -DHAVE_GETIFADDRS \ - -I${.CURDIR}/sysdep/common -I/usr/include \ +- -I/usr/local/include -I/usr/local/include/openssl +CFLAGS+= -DHAVE_GETIFADDRS -DHAVE_PCAP \ -+ -I${.CURDIR}/sysdep/common -I/usr/include -I/usr/include/openssl \ - -I/usr/local/include -I/usr/local/include/openssl ++ -I${.CURDIR}/sysdep/common -I${OPENSSLINC} -I${OPENSSLINC}/openssl IPSEC_SRCS= pf_key_v2.c -@@ -58,9 +58,6 @@ + IPSEC_CFLAGS= -DUSE_PF_KEY_V2 +@@ -58,9 +57,6 @@ GENERATED+= sysdep-target sysdep-target: cd ${.CURDIR}/sysdep/common/libsysdep; ${MAKE} ${.MAKEFLAGS} diff --git a/security/isakmpd/files/patch-sysdep-common-libsysdep-sha1.c b/security/isakmpd/files/patch-sysdep-common-libsysdep-sha1.c new file mode 100644 index 000000000000..17ce0e83989d --- /dev/null +++ b/security/isakmpd/files/patch-sysdep-common-libsysdep-sha1.c @@ -0,0 +1,67 @@ +diff -rpu8 sysdep/common/libsysdep/sha1.c sysdep-FIXED/common/libsysdep/sha1.c +--- sysdep/common/libsysdep/sha1.c Sun Jan 28 23:38:48 2001 ++++ sysdep-FIXED/common/libsysdep/sha1.c Sat Mar 25 02:48:19 2006 +@@ -46,22 +46,22 @@ A million repetitions of "a" + #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); + #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); + #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); + #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); + + + /* Hash a single 512-bit block. This is the core of the algorithm. */ + +-void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) ++void SHA1Transform(UINT4 state[5], unsigned char buffer[64]) + { +-unsigned long a, b, c, d, e; ++UINT4 a, b, c, d, e; + typedef union { + unsigned char c[64]; +- unsigned long l[16]; ++ UINT4 l[16]; + } CHAR64LONG16; + CHAR64LONG16* block; + #ifdef SHA1HANDSOFF + static CHAR64LONG16 workspace; + block = &workspace; + memcpy(block, buffer, 64); + #else + block = (CHAR64LONG16*)buffer; +@@ -118,17 +118,17 @@ void SHA1Init(SHA1_CTX* context) + } + + + /* Run your data through this. */ + + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) + { + unsigned int i; +-unsigned long j; ++UINT4 j; + + j = context->count[0]; + if ((context->count[0] += len << 3) < j) context->count[1] += (len>>29)+1; + j = (j >> 3) & 63; + if ((j + len) > 63) { + memcpy(&context->buffer[j], data, (i = 64-j)); + SHA1Transform(context->state, context->buffer); + for ( ; i + 63 < len; i += 64) { +@@ -140,17 +140,17 @@ unsigned long j; + memcpy(&context->buffer[j], &data[i], len - i); + } + + + /* Add padding and return the message digest. */ + + void SHA1Final(unsigned char digest[20], SHA1_CTX* context) + { +-unsigned long i, j; ++UINT4 i, j; + unsigned char finalcount[8]; + + for (i = 0; i < 8; i++) { + finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] + >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ + } + SHA1Update(context, (unsigned char *)"\200", 1); + while ((context->count[0] & 504) != 448) { diff --git a/security/isakmpd/files/patch-sysdep-common-md5.h b/security/isakmpd/files/patch-sysdep-common-md5.h new file mode 100644 index 000000000000..a0879723f012 --- /dev/null +++ b/security/isakmpd/files/patch-sysdep-common-md5.h @@ -0,0 +1,32 @@ +diff -rpu8 sysdep/common/md5.h sysdep-FIXED/common/md5.h +--- sysdep/common/md5.h Sun Jan 28 23:38:47 2001 ++++ sysdep-FIXED/common/md5.h Sat Mar 25 02:47:19 2006 +@@ -7,24 +7,26 @@ + function argument prototyping. + The following makes PROTOTYPES default to 0 if it has not already + been defined with C compiler flags. + */ + #ifndef PROTOTYPES + #define PROTOTYPES 1 + #endif + ++#include <sys/types.h> ++ + /* POINTER defines a generic pointer type */ + typedef unsigned char *POINTER; + + /* UINT2 defines a two byte word */ +-typedef unsigned short int UINT2; ++typedef u_int16_t UINT2; + + /* UINT4 defines a four byte word */ +-typedef unsigned long int UINT4; ++typedef u_int32_t UINT4; + + /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. + If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it + returns an empty list. + */ + + #if PROTOTYPES + #define PROTO_LIST(list) list diff --git a/security/isakmpd/files/patch-sysdep-common-sha1.h b/security/isakmpd/files/patch-sysdep-common-sha1.h new file mode 100644 index 000000000000..a32edba5d495 --- /dev/null +++ b/security/isakmpd/files/patch-sysdep-common-sha1.h @@ -0,0 +1,26 @@ +--- sysdep/common/sha1.h.orig Sun Jan 28 19:38:47 2001 ++++ sysdep/common/sha1.h Sat Sep 29 16:27:50 2007 +@@ -6,13 +6,20 @@ + 100% Public Domain + */ + ++#include <sys/types.h> ++ ++/* Check if already defined by md5.h */ ++#ifndef PROTOTYPES ++typedef u_int32_t UINT4; ++#endif ++ + typedef struct { +- unsigned long state[5]; +- unsigned long count[2]; ++ UINT4 state[5]; ++ UINT4 count[2]; + unsigned char buffer[64]; + } SHA1_CTX; + +-void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); ++void SHA1Transform(UINT4 state[5], unsigned char buffer[64]); + void SHA1Init(SHA1_CTX* context); + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); + void SHA1Final(unsigned char digest[20], SHA1_CTX* context); |