From 46b29cc815dca1104f23ab41e22f3188fc0a00bc Mon Sep 17 00:00:00 2001 From: kris Date: Sun, 6 Feb 2000 22:14:05 +0000 Subject: USE_OPENSSL, respect CC and CFLAGS. Assisted by: Jim Bloom --- net/tund/Makefile | 6 +--- net/tund/files/patch-aa | 21 ++++++++++-- net/tund/files/patch-ab | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 net/tund/files/patch-ab diff --git a/net/tund/Makefile b/net/tund/Makefile index 366b63f7823..44295acaed1 100644 --- a/net/tund/Makefile +++ b/net/tund/Makefile @@ -12,11 +12,7 @@ MASTER_SITES= ftp://ftp.chg.ru/pub/networking/freebsd/ MAINTAINER= ks@itp.ac.ru -BUILD_DEPENDS= ${LOCALBASE}/lib/libcrypto.a:${PORTSDIR}/security/openssl - -.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES -MAKE_ENV+= EXTRA_SSL_LIBS="-lRSAglue -lrsaref" -.endif +USE_OPENSSL= RSA MAN8= tund.8 MANCOMPRESSED= yes diff --git a/net/tund/files/patch-aa b/net/tund/files/patch-aa index cb11aab93c8..1d475e13090 100644 --- a/net/tund/files/patch-aa +++ b/net/tund/files/patch-aa @@ -1,6 +1,21 @@ ---- Makefile.orig Fri Sep 17 14:20:52 1999 -+++ Makefile Fri Sep 17 14:21:05 1999 -@@ -10,13 +10,13 @@ +--- Makefile.orig Tue Aug 24 03:48:00 1999 ++++ Makefile Sat Feb 5 22:30:00 2000 +@@ -1,22 +1,24 @@ + + RSA_KEY_LENGTH = 1024 + +-CFLAGS = -g -DDEBUG ++CFLAGS ?= -O2 ++CFLAGS += -g -DDEBUG $(OPENSSL_CFLAGS) + # CFLAGS = -O6 -mpentium +-CC = cc $(CFLAGS) +-INC = -I/usr/local/include +-LIB = -L/usr/local/lib ++CC ?= cc ++CC += $(CFLAGS) ++INC = -I$(OPENSSLINC) ++LIB = -L$(OPENSSLLIB) + all: rsa_kg pkey_gen tund keygen rsa_kg: rsa_kg.c tund.h diff --git a/net/tund/files/patch-ab b/net/tund/files/patch-ab new file mode 100644 index 00000000000..8882676cea5 --- /dev/null +++ b/net/tund/files/patch-ab @@ -0,0 +1,86 @@ +--- cipher.c.orig Sat Feb 5 21:35:24 2000 ++++ cipher.c Sat Feb 5 21:38:51 2000 +@@ -1,7 +1,9 @@ + #include + #include "tund.h" + #include ++#ifndef NO_IDEA + #include ++#endif + #include + + +@@ -27,7 +29,9 @@ + { + Tunnel *tun; + BF_KEY *bf_key; ++#ifndef NO_IDEA + IDEA_KEY_SCHEDULE *idea_key1,*idea_key2; ++#endif + RC5_32_KEY *rc5_key; + void *key; + unsigned char *data; +@@ -56,6 +60,7 @@ + BF_set_key(bf_key,16,data); + key=bf_key; + break; ++#ifndef NO_IDEA + case TUN_CIPHER_IDEA: idea_key1=must_malloc(sizeof(IDEA_KEY_SCHEDULE)); + idea_set_encrypt_key(data,idea_key1); + if(remote) +@@ -67,6 +72,7 @@ + } + key=idea_key1; + break; ++#endif + case TUN_CIPHER_RC5:rc5_key=must_malloc(sizeof(RC5_32_KEY)); + RC5_32_set_key(rc5_key,16,data,RC5_8_ROUNDS); + key=rc5_key; +@@ -93,7 +99,9 @@ + Tunnel *tun=(Tunnel*)stun->buf[tun_ind]; + int cipher; + BF_KEY *bf_key; ++#ifndef NO_IDEA + IDEA_KEY_SCHEDULE *idea_key; ++#endif + RC5_32_KEY *rc5_key; + int length; + +@@ -106,11 +114,13 @@ + bcopy(ivec_ini,iv_buf,8); + BF_cbc_encrypt(in,out,length,bf_key,iv_buf,BF_ENCRYPT); + return length; ++#ifndef NO_IDEA + case TUN_CIPHER_IDEA:idea_key=tun->localCipherKey; + bcopy(ivec_ini,iv_buf,8); + idea_cbc_encrypt(in,out,length,idea_key, + iv_buf,IDEA_ENCRYPT); + return length; ++#endif + case TUN_CIPHER_RC5:rc5_key=tun->localCipherKey; + bcopy(ivec_ini,iv_buf,8); + RC5_32_cbc_encrypt(in,out,length,rc5_key, +@@ -129,7 +139,9 @@ + Tunnel *tun=(Tunnel*)stun->buf[tun_ind]; + int cipher; + BF_KEY *bf_key; ++#ifndef NO_IDEA + IDEA_KEY_SCHEDULE *idea_key; ++#endif + RC5_32_KEY *rc5_key; + int length; + +@@ -142,11 +154,13 @@ + bcopy(ivec_ini,iv_buf,8); + BF_cbc_encrypt(in,out,length,bf_key,iv_buf,BF_DECRYPT); + break; ++#ifndef NO_IDEA + case TUN_CIPHER_IDEA:idea_key=tun->remoteCipherKey; + bcopy(ivec_ini,iv_buf,8); + idea_cbc_encrypt(in,out,length,idea_key, + iv_buf,IDEA_DECRYPT); + break; ++#endif + case TUN_CIPHER_RC5:rc5_key=tun->remoteCipherKey; + bcopy(ivec_ini,iv_buf,8); + RC5_32_cbc_encrypt(in,out,length,rc5_key, -- cgit