aboutsummaryrefslogtreecommitdiffstats
path: root/security/cfs
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-05-20 05:20:01 +0800
committergreen <green@FreeBSD.org>2004-05-20 05:20:01 +0800
commitc836984f2538e15f57647fc61f92dcb25da1184e (patch)
treedab1a2d9a60fef63b1b3d71b6b431ea508d619b0 /security/cfs
parent9c0e4243b4c287146c40c5346237916c19c95868 (diff)
downloadfreebsd-ports-gnome-c836984f2538e15f57647fc61f92dcb25da1184e.tar.gz
freebsd-ports-gnome-c836984f2538e15f57647fc61f92dcb25da1184e.tar.zst
freebsd-ports-gnome-c836984f2538e15f57647fc61f92dcb25da1184e.zip
Back out the work-around for CFS's failure to use 8-bit filenames. It
appears to be crashing some people (but not others).
Diffstat (limited to 'security/cfs')
-rw-r--r--security/cfs/Makefile2
-rw-r--r--security/cfs/files/patch-cfs_fh.c71
2 files changed, 1 insertions, 72 deletions
diff --git a/security/cfs/Makefile b/security/cfs/Makefile
index 38d2e4f8d641..43df0eb952eb 100644
--- a/security/cfs/Makefile
+++ b/security/cfs/Makefile
@@ -7,7 +7,7 @@
PORTNAME= cfs
PORTVERSION= 1.4.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://www.crypto.com/software/
diff --git a/security/cfs/files/patch-cfs_fh.c b/security/cfs/files/patch-cfs_fh.c
deleted file mode 100644
index f2fcf64686bf..000000000000
--- a/security/cfs/files/patch-cfs_fh.c
+++ /dev/null
@@ -1,71 +0,0 @@
---- cfs_fh.c.orig Sat Apr 17 20:44:41 2004
-+++ cfs_fh.c Sat Apr 17 23:01:11 2004
-@@ -225,7 +225,9 @@
- }
-
- /*
-- * set high order bits
-+ * Carefully frob the high order bits of s in a way that is both easily
-+ * reversible (see unchksum) and backwards-compatible (at least for 7-bit
-+ * characters).
- */
- chksum(s,l)
- char *s;
-@@ -236,16 +238,44 @@
- u_char bits[8];
-
- acc=0;
-- for (i=0; s[i]!='\0'; i++)
-- acc += s[i]*((i%6)+1);
-+ /* Everything we do here must be reproducible without knowledge of
-+ bit 7 because unchksum won't have that information. Therefore,
-+ only accumulate the lower 7 bits of each char and stop at the
-+ first occurrence of either 0x00 or 0x80. Note that, for inputs
-+ with bit 7 constantly zero, this is equivalent to looking at the
-+ whole string. */
-+ for (i=0; (s[i]&0x7f) != '\0'; i++)
-+ acc += (s[i]&0x7f)*((i%6)+1);
-+ for (; s[i]!='\0'; i++) /* advance i if we stopped at a 0x80 */
-+ ;
- for (i++; i<l; i++) /* fill up the end */
- s[i] = s[i%8];
- for (i=0; i<8; i++)
- bits[i] = (acc<<(i%8))&0x80;
- for (i=0; i<l; i++)
-- s[i] |= bits[i%8];
-+ s[i] ^= bits[i%8];
- }
-
-+unchksum(s,l)
-+ char *s;
-+ long l;
-+{
-+ u_long acc;
-+ int i;
-+ u_char bits[8];
-+
-+ acc=0;
-+ for (i=0; (s[i]&0x7f) != '\0'; i++)
-+ acc += (s[i]&0x7f)*((i%6)+1);
-+ for (i=0; i<8; i++)
-+ bits[i] = (acc<<(i%8))&0x80;
-+ for (i=0; i<l; i++) {
-+ s[i] ^= bits[i%8];
-+ /* not sure whether this actually buys any performance */
-+ if(s[i]=='\0')
-+ break; /* found end of filename, can stop here */
-+ }
-+}
-
- /*
- * decrypt path component
-@@ -286,8 +316,7 @@
- if (l%CFSBLOCK)
- return NULL;
- dodecrypt(key,clearstring,l,10241,zerovect);
-- for (i=0; (clearstring[i]&0x7f) !='\0'; i++)
-- clearstring[i] &= 0x7f;
-+ unchksum(clearstring,l);
- clearstring[i]='\0';
- return clearstring;
- }