diff options
author | Mark Murray <markm@FreeBSD.org> | 2003-06-10 13:06:41 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 2003-06-10 13:06:41 +0000 |
commit | cb350defb66e14e5e7ed1aeec5527f4d1a331802 (patch) | |
tree | d60cdf8f4e843d65ab1a368fabd49ab01c7fdba5 /net/xisp | |
parent | - remove empty dirs (diff) |
Slightly crude fix for libcipher removal. Improvements welcome.
Notes
Notes:
svn path=/head/; revision=82675
Diffstat (limited to 'net/xisp')
-rw-r--r-- | net/xisp/files/patch-Makefile | 15 | ||||
-rw-r--r-- | net/xisp/files/patch-pcode.c | 73 |
2 files changed, 86 insertions, 2 deletions
diff --git a/net/xisp/files/patch-Makefile b/net/xisp/files/patch-Makefile index b1861b2b67fb..c04e7a461c8a 100644 --- a/net/xisp/files/patch-Makefile +++ b/net/xisp/files/patch-Makefile @@ -1,5 +1,5 @@ ---- Makefile.orig Mon Feb 3 04:59:04 2003 -+++ Makefile Mon Feb 3 04:59:28 2003 +--- Makefile.orig Tue Jun 10 13:24:04 2003 ++++ Makefile Tue Jun 10 13:48:35 2003 @@ -13,8 +13,8 @@ #===================================================================== # @@ -11,3 +11,14 @@ INCX11 = $(X11PREFIX)/include LIBX11 = $(X11PREFIX)/lib INCFORMS = $(X11PREFIX)/include/X11 +@@ -223,8 +223,8 @@ + GROUP = dialer + CHAT_PATH = /usr/bin + PPPD_PATH = /usr/sbin +-CCFLAGS = -Wall -O +-EXTRALIBS = -lcipher ++CCFLAGS = -Wall -O -DUSE_OPENSSL ++EXTRALIBS = -lcrypto + LINKX11 = -Wl,-R$(LIBX11) + LINKFORMS = -L$(LIBFORMS) -lforms + INSTALL = /usr/bin/install diff --git a/net/xisp/files/patch-pcode.c b/net/xisp/files/patch-pcode.c new file mode 100644 index 000000000000..45dc26e9f9bd --- /dev/null +++ b/net/xisp/files/patch-pcode.c @@ -0,0 +1,73 @@ +--- pcode.c.orig Tue Jun 10 13:30:26 2003 ++++ pcode.c Tue Jun 10 14:02:23 2003 +@@ -21,10 +21,14 @@ + /* Password encryption/decryption data structures and routines */ + + #include <sys/param.h> ++#if defined(USE_OPENSSL) ++#include <openssl/des.h> ++#else /* ! OpenSSL */ + #if (defined(BSD) && BSD >= 199306) + #include <unistd.h> + #include <stdlib.h> + #endif ++#endif /* OpenSSL */ + + static unsigned char pkey[8] = {0x87,0xB6,0xAC,0xAF,0xC6,0xC8,0x94,0x8C}, + ukey[64], upwd[64]; +@@ -68,15 +72,27 @@ + void pencode(unsigned char *ep, unsigned char *pp) + { + int i; ++#if defined(USE_OPENSSL) ++ DES_key_schedule key; ++#else + #if !(defined(BSD) && BSD >= 199306) + void setkey(), encrypt(); + #endif ++#endif + + cupack(ukey, pkey); /* unpack the key */ ++#if defined(USE_OPENSSL) ++ DES_set_key((DES_cblock *)ukey, &key); ++#else + setkey(ukey); /* insert it in crypt's machine */ ++#endif + for (i=0; i<8; i++) { /* do all 64 bytes */ + cupack(upwd, pp); /* unpack the plain-text password */ ++#if defined(USE_OPENSSL) ++ DES_ecb_encrypt((const_DES_cblock *)upwd, (DES_cblock *)upwd, &key, 1); ++#else + encrypt(upwd, 0); /* encrypt it in place */ ++#endif + cpack(ep, upwd); /* copy it out into the result */ + ep += 8; pp += 8; /* get next 8 bytes */ + } +@@ -86,15 +102,27 @@ + void pdecode(unsigned char *pp, unsigned char *ep) + { + int i; ++#if defined(USE_OPENSSL) ++ DES_key_schedule key; ++#else + #if !(defined(BSD) && BSD >= 199306) + void setkey(), encrypt(); + #endif ++#endif + + cupack(ukey, pkey); /* unpack the key */ ++#if defined(USE_OPENSSL) ++ DES_set_key((DES_cblock *)ukey, &key); ++#else + setkey(ukey); /* insert it in crypt's machine */ ++#endif + for (i=0; i<8; i++) { /* do all 64 bytes */ + cupack(upwd, ep); /* unpack the encrypted password */ ++#if defined(USE_OPENSSL) ++ DES_ecb_encrypt((const_DES_cblock *)upwd, (DES_cblock *)upwd, &key, 0); ++#else + encrypt(upwd, 1); /* decrypt it in place */ ++#endif + cpack(pp, upwd); /* copy it out into the result */ + ep += 8; pp += 8; /* get next 8 bytes */ + } |