1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

USE_OPENSSL, respect CC and CFLAGS.

Assisted by:    Jim Bloom <bloom@acm.org>
This commit is contained in:
Kris Kennaway 2000-02-06 22:14:05 +00:00
parent 7d2dd70a77
commit 6a179c6b82
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=25530
3 changed files with 105 additions and 8 deletions

View File

@ -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

View File

@ -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

86
net/tund/files/patch-ab Normal file
View File

@ -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 <stdlib.h>
#include "tund.h"
#include <openssl/blowfish.h>
+#ifndef NO_IDEA
#include <openssl/idea.h>
+#endif
#include <openssl/rc5.h>
@@ -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,